From 116db41accdfc9f4762bdef795a3196fc3e74c6e Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 3 Jun 2024 17:40:26 +0800 Subject: [PATCH 01/90] replace logics for process parameter --- typespec-extension/src/code-model-builder.ts | 261 ++++++++++++++++++- 1 file changed, 260 insertions(+), 1 deletion(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 521d15ce5f..d118298150 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -55,6 +55,7 @@ import { SdkEnumValueType, SdkModelPropertyType, SdkModelType, + SdkPackage, SdkType, SdkUnionType, createSdkContext, @@ -63,6 +64,8 @@ import { getClientType, getCrossLanguageDefinitionId, getDefaultApiVersion, + getSdkModelPropertyType, + getSdkModelPropertyTypeBase, getWireName, isApiVersion, isInternal, @@ -516,7 +519,98 @@ export class CodeModelBuilder { } } + // private processClientsFromSdkType() { + // // preprocess group-etag-headers + // this.options["group-etag-headers"] = this.options["group-etag-headers"] ?? true; + + // const sdkPackage = this.sdkContext.experimental_sdkPackage; + // for (const client of sdkPackage.clients) { + // const codeModelClient = new CodeModelClient(client.name, client.details ?? "", { + // summary: client.description, + + // // at present, use global security definition + // security: this.codeModel.security, + // }); + // // codeModelClient.crossLanguageDefinitionId = client.crossLanguageDefinitionId; + // } + + // versioning + // const versioning = getVersion(this.program, client.service); + // if (versioning && versioning.getVersions()) { + // // @versioned in versioning + // if (!this.sdkContext.apiVersion || ["all", "latest"].includes(this.sdkContext.apiVersion)) { + // this.apiVersion = getDefaultApiVersion(this.sdkContext, client.service); + // } else { + // this.apiVersion = versioning.getVersions().find((it: Version) => it.value === this.sdkContext.apiVersion); + // if (!this.apiVersion) { + // throw new Error("Unrecognized api-version: " + this.sdkContext.apiVersion); + // } + // } + + // codeModelClient.apiVersions = []; + // for (const version of this.getFilteredApiVersions(this.apiVersion, versioning.getVersions())) { + // const apiVersion = new ApiVersion(); + // apiVersion.version = version.value; + // codeModelClient.apiVersions.push(apiVersion); + // } + // } + + // server + // let baseUri = "{endpoint}"; + // const servers = getServers(this.program, client.service); + // if (servers && servers.length === 1 && !this.isArmSynthesizedServer(servers[0])) { + // baseUri = servers[0].url; + // } + // const hostParameters = this.processHost(servers?.length === 1 ? servers[0] : undefined); + // codeModelClient.addGlobalParameters(hostParameters); + // const clientContext = new ClientContext( + // baseUri, + // hostParameters, + // codeModelClient.globalParameters!, + // codeModelClient.apiVersions, + // ); + // clientContext.preProcessOperations(this.sdkContext, client); + + // const operationGroups = listOperationGroups(this.sdkContext, client, true); + + // const operationWithoutGroup = listOperationsInOperationGroup(this.sdkContext, client); + // let codeModelGroup = new OperationGroup(""); + // for (const operation of operationWithoutGroup) { + // if (!this.needToSkipProcessingOperation(operation, clientContext)) { + // codeModelGroup.addOperation(this.processOperation("", operation, clientContext)); + // } + // } + // if (codeModelGroup.operations?.length > 0) { + // codeModelClient.operationGroups.push(codeModelGroup); + // } + + // for (const operationGroup of operationGroups) { + // const operations = listOperationsInOperationGroup(this.sdkContext, operationGroup); + // // operation group with no operation is skipped + // if (operations.length > 0) { + // const groupPath = operationGroup.groupPath.split("."); + // let operationGroupName: string; + // if (groupPath.length > 1) { + // // groupPath should be in format of "OpenAIClient.Chat.Completions" + // operationGroupName = groupPath.slice(1).join(""); + // } else { + // // protection + // operationGroupName = operationGroup.type.name; + // } + // codeModelGroup = new OperationGroup(operationGroupName); + // for (const operation of operations) { + // if (!this.needToSkipProcessingOperation(operation, clientContext)) { + // codeModelGroup.addOperation(this.processOperation(operationGroupName, operation, clientContext)); + // } + // } + // codeModelClient.operationGroups.push(codeModelGroup); + // } + // } + + // } + private processClients(): SdkClient[] { + const sdkPackage = this.sdkContext.experimental_sdkPackage; const clients = listClients(this.sdkContext); // preprocess group-etag-headers this.options["group-etag-headers"] = this.options["group-etag-headers"] ?? true; @@ -789,7 +883,10 @@ export class CodeModelBuilder { // host clientContext.hostParameters.forEach((it) => codeModelOperation.addParameter(it)); // parameters - op.parameters.parameters.map((it) => this.processParameter(codeModelOperation, it, clientContext)); + op.parameters.parameters.map((it) => { + const sdkParamType = ignoreDiagnostics(getSdkModelPropertyType(this.sdkContext, it.param, operation)); + this.processParameterFromSdkType(codeModelOperation, sdkParamType, it, clientContext); + }); // "accept" header this.addAcceptHeaderParameter(codeModelOperation, op.responses); // body @@ -988,6 +1085,160 @@ export class CodeModelBuilder { private _armApiVersionParameter?: Parameter; + private processParameterFromSdkType(op: CodeModelOperation, param: SdkModelPropertyType, raw: HttpOperationParameter, clientContext: ClientContext) { + if (clientContext.apiVersions && isApiVersion(this.sdkContext, param)) { + // pre-condition for "isApiVersion": the client supports ApiVersions + if (this.isArm()) { + // Currently we assume ARM tsp only have one client and one api-version. + // TODO: How will service define mixed api-versions(like those in Compute RP)? + const apiVersion = this.apiVersion?.value; + if (!this._armApiVersionParameter) { + this._armApiVersionParameter = this.createApiVersionParameter( + "api-version", + param.kind === "query" ? ParameterLocation.Query : ParameterLocation.Path, + apiVersion, + ); + clientContext.addGlobalParameter(this._armApiVersionParameter); + } + op.addParameter(this._armApiVersionParameter); + } else { + const parameter = param.kind === "query" ? this.apiVersionParameter : this.apiVersionParameterInPath; + op.addParameter(parameter); + clientContext.addGlobalParameter(parameter); + } + } + // else if (this.isSubscriptionId(raw)) { + // const parameter = this.subscriptionIdParameter(raw); + // op.addParameter(parameter); + // clientContext.addGlobalParameter(parameter); + // } + else if (SPECIAL_HEADER_NAMES.has(param.name.toLowerCase())) { + // special headers + op.specialHeaders = op.specialHeaders ?? []; + if (!stringArrayContainsIgnoreCase(op.specialHeaders, param.name)) { + op.specialHeaders.push(param.name); + } + } else { + // schema + let schema; + const sdkType = param.type; + if ( + param.kind === "header" && (sdkType.kind === "utcDateTime" || sdkType.kind === "offsetDateTime")) { + // utcDateTime in header maps to rfc7231 + schema = this.processDateTimeSchemaFromSdkType(sdkType, param.name, true); + } else { + schema = this.processSchemaFromSdkType(sdkType, param.name); + } + + // skip-url-encoding + let extensions: { [id: string]: any } | undefined = undefined; + if ( + (param.kind === "query" || param.kind === "path") && + isSdkBuiltInKind(sdkType.kind) && // TODO: question: Scalar -> builtin kinds, is it fine? + schema instanceof UriSchema + ) { + extensions = { "x-ms-skip-url-encoding": true }; + } + + if (this.supportsAdvancedVersioning()) { + // versioning + const addedOn = getAddedOnVersions(this.program, raw.param); + if (addedOn) { + extensions = extensions ?? {}; + extensions["x-ms-versioning-added"] = clientContext.getAddedVersions(addedOn); + } + } + + // format if array + let style = undefined; + let explode = undefined; + if (sdkType.kind === "array" && sdkType.valueType.kind === "model") { + if (param.kind === "query") { + const format = param.collectionFormat; + switch (format) { + case "csv": + style = SerializationStyle.Simple; + break; + + case "ssv": + style = SerializationStyle.SpaceDelimited; + break; + + case "tsv": + style = SerializationStyle.TabDelimited; + break; + + case "pipes": + style = SerializationStyle.PipeDelimited; + break; + + case "multi": + style = SerializationStyle.Form; + explode = true; + break; + + default: + if (format) { + this.logWarning(`Unrecognized query parameter format: '${format}'.`); + } + break; + } + } else if (param.kind === "header") { + const format = param.collectionFormat; + switch (format) { + case "csv": + style = SerializationStyle.Simple; + break; + + default: + if (format) { + this.logWarning(`Unrecognized header parameter format: '${format}'.`); + } + break; + } + } + } + + const nullable = param.nullable; + const parameter = new Parameter(param.name, param.description ?? "", schema, { + summary: param.details, + implementation: ImplementationLocation.Method, + required: !param.optional, + nullable: nullable, + protocol: { + http: new HttpParameter(raw.type, { + style: style, + explode: explode, + }), + }, + language: { + default: { + serializedName: param.name, + }, + }, + extensions: extensions, + }); + op.addParameter(parameter); + + this.trackSchemaUsage(schema, { usage: [SchemaContext.Input] }); + + if (op.convenienceApi) { + this.trackSchemaUsage(schema, { usage: [op.internalApi ? SchemaContext.Internal : SchemaContext.Public] }); + } + + if (param.name.toLowerCase() === CONTENT_TYPE_KEY) { + let mediaTypes = ["application/json"]; + if (schema instanceof ConstantSchema) { + mediaTypes = [schema.value.value.toString()]; + } else if (schema instanceof SealedChoiceSchema) { + mediaTypes = schema.choices.map((it) => it.value.toString()); + } + op.requests![0].protocol.http!.mediaTypes = mediaTypes; + } + } + + } + private processParameter(op: CodeModelOperation, param: HttpOperationParameter, clientContext: ClientContext) { if (clientContext.apiVersions && isApiVersion(this.sdkContext, param)) { // pre-condition for "isApiVersion": the client supports ApiVersions @@ -2625,4 +2876,12 @@ export class CodeModelBuilder { private isArm(): boolean { return Boolean(this.codeModel.arm); } + + // private getLocationFromSdkParameter(param: SdkModelPropertyType): string { + // if (Object.values(ParameterLocation).includes(param.kind)) { + // return param.kind; + // } else { + // return "none"; + // } + // } } From 3d56d8ab0ce8860e60491b6c877894392be92e25 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Tue, 4 Jun 2024 17:03:53 +0800 Subject: [PATCH 02/90] bug fix --- typespec-extension/src/code-model-builder.ts | 34 ++++++++------------ 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index d118298150..21fbbd0000 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -884,7 +884,7 @@ export class CodeModelBuilder { clientContext.hostParameters.forEach((it) => codeModelOperation.addParameter(it)); // parameters op.parameters.parameters.map((it) => { - const sdkParamType = ignoreDiagnostics(getSdkModelPropertyType(this.sdkContext, it.param, operation)); + const sdkParamType: SdkModelPropertyType = ignoreDiagnostics(getSdkModelPropertyType(this.sdkContext, it.param, operation)); this.processParameterFromSdkType(codeModelOperation, sdkParamType, it, clientContext); }); // "accept" header @@ -1107,28 +1107,22 @@ export class CodeModelBuilder { clientContext.addGlobalParameter(parameter); } } - // else if (this.isSubscriptionId(raw)) { - // const parameter = this.subscriptionIdParameter(raw); - // op.addParameter(parameter); - // clientContext.addGlobalParameter(parameter); - // } - else if (SPECIAL_HEADER_NAMES.has(param.name.toLowerCase())) { + else if (this.isSubscriptionId(raw)) { // TODO: remove this + const parameter = this.subscriptionIdParameter(raw); + op.addParameter(parameter); + clientContext.addGlobalParameter(parameter); + } + else if (param.kind === "header" && SPECIAL_HEADER_NAMES.has(param.serializedName.toLowerCase())) { // special headers op.specialHeaders = op.specialHeaders ?? []; - if (!stringArrayContainsIgnoreCase(op.specialHeaders, param.name)) { - op.specialHeaders.push(param.name); + if (!stringArrayContainsIgnoreCase(op.specialHeaders, param.serializedName)) { + op.specialHeaders.push(param.serializedName); } } else { // schema let schema; const sdkType = param.type; - if ( - param.kind === "header" && (sdkType.kind === "utcDateTime" || sdkType.kind === "offsetDateTime")) { - // utcDateTime in header maps to rfc7231 - schema = this.processDateTimeSchemaFromSdkType(sdkType, param.name, true); - } else { - schema = this.processSchemaFromSdkType(sdkType, param.name); - } + schema = this.processSchemaFromSdkType(sdkType, param.name); // skip-url-encoding let extensions: { [id: string]: any } | undefined = undefined; @@ -1200,8 +1194,8 @@ export class CodeModelBuilder { } const nullable = param.nullable; - const parameter = new Parameter(param.name, param.description ?? "", schema, { - summary: param.details, + const parameter = new Parameter(param.name, param.details ?? "", schema, { + summary: param.description, implementation: ImplementationLocation.Method, required: !param.optional, nullable: nullable, @@ -1213,7 +1207,7 @@ export class CodeModelBuilder { }, language: { default: { - serializedName: param.name, + serializedName: (param.kind === "header" || param.kind === "query" || param.kind === "path" || param.kind === "property") ? param.serializedName : param.name, }, }, extensions: extensions, @@ -1226,7 +1220,7 @@ export class CodeModelBuilder { this.trackSchemaUsage(schema, { usage: [op.internalApi ? SchemaContext.Internal : SchemaContext.Public] }); } - if (param.name.toLowerCase() === CONTENT_TYPE_KEY) { + if (param.kind === "header" && param.serializedName.toLowerCase() === CONTENT_TYPE_KEY) { let mediaTypes = ["application/json"]; if (schema instanceof ConstantSchema) { mediaTypes = [schema.value.value.toString()]; From 3863d59d5fad1978f3de6dab8caffee6e117774e Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Thu, 20 Jun 2024 11:29:23 +0800 Subject: [PATCH 03/90] add logics for process clients and operation --- typespec-extension/src/code-model-builder.ts | 796 +++++++++++++------ 1 file changed, 555 insertions(+), 241 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 21fbbd0000..1fecf52d79 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -44,18 +44,31 @@ import { KnownMediaType } from "@azure-tools/codegen"; import { getLroMetadata, getPagedResult, isPollingLocation } from "@azure-tools/typespec-azure-core"; import { SdkArrayType, + SdkBodyParameter, SdkBuiltInType, SdkClient, + SdkClientType, SdkConstantType, SdkContext, SdkDatetimeType, SdkDictionaryType, SdkDurationType, + SdkEndpointParameter, SdkEnumType, SdkEnumValueType, + SdkHeaderParameter, + SdkHttpOperation, + SdkHttpResponse, + SdkInitializationType, + SdkMethod, SdkModelPropertyType, SdkModelType, SdkPackage, + SdkParameter, + SdkPathParameter, + SdkQueryParameter, + SdkServiceMethod, + SdkServiceOperation, SdkType, SdkUnionType, createSdkContext, @@ -114,6 +127,7 @@ import { HttpOperationParameter, HttpOperationResponse, HttpServer, + HttpStatusCodeRange, HttpStatusCodesEntry, Visibility, getAuthentication, @@ -198,6 +212,7 @@ export class CodeModelBuilder { private operationExamples: Map = new Map(); // current apiVersion name to generate code private apiVersion: Version | undefined; + private apiVersionString: string | undefined; public constructor(program1: Program, context: EmitContext) { this.options = context.options; @@ -270,7 +285,9 @@ export class CodeModelBuilder { const clients = this.processClients(); - this.processModels(clients); + this.processClientsFromSdkType(); + + this.processModels(); this.processSchemaUsage(); @@ -343,6 +360,36 @@ export class CodeModelBuilder { } } + private processHostParametersFromSdkType(sdkPathParameters: SdkPathParameter[]): Parameter[] { + const hostParameters: Parameter[] = []; + let parameter; + sdkPathParameters.forEach((arg) => { + const schema = this.processSchemaFromSdkType(arg.type, arg.name); + this.trackSchemaUsage(schema, { + usage: [SchemaContext.Input, SchemaContext.Output /*SchemaContext.Public*/], + }); + parameter = new Parameter(arg.name, arg.description ?? "", schema, { // TODO: descroption or details? + implementation: ImplementationLocation.Client, + origin: "modelerfour:synthesized/host", + required: true, + protocol: { + http: new HttpParameter(ParameterLocation.Uri), + }, + language: { + default: { + serializedName: arg.name, + }, + }, + extensions: { + "x-ms-skip-url-encoding": schema instanceof UriSchema, + }, + }); + hostParameters.push(this.codeModel.addGlobalParameter(parameter)); + }); + + return hostParameters; + } + private processAuth(auth: Authentication) { const securitySchemes: SecurityScheme[] = []; for (const option of auth.options) { @@ -413,7 +460,7 @@ export class CodeModelBuilder { } } - private processModels(clients: SdkClient[]) { + private processModels() { const processedSdkModels: Set = new Set(); // lambda to mark model as public @@ -519,95 +566,160 @@ export class CodeModelBuilder { } } - // private processClientsFromSdkType() { - // // preprocess group-etag-headers - // this.options["group-etag-headers"] = this.options["group-etag-headers"] ?? true; + private processClientsFromSdkType() { + // preprocess group-etag-headers + this.options["group-etag-headers"] = this.options["group-etag-headers"] ?? true; - // const sdkPackage = this.sdkContext.experimental_sdkPackage; - // for (const client of sdkPackage.clients) { - // const codeModelClient = new CodeModelClient(client.name, client.details ?? "", { - // summary: client.description, - - // // at present, use global security definition - // security: this.codeModel.security, - // }); - // // codeModelClient.crossLanguageDefinitionId = client.crossLanguageDefinitionId; - // } + const sdkPackage = this.sdkContext.experimental_sdkPackage; + for (const client of sdkPackage.clients) { + if (client.initialization.access !== "public") { // do not generate client for internal client which is operation group + continue; + } + const codeModelClient = new CodeModelClient(client.name, client.details ?? "", { + summary: client.description, + + // at present, use global security definition + security: this.codeModel.security, + }); + // codeModelClient.crossLanguageDefinitionId = client.crossLanguageDefinitionId; // versioning - // const versioning = getVersion(this.program, client.service); - // if (versioning && versioning.getVersions()) { - // // @versioned in versioning - // if (!this.sdkContext.apiVersion || ["all", "latest"].includes(this.sdkContext.apiVersion)) { - // this.apiVersion = getDefaultApiVersion(this.sdkContext, client.service); - // } else { - // this.apiVersion = versioning.getVersions().find((it: Version) => it.value === this.sdkContext.apiVersion); - // if (!this.apiVersion) { - // throw new Error("Unrecognized api-version: " + this.sdkContext.apiVersion); - // } - // } + const versions = client.apiVersions; + if (versions && versions.length > 0) { + if (!this.sdkContext.apiVersion || ["all", "latest"].includes(this.sdkContext.apiVersion)) { + this.apiVersionString = versions[versions.length - 1]; + } else { + this.apiVersionString = versions.find((it: string) => it === this.sdkContext.apiVersion); + if (!this.apiVersionString) { + throw new Error("Unrecognized api-version: " + this.sdkContext.apiVersion); + } + } - // codeModelClient.apiVersions = []; - // for (const version of this.getFilteredApiVersions(this.apiVersion, versioning.getVersions())) { - // const apiVersion = new ApiVersion(); - // apiVersion.version = version.value; - // codeModelClient.apiVersions.push(apiVersion); - // } - // } + codeModelClient.apiVersions = []; + for (const version of this.getFilteredApiVersionsFromString(this.apiVersionString, versions)) { + const apiVersion = new ApiVersion(); + apiVersion.version = version; + codeModelClient.apiVersions.push(apiVersion); + } + } - // server - // let baseUri = "{endpoint}"; - // const servers = getServers(this.program, client.service); - // if (servers && servers.length === 1 && !this.isArmSynthesizedServer(servers[0])) { - // baseUri = servers[0].url; - // } - // const hostParameters = this.processHost(servers?.length === 1 ? servers[0] : undefined); - // codeModelClient.addGlobalParameters(hostParameters); - // const clientContext = new ClientContext( - // baseUri, - // hostParameters, - // codeModelClient.globalParameters!, - // codeModelClient.apiVersions, - // ); - // clientContext.preProcessOperations(this.sdkContext, client); - - // const operationGroups = listOperationGroups(this.sdkContext, client, true); - - // const operationWithoutGroup = listOperationsInOperationGroup(this.sdkContext, client); - // let codeModelGroup = new OperationGroup(""); - // for (const operation of operationWithoutGroup) { - // if (!this.needToSkipProcessingOperation(operation, clientContext)) { - // codeModelGroup.addOperation(this.processOperation("", operation, clientContext)); - // } - // } - // if (codeModelGroup.operations?.length > 0) { - // codeModelClient.operationGroups.push(codeModelGroup); - // } + // client initialization + let baseUri = "{endpoint}"; + let hostParameters: Parameter[] = []; + client.initialization.properties.forEach((initializationProperty) => { + if (initializationProperty.kind === "endpoint") { + baseUri = initializationProperty.type.serverUrl; + hostParameters = this.processHostParametersFromSdkType(initializationProperty.type.templateArguments); + codeModelClient.addGlobalParameters(hostParameters); + } + }); - // for (const operationGroup of operationGroups) { - // const operations = listOperationsInOperationGroup(this.sdkContext, operationGroup); - // // operation group with no operation is skipped - // if (operations.length > 0) { - // const groupPath = operationGroup.groupPath.split("."); - // let operationGroupName: string; - // if (groupPath.length > 1) { - // // groupPath should be in format of "OpenAIClient.Chat.Completions" - // operationGroupName = groupPath.slice(1).join(""); - // } else { - // // protection - // operationGroupName = operationGroup.type.name; - // } - // codeModelGroup = new OperationGroup(operationGroupName); - // for (const operation of operations) { - // if (!this.needToSkipProcessingOperation(operation, clientContext)) { - // codeModelGroup.addOperation(this.processOperation(operationGroupName, operation, clientContext)); - // } - // } - // codeModelClient.operationGroups.push(codeModelGroup); - // } - // } - - // } + const clientContext = new ClientContext( + baseUri, + hostParameters, + codeModelClient.globalParameters!, + codeModelClient.apiVersions, + ); + + // preprocess operation groups and operations + const serviceMethodsWithoutSubClient = this.listServiceMethodsUnderClient(client, false); + let codeModelGroup = new OperationGroup(""); + for (const serviceMethod of serviceMethodsWithoutSubClient) { + if (!this.needToSkipProcessingOperation(serviceMethod.__raw, clientContext)) { + codeModelGroup.addOperation(this.processOperationFromSdkType(serviceMethod, clientContext, "")); + } + } + if (codeModelGroup.operations?.length > 0) { + codeModelClient.operationGroups.push(codeModelGroup); + } + + const subClients = this.listSubClientsUnderClient(client, true); + for (const subClient of subClients) { + const serviceMethods = this.listServiceMethodsUnderClient(subClient, true); + // operation group with no operation is skipped + if (serviceMethods.length > 0) { + codeModelGroup = new OperationGroup(subClient.name); + for (const serviceMethod of serviceMethods) { + if (!this.needToSkipProcessingOperation(serviceMethod.__raw, clientContext)) { + codeModelGroup.addOperation(this.processOperationFromSdkType(serviceMethod, clientContext, subClient.name)); + } + } + codeModelClient.operationGroups.push(codeModelGroup); + } + } + this.codeModel.clients.push(codeModelClient); + + // postprocess for ServiceVersion + let apiVersionSameForAllClients = true; + let sharedApiVersions = undefined; + for (const client of this.codeModel.clients) { + const apiVersions = client.apiVersions; + if (!apiVersions) { + // client does not have apiVersions + apiVersionSameForAllClients = false; + } else if (!sharedApiVersions) { + // first client, set it to sharedApiVersions + sharedApiVersions = apiVersions; + } else { + apiVersionSameForAllClients = isEqual(sharedApiVersions, apiVersions); + } + if (!apiVersionSameForAllClients) { + break; + } + } + if (apiVersionSameForAllClients) { + const serviceVersion = getServiceVersion(this.codeModel); + for (const client of this.codeModel.clients) { + client.serviceVersion = serviceVersion; + } + } else { + for (const client of this.codeModel.clients) { + const apiVersions = client.apiVersions; + if (apiVersions) { + client.serviceVersion = getServiceVersion(client); + } + } + } + } + } + + private processOperationGroupsUnderClient(codeModelClient: CodeModelClient, sdkOperationGroup: SdkClientType, clientContext: ClientContext) { + + } + + private listSubClientsUnderClient(client: SdkClientType, includeNestedOperationGroups: boolean): SdkClientType[] { + const operationGroups: SdkClientType[] = []; + for (const method of client.methods) { + if (method.kind === "clientaccessor") { + const client = method.response; + operationGroups.push(client); + if (includeNestedOperationGroups) { + for (const operationGroup of this.listSubClientsUnderClient(client, includeNestedOperationGroups)) { + operationGroups.push(operationGroup); + } + } + } + } + return operationGroups; + } + + private listServiceMethodsUnderClient(client: SdkClientType, includeNestedServiceMethods: boolean): SdkServiceMethod[] { + const methods: SdkServiceMethod[] = []; + for (const method of client.methods) { + if (includeNestedServiceMethods) { + if (method.kind === "clientaccessor") { + const client = method.response; + for (const method of this.listServiceMethodsUnderClient(client, includeNestedServiceMethods)) { + methods.push(method); + } + } + } + if (method.kind !== "clientaccessor") { + methods.push(method); + } + } + return methods; + } private processClients(): SdkClient[] { const sdkPackage = this.sdkContext.experimental_sdkPackage; @@ -743,13 +855,34 @@ export class CodeModelBuilder { * @param versions api-versions to filter * @returns filtered api-versions */ - private getFilteredApiVersions(pinnedApiVersion: Version | undefined, versions: Version[]): Version[] { + private getFilteredApiVersionsFromString(pinnedApiVersion: string | undefined, versions: string[]): string[] { if (!pinnedApiVersion) { return versions; } return versions .slice(0, versions.indexOf(pinnedApiVersion) + 1) - .filter((version) => !isStable(pinnedApiVersion) || isStable(version)); + .filter((version) => !this.isStableApiVersion(pinnedApiVersion) || this.isStableApiVersion(version)); + } + + /** + * Filter api-versions for "ServiceVersion". + * TODO(xiaofei) pending TCGC design: https://github.com/Azure/typespec-azure/issues/746 + * + * @param pinnedApiVersion the api-version to use as filter base + * @param versions api-versions to filter + * @returns filtered api-versions + */ + private getFilteredApiVersions(pinnedApiVersion: Version | undefined, versions: Version[]): Version[] { + if (!pinnedApiVersion) { + return versions; + } + return versions + .slice(0, versions.indexOf(pinnedApiVersion) + 1) + .filter((version) => !isStable(pinnedApiVersion) || isStable(version)); + } + + private isStableApiVersion(version: string): boolean { + return !version.includes("preview"); } /** @@ -764,10 +897,10 @@ export class CodeModelBuilder { return this.isArm() && (!server.parameters || server.parameters.size == 0); } - private needToSkipProcessingOperation(operation: Operation, clientContext: ClientContext): boolean { + private needToSkipProcessingOperation(operation: Operation | undefined, clientContext: ClientContext): boolean { // don't generate protocol and convenience method for overloaded operations // issue link: https://github.com/Azure/autorest.java/issues/1958#issuecomment-1562558219 we will support generate overload methods for non-union type in future (TODO issue: https://github.com/Azure/autorest.java/issues/2160) - if (getOverloadedOperation(this.program, operation)) { + if (operation && getOverloadedOperation(this.program, operation)) { this.trace(`Operation '${operation.name}' is temporary skipped, as it is an overloaded operation`); return true; } @@ -799,6 +932,116 @@ export class CodeModelBuilder { return operationExample; } + private processOperationFromSdkType(sdkMethod: SdkServiceMethod, clientContext: ClientContext, groupName?: string): CodeModelOperation { + // TODO: get operation example + const operationName = sdkMethod.name; + const httpOperation = sdkMethod.operation; + const operationId = groupName ? `${groupName}_${operationName}` : `${operationName}`; + + const codeModelOperation = new CodeModelOperation(operationName, sdkMethod.details ?? "", { + operationId: operationId, + summary: sdkMethod.description, + // extensions: { + // "x-ms-examples": operationExample + // ? { [operationExample.title ?? operationExample.operationId ?? operation.name]: operationExample } + // : undefined, + // }, + }); + + codeModelOperation.crossLanguageDefinitionId = sdkMethod.crossLanguageDefintionId; + codeModelOperation.internalApi = sdkMethod.access === "internal"; + + const convenienceApiName = this.getConvenienceApiNameFromServiceMethod(sdkMethod); + let generateConvenienceApi: boolean = Boolean(convenienceApiName); + let generateProtocolApi: boolean = sdkMethod.__raw ? shouldGenerateProtocol(this.sdkContext, sdkMethod.__raw) : true; + + let apiComment: string | undefined = undefined; + if (generateConvenienceApi) { + // check if the convenience API need to be disabled for some special cases + if (operationIsMultipart(httpOperation.__raw)) { + // do not generate protocol method for multipart/form-data, as it be very hard for user to prepare the request body as BinaryData + generateProtocolApi = false; + apiComment = `Protocol API requires serialization of parts with content-disposition and data, as operation '${operationName}' is 'multipart/form-data'`; + this.logWarning(apiComment); + } else if (operationIsMultipleContentTypes(httpOperation.__raw)) { + // and multiple content types + // issue link: https://github.com/Azure/autorest.java/issues/1958#issuecomment-1562558219 + generateConvenienceApi = false; + apiComment = `Convenience API is not generated, as operation '${operationName}' is multiple content-type`; + this.logWarning(apiComment); + } else if (operationIsJsonMergePatch(httpOperation.__raw) && this.options["stream-style-serialization"] === false) { + // do not generate convenient method for json merge patch operation if stream-style-serialization is not enabled + generateConvenienceApi = false; + apiComment = `Convenience API is not generated, as operation '${operationName}' is 'application/merge-patch+json' and stream-style-serialization is not enabled`; + this.logWarning(apiComment); + } + // else { + // const union = operationRefersUnion(this.program, op, this.typeUnionRefCache); + // if (union) { + // // and Union + // generateConvenienceApi = false; + // apiComment = `Convenience API is not generated, as operation '${ + // op.operation.name + // }' refers Union '${getUnionDescription(union, this.typeNameOptions)}'`; + // this.logWarning(apiComment); + // } + // } + } + if (generateConvenienceApi && convenienceApiName) { + codeModelOperation.convenienceApi = new ConvenienceApi(convenienceApiName); + } + if (apiComment) { + codeModelOperation.language.java = new Language(); + codeModelOperation.language.java.comment = apiComment; + } + + // check for generating protocol api or not + codeModelOperation.generateProtocolApi = generateProtocolApi && !codeModelOperation.internalApi; + + codeModelOperation.addRequest( + new Request({ + protocol: { + http: { + path: httpOperation.path, + method: httpOperation.verb, + uri: clientContext.baseUri, + }, + }, + }), + ); + + // host + clientContext.hostParameters.forEach((it) => codeModelOperation.addParameter(it)); + // path/query/header parameters + httpOperation.parameters.map((it) => { + this.processParameterFromSdkType(codeModelOperation, it, clientContext); + }); + // "accept" header + this.addAcceptHeaderParameterFromSdkType(codeModelOperation, httpOperation.responses); + // // body + if (httpOperation.bodyParam && httpOperation.__raw && sdkMethod.__raw && httpOperation.bodyParam.type.__raw) { + let bodyType = httpOperation.bodyParam.type; + if (bodyType.kind === "model" && bodyType.__raw) { + // // try use resource type as round-trip model + // const resourceType = getResourceOperation(this.program, rawOperation)?.resourceType; + // if (resourceType && rawHttpOperation.responses && rawHttpOperation.responses.length > 0) { + // const resp = rawHttpOperation.responses[0]; + // if (resp.responses && resp.responses.length > 0 && resp.responses[0].body) { + // const responseBody = resp.responses[0].body; + // const bodyTypeInResponse = this.findResponseBody(responseBody.type); + // // response body type is resource type, and request body type (if templated) contains resource type + // if (bodyTypeInResponse === resourceType && isModelReferredInTemplate(bodyType, resourceType)) { + // bodyType = resourceType; + // } + // } + // } + this.processParameterBody(codeModelOperation, httpOperation.__raw, bodyType.__raw as Model | ModelProperty); + } + + } + return codeModelOperation; + } + private processOperation(groupName: string, operation: Operation, clientContext: ClientContext): CodeModelOperation { const op = ignoreDiagnostics(getHttpOperation(this.program, operation)); @@ -884,9 +1127,9 @@ export class CodeModelBuilder { clientContext.hostParameters.forEach((it) => codeModelOperation.addParameter(it)); // parameters op.parameters.parameters.map((it) => { - const sdkParamType: SdkModelPropertyType = ignoreDiagnostics(getSdkModelPropertyType(this.sdkContext, it.param, operation)); - this.processParameterFromSdkType(codeModelOperation, sdkParamType, it, clientContext); - }); + const sdkParamType = ignoreDiagnostics(getSdkModelPropertyType(this.sdkContext, it.param, operation)) as SdkHeaderParameter | SdkQueryParameter | SdkPathParameter; + this.processParameterFromSdkType(codeModelOperation, sdkParamType, clientContext); + }); // "accept" header this.addAcceptHeaderParameter(codeModelOperation, op.responses); // body @@ -1085,7 +1328,7 @@ export class CodeModelBuilder { private _armApiVersionParameter?: Parameter; - private processParameterFromSdkType(op: CodeModelOperation, param: SdkModelPropertyType, raw: HttpOperationParameter, clientContext: ClientContext) { + private processParameterFromSdkType(op: CodeModelOperation, param: SdkQueryParameter | SdkPathParameter | SdkHeaderParameter, clientContext: ClientContext) { if (clientContext.apiVersions && isApiVersion(this.sdkContext, param)) { // pre-condition for "isApiVersion": the client supports ApiVersions if (this.isArm()) { @@ -1107,11 +1350,11 @@ export class CodeModelBuilder { clientContext.addGlobalParameter(parameter); } } - else if (this.isSubscriptionId(raw)) { // TODO: remove this - const parameter = this.subscriptionIdParameter(raw); - op.addParameter(parameter); - clientContext.addGlobalParameter(parameter); - } + // else if (this.isSubscriptionId(raw)) { // TODO: remove this + // const parameter = this.subscriptionIdParameter(raw); + // op.addParameter(parameter); + // clientContext.addGlobalParameter(parameter); + // } else if (param.kind === "header" && SPECIAL_HEADER_NAMES.has(param.serializedName.toLowerCase())) { // special headers op.specialHeaders = op.specialHeaders ?? []; @@ -1134,9 +1377,9 @@ export class CodeModelBuilder { extensions = { "x-ms-skip-url-encoding": true }; } - if (this.supportsAdvancedVersioning()) { + if (this.supportsAdvancedVersioning() && param.__raw) { // versioning - const addedOn = getAddedOnVersions(this.program, raw.param); + const addedOn = getAddedOnVersions(this.program, param.__raw); if (addedOn) { extensions = extensions ?? {}; extensions["x-ms-versioning-added"] = clientContext.getAddedVersions(addedOn); @@ -1146,7 +1389,7 @@ export class CodeModelBuilder { // format if array let style = undefined; let explode = undefined; - if (sdkType.kind === "array" && sdkType.valueType.kind === "model") { + if (sdkType.kind === "array") { if (param.kind === "query") { const format = param.collectionFormat; switch (format) { @@ -1200,14 +1443,14 @@ export class CodeModelBuilder { required: !param.optional, nullable: nullable, protocol: { - http: new HttpParameter(raw.type, { + http: new HttpParameter(param.kind, { style: style, explode: explode, }), }, language: { default: { - serializedName: (param.kind === "header" || param.kind === "query" || param.kind === "path" || param.kind === "property") ? param.serializedName : param.name, + serializedName: param.serializedName, }, }, extensions: extensions, @@ -1233,161 +1476,210 @@ export class CodeModelBuilder { } - private processParameter(op: CodeModelOperation, param: HttpOperationParameter, clientContext: ClientContext) { - if (clientContext.apiVersions && isApiVersion(this.sdkContext, param)) { - // pre-condition for "isApiVersion": the client supports ApiVersions - if (this.isArm()) { - // Currently we assume ARM tsp only have one client and one api-version. - // TODO: How will service define mixed api-versions(like those in Compute RP)? - const apiVersion = this.apiVersion?.value; - if (!this._armApiVersionParameter) { - this._armApiVersionParameter = this.createApiVersionParameter( - "api-version", - param.type === "query" ? ParameterLocation.Query : ParameterLocation.Path, - apiVersion, - ); - clientContext.addGlobalParameter(this._armApiVersionParameter); - } - op.addParameter(this._armApiVersionParameter); - } else { - const parameter = param.type === "query" ? this.apiVersionParameter : this.apiVersionParameterInPath; - op.addParameter(parameter); - clientContext.addGlobalParameter(parameter); - } - } else if (this.isSubscriptionId(param)) { - const parameter = this.subscriptionIdParameter(param); - op.addParameter(parameter); - clientContext.addGlobalParameter(parameter); - } else if (SPECIAL_HEADER_NAMES.has(param.name.toLowerCase())) { - // special headers - op.specialHeaders = op.specialHeaders ?? []; - if (!stringArrayContainsIgnoreCase(op.specialHeaders, param.name)) { - op.specialHeaders.push(param.name); - } - } else { - // schema - let schema; - const sdkType = getClientType(this.sdkContext, param.param); - if ( - param.type === "header" && - param.param.type.kind === "Scalar" && - getEncode(this.program, param.param) === undefined && - getEncode(this.program, param.param.type) === undefined && - (hasScalarAsBase(param.param.type, "utcDateTime") || hasScalarAsBase(param.param.type, "offsetDateTime")) && - (sdkType.kind === "utcDateTime" || sdkType.kind === "offsetDateTime") - ) { - // utcDateTime in header maps to rfc7231 - schema = this.processDateTimeSchemaFromSdkType(sdkType, param.param.name, true); - } else { - schema = this.processSchemaFromSdkType(sdkType, param.param.name); - } - - // skip-url-encoding - let extensions: { [id: string]: any } | undefined = undefined; - if ( - (param.type === "query" || param.type === "path") && - param.param.type.kind === "Scalar" && - schema instanceof UriSchema - ) { - extensions = { "x-ms-skip-url-encoding": true }; - } - - if (this.supportsAdvancedVersioning()) { - // versioning - const addedOn = getAddedOnVersions(this.program, param.param); - if (addedOn) { - extensions = extensions ?? {}; - extensions["x-ms-versioning-added"] = clientContext.getAddedVersions(addedOn); - } - } + // private processParameter(op: CodeModelOperation, param: HttpOperationParameter, clientContext: ClientContext) { + // if (clientContext.apiVersions && isApiVersion(this.sdkContext, param)) { + // // pre-condition for "isApiVersion": the client supports ApiVersions + // if (this.isArm()) { + // // Currently we assume ARM tsp only have one client and one api-version. + // // TODO: How will service define mixed api-versions(like those in Compute RP)? + // const apiVersion = this.apiVersion?.value; + // if (!this._armApiVersionParameter) { + // this._armApiVersionParameter = this.createApiVersionParameter( + // "api-version", + // param.type === "query" ? ParameterLocation.Query : ParameterLocation.Path, + // apiVersion, + // ); + // clientContext.addGlobalParameter(this._armApiVersionParameter); + // } + // op.addParameter(this._armApiVersionParameter); + // } else { + // const parameter = param.type === "query" ? this.apiVersionParameter : this.apiVersionParameterInPath; + // op.addParameter(parameter); + // clientContext.addGlobalParameter(parameter); + // } + // } else if (this.isSubscriptionId(param)) { + // const parameter = this.subscriptionIdParameter(param); + // op.addParameter(parameter); + // clientContext.addGlobalParameter(parameter); + // } else if (SPECIAL_HEADER_NAMES.has(param.name.toLowerCase())) { + // // special headers + // op.specialHeaders = op.specialHeaders ?? []; + // if (!stringArrayContainsIgnoreCase(op.specialHeaders, param.name)) { + // op.specialHeaders.push(param.name); + // } + // } else { + // // schema + // let schema; + // const sdkType = getClientType(this.sdkContext, param.param); + // if ( + // param.type === "header" && + // param.param.type.kind === "Scalar" && + // getEncode(this.program, param.param) === undefined && + // getEncode(this.program, param.param.type) === undefined && + // (hasScalarAsBase(param.param.type, "utcDateTime") || hasScalarAsBase(param.param.type, "offsetDateTime")) && + // (sdkType.kind === "utcDateTime" || sdkType.kind === "offsetDateTime") + // ) { + // // utcDateTime in header maps to rfc7231 + // schema = this.processDateTimeSchemaFromSdkType(sdkType, param.param.name, true); + // } else { + // schema = this.processSchemaFromSdkType(sdkType, param.param.name); + // } - // format if array - let style = undefined; - let explode = undefined; - if (param.param.type.kind === "Model" && isArrayModelType(this.program, param.param.type)) { - if (param.type === "query") { - const queryParamOptions = getQueryParamOptions(this.program, param.param); - switch (queryParamOptions?.format) { - case "csv": - style = SerializationStyle.Simple; - break; + // // skip-url-encoding + // let extensions: { [id: string]: any } | undefined = undefined; + // if ( + // (param.type === "query" || param.type === "path") && + // param.param.type.kind === "Scalar" && + // schema instanceof UriSchema + // ) { + // extensions = { "x-ms-skip-url-encoding": true }; + // } - case "ssv": - style = SerializationStyle.SpaceDelimited; - break; + // if (this.supportsAdvancedVersioning()) { + // // versioning + // const addedOn = getAddedOnVersions(this.program, param.param); + // if (addedOn) { + // extensions = extensions ?? {}; + // extensions["x-ms-versioning-added"] = clientContext.getAddedVersions(addedOn); + // } + // } - case "tsv": - style = SerializationStyle.TabDelimited; - break; + // // format if array + // let style = undefined; + // let explode = undefined; + // if (param.param.type.kind === "Model" && isArrayModelType(this.program, param.param.type)) { + // if (param.type === "query") { + // const queryParamOptions = getQueryParamOptions(this.program, param.param); + // switch (queryParamOptions?.format) { + // case "csv": + // style = SerializationStyle.Simple; + // break; + + // case "ssv": + // style = SerializationStyle.SpaceDelimited; + // break; + + // case "tsv": + // style = SerializationStyle.TabDelimited; + // break; + + // case "pipes": + // style = SerializationStyle.PipeDelimited; + // break; + + // case "multi": + // style = SerializationStyle.Form; + // explode = true; + // break; + + // default: + // if (queryParamOptions?.format) { + // this.logWarning(`Unrecognized query parameter format: '${queryParamOptions?.format}'.`); + // } + // break; + // } + // } else if (param.type === "header") { + // const headerFieldOptions = getHeaderFieldOptions(this.program, param.param); + // switch (headerFieldOptions?.format) { + // case "csv": + // style = SerializationStyle.Simple; + // break; + + // default: + // if (headerFieldOptions?.format) { + // this.logWarning(`Unrecognized header parameter format: '${headerFieldOptions?.format}'.`); + // } + // break; + // } + // } + // } - case "pipes": - style = SerializationStyle.PipeDelimited; - break; + // const nullable = isNullableType(param.param.type); + // const parameter = new Parameter(this.getName(param.param), this.getDoc(param.param), schema, { + // summary: this.getSummary(param.param), + // implementation: ImplementationLocation.Method, + // required: !param.param.optional, + // nullable: nullable, + // protocol: { + // http: new HttpParameter(param.type, { + // style: style, + // explode: explode, + // }), + // }, + // language: { + // default: { + // serializedName: param.name, + // }, + // }, + // extensions: extensions, + // }); + // op.addParameter(parameter); + + // this.trackSchemaUsage(schema, { usage: [SchemaContext.Input] }); + + // if (op.convenienceApi) { + // this.trackSchemaUsage(schema, { usage: [op.internalApi ? SchemaContext.Internal : SchemaContext.Public] }); + // } - case "multi": - style = SerializationStyle.Form; - explode = true; - break; + // if (param.name.toLowerCase() === CONTENT_TYPE_KEY) { + // let mediaTypes = ["application/json"]; + // if (schema instanceof ConstantSchema) { + // mediaTypes = [schema.value.value.toString()]; + // } else if (schema instanceof SealedChoiceSchema) { + // mediaTypes = schema.choices.map((it) => it.value.toString()); + // } + // op.requests![0].protocol.http!.mediaTypes = mediaTypes; + // } + // } + // } - default: - if (queryParamOptions?.format) { - this.logWarning(`Unrecognized query parameter format: '${queryParamOptions?.format}'.`); - } - break; - } - } else if (param.type === "header") { - const headerFieldOptions = getHeaderFieldOptions(this.program, param.param); - switch (headerFieldOptions?.format) { - case "csv": - style = SerializationStyle.Simple; - break; + private addAcceptHeaderParameterFromSdkType(op: CodeModelOperation, responses: Map) { + if (op.parameters?.some((it) => it.language.default.serializedName?.toLowerCase() === "accept")) { + // parameters already include "accept" header + return; + }`` - default: - if (headerFieldOptions?.format) { - this.logWarning(`Unrecognized header parameter format: '${headerFieldOptions?.format}'.`); - } - break; - } + const produces = new Set(); + for (const code of responses.keys()) { + const response = responses.get(code); + if (response) { + if (response.contentTypes && response.contentTypes.length > 0) { + response.contentTypes.forEach((it) => produces.add(it)); + } else if (response.defaultContentType) { + produces.add(response.defaultContentType); } } + } + if (produces.size === 0) { + produces.add("application/json"); + } + const acceptTypes = Array.from(produces.values()).join(", "); - const nullable = isNullableType(param.param.type); - const parameter = new Parameter(this.getName(param.param), this.getDoc(param.param), schema, { - summary: this.getSummary(param.param), + const acceptSchema = + this.codeModel.schemas.constants?.find( + (it) => it.language.default.name === "accept" && it.value.value === acceptTypes, + ) || + this.codeModel.schemas.add( + new ConstantSchema("accept", `Accept: ${acceptTypes}`, { + valueType: this.stringSchema, + value: new ConstantValue(acceptTypes), + }), + ); + op.addParameter( + new Parameter("accept", "Accept header", acceptSchema, { implementation: ImplementationLocation.Method, - required: !param.param.optional, - nullable: nullable, + origin: "modelerfour:synthesized/accept", + required: true, protocol: { - http: new HttpParameter(param.type, { - style: style, - explode: explode, - }), + http: new HttpParameter(ParameterLocation.Header), }, language: { default: { - serializedName: param.name, + serializedName: "accept", }, }, - extensions: extensions, - }); - op.addParameter(parameter); - - this.trackSchemaUsage(schema, { usage: [SchemaContext.Input] }); - - if (op.convenienceApi) { - this.trackSchemaUsage(schema, { usage: [op.internalApi ? SchemaContext.Internal : SchemaContext.Public] }); - } - - if (param.name.toLowerCase() === CONTENT_TYPE_KEY) { - let mediaTypes = ["application/json"]; - if (schema instanceof ConstantSchema) { - mediaTypes = [schema.value.value.toString()]; - } else if (schema instanceof SealedChoiceSchema) { - mediaTypes = schema.choices.map((it) => it.value.toString()); - } - op.requests![0].protocol.http!.mediaTypes = mediaTypes; - } - } + }), + ); } private addAcceptHeaderParameter(op: CodeModelOperation, responses: HttpOperationResponse[]) { @@ -1571,6 +1863,19 @@ export class CodeModelBuilder { } } + private processParameterBodyFromSdkType(op: CodeModelOperation, httpOperation: HttpOperation, body: SdkModelPropertyType) { + const parameters = httpOperation.operation.parameters; + + const unknownRequestBody = + op.requests![0].protocol.http!.mediaTypes && + op.requests![0].protocol.http!.mediaTypes.length > 0 && + !isKnownContentType(op.requests![0].protocol.http!.mediaTypes); + + // const sdkType: SdkType = getClientType(this.sdkContext, body, httpOperation.operation); + + + } + private processParameterBody(op: CodeModelOperation, httpOperation: HttpOperation, body: ModelProperty | Model) { const parameters = httpOperation.operation.parameters; @@ -2627,6 +2932,15 @@ export class CodeModelBuilder { } } + private getConvenienceApiNameFromServiceMethod(sdkMethod: SdkServiceMethod): string | undefined { + // check @convenienceMethod + if (sdkMethod.__raw && shouldGenerateConvenient(this.sdkContext, sdkMethod.__raw)) { + return sdkMethod.name; + } else { + return undefined; + } + } + private logWarning(msg: string) { if (this.loggingEnabled) { logWarning(this.program, msg); From 8d21b60dcb2bea3d32b90923afb2c699288d1f98 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Thu, 27 Jun 2024 14:50:57 +0800 Subject: [PATCH 04/90] replace logic to process response --- typespec-extension/src/code-model-builder.ts | 564 +++++++++++++++++-- 1 file changed, 530 insertions(+), 34 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 1b1a4e826b..ee462941b9 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -60,6 +60,8 @@ import { SdkHttpOperation, SdkHttpResponse, SdkInitializationType, + SdkLroPagingServiceMethod, + SdkLroServiceMethod, SdkMethod, SdkModelPropertyType, SdkModelType, @@ -682,10 +684,6 @@ export class CodeModelBuilder { } } - private processOperationGroupsUnderClient(codeModelClient: CodeModelClient, sdkOperationGroup: SdkClientType, clientContext: ClientContext) { - - } - private listSubClientsUnderClient(client: SdkClientType, includeNestedOperationGroups: boolean): SdkClientType[] { const operationGroups: SdkClientType[] = []; for (const method of client.methods) { @@ -931,11 +929,12 @@ export class CodeModelBuilder { return operationExample; } - private processOperationFromSdkType(sdkMethod: SdkServiceMethod, clientContext: ClientContext, groupName?: string): CodeModelOperation { - // TODO: get operation example + private processOperationFromSdkType(sdkMethod: SdkServiceMethod, clientContext: ClientContext, groupName: string): CodeModelOperation { + // TODO: haoling get operation example const operationName = sdkMethod.name; const httpOperation = sdkMethod.operation; const operationId = groupName ? `${groupName}_${operationName}` : `${operationName}`; + const operationGroup = this.codeModel.getOperationGroup(groupName); const codeModelOperation = new CodeModelOperation(operationName, sdkMethod.details ?? "", { operationId: operationId, @@ -1016,11 +1015,11 @@ export class CodeModelBuilder { this.processParameterFromSdkType(codeModelOperation, it, clientContext); }); // "accept" header - this.addAcceptHeaderParameterFromSdkType(codeModelOperation, httpOperation.responses); + // this.addAcceptHeaderParameterFromSdkType(codeModelOperation, httpOperation.responses); // // body if (httpOperation.bodyParam && httpOperation.__raw && sdkMethod.__raw && httpOperation.bodyParam.type.__raw) { - let bodyType = httpOperation.bodyParam.type; - if (bodyType.kind === "model" && bodyType.__raw) { + // let bodyType = httpOperation.bodyParam.type; + // if (bodyType.kind === "model" && bodyType.__raw) { // // try use resource type as round-trip model // const resourceType = getResourceOperation(this.program, rawOperation)?.resourceType; // if (resourceType && rawHttpOperation.responses && rawHttpOperation.responses.length > 0) { @@ -1034,20 +1033,32 @@ export class CodeModelBuilder { // } // } // } - this.processParameterBody(codeModelOperation, httpOperation.__raw, bodyType.__raw as Model | ModelProperty); - } + // this.processParameterBody(codeModelOperation, httpOperation.__raw, bodyType.__raw as Model | ModelProperty); + this.processParameterBodyFromSdkType(codeModelOperation, httpOperation.__raw, httpOperation.bodyParam); + // } } // group ETag header parameters, if exists if (this.options["group-etag-headers"]) { - this.processEtagHeaderParameters(codeModelOperation, sdkMethod.operation.__raw); + this.processEtagHeaderParametersFromSdkType(codeModelOperation, sdkMethod.operation); } // lro metadata - const lroMetadata = this.processLroMetadata(codeModelOperation, sdkMethod.operation.__raw); + let lroMetadata = new LongRunningMetadata(false); + if (sdkMethod.kind === "lro" || sdkMethod.kind === "lropaging") { + this.processLroMetadataFromSdkType(codeModelOperation, sdkMethod); + } // responses - sdkMethod.operation.__raw.responses.map((it) => this.processResponse(codeModelOperation, it, lroMetadata.longRunning)); + // this.processResponseFromSdkType(codeModelOperation, sdkMethod.operation.responses, lroMetadata.longRunning); + + for (const [code, response] of sdkMethod.operation.responses) { + this.processResponseFromSdkType(codeModelOperation, code, response, lroMetadata.longRunning); + } + + + // sdkMethod.operation.__raw.responses.map((it) => this.processResponse(codeModelOperation, it, lroMetadata.longRunning)); + // check for paged this.processRouteForPaged(codeModelOperation, sdkMethod.operation.__raw.responses); @@ -1056,6 +1067,8 @@ export class CodeModelBuilder { this.processRouteForLongRunning(codeModelOperation, sdkMethod.__raw, sdkMethod.operation.__raw.responses, lroMetadata); } + operationGroup.addOperation(codeModelOperation); + return codeModelOperation; } @@ -1318,6 +1331,96 @@ export class CodeModelBuilder { return new LongRunningMetadata(false); } + private processLroMetadataFromSdkType(op: CodeModelOperation, sdkMethod: SdkLroServiceMethod | SdkLroPagingServiceMethod): LongRunningMetadata { + const trackConvenienceApi: boolean = Boolean(op.convenienceApi); + + const lroMetadata = sdkMethod.__raw_lro_metadata; + // needs lroMetadata.statusMonitorStep, as getLroMetadata would return for @pollingOperation operation + if (lroMetadata && lroMetadata.pollingInfo && lroMetadata.statusMonitorStep) { + let pollingSchema = undefined; + let finalSchema = undefined; + + let pollingStrategy: Metadata | undefined = undefined; + let finalResultPropertySerializedName: string | undefined = undefined; + + const verb = sdkMethod.operation.verb; + const useNewPollStrategy = isLroNewPollingStrategy(sdkMethod.operation.__raw, lroMetadata); + if (useNewPollStrategy) { + // use OperationLocationPollingStrategy + pollingStrategy = new Metadata({ + language: { + java: { + name: "OperationLocationPollingStrategy", + namespace: getJavaNamespace(this.namespace) + ".implementation", + }, + }, + }); + } + + // pollingSchema + if (modelIs(lroMetadata.pollingInfo.responseModel, "OperationStatus", "Azure.Core.Foundations")) { + pollingSchema = this.pollResultSchema; + } else { + const pollType = this.findResponseBody(lroMetadata.pollingInfo.responseModel); + const sdkType = getClientType(this.sdkContext, pollType); + pollingSchema = this.processSchemaFromSdkType(sdkType, "pollResult"); + } + + // finalSchema + if ( + verb !== "delete" && + lroMetadata.finalResult && + lroMetadata.finalEnvelopeResult && + lroMetadata.finalResult !== "void" && + lroMetadata.finalEnvelopeResult !== "void" + ) { + const finalResult = useNewPollStrategy ? lroMetadata.finalResult : lroMetadata.finalEnvelopeResult; + const finalType = this.findResponseBody(finalResult); + const sdkType = getClientType(this.sdkContext, finalType); + finalSchema = this.processSchemaFromSdkType(sdkType, "finalResult"); + + if ( + useNewPollStrategy && + lroMetadata.finalStep && + lroMetadata.finalStep.kind === "pollingSuccessProperty" && + lroMetadata.finalStep.target + ) { + // final result is the value in lroMetadata.finalStep.target + finalResultPropertySerializedName = this.getSerializedName(lroMetadata.finalStep.target); + } + } + + // track usage + if (pollingSchema) { + this.trackSchemaUsage(pollingSchema, { usage: [SchemaContext.Output] }); + if (trackConvenienceApi) { + this.trackSchemaUsage(pollingSchema, { + usage: [op.internalApi ? SchemaContext.Internal : SchemaContext.Public], + }); + } + } + if (finalSchema) { + this.trackSchemaUsage(finalSchema, { usage: [SchemaContext.Output] }); + if (trackConvenienceApi) { + this.trackSchemaUsage(finalSchema, { + usage: [op.internalApi ? SchemaContext.Internal : SchemaContext.Public], + }); + } + } + + op.lroMetadata = new LongRunningMetadata( + true, + pollingSchema, + finalSchema, + pollingStrategy, + finalResultPropertySerializedName, + ); + return op.lroMetadata; + } + + return new LongRunningMetadata(false); + } + private processRouteForLongRunning( op: CodeModelOperation, operation: Operation, @@ -1352,7 +1455,7 @@ export class CodeModelBuilder { if (this.isArm()) { // Currently we assume ARM tsp only have one client and one api-version. // TODO: How will service define mixed api-versions(like those in Compute RP)? - const apiVersion = this.apiVersion?.value; + const apiVersion = this.apiVersionString; if (!this._armApiVersionParameter) { this._armApiVersionParameter = this.createApiVersionParameter( "api-version", @@ -1368,11 +1471,11 @@ export class CodeModelBuilder { clientContext.addGlobalParameter(parameter); } } - // else if (this.isSubscriptionId(raw)) { // TODO: remove this - // const parameter = this.subscriptionIdParameter(raw); - // op.addParameter(parameter); - // clientContext.addGlobalParameter(parameter); - // } + else if (param.kind === "path" && param.onClient && this.isSubscriptionId(param)) { + const parameter = this.subscriptionIdParameter(param); + op.addParameter(parameter); + clientContext.addGlobalParameter(parameter); + } else if (param.kind === "header" && SPECIAL_HEADER_NAMES.has(param.serializedName.toLowerCase())) { // special headers op.specialHeaders = op.specialHeaders ?? []; @@ -1381,9 +1484,8 @@ export class CodeModelBuilder { } } else { // schema - let schema; const sdkType = param.type; - schema = this.processSchemaFromSdkType(sdkType, param.name); + const schema = this.processSchemaFromSdkType(sdkType, param.name); // skip-url-encoding let extensions: { [id: string]: any } | undefined = undefined; @@ -1468,7 +1570,7 @@ export class CodeModelBuilder { }, language: { default: { - serializedName: param.serializedName, + serializedName: param.serializedName, // it uses param.name previously, but better to use param.serializedName directly }, }, extensions: extensions, @@ -1655,7 +1757,7 @@ export class CodeModelBuilder { if (op.parameters?.some((it) => it.language.default.serializedName?.toLowerCase() === "accept")) { // parameters already include "accept" header return; - }`` + } const produces = new Set(); for (const code of responses.keys()) { @@ -1881,7 +1983,142 @@ export class CodeModelBuilder { } } - private processParameterBodyFromSdkType(op: CodeModelOperation, httpOperation: HttpOperation, body: SdkModelPropertyType) { + private processEtagHeaderParametersFromSdkType(op: CodeModelOperation, httpOperation: SdkHttpOperation) { + if (op.convenienceApi && op.parameters && op.signatureParameters) { + const etagHeadersNames = new Set([ + "if-match", + "if-none-match", + "if-unmodified-since", + "if-modified-since", + ]); + + // collect etag headers in parameters + const etagHeaders: string[] = []; + if (op.parameters) { + for (const parameter of op.parameters) { + if ( + parameter.language.default.serializedName && + etagHeadersNames.has(parameter.language.default.serializedName.toLowerCase()) + ) { + etagHeaders.push(parameter.language.default.serializedName); + } + } + } + + let groupToRequestConditions = false; + let groupToMatchConditions = false; + + if (etagHeaders.length === 4) { + // all 4 headers available, use RequestConditions + groupToRequestConditions = true; + } else if (etagHeaders.length === 2) { + const etagHeadersLowerCase = etagHeaders.map((it) => it.toLowerCase()); + if (etagHeadersLowerCase.includes("if-match") && etagHeadersLowerCase.includes("if-none-match")) { + // only 2 headers available, use MatchConditions + groupToMatchConditions = true; + } + } + + if (groupToRequestConditions || groupToMatchConditions) { + op.convenienceApi.requests = []; + const request = new Request({ + protocol: op.requests![0].protocol, + }); + request.parameters = []; + request.signatureParameters = []; + op.convenienceApi.requests.push(request); + + for (const parameter of op.parameters) { + // copy all parameters to request + const clonedParameter = cloneOperationParameter(parameter); + request.parameters.push(clonedParameter); + + // copy signatureParameters, but exclude etag headers (as they won't be in method signature) + if ( + op.signatureParameters.includes(parameter) && + !( + parameter.language.default.serializedName && + etagHeaders.includes(parameter.language.default.serializedName) + ) + ) { + request.signatureParameters.push(clonedParameter); + } + } + + const namespace = getNamespace(httpOperation.__raw.operation); // TODO: SdkHttpOperation does not have namespace + const schemaName = groupToRequestConditions ? "RequestConditions" : "MatchConditions"; + const schemaDescription = groupToRequestConditions + ? "Specifies HTTP options for conditional requests based on modification time." + : "Specifies HTTP options for conditional requests."; + + // group schema + const requestConditionsSchema = this.codeModel.schemas.add( + new GroupSchema(schemaName, schemaDescription, { + language: { + default: { + namespace: namespace, + }, + java: { + namespace: "com.azure.core.http", + }, + }, + }), + ); + + // parameter (optional) of the group schema + const requestConditionsParameter = new Parameter( + schemaName, + requestConditionsSchema.language.default.description, + requestConditionsSchema, + { + implementation: ImplementationLocation.Method, + required: false, + nullable: true, + }, + ); + + this.trackSchemaUsage(requestConditionsSchema, { usage: [SchemaContext.Input] }); + if (op.convenienceApi) { + this.trackSchemaUsage(requestConditionsSchema, { + usage: [op.internalApi ? SchemaContext.Internal : SchemaContext.Public], + }); + } + + // update group schema for properties + for (const parameter of request.parameters) { + if ( + parameter.language.default.serializedName && + etagHeaders.includes(parameter.language.default.serializedName) + ) { + parameter.groupedBy = requestConditionsParameter; + + requestConditionsSchema.add( + // name is serializedName, as it must be same as that in RequestConditions class + new GroupProperty( + parameter.language.default.serializedName, + parameter.language.default.description, + parameter.schema, + { + originalParameter: [parameter], + summary: parameter.summary, + required: false, + nullable: true, + readOnly: false, + serializedName: parameter.language.default.serializedName, + }, + ), + ); + } + } + + // put RequestConditions/MatchConditions as last parameter/signatureParameters + request.parameters.push(requestConditionsParameter); + request.signatureParameters.push(requestConditionsParameter); + } + } + } + + private processParameterBodyFromSdkType(op: CodeModelOperation, httpOperation: HttpOperation, sdkBody: SdkModelPropertyType) { const parameters = httpOperation.operation.parameters; const unknownRequestBody = @@ -1889,8 +2126,168 @@ export class CodeModelBuilder { op.requests![0].protocol.http!.mediaTypes.length > 0 && !isKnownContentType(op.requests![0].protocol.http!.mediaTypes); - // const sdkType: SdkType = getClientType(this.sdkContext, body, httpOperation.operation); + const sdkType: SdkType = sdkBody.type; + let schema: Schema; + if (unknownRequestBody && sdkType.kind === "bytes") { + // if it's unknown request body, handle binary request body + schema = this.processBinarySchemaFromSdkType(sdkType); + } else { + schema = this.processSchemaFromSdkType(getNonNullSdkType(sdkType), sdkBody.name); + } + + const isAnonymousModel = sdkType.kind === "model" && sdkType.isGeneratedName === true; + const parameterName = sdkBody.name; + const parameter = new Parameter(parameterName, sdkBody.description ?? "", schema, { + summary: sdkBody.details, + implementation: ImplementationLocation.Method, + required: !sdkBody.optional, + protocol: { + http: new HttpParameter(ParameterLocation.Body), + }, + }); + op.addParameter(parameter); + + this.trackSchemaUsage(schema, { usage: [SchemaContext.Input] }); + + if (op.convenienceApi) { + // model/schema does not need to be Public or Internal, if it is not to be used in convenience API + this.trackSchemaUsage(schema, { usage: [op.internalApi ? SchemaContext.Internal : SchemaContext.Public] }); + } + + if (operationIsJsonMergePatch(httpOperation)) { + this.trackSchemaUsage(schema, { usage: [SchemaContext.JsonMergePatch] }); + } + if (op.convenienceApi && operationIsMultipart(httpOperation)) { + this.trackSchemaUsage(schema, { serializationFormats: [KnownMediaType.Multipart] }); + } + + if (schema instanceof ObjectSchema && isAnonymousModel) { + // anonymous model + + // name the schema for documentation + schema.language.default.name = pascalCase(op.language.default.name) + "Request"; + + if (!parameter.language.default.name) { + // name the parameter for documentation + parameter.language.default.name = "request"; + } + + if (operationIsJsonMergePatch(httpOperation)) { + // skip model flatten, if "application/merge-patch+json" + schema.language.default.name = pascalCase(op.language.default.name) + "PatchRequest"; + return; + } + + this.trackSchemaUsage(schema, { usage: [SchemaContext.Anonymous] }); + + if (op.convenienceApi && op.parameters) { + op.convenienceApi.requests = []; + const request = new Request({ + protocol: op.requests![0].protocol, + }); + request.parameters = []; + op.convenienceApi.requests.push(request); + + for (const [_, opParameter] of parameters.properties) { + const serializedName = this.getSerializedName(opParameter); + const existParameter = op.parameters.find((it) => it.language.default.serializedName === serializedName); + if (existParameter) { + // parameter + if ( + existParameter.implementation === ImplementationLocation.Method && + (existParameter.origin?.startsWith("modelerfour:synthesized/") ?? true) + ) { + request.parameters.push(cloneOperationParameter(existParameter)); + } + } else { + // property from anonymous model + const existBodyProperty = schema.properties?.find((it) => it.serializedName === serializedName); + if ( + existBodyProperty && + !existBodyProperty.readOnly && + !(existBodyProperty.schema instanceof ConstantSchema) + ) { + request.parameters.push( + new VirtualParameter( + existBodyProperty.language.default.name, + existBodyProperty.language.default.description, + existBodyProperty.schema, + { + originalParameter: parameter, + targetProperty: existBodyProperty, + language: { + default: { + serializedName: existBodyProperty.serializedName, + }, + }, + summary: existBodyProperty.summary, + implementation: ImplementationLocation.Method, + required: existBodyProperty.required, + nullable: existBodyProperty.nullable, + }, + ), + ); + } + } + } + request.signatureParameters = request.parameters; + + if (request.signatureParameters.length > 6) { + // create an option bag + const name = op.language.default.name + "Options"; + const namespace = getNamespace(httpOperation.operation); + // option bag schema + const optionBagSchema = this.codeModel.schemas.add( + new GroupSchema(name, `Options for ${op.language.default.name} API`, { + language: { + default: { + namespace: namespace, + }, + java: { + namespace: getJavaNamespace(namespace), + }, + }, + }), + ); + request.parameters.forEach((it) => { + optionBagSchema.add( + new GroupProperty(it.language.default.name, it.language.default.description, it.schema, { + originalParameter: [it], + summary: it.summary, + required: it.required, + nullable: it.nullable, + readOnly: false, + serializedName: it.language.default.serializedName, + }), + ); + }); + + this.trackSchemaUsage(optionBagSchema, { usage: [SchemaContext.Input] }); + if (op.convenienceApi) { + this.trackSchemaUsage(optionBagSchema, { + usage: [op.internalApi ? SchemaContext.Internal : SchemaContext.Public], + }); + } + + // option bag parameter + const optionBagParameter = new Parameter( + "options", + optionBagSchema.language.default.description, + optionBagSchema, + { + implementation: ImplementationLocation.Method, + required: true, + nullable: false, + }, + ); + + request.signatureParameters = [optionBagParameter]; + request.parameters.forEach((it) => (it.groupedBy = optionBagParameter)); + request.parameters.push(optionBagParameter); + } + } + } } @@ -2199,6 +2596,101 @@ export class CodeModelBuilder { } } + private processResponseFromSdkType(op: CodeModelOperation, statusCode: number | HttpStatusCodeRange, sdkResponse: SdkHttpResponse, longRunning: boolean) { + // TODO: what to do if more than 1 response? + // It happens when the response type is Union, on one status code. + // let response: Response; + let headers: Array | undefined = undefined; + + // headers + headers = []; + if (sdkResponse.headers) { + for (const header of sdkResponse.headers) { + const schema = this.processSchemaFromSdkType(header.type, header.serializedName); + headers.push( + new HttpHeader(header.serializedName, schema, { + language: { + default: { + name: header.serializedName, + description: header.description ?? header.details, + }, + } + }), + ); + } + } + + // let responseBody: SdkHttpResponse | undefined = undefined; + let bodyType: SdkType | undefined = sdkResponse.type; + let trackConvenienceApi: boolean = Boolean(op.convenienceApi); + + const unknownResponseBody = + sdkResponse.contentTypes && sdkResponse.contentTypes.length > 0 && !isKnownContentType(sdkResponse.contentTypes); + + let response: Response; + if (unknownResponseBody && bodyType && bodyType.kind === "bytes") { + // binary + response = new BinaryResponse({ + protocol: { + http: { + statusCodes: statusCode, + headers: headers, + mediaTypes: sdkResponse.contentTypes, + knownMediaType: KnownMediaType.Binary, + }, + }, + language: { + default: { + name: op.language.default.name + "Response", + description: sdkResponse.description ?? bodyType.details, + }, + }, + }); + } else if (bodyType) { + // schema (usually JSON) + let schema: Schema | undefined = undefined; + if (longRunning) { + // LRO uses the LroMetadata for poll/final result, not the response of activation request + trackConvenienceApi = false; + } + if (!schema) { + schema = this.processSchemaFromSdkType(bodyType, op.language.default.name + "Response"); + } + response = new SchemaResponse(schema, { + protocol: { + http: { + statusCodes: statusCode, + headers: headers, + mediaTypes: sdkResponse.contentTypes, + }, + }, + language: { + default: { + name: op.language.default.name + "Response", + description: bodyType.description ?? bodyType.details, + }, + }, + }); + } else { + // not binary nor schema, usually NoContent + response = new Response({ + protocol: { + http: { + statusCodes: statusCode, + headers: headers, + }, + }, + language: { + default: { + name: op.language.default.name + "Response", + description: this.getResponseDescription(resp), + }, + }, + }); + } + + } + private getStatusCodes(statusCodes: HttpStatusCodesEntry): string[] { if (statusCodes === "*") { return ["default"]; @@ -2719,6 +3211,14 @@ export class CodeModelBuilder { ); } + private processBinarySchemaFromSdkType(type: SdkBuiltInType): BinarySchema { + return this.codeModel.schemas.add( + new BinarySchema(type.description ?? "", { + summary: type.details, + }), + ); + } + private getUnionVariantName(type: Type | undefined, option: any): string { if (type === undefined) { throw new Error("type is undefined."); @@ -3014,19 +3514,15 @@ export class CodeModelBuilder { ); } - private isSubscriptionId(param: HttpOperationParameter): boolean { + private isSubscriptionId(param: SdkPathParameter): boolean { return ( - "subscriptionId".toLocaleLowerCase() === param?.name?.toLocaleLowerCase() && - param.param && - isArmCommonType(param.param) && - isPathParam(this.program, param.param) + "subscriptionId".toLocaleLowerCase() === param.name.toLocaleLowerCase() ); } - private subscriptionIdParameter(parameter: HttpOperationParameter): Parameter { + private subscriptionIdParameter(parameter: SdkPathParameter): Parameter { if (!this._subscriptionParameter) { - const param = parameter.param; - const description = getDoc(this.program, param); + const description = parameter.description; this._subscriptionParameter = new Parameter( "subscriptionId", description ? description : "The ID of the target subscription.", From 07a773fbfd7183031fbf8941876f6b5e3f12666d Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Thu, 27 Jun 2024 17:22:40 +0800 Subject: [PATCH 05/90] regen --- .../InternalOperationsImpl.java | 12 +- .../implementation/PublicOperationsImpl.java | 8 +- .../RelativeModelInOperationsImpl.java | 8 +- .../SharedModelInOperationsImpl.java | 8 +- .../implementation/ModelInOperationsImpl.java | 33 +- .../basic/implementation/BasicClientImpl.java | 101 ++- .../TwoModelsAsPageItemsImpl.java | 28 +- .../azure/core/lro/rpc/RpcAsyncClient.java | 4 +- .../_specs_/azure/core/lro/rpc/RpcClient.java | 4 +- .../lro/rpc/implementation/RpcClientImpl.java | 30 +- .../core/lro/rpc/models/OperationState.java | 75 ++ ...nerationResponseGenerationResultError.java | 152 ++++ .../implementation/StandardClientImpl.java | 24 +- .../lro/standard/models/OperationState.java | 75 ++ .../standard/models/OperationStatusError.java | 129 ++++ ...eOperationStatusUserExportedUserError.java | 150 ++++ .../azure/core/scalar/ScalarAsyncClient.java | 6 +- .../azure/core/scalar/ScalarClient.java | 4 +- .../AzureLocationScalarsImpl.java | 67 +- .../azure/core/traits/TraitsAsyncClient.java | 11 +- .../azure/core/traits/TraitsClient.java | 10 +- .../implementation/TraitsClientImpl.java | 30 +- .../implementation/ApiKeyClientImpl.java | 15 +- .../implementation/CustomClientImpl.java | 15 +- .../implementation/OAuth2ClientImpl.java | 15 +- .../union/implementation/UnionClientImpl.java | 25 +- .../models/resources/ResourcesManager.java | 1 - .../fluent/NestedProxyResourcesClient.java | 4 +- .../resources/fluent/ResourcesClient.java | 7 - .../TopLevelTrackedResourcesClient.java | 5 +- .../NestedProxyResourcesClientImpl.java | 159 ++--- .../ResourcesClientBuilder.java | 18 +- .../implementation/ResourcesClientImpl.java | 18 +- .../TopLevelTrackedResourcesClientImpl.java | 197 ++---- .../models/NestedProxyResources.java | 8 +- .../models/TopLevelTrackedResources.java | 11 +- .../XmsClientRequestIdAsyncClient.java | 5 +- .../XmsClientRequestIdClient.java | 2 +- .../XmsClientRequestIdClientImpl.java | 16 +- .../ArmResourceProviderManager.java | 1 - .../fluent/ArmResourceProviderClient.java | 7 - ...hildExtensionResourceInterfacesClient.java | 4 +- .../ChildResourcesInterfacesClient.java | 4 +- .../TopLevelArmResourceInterfacesClient.java | 5 +- .../ArmResourceProviderClientBuilder.java | 18 +- .../ArmResourceProviderClientImpl.java | 18 +- ...ExtensionResourceInterfacesClientImpl.java | 153 ++-- .../ChildResourcesInterfacesClientImpl.java | 191 ++--- ...mTemplateResourceInterfacesClientImpl.java | 64 +- .../implementation/OperationsClientImpl.java | 39 +- ...pLevelArmResourceInterfacesClientImpl.java | 219 ++---- .../ChildExtensionResourceInterfaces.java | 8 +- .../models/ChildResourcesInterfaces.java | 8 +- .../models/TopLevelArmResourceInterfaces.java | 11 +- .../ArmStreamStyleSerializationManager.java | 1 - .../ArmStreamStyleSerializationClient.java | 7 - ...StreamStyleSerializationClientBuilder.java | 18 +- ...ArmStreamStyleSerializationClientImpl.java | 18 +- .../implementation/FishesClientImpl.java | 37 +- .../TopLevelArmResourcesClientImpl.java | 31 +- .../implementation/BuiltinClientImpl.java | 10 +- .../implementation/BuiltinOpsImpl.java | 24 +- .../implementation/EnumServiceClientImpl.java | 70 +- .../implementation/ErrorModelClientImpl.java | 10 +- .../implementation/ErrorOpsImpl.java | 4 +- .../com/cadl/flatten/FlattenAsyncClient.java | 109 +-- .../java/com/cadl/flatten/FlattenClient.java | 107 +-- .../implementation/FlattenClientImpl.java | 165 +++-- .../cadl/internal/InternalAsyncClient.java | 6 +- .../com/cadl/internal/InternalClient.java | 6 +- .../implementation/InternalClientImpl.java | 10 +- .../implementation/InternalOpsImpl.java | 36 +- .../models/ResponseInternal.java | 2 +- .../models/ResponseInternalInner.java | 2 +- .../implementation/LiteralOpsImpl.java | 19 +- .../LiteralServiceClientImpl.java | 10 +- .../longrunning/LongRunningAsyncClient.java | 19 +- .../cadl/longrunning/LongRunningClient.java | 18 +- .../implementation/LongRunningClientImpl.java | 138 +--- .../models/LroOperationStatusError.java | 177 +++++ .../model/implementation/ModelClientImpl.java | 10 +- .../model/implementation/ModelOpsImpl.java | 48 +- .../MultiContentTypesClientImpl.java | 27 +- .../MultipleContentTypesOnRequestsImpl.java | 58 +- .../SingleContentTypesImpl.java | 20 +- .../implementation/MultipartClientImpl.java | 24 +- .../implementation/FirstClientImpl.java | 14 +- .../NoApiVersionClientImpl.java | 25 +- .../implementation/SecondClientImpl.java | 14 +- .../com/cadl/naming/NamingAsyncClient.java | 12 +- .../java/com/cadl/naming/NamingClient.java | 10 +- .../implementation/NamingClientImpl.java | 10 +- .../naming/implementation/NamingOpsImpl.java | 29 +- .../cadl/optional/OptionalAsyncClient.java | 221 ------ .../com/cadl/optional/OptionalClient.java | 217 ------ .../cadl/optional/OptionalClientBuilder.java | 287 -------- .../implementation/OptionalClientImpl.java | 107 --- .../implementation/OptionalOpsImpl.java | 309 -------- .../optional/implementation/package-info.java | 10 - .../models/AllPropertiesOptional.java | 462 ------------ .../cadl/optional/models/ImmutableModel.java | 105 --- .../com/cadl/optional/models/Optional.java | 665 ------------------ .../cadl/optional/models/package-info.java | 10 - .../java/com/cadl/optional/package-info.java | 10 - .../PartialUpdateClientImpl.java | 14 +- .../patch/implementation/PatchClientImpl.java | 10 +- .../patch/implementation/PatchesImpl.java | 12 +- .../ProtocolAndConvenienceOpsImpl.java | 98 +-- .../ProtocolAndConvenientClientImpl.java | 10 +- .../implementation/ResponseClientImpl.java | 97 +-- .../com/cadl/server/ContosoClientBuilder.java | 21 +- .../com/cadl/server/HttpbinClientBuilder.java | 1 + .../implementation/ContosoClientImpl.java | 45 +- .../implementation/HttpbinClientImpl.java | 15 +- .../implementation/BuiltinOpsImpl.java | 15 +- .../SpecialCharsClientImpl.java | 10 +- .../implementation/EtagHeadersImpl.java | 32 +- .../EtagHeadersOptionalBodiesImpl.java | 18 +- .../RepeatabilityHeadersImpl.java | 31 +- .../SkipSpecialHeadersImpl.java | 4 +- .../SpecialHeadersClientImpl.java | 10 +- .../java/com/cadl/union/UnionAsyncClient.java | 31 +- .../main/java/com/cadl/union/UnionClient.java | 30 +- .../union/implementation/UnionClientImpl.java | 9 +- .../implementation/UnionFlattenOpsImpl.java | 70 +- .../com/cadl/union/models/OperationState.java | 75 ++ ...ationStatusOperationStatusResultError.java | 150 ++++ .../implementation/VersioningClientImpl.java | 10 +- .../implementation/VersioningOpsImpl.java | 31 +- .../versioning/models/OperationState.java | 75 ++ ...onStatusResourceExportedResourceError.java | 151 ++++ .../implementation/VisibilityClientImpl.java | 56 +- .../implementation/VisibilityReadsImpl.java | 4 +- .../implementation/VisibilityWritesImpl.java | 14 +- .../implementation/WireTypeClientImpl.java | 10 +- .../implementation/WireTypeOpsImpl.java | 50 +- .../naming/implementation/ModelsImpl.java | 24 +- .../implementation/NamingClientImpl.java | 88 +-- .../naming/implementation/UnionEnumsImpl.java | 24 +- .../structure/service/BarAsyncClient.java | 48 +- .../client/structure/service/BarClient.java | 47 +- ...ooAsyncClient.java => BazAsyncClient.java} | 10 +- .../{BazFooClient.java => BazClient.java} | 10 +- .../structure/service/FooAsyncClient.java | 48 +- .../client/structure/service/FooClient.java | 47 +- .../structure/service/QuxAsyncClient.java | 34 + .../structure/service/QuxBarAsyncClient.java | 72 -- .../structure/service/QuxBarClient.java | 69 -- .../client/structure/service/QuxClient.java | 33 + .../service/ServiceClientClientBuilder.java | 70 +- .../service/implementation/BarsImpl.java | 82 +-- .../implementation/BarsOperationsImpl.java | 155 ++++ .../{BazFoosImpl.java => BazesImpl.java} | 30 +- .../implementation/ClientAClientImpl.java | 35 +- .../implementation/ClientBClientImpl.java | 37 +- .../service/implementation/FoosImpl.java | 82 +-- .../implementation/FoosOperationsImpl.java | 155 ++++ .../service/implementation/Group1sImpl.java | 40 +- .../service/implementation/Group2sImpl.java | 40 +- .../service/implementation/GroupsImpl.java | 37 +- .../service/implementation/QuxBarsImpl.java | 110 --- .../service/implementation/QuxesImpl.java | 63 +- .../RenamedOperationClientImpl.java | 35 +- .../ServiceClientClientImpl.java | 90 +-- .../bytes/implementation/HeadersImpl.java | 54 +- .../bytes/implementation/PropertiesImpl.java | 66 +- .../bytes/implementation/QueriesImpl.java | 55 +- .../implementation/RequestBodiesImpl.java | 72 +- .../implementation/ResponseBodiesImpl.java | 20 +- .../datetime/implementation/HeadersImpl.java | 71 +- .../implementation/PropertiesImpl.java | 83 ++- .../datetime/implementation/QueriesImpl.java | 72 +- .../implementation/ResponseHeadersImpl.java | 49 +- .../duration/implementation/HeadersImpl.java | 88 +-- .../implementation/PropertiesImpl.java | 101 ++- .../duration/implementation/QueriesImpl.java | 85 +-- .../implementation/ExplicitBodiesImpl.java | 14 +- .../implementation/ImplicitBodiesImpl.java | 12 +- .../BodyOptionalityClientImpl.java | 25 +- .../implementation/OptionalExplicitsImpl.java | 28 +- .../implementation/HeadersImpl.java | 12 +- .../implementation/QueriesImpl.java | 59 +- .../parameters/spread/AliasAsyncClient.java | 32 +- .../com/parameters/spread/AliasClient.java | 35 +- .../parameters/spread/ModelAsyncClient.java | 8 +- .../com/parameters/spread/ModelClient.java | 8 +- .../spread/implementation/AliasImpl.java | 75 +- .../spread/implementation/ModelsImpl.java | 70 +- .../JsonMergePatchClientImpl.java | 33 +- .../implementation/StringBodiesImpl.java | 40 +- .../multipart/MultiPartAsyncClient.java | 22 +- .../payload/multipart/MultiPartClient.java | 22 +- .../implementation/FormDatasImpl.java | 143 ++-- .../implementation/PageableClientImpl.java | 12 +- .../ResiliencyServiceDrivenClientBuilder.java | 21 +- .../ResiliencyServiceDrivenClientImpl.java | 94 +-- .../ResiliencyServiceDrivenClientBuilder.java | 23 +- .../ResiliencyServiceDrivenClientImpl.java | 82 ++- .../json/implementation/PropertiesImpl.java | 17 +- .../implementation/NotDefinedClientImpl.java | 25 +- .../path/multiple/MultipleClientBuilder.java | 21 +- .../implementation/MultipleClientImpl.java | 59 +- .../implementation/SingleClientImpl.java | 14 +- .../NotVersionedClientImpl.java | 40 +- .../implementation/VersionedClientImpl.java | 54 +- .../ConditionalRequestClientImpl.java | 25 +- .../RepeatabilityClientImpl.java | 13 +- .../implementation/ModelPropertiesImpl.java | 12 +- .../implementation/ModelsImpl.java | 418 +++++------ .../implementation/OperationsImpl.java | 364 ++++------ .../implementation/ParametersImpl.java | 439 +++++------- .../implementation/BooleanValuesImpl.java | 20 +- .../implementation/DatetimeValuesImpl.java | 20 +- .../implementation/DurationValuesImpl.java | 20 +- .../implementation/Float32ValuesImpl.java | 20 +- .../array/implementation/Int32ValuesImpl.java | 20 +- .../array/implementation/Int64ValuesImpl.java | 20 +- .../array/implementation/ModelValuesImpl.java | 20 +- .../NullableBooleanValuesImpl.java | 20 +- .../NullableFloatValuesImpl.java | 20 +- .../NullableInt32ValuesImpl.java | 20 +- .../NullableModelValuesImpl.java | 20 +- .../NullableStringValuesImpl.java | 20 +- .../implementation/StringValuesImpl.java | 20 +- .../implementation/UnknownValuesImpl.java | 20 +- .../implementation/BooleanValuesImpl.java | 20 +- .../implementation/DatetimeValuesImpl.java | 20 +- .../implementation/DurationValuesImpl.java | 20 +- .../implementation/Float32ValuesImpl.java | 20 +- .../implementation/Int32ValuesImpl.java | 20 +- .../implementation/Int64ValuesImpl.java | 20 +- .../implementation/ModelValuesImpl.java | 20 +- .../NullableFloatValuesImpl.java | 20 +- .../RecursiveModelValuesImpl.java | 20 +- .../implementation/StringValuesImpl.java | 20 +- .../implementation/UnknownValuesImpl.java | 20 +- .../implementation/StringOperationsImpl.java | 32 +- .../implementation/StringOperationsImpl.java | 28 +- .../empty/implementation/EmptyClientImpl.java | 33 +- .../implementation/FlattenClientImpl.java | 34 +- .../EnumDiscriminatorAsyncClient.java | 22 +- .../EnumDiscriminatorClient.java | 16 +- .../EnumDiscriminatorClientImpl.java | 70 +- .../EnumNestedDiscriminatorClientImpl.java | 40 +- .../NestedDiscriminatorClientImpl.java | 40 +- .../NotDiscriminatedClientImpl.java | 32 +- .../implementation/RecursiveClientImpl.java | 20 +- .../SingleDiscriminatorClientImpl.java | 44 +- .../usage/implementation/UsageClientImpl.java | 35 +- .../implementation/VisibilityClientImpl.java | 76 +- ...xtendsDifferentSpreadFloatAsyncClient.java | 6 +- .../ExtendsDifferentSpreadFloatClient.java | 5 +- ...sDifferentSpreadModelArrayAsyncClient.java | 6 +- ...xtendsDifferentSpreadModelArrayClient.java | 6 +- ...xtendsDifferentSpreadModelAsyncClient.java | 6 +- .../ExtendsDifferentSpreadModelClient.java | 6 +- ...tendsDifferentSpreadStringAsyncClient.java | 6 +- .../ExtendsDifferentSpreadStringClient.java | 5 +- .../ExtendsFloatAsyncClient.java | 5 +- .../ExtendsFloatClient.java | 4 +- .../ExtendsModelArrayAsyncClient.java | 5 +- .../ExtendsModelArrayClient.java | 4 +- .../ExtendsModelAsyncClient.java | 5 +- .../ExtendsModelClient.java | 4 +- .../ExtendsStringAsyncClient.java | 5 +- .../ExtendsStringClient.java | 4 +- .../ExtendsUnknownAsyncClient.java | 5 +- .../ExtendsUnknownClient.java | 4 +- .../ExtendsUnknownDerivedAsyncClient.java | 6 +- .../ExtendsUnknownDerivedClient.java | 4 +- ...xtendsUnknownDiscriminatedAsyncClient.java | 6 +- .../ExtendsUnknownDiscriminatedClient.java | 4 +- .../IsFloatAsyncClient.java | 5 +- .../additionalproperties/IsFloatClient.java | 4 +- .../IsModelArrayAsyncClient.java | 5 +- .../IsModelArrayClient.java | 4 +- .../IsModelAsyncClient.java | 5 +- .../additionalproperties/IsModelClient.java | 4 +- .../IsStringAsyncClient.java | 5 +- .../additionalproperties/IsStringClient.java | 4 +- .../IsUnknownAsyncClient.java | 5 +- .../additionalproperties/IsUnknownClient.java | 4 +- .../IsUnknownDerivedAsyncClient.java | 6 +- .../IsUnknownDerivedClient.java | 4 +- .../IsUnknownDiscriminatedAsyncClient.java | 5 +- .../IsUnknownDiscriminatedClient.java | 4 +- .../MultipleSpreadAsyncClient.java | 5 +- .../MultipleSpreadClient.java | 4 +- .../SpreadDifferentFloatAsyncClient.java | 6 +- .../SpreadDifferentFloatClient.java | 5 +- .../SpreadDifferentModelArrayAsyncClient.java | 6 +- .../SpreadDifferentModelArrayClient.java | 5 +- .../SpreadDifferentModelAsyncClient.java | 6 +- .../SpreadDifferentModelClient.java | 5 +- .../SpreadDifferentStringAsyncClient.java | 6 +- .../SpreadDifferentStringClient.java | 4 +- .../SpreadFloatAsyncClient.java | 6 +- .../SpreadFloatClient.java | 4 +- .../SpreadModelArrayAsyncClient.java | 4 +- .../SpreadModelArrayClient.java | 4 +- .../SpreadModelAsyncClient.java | 6 +- .../SpreadModelClient.java | 5 +- ...adRecordDiscriminatedUnionAsyncClient.java | 5 +- .../SpreadRecordDiscriminatedUnionClient.java | 4 +- ...cordNonDiscriminatedUnion2AsyncClient.java | 5 +- ...eadRecordNonDiscriminatedUnion2Client.java | 4 +- ...cordNonDiscriminatedUnion3AsyncClient.java | 5 +- ...eadRecordNonDiscriminatedUnion3Client.java | 4 +- ...ecordNonDiscriminatedUnionAsyncClient.java | 5 +- ...readRecordNonDiscriminatedUnionClient.java | 4 +- .../SpreadRecordUnionAsyncClient.java | 5 +- .../SpreadRecordUnionClient.java | 4 +- .../SpreadStringAsyncClient.java | 6 +- .../SpreadStringClient.java | 4 +- .../ExtendsDifferentSpreadFloatsImpl.java | 26 +- ...ExtendsDifferentSpreadModelArraysImpl.java | 26 +- .../ExtendsDifferentSpreadModelsImpl.java | 26 +- .../ExtendsDifferentSpreadStringsImpl.java | 26 +- .../implementation/ExtendsFloatsImpl.java | 25 +- .../ExtendsModelArraysImpl.java | 25 +- .../implementation/ExtendsModelsImpl.java | 25 +- .../implementation/ExtendsStringsImpl.java | 25 +- .../ExtendsUnknownDerivedsImpl.java | 25 +- .../ExtendsUnknownDiscriminatedsImpl.java | 25 +- .../implementation/ExtendsUnknownsImpl.java | 25 +- .../implementation/IsFloatsImpl.java | 25 +- .../implementation/IsModelArraysImpl.java | 25 +- .../implementation/IsModelsImpl.java | 25 +- .../implementation/IsStringsImpl.java | 25 +- .../implementation/IsUnknownDerivedsImpl.java | 25 +- .../IsUnknownDiscriminatedsImpl.java | 25 +- .../implementation/IsUnknownsImpl.java | 25 +- .../implementation/MultipleSpreadsImpl.java | 25 +- .../SpreadDifferentFloatsImpl.java | 26 +- .../SpreadDifferentModelArraysImpl.java | 26 +- .../SpreadDifferentModelsImpl.java | 26 +- .../SpreadDifferentStringsImpl.java | 25 +- .../implementation/SpreadFloatsImpl.java | 25 +- .../implementation/SpreadModelArraysImpl.java | 24 +- .../implementation/SpreadModelsImpl.java | 26 +- .../SpreadRecordDiscriminatedUnionsImpl.java | 25 +- ...readRecordNonDiscriminatedUnion2sImpl.java | 25 +- ...readRecordNonDiscriminatedUnion3sImpl.java | 25 +- ...preadRecordNonDiscriminatedUnionsImpl.java | 25 +- .../SpreadRecordUnionsImpl.java | 25 +- .../implementation/SpreadStringsImpl.java | 25 +- .../property/nullable/BytesAsyncClient.java | 12 +- .../type/property/nullable/BytesClient.java | 8 +- .../nullable/CollectionsByteAsyncClient.java | 10 +- .../nullable/CollectionsByteClient.java | 8 +- .../nullable/CollectionsModelAsyncClient.java | 10 +- .../nullable/CollectionsModelClient.java | 8 +- .../CollectionsStringAsyncClient.java | 10 +- .../nullable/CollectionsStringClient.java | 8 +- .../DatetimeOperationAsyncClient.java | 10 +- .../nullable/DatetimeOperationClient.java | 8 +- .../DurationOperationAsyncClient.java | 10 +- .../nullable/DurationOperationClient.java | 8 +- .../nullable/StringOperationAsyncClient.java | 12 +- .../nullable/StringOperationClient.java | 8 +- .../nullable/implementation/BytesImpl.java | 45 +- .../implementation/CollectionsBytesImpl.java | 43 +- .../implementation/CollectionsModelsImpl.java | 43 +- .../CollectionsStringsImpl.java | 43 +- .../DatetimeOperationsImpl.java | 43 +- .../DurationOperationsImpl.java | 43 +- .../implementation/StringOperationsImpl.java | 45 +- .../optional/BooleanLiteralAsyncClient.java | 10 +- .../optional/BooleanLiteralClient.java | 8 +- .../property/optional/BytesAsyncClient.java | 12 +- .../type/property/optional/BytesClient.java | 8 +- .../optional/CollectionsByteAsyncClient.java | 10 +- .../optional/CollectionsByteClient.java | 8 +- .../optional/CollectionsModelAsyncClient.java | 10 +- .../optional/CollectionsModelClient.java | 8 +- .../DatetimeOperationAsyncClient.java | 10 +- .../optional/DatetimeOperationClient.java | 8 +- .../DurationOperationAsyncClient.java | 10 +- .../optional/DurationOperationClient.java | 8 +- .../optional/FloatLiteralAsyncClient.java | 10 +- .../property/optional/FloatLiteralClient.java | 8 +- .../optional/IntLiteralAsyncClient.java | 10 +- .../property/optional/IntLiteralClient.java | 8 +- .../RequiredAndOptionalAsyncClient.java | 12 +- .../optional/RequiredAndOptionalClient.java | 8 +- .../optional/StringLiteralAsyncClient.java | 10 +- .../optional/StringLiteralClient.java | 8 +- .../optional/StringOperationAsyncClient.java | 12 +- .../optional/StringOperationClient.java | 8 +- .../UnionFloatLiteralAsyncClient.java | 10 +- .../optional/UnionFloatLiteralClient.java | 8 +- .../optional/UnionIntLiteralAsyncClient.java | 10 +- .../optional/UnionIntLiteralClient.java | 8 +- .../UnionStringLiteralAsyncClient.java | 10 +- .../optional/UnionStringLiteralClient.java | 8 +- .../implementation/BooleanLiteralsImpl.java | 44 +- .../optional/implementation/BytesImpl.java | 46 +- .../implementation/CollectionsBytesImpl.java | 44 +- .../implementation/CollectionsModelsImpl.java | 44 +- .../DatetimeOperationsImpl.java | 44 +- .../DurationOperationsImpl.java | 44 +- .../implementation/FloatLiteralsImpl.java | 44 +- .../implementation/IntLiteralsImpl.java | 44 +- .../RequiredAndOptionalsImpl.java | 46 +- .../implementation/StringLiteralsImpl.java | 44 +- .../implementation/StringOperationsImpl.java | 46 +- .../UnionFloatLiteralsImpl.java | 44 +- .../implementation/UnionIntLiteralsImpl.java | 44 +- .../UnionStringLiteralsImpl.java | 44 +- .../valuetypes/BooleanLiteralAsyncClient.java | 5 +- .../valuetypes/BooleanLiteralClient.java | 4 +- .../BooleanOperationAsyncClient.java | 4 +- .../valuetypes/BooleanOperationClient.java | 4 +- .../property/valuetypes/BytesAsyncClient.java | 4 +- .../type/property/valuetypes/BytesClient.java | 4 +- .../valuetypes/CollectionsIntAsyncClient.java | 5 +- .../valuetypes/CollectionsIntClient.java | 4 +- .../CollectionsModelAsyncClient.java | 5 +- .../valuetypes/CollectionsModelClient.java | 4 +- .../CollectionsStringAsyncClient.java | 5 +- .../valuetypes/CollectionsStringClient.java | 4 +- .../DatetimeOperationAsyncClient.java | 4 +- .../valuetypes/DatetimeOperationClient.java | 4 +- .../valuetypes/Decimal128AsyncClient.java | 4 +- .../property/valuetypes/Decimal128Client.java | 4 +- .../valuetypes/DecimalAsyncClient.java | 4 +- .../property/valuetypes/DecimalClient.java | 4 +- .../DictionaryStringAsyncClient.java | 5 +- .../valuetypes/DictionaryStringClient.java | 4 +- .../DurationOperationAsyncClient.java | 4 +- .../valuetypes/DurationOperationClient.java | 4 +- .../property/valuetypes/EnumAsyncClient.java | 4 +- .../type/property/valuetypes/EnumClient.java | 4 +- .../valuetypes/ExtensibleEnumAsyncClient.java | 5 +- .../valuetypes/ExtensibleEnumClient.java | 4 +- .../valuetypes/FloatLiteralAsyncClient.java | 4 +- .../valuetypes/FloatLiteralClient.java | 4 +- .../valuetypes/FloatOperationAsyncClient.java | 4 +- .../valuetypes/FloatOperationClient.java | 4 +- .../property/valuetypes/IntAsyncClient.java | 4 +- .../type/property/valuetypes/IntClient.java | 4 +- .../valuetypes/IntLiteralAsyncClient.java | 4 +- .../property/valuetypes/IntLiteralClient.java | 4 +- .../property/valuetypes/ModelAsyncClient.java | 4 +- .../type/property/valuetypes/ModelClient.java | 4 +- .../property/valuetypes/NeverAsyncClient.java | 4 +- .../type/property/valuetypes/NeverClient.java | 4 +- .../valuetypes/StringLiteralAsyncClient.java | 5 +- .../valuetypes/StringLiteralClient.java | 4 +- .../StringOperationAsyncClient.java | 4 +- .../valuetypes/StringOperationClient.java | 4 +- .../valuetypes/UnionEnumValueAsyncClient.java | 5 +- .../valuetypes/UnionEnumValueClient.java | 4 +- .../UnionFloatLiteralAsyncClient.java | 5 +- .../valuetypes/UnionFloatLiteralClient.java | 4 +- .../UnionIntLiteralAsyncClient.java | 5 +- .../valuetypes/UnionIntLiteralClient.java | 4 +- .../UnionStringLiteralAsyncClient.java | 5 +- .../valuetypes/UnionStringLiteralClient.java | 4 +- .../valuetypes/UnknownArrayAsyncClient.java | 5 +- .../valuetypes/UnknownArrayClient.java | 4 +- .../valuetypes/UnknownDictAsyncClient.java | 5 +- .../valuetypes/UnknownDictClient.java | 4 +- .../valuetypes/UnknownIntAsyncClient.java | 5 +- .../property/valuetypes/UnknownIntClient.java | 4 +- .../valuetypes/UnknownStringAsyncClient.java | 5 +- .../valuetypes/UnknownStringClient.java | 4 +- .../implementation/BooleanLiteralsImpl.java | 25 +- .../implementation/BooleanOperationsImpl.java | 24 +- .../valuetypes/implementation/BytesImpl.java | 24 +- .../implementation/CollectionsIntsImpl.java | 25 +- .../implementation/CollectionsModelsImpl.java | 25 +- .../CollectionsStringsImpl.java | 25 +- .../DatetimeOperationsImpl.java | 24 +- .../implementation/Decimal128sImpl.java | 24 +- .../implementation/DecimalsImpl.java | 24 +- .../implementation/DictionaryStringsImpl.java | 25 +- .../DurationOperationsImpl.java | 24 +- .../valuetypes/implementation/EnumsImpl.java | 24 +- .../implementation/ExtensibleEnumsImpl.java | 25 +- .../implementation/FloatLiteralsImpl.java | 24 +- .../implementation/FloatOperationsImpl.java | 24 +- .../implementation/IntLiteralsImpl.java | 24 +- .../valuetypes/implementation/IntsImpl.java | 24 +- .../valuetypes/implementation/ModelsImpl.java | 24 +- .../valuetypes/implementation/NeversImpl.java | 24 +- .../implementation/StringLiteralsImpl.java | 25 +- .../implementation/StringOperationsImpl.java | 24 +- .../implementation/UnionEnumValuesImpl.java | 25 +- .../UnionFloatLiteralsImpl.java | 25 +- .../implementation/UnionIntLiteralsImpl.java | 25 +- .../UnionStringLiteralsImpl.java | 25 +- .../implementation/UnknownArraysImpl.java | 25 +- .../implementation/UnknownDictsImpl.java | 25 +- .../implementation/UnknownIntsImpl.java | 25 +- .../implementation/UnknownStringsImpl.java | 25 +- .../scalar/BooleanOperationAsyncClient.java | 5 +- .../type/scalar/BooleanOperationClient.java | 4 +- .../scalar/StringOperationAsyncClient.java | 4 +- .../type/scalar/StringOperationClient.java | 4 +- .../com/type/scalar/UnknownAsyncClient.java | 4 +- .../java/com/type/scalar/UnknownClient.java | 4 +- .../implementation/BooleanOperationsImpl.java | 25 +- .../implementation/Decimal128TypesImpl.java | 30 +- .../Decimal128VerifiesImpl.java | 18 +- .../implementation/DecimalTypesImpl.java | 30 +- .../implementation/DecimalVerifiesImpl.java | 18 +- .../implementation/StringOperationsImpl.java | 24 +- .../scalar/implementation/UnknownsImpl.java | 24 +- .../union/implementation/EnumsOnliesImpl.java | 16 +- .../implementation/FloatsOnliesImpl.java | 16 +- .../union/implementation/IntsOnliesImpl.java | 16 +- .../implementation/MixedLiteralsImpl.java | 16 +- .../union/implementation/MixedTypesImpl.java | 16 +- .../implementation/ModelsOnliesImpl.java | 16 +- .../implementation/StringAndArraysImpl.java | 16 +- .../StringExtensibleNamedsImpl.java | 16 +- .../implementation/StringExtensiblesImpl.java | 16 +- .../implementation/StringsOnliesImpl.java | 16 +- .../added/implementation/AddedClientImpl.java | 37 +- .../implementation/InterfaceV2sImpl.java | 16 +- .../MadeOptionalClientImpl.java | 17 +- .../implementation/RemovedClientImpl.java | 17 +- .../implementation/NewInterfacesImpl.java | 18 +- .../implementation/RenamedFromClientImpl.java | 20 +- .../ReturnTypeChangedFromClientImpl.java | 17 +- .../TypeChangedFromClientImpl.java | 18 +- .../main/resources/cadl-optional.properties | 2 - .../cadl/builtin/generated/BuiltinOpRead.java | 20 - .../cadl/flatten/generated/FlattenOpSend.java | 20 - .../flatten/generated/FlattenOpSendLong.java | 29 - .../generated/LongRunningCreateJob.java | 39 - .../model/generated/ModelOpPutNested.java | 20 - ...ntTypeUploadImageForSingleContentType.java | 23 - .../response/generated/ResponseOpExists.java | 20 - .../generated/ResponseOpListStrings.java | 21 - .../specialchars/generated/BuiltinOpRead.java | 21 - .../generated/EtagHeadersListWithEtag.java | 22 - .../EtagHeadersPutWithRequestHeaders.java | 24 - .../generated/VersioningOpList.java | 23 - .../generated/HttpbinClientTestBase.java | 2 + .../ServiceClientClientTestBase.java | 37 +- ...ResiliencyServiceDrivenClientTestBase.java | 1 + ...ResiliencyServiceDrivenClientTestBase.java | 1 + .../generated/MultipleClientTestBase.java | 1 + 545 files changed, 7581 insertions(+), 9681 deletions(-) create mode 100644 typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/models/OperationState.java create mode 100644 typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/models/ResourceOperationStatusGenerationResponseGenerationResultError.java create mode 100644 typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/models/OperationState.java create mode 100644 typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/models/OperationStatusError.java create mode 100644 typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/models/ResourceOperationStatusUserExportedUserError.java rename typespec-tests/src/main/java/com/cadl/internal/{implementation => }/models/ResponseInternal.java (98%) rename typespec-tests/src/main/java/com/cadl/internal/{implementation => }/models/ResponseInternalInner.java (98%) create mode 100644 typespec-tests/src/main/java/com/cadl/longrunning/models/LroOperationStatusError.java delete mode 100644 typespec-tests/src/main/java/com/cadl/optional/OptionalAsyncClient.java delete mode 100644 typespec-tests/src/main/java/com/cadl/optional/OptionalClient.java delete mode 100644 typespec-tests/src/main/java/com/cadl/optional/OptionalClientBuilder.java delete mode 100644 typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalClientImpl.java delete mode 100644 typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalOpsImpl.java delete mode 100644 typespec-tests/src/main/java/com/cadl/optional/implementation/package-info.java delete mode 100644 typespec-tests/src/main/java/com/cadl/optional/models/AllPropertiesOptional.java delete mode 100644 typespec-tests/src/main/java/com/cadl/optional/models/ImmutableModel.java delete mode 100644 typespec-tests/src/main/java/com/cadl/optional/models/Optional.java delete mode 100644 typespec-tests/src/main/java/com/cadl/optional/models/package-info.java delete mode 100644 typespec-tests/src/main/java/com/cadl/optional/package-info.java create mode 100644 typespec-tests/src/main/java/com/cadl/union/models/OperationState.java create mode 100644 typespec-tests/src/main/java/com/cadl/union/models/ResourceOperationStatusOperationStatusResultError.java create mode 100644 typespec-tests/src/main/java/com/cadl/versioning/models/OperationState.java create mode 100644 typespec-tests/src/main/java/com/cadl/versioning/models/ResourceOperationStatusResourceExportedResourceError.java rename typespec-tests/src/main/java/com/client/structure/service/{BazFooAsyncClient.java => BazAsyncClient.java} (91%) rename typespec-tests/src/main/java/com/client/structure/service/{BazFooClient.java => BazClient.java} (91%) delete mode 100644 typespec-tests/src/main/java/com/client/structure/service/QuxBarAsyncClient.java delete mode 100644 typespec-tests/src/main/java/com/client/structure/service/QuxBarClient.java create mode 100644 typespec-tests/src/main/java/com/client/structure/service/implementation/BarsOperationsImpl.java rename typespec-tests/src/main/java/com/client/structure/service/implementation/{BazFoosImpl.java => BazesImpl.java} (81%) create mode 100644 typespec-tests/src/main/java/com/client/structure/service/implementation/FoosOperationsImpl.java delete mode 100644 typespec-tests/src/main/java/com/client/structure/service/implementation/QuxBarsImpl.java delete mode 100644 typespec-tests/src/main/resources/cadl-optional.properties delete mode 100644 typespec-tests/src/samples/java/com/cadl/builtin/generated/BuiltinOpRead.java delete mode 100644 typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSend.java delete mode 100644 typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSendLong.java delete mode 100644 typespec-tests/src/samples/java/com/cadl/longrunning/generated/LongRunningCreateJob.java delete mode 100644 typespec-tests/src/samples/java/com/cadl/model/generated/ModelOpPutNested.java delete mode 100644 typespec-tests/src/samples/java/com/cadl/multicontenttypes/generated/SingleContentTypeUploadImageForSingleContentType.java delete mode 100644 typespec-tests/src/samples/java/com/cadl/response/generated/ResponseOpExists.java delete mode 100644 typespec-tests/src/samples/java/com/cadl/response/generated/ResponseOpListStrings.java delete mode 100644 typespec-tests/src/samples/java/com/cadl/specialchars/generated/BuiltinOpRead.java delete mode 100644 typespec-tests/src/samples/java/com/cadl/specialheaders/generated/EtagHeadersListWithEtag.java delete mode 100644 typespec-tests/src/samples/java/com/cadl/specialheaders/generated/EtagHeadersPutWithRequestHeaders.java delete mode 100644 typespec-tests/src/samples/java/com/cadl/versioning/generated/VersioningOpList.java diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/InternalOperationsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/InternalOperationsImpl.java index 1f546b3b79..f0b3990416 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/InternalOperationsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/InternalOperationsImpl.java @@ -64,7 +64,7 @@ public interface InternalOperationsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> noDecoratorInInternal(@QueryParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/internalOperation/noDecoratorInInternal") @ExpectedResponses({ 200 }) @@ -73,7 +73,7 @@ Mono> noDecoratorInInternal(@QueryParam("name") String name @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response noDecoratorInInternalSync(@QueryParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/internalOperation/internalDecoratorInInternal") @ExpectedResponses({ 200 }) @@ -82,7 +82,7 @@ Response noDecoratorInInternalSync(@QueryParam("name") String name, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> internalDecoratorInInternal(@QueryParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/internalOperation/internalDecoratorInInternal") @ExpectedResponses({ 200 }) @@ -91,7 +91,7 @@ Mono> internalDecoratorInInternal(@QueryParam("name") Strin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response internalDecoratorInInternalSync(@QueryParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/internalOperation/publicDecoratorInInternal") @ExpectedResponses({ 200 }) @@ -100,7 +100,7 @@ Response internalDecoratorInInternalSync(@QueryParam("name") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> publicDecoratorInInternal(@QueryParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/internalOperation/publicDecoratorInInternal") @ExpectedResponses({ 200 }) @@ -109,7 +109,7 @@ Mono> publicDecoratorInInternal(@QueryParam("name") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response publicDecoratorInInternalSync(@QueryParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/PublicOperationsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/PublicOperationsImpl.java index 3c5b2aec41..d50ff927b4 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/PublicOperationsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/PublicOperationsImpl.java @@ -64,7 +64,7 @@ public interface PublicOperationsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> noDecoratorInPublic(@QueryParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/publicOperation/noDecoratorInPublic") @ExpectedResponses({ 200 }) @@ -73,7 +73,7 @@ Mono> noDecoratorInPublic(@QueryParam("name") String name, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response noDecoratorInPublicSync(@QueryParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/publicOperation/publicDecoratorInPublic") @ExpectedResponses({ 200 }) @@ -82,7 +82,7 @@ Response noDecoratorInPublicSync(@QueryParam("name") String name, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> publicDecoratorInPublic(@QueryParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/publicOperation/publicDecoratorInPublic") @ExpectedResponses({ 200 }) @@ -91,7 +91,7 @@ Mono> publicDecoratorInPublic(@QueryParam("name") String na @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response publicDecoratorInPublicSync(@QueryParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/RelativeModelInOperationsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/RelativeModelInOperationsImpl.java index ecd6b80784..a475dde8cc 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/RelativeModelInOperationsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/RelativeModelInOperationsImpl.java @@ -63,7 +63,7 @@ public interface RelativeModelInOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> operation(@QueryParam("name") String name, @HeaderParam("accept") String accept, + Mono> operation(@QueryParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/relativeModelInOperation/operation") @@ -72,7 +72,7 @@ Mono> operation(@QueryParam("name") String name, @HeaderPar @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response operationSync(@QueryParam("name") String name, @HeaderParam("accept") String accept, + Response operationSync(@QueryParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/relativeModelInOperation/discriminator") @@ -81,7 +81,7 @@ Response operationSync(@QueryParam("name") String name, @HeaderParam @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> discriminator(@QueryParam("kind") String kind, @HeaderParam("accept") String accept, + Mono> discriminator(@QueryParam("kind") String kind, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/relativeModelInOperation/discriminator") @@ -90,7 +90,7 @@ Mono> discriminator(@QueryParam("kind") String kind, @Heade @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response discriminatorSync(@QueryParam("kind") String kind, @HeaderParam("accept") String accept, + Response discriminatorSync(@QueryParam("kind") String kind, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/SharedModelInOperationsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/SharedModelInOperationsImpl.java index cd3684b45b..ba5e9df97d 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/SharedModelInOperationsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/SharedModelInOperationsImpl.java @@ -63,7 +63,7 @@ public interface SharedModelInOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> publicMethod(@QueryParam("name") String name, @HeaderParam("accept") String accept, + Mono> publicMethod(@QueryParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/sharedModelInOperation/public") @@ -72,7 +72,7 @@ Mono> publicMethod(@QueryParam("name") String name, @Header @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response publicMethodSync(@QueryParam("name") String name, @HeaderParam("accept") String accept, + Response publicMethodSync(@QueryParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/sharedModelInOperation/internal") @@ -81,7 +81,7 @@ Response publicMethodSync(@QueryParam("name") String name, @HeaderPa @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> internal(@QueryParam("name") String name, @HeaderParam("accept") String accept, + Mono> internal(@QueryParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/sharedModelInOperation/internal") @@ -90,7 +90,7 @@ Mono> internal(@QueryParam("name") String name, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response internalSync(@QueryParam("name") String name, @HeaderParam("accept") String accept, + Response internalSync(@QueryParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/implementation/ModelInOperationsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/implementation/ModelInOperationsImpl.java index fd5a97122f..45f193c3c1 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/implementation/ModelInOperationsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/implementation/ModelInOperationsImpl.java @@ -65,7 +65,7 @@ public interface ModelInOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> inputToInputOutput(@HeaderParam("accept") String accept, + Mono> inputToInputOutput(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/azure/client-generator-core/usage/inputToInputOutput") @@ -74,7 +74,7 @@ Mono> inputToInputOutput(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response inputToInputOutputSync(@HeaderParam("accept") String accept, + Response inputToInputOutputSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/usage/outputToInputOutput") @@ -83,7 +83,7 @@ Response inputToInputOutputSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> outputToInputOutput(@HeaderParam("accept") String accept, + Mono> outputToInputOutput(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/usage/outputToInputOutput") @@ -92,7 +92,7 @@ Mono> outputToInputOutput(@HeaderParam("accept") String acc @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response outputToInputOutputSync(@HeaderParam("accept") String accept, + Response outputToInputOutputSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/azure/client-generator-core/usage/modelInReadOnlyProperty") @@ -101,8 +101,9 @@ Response outputToInputOutputSync(@HeaderParam("accept") String accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> modelInReadOnlyProperty(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> modelInReadOnlyProperty(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/azure/client-generator-core/usage/modelInReadOnlyProperty") @ExpectedResponses({ 200 }) @@ -110,8 +111,9 @@ Mono> modelInReadOnlyProperty(@HeaderParam("accept") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response modelInReadOnlyPropertySync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response modelInReadOnlyPropertySync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -139,8 +141,8 @@ Response modelInReadOnlyPropertySync(@HeaderParam("accept") String a */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> inputToInputOutputWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.inputToInputOutput(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.inputToInputOutput(contentType, body, requestOptions, context)); } /** @@ -168,8 +170,8 @@ public Mono> inputToInputOutputWithResponseAsync(BinaryData body, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response inputToInputOutputWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.inputToInputOutputSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.inputToInputOutputSync(contentType, body, requestOptions, Context.NONE); } /** @@ -274,8 +276,10 @@ public Response outputToInputOutputWithResponse(RequestOptions reque @ServiceMethod(returns = ReturnType.SINGLE) public Mono> modelInReadOnlyPropertyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.modelInReadOnlyProperty(accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.modelInReadOnlyProperty(contentType, accept, body, requestOptions, context)); } /** @@ -323,7 +327,8 @@ public Mono> modelInReadOnlyPropertyWithResponseAsync(Binar */ @ServiceMethod(returns = ReturnType.SINGLE) public Response modelInReadOnlyPropertyWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.modelInReadOnlyPropertySync(accept, body, requestOptions, Context.NONE); + return service.modelInReadOnlyPropertySync(contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java index 01fdba4193..93765b3642 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java @@ -160,7 +160,7 @@ public interface BasicClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrUpdate(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -171,7 +171,7 @@ Mono> createOrUpdate(@QueryParam("api-version") String apiV @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrUpdateSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -182,8 +182,9 @@ Response createOrUpdateSync(@QueryParam("api-version") String apiVer @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrReplace(@QueryParam("api-version") String apiVersion, - @PathParam("id") int id, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); + @PathParam("id") int id, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData resource, + RequestOptions requestOptions, Context context); @Put("/azure/core/basic/users/{id}") @ExpectedResponses({ 200, 201 }) @@ -192,8 +193,8 @@ Mono> createOrReplace(@QueryParam("api-version") String api @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrReplaceSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/users/{id}") @ExpectedResponses({ 200 }) @@ -202,7 +203,7 @@ Response createOrReplaceSync(@QueryParam("api-version") String apiVe @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> get(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/users/{id}") @ExpectedResponses({ 200 }) @@ -211,7 +212,7 @@ Mono> get(@QueryParam("api-version") String apiVersion, @Pa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/users") @ExpectedResponses({ 200 }) @@ -220,7 +221,7 @@ Response getSync(@QueryParam("api-version") String apiVersion, @Path @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> list(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/users") @ExpectedResponses({ 200 }) @@ -229,7 +230,7 @@ Mono> list(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/page") @ExpectedResponses({ 200 }) @@ -238,7 +239,7 @@ Response listSync(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithPage(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/page") @ExpectedResponses({ 200 }) @@ -247,7 +248,7 @@ Mono> listWithPage(@QueryParam("api-version") String apiVer @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithPageSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/parameters") @ExpectedResponses({ 200 }) @@ -256,8 +257,8 @@ Response listWithPageSync(@QueryParam("api-version") String apiVersi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithParameters(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData bodyInput, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData bodyInput, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/parameters") @ExpectedResponses({ 200 }) @@ -266,8 +267,8 @@ Mono> listWithParameters(@QueryParam("api-version") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithParametersSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData bodyInput, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData bodyInput, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/custom-page") @ExpectedResponses({ 200 }) @@ -276,7 +277,7 @@ Response listWithParametersSync(@QueryParam("api-version") String ap @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithCustomPageModel(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/custom-page") @ExpectedResponses({ 200 }) @@ -285,7 +286,7 @@ Mono> listWithCustomPageModel(@QueryParam("api-version") St @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithCustomPageModelSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/azure/core/basic/users/{id}") @ExpectedResponses({ 204 }) @@ -294,7 +295,7 @@ Response listWithCustomPageModelSync(@QueryParam("api-version") Stri @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> delete(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/azure/core/basic/users/{id}") @ExpectedResponses({ 204 }) @@ -303,7 +304,7 @@ Mono> delete(@QueryParam("api-version") String apiVersion, @PathP @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/azure/core/basic/users/{id}:export") @ExpectedResponses({ 200 }) @@ -312,7 +313,7 @@ Response deleteSync(@QueryParam("api-version") String apiVersion, @PathPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> export(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @QueryParam("format") String format, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @QueryParam("format") String format, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/azure/core/basic/users/{id}:export") @@ -322,7 +323,7 @@ Mono> export(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response exportSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @QueryParam("format") String format, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @QueryParam("format") String format, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -332,7 +333,7 @@ Response exportSync(@QueryParam("api-version") String apiVersion, @P @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -341,7 +342,7 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = tru @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -350,7 +351,7 @@ Response listNextSync(@PathParam(value = "nextLink", encoded = true) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithPageNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -359,7 +360,7 @@ Mono> listWithPageNext(@PathParam(value = "nextLink", encod @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithPageNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -368,7 +369,8 @@ Response listWithPageNextSync(@PathParam(value = "nextLink", encoded @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithParametersNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("accept") String accept, + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -378,7 +380,8 @@ Mono> listWithParametersNext( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithParametersNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -387,7 +390,7 @@ Response listWithParametersNextSync(@PathParam(value = "nextLink", e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithCustomPageModelNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("accept") String accept, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -397,7 +400,7 @@ Mono> listWithCustomPageModelNext( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithCustomPageModelNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("accept") String accept, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -562,9 +565,10 @@ public Response createOrUpdateWithResponse(int id, BinaryData resour @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createOrReplaceWithResponseAsync(int id, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.createOrReplace(this.getServiceVersion().getVersion(), id, - accept, resource, requestOptions, context)); + contentType, accept, resource, requestOptions, context)); } /** @@ -617,9 +621,10 @@ public Mono> createOrReplaceWithResponseAsync(int id, Binar @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrReplaceWithResponse(int id, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrReplaceSync(this.getServiceVersion().getVersion(), id, accept, resource, requestOptions, - Context.NONE); + return service.createOrReplaceSync(this.getServiceVersion().getVersion(), id, contentType, accept, resource, + requestOptions, Context.NONE); } /** @@ -1133,10 +1138,11 @@ public PagedIterable listWithPage(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithParametersSinglePageAsync(BinaryData bodyInput, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listWithParameters(this.getServiceVersion().getVersion(), accept, bodyInput, - requestOptions, context)) + .withContext(context -> service.listWithParameters(this.getServiceVersion().getVersion(), contentType, + accept, bodyInput, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -1239,9 +1245,10 @@ public PagedFlux listWithParametersAsync(BinaryData bodyInput, Reque @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listWithParametersSinglePage(BinaryData bodyInput, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - Response res = service.listWithParametersSync(this.getServiceVersion().getVersion(), accept, - bodyInput, requestOptions, Context.NONE); + Response res = service.listWithParametersSync(this.getServiceVersion().getVersion(), contentType, + accept, bodyInput, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } @@ -1627,6 +1634,8 @@ private PagedResponse listNextSinglePage(String nextLink, RequestOpt } /** + * List with Azure.Core.Page<>. + * * Get the next page of items. *

Response Body Schema

* @@ -1663,6 +1672,8 @@ private Mono> listWithPageNextSinglePageAsync(String n } /** + * List with Azure.Core.Page<>. + * * Get the next page of items. *

Response Body Schema

* @@ -1698,6 +1709,8 @@ private PagedResponse listWithPageNextSinglePage(String nextLink, Re } /** + * List with extensible enum parameter Azure.Core.Page<>. + * * Get the next page of items. *

Response Body Schema

* @@ -1727,14 +1740,18 @@ private PagedResponse listWithPageNextSinglePage(String nextLink, Re @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithParametersNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listWithParametersNext(nextLink, accept, requestOptions, context)) + .withContext( + context -> service.listWithParametersNext(nextLink, contentType, accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** + * List with extensible enum parameter Azure.Core.Page<>. + * * Get the next page of items. *

Response Body Schema

* @@ -1763,13 +1780,17 @@ private Mono> listWithParametersNextSinglePageAsync(St */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listWithParametersNextSinglePage(String nextLink, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - Response res = service.listWithParametersNextSync(nextLink, accept, requestOptions, Context.NONE); + Response res + = service.listWithParametersNextSync(nextLink, contentType, accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } /** + * List with custom page model. + * * Get the next page of items. *

Response Body Schema

* @@ -1807,6 +1828,8 @@ private Mono> listWithCustomPageModelNextSinglePageAsy } /** + * List with custom page model. + * * Get the next page of items. *

Response Body Schema

* diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/TwoModelsAsPageItemsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/TwoModelsAsPageItemsImpl.java index cb380a6b93..677f55c324 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/TwoModelsAsPageItemsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/TwoModelsAsPageItemsImpl.java @@ -82,7 +82,7 @@ public interface TwoModelsAsPageItemsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listFirstItem(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/first-item") @ExpectedResponses({ 200 }) @@ -91,7 +91,7 @@ Mono> listFirstItem(@QueryParam("api-version") String apiVe @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listFirstItemSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/second-item") @ExpectedResponses({ 200 }) @@ -100,7 +100,7 @@ Response listFirstItemSync(@QueryParam("api-version") String apiVers @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listSecondItem(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/second-item") @ExpectedResponses({ 200 }) @@ -109,7 +109,7 @@ Mono> listSecondItem(@QueryParam("api-version") String apiV @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listSecondItemSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -118,7 +118,7 @@ Response listSecondItemSync(@QueryParam("api-version") String apiVer @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listFirstItemNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -127,7 +127,7 @@ Mono> listFirstItemNext(@PathParam(value = "nextLink", enco @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listFirstItemNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -136,7 +136,7 @@ Response listFirstItemNextSync(@PathParam(value = "nextLink", encode @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listSecondItemNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -145,7 +145,7 @@ Mono> listSecondItemNext(@PathParam(value = "nextLink", enc @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listSecondItemNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -369,6 +369,9 @@ public PagedIterable listSecondItem(RequestOptions requestOptions) { } /** + * Two operations with two different page item types should be successfully generated. Should generate model for + * FirstItem. + * * Get the next page of items. *

Response Body Schema

* @@ -397,6 +400,9 @@ private Mono> listFirstItemNextSinglePageAsync(String } /** + * Two operations with two different page item types should be successfully generated. Should generate model for + * FirstItem. + * * Get the next page of items. *

Response Body Schema

* @@ -423,6 +429,9 @@ private PagedResponse listFirstItemNextSinglePage(String nextLink, R } /** + * Two operations with two different page item types should be successfully generated. Should generate model for + * SecondItem. + * * Get the next page of items. *

Response Body Schema

* @@ -451,6 +460,9 @@ private Mono> listSecondItemNextSinglePageAsync(String } /** + * Two operations with two different page item types should be successfully generated. Should generate model for + * SecondItem. + * * Get the next page of items. *

Response Body Schema

* diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/RpcAsyncClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/RpcAsyncClient.java index ad68e21ebd..263f922bde 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/RpcAsyncClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/RpcAsyncClient.java @@ -68,7 +68,7 @@ public final class RpcAsyncClient { * } * } * - * @param generationOptions Options for the generation. + * @param generationOptions The generationOptions parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -86,7 +86,7 @@ public PollerFlux beginLongRunningRpc(BinaryData generat /** * Generate data. * - * @param generationOptions Options for the generation. + * @param generationOptions The generationOptions parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/RpcClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/RpcClient.java index 01f413c02c..dbfdc2cfa2 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/RpcClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/RpcClient.java @@ -68,7 +68,7 @@ public final class RpcClient { * } * } * - * @param generationOptions Options for the generation. + * @param generationOptions The generationOptions parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -86,7 +86,7 @@ public SyncPoller beginLongRunningRpc(BinaryData generat /** * Generate data. * - * @param generationOptions Options for the generation. + * @param generationOptions The generationOptions parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/implementation/RpcClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/implementation/RpcClientImpl.java index 36653b9616..3365c116da 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/implementation/RpcClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/implementation/RpcClientImpl.java @@ -139,8 +139,9 @@ public interface RpcClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> longRunningRpc(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData generationOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData generationOptions, RequestOptions requestOptions, + Context context); @Post("/azure/core/lro/rpc/generations:submit") @ExpectedResponses({ 202 }) @@ -149,8 +150,9 @@ Mono> longRunningRpc(@QueryParam("api-version") String apiV @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response longRunningRpcSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData generationOptions, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData generationOptions, RequestOptions requestOptions, + Context context); } /** @@ -183,7 +185,7 @@ Response longRunningRpcSync(@QueryParam("api-version") String apiVer * } * } * - * @param generationOptions Options for the generation. + * @param generationOptions The generationOptions parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -195,9 +197,10 @@ Response longRunningRpcSync(@QueryParam("api-version") String apiVer @ServiceMethod(returns = ReturnType.SINGLE) private Mono> longRunningRpcWithResponseAsync(BinaryData generationOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.longRunningRpc(this.getServiceVersion().getVersion(), accept, - generationOptions, requestOptions, context)); + return FluxUtil.withContext(context -> service.longRunningRpc(this.getServiceVersion().getVersion(), + contentType, accept, generationOptions, requestOptions, context)); } /** @@ -230,7 +233,7 @@ private Mono> longRunningRpcWithResponseAsync(BinaryData ge * } * } * - * @param generationOptions Options for the generation. + * @param generationOptions The generationOptions parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -241,8 +244,9 @@ private Mono> longRunningRpcWithResponseAsync(BinaryData ge @ServiceMethod(returns = ReturnType.SINGLE) private Response longRunningRpcWithResponse(BinaryData generationOptions, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.longRunningRpcSync(this.getServiceVersion().getVersion(), accept, generationOptions, + return service.longRunningRpcSync(this.getServiceVersion().getVersion(), contentType, accept, generationOptions, requestOptions, Context.NONE); } @@ -276,7 +280,7 @@ private Response longRunningRpcWithResponse(BinaryData generationOpt * } * } * - * @param generationOptions Options for the generation. + * @param generationOptions The generationOptions parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -330,7 +334,7 @@ public PollerFlux beginLongRunningRpcAsync(BinaryData ge * } * } * - * @param generationOptions Options for the generation. + * @param generationOptions The generationOptions parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -384,7 +388,7 @@ public SyncPoller beginLongRunningRpc(BinaryData generat * } * } * - * @param generationOptions Options for the generation. + * @param generationOptions The generationOptions parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -439,7 +443,7 @@ public SyncPoller beginLongRunningRpc(BinaryData generat * } * } * - * @param generationOptions Options for the generation. + * @param generationOptions The generationOptions parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/models/OperationState.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/models/OperationState.java new file mode 100644 index 0000000000..69593dba1f --- /dev/null +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/models/OperationState.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com._specs_.azure.core.lro.rpc.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum describing allowed operation states. + */ +public final class OperationState extends ExpandableStringEnum { + /** + * The operation has not started. + */ + @Generated + public static final OperationState NOT_STARTED = fromString("NotStarted"); + + /** + * The operation is in progress. + */ + @Generated + public static final OperationState RUNNING = fromString("Running"); + + /** + * The operation has completed successfully. + */ + @Generated + public static final OperationState SUCCEEDED = fromString("Succeeded"); + + /** + * The operation has failed. + */ + @Generated + public static final OperationState FAILED = fromString("Failed"); + + /** + * The operation has been canceled by the user. + */ + @Generated + public static final OperationState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of OperationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public OperationState() { + } + + /** + * Creates or finds a OperationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationState. + */ + @Generated + public static OperationState fromString(String name) { + return fromString(name, OperationState.class); + } + + /** + * Gets known OperationState values. + * + * @return known OperationState values. + */ + @Generated + public static Collection values() { + return values(OperationState.class); + } +} diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/models/ResourceOperationStatusGenerationResponseGenerationResultError.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/models/ResourceOperationStatusGenerationResponseGenerationResultError.java new file mode 100644 index 0000000000..17f485cf69 --- /dev/null +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/models/ResourceOperationStatusGenerationResponseGenerationResultError.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com._specs_.azure.core.lro.rpc.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.models.ResponseError; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Provides status details for long running operations. + */ +@Immutable +public final class ResourceOperationStatusGenerationResponseGenerationResultError + implements JsonSerializable { + /* + * The unique ID of the operation. + */ + @Generated + private String id; + + /* + * The status of the operation + */ + @Generated + private final OperationState status; + + /* + * Error object that describes the error when status is "Failed". + */ + @Generated + private ResponseError error; + + /* + * The result of the operation. + */ + @Generated + private GenerationResult result; + + /** + * Creates an instance of ResourceOperationStatusGenerationResponseGenerationResultError class. + * + * @param status the status value to set. + */ + @Generated + private ResourceOperationStatusGenerationResponseGenerationResultError(OperationState status) { + this.status = status; + } + + /** + * Get the id property: The unique ID of the operation. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the status property: The status of the operation. + * + * @return the status value. + */ + @Generated + public OperationState getStatus() { + return this.status; + } + + /** + * Get the error property: Error object that describes the error when status is "Failed". + * + * @return the error value. + */ + @Generated + public ResponseError getError() { + return this.error; + } + + /** + * Get the result property: The result of the operation. + * + * @return the result value. + */ + @Generated + public GenerationResult getResult() { + return this.result; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeJsonField("error", this.error); + jsonWriter.writeJsonField("result", this.result); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceOperationStatusGenerationResponseGenerationResultError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceOperationStatusGenerationResponseGenerationResultError if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * ResourceOperationStatusGenerationResponseGenerationResultError. + */ + @Generated + public static ResourceOperationStatusGenerationResponseGenerationResultError fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + OperationState status = null; + ResponseError error = null; + GenerationResult result = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("status".equals(fieldName)) { + status = OperationState.fromString(reader.getString()); + } else if ("error".equals(fieldName)) { + error = ResponseError.fromJson(reader); + } else if ("result".equals(fieldName)) { + result = GenerationResult.fromJson(reader); + } else { + reader.skipChildren(); + } + } + ResourceOperationStatusGenerationResponseGenerationResultError deserializedResourceOperationStatusGenerationResponseGenerationResultError + = new ResourceOperationStatusGenerationResponseGenerationResultError(status); + deserializedResourceOperationStatusGenerationResponseGenerationResultError.id = id; + deserializedResourceOperationStatusGenerationResponseGenerationResultError.error = error; + deserializedResourceOperationStatusGenerationResponseGenerationResultError.result = result; + + return deserializedResourceOperationStatusGenerationResponseGenerationResultError; + }); + } +} diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/implementation/StandardClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/implementation/StandardClientImpl.java index f66dfb0fe8..2e2ff4667f 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/implementation/StandardClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/implementation/StandardClientImpl.java @@ -143,8 +143,9 @@ public interface StandardClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrReplace(@QueryParam("api-version") String apiVersion, - @PathParam("name") String name, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData resource, + RequestOptions requestOptions, Context context); @Put("/azure/core/lro/standard/users/{name}") @ExpectedResponses({ 200, 201 }) @@ -153,8 +154,9 @@ Mono> createOrReplace(@QueryParam("api-version") String api @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrReplaceSync(@QueryParam("api-version") String apiVersion, - @PathParam("name") String name, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData resource, + RequestOptions requestOptions, Context context); @Delete("/azure/core/lro/standard/users/{name}") @ExpectedResponses({ 202 }) @@ -163,7 +165,7 @@ Response createOrReplaceSync(@QueryParam("api-version") String apiVe @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> delete(@QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/azure/core/lro/standard/users/{name}") @ExpectedResponses({ 202 }) @@ -172,7 +174,7 @@ Mono> delete(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteSync(@QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/azure/core/lro/standard/users/{name}:export") @ExpectedResponses({ 202 }) @@ -181,7 +183,7 @@ Response deleteSync(@QueryParam("api-version") String apiVersion, @P @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> export(@QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @QueryParam("format") String format, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @QueryParam("format") String format, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/azure/core/lro/standard/users/{name}:export") @@ -191,7 +193,7 @@ Mono> export(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response exportSync(@QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @QueryParam("format") String format, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @QueryParam("format") String format, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -229,9 +231,10 @@ Response exportSync(@QueryParam("api-version") String apiVersion, @P @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrReplaceWithResponseAsync(String name, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.createOrReplace(this.getServiceVersion().getVersion(), name, - accept, resource, requestOptions, context)); + contentType, accept, resource, requestOptions, context)); } /** @@ -268,8 +271,9 @@ private Mono> createOrReplaceWithResponseAsync(String name, @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrReplaceWithResponse(String name, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrReplaceSync(this.getServiceVersion().getVersion(), name, accept, resource, + return service.createOrReplaceSync(this.getServiceVersion().getVersion(), name, contentType, accept, resource, requestOptions, Context.NONE); } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/models/OperationState.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/models/OperationState.java new file mode 100644 index 0000000000..070ef6faa2 --- /dev/null +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/models/OperationState.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com._specs_.azure.core.lro.standard.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum describing allowed operation states. + */ +public final class OperationState extends ExpandableStringEnum { + /** + * The operation has not started. + */ + @Generated + public static final OperationState NOT_STARTED = fromString("NotStarted"); + + /** + * The operation is in progress. + */ + @Generated + public static final OperationState RUNNING = fromString("Running"); + + /** + * The operation has completed successfully. + */ + @Generated + public static final OperationState SUCCEEDED = fromString("Succeeded"); + + /** + * The operation has failed. + */ + @Generated + public static final OperationState FAILED = fromString("Failed"); + + /** + * The operation has been canceled by the user. + */ + @Generated + public static final OperationState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of OperationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public OperationState() { + } + + /** + * Creates or finds a OperationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationState. + */ + @Generated + public static OperationState fromString(String name) { + return fromString(name, OperationState.class); + } + + /** + * Gets known OperationState values. + * + * @return known OperationState values. + */ + @Generated + public static Collection values() { + return values(OperationState.class); + } +} diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/models/OperationStatusError.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/models/OperationStatusError.java new file mode 100644 index 0000000000..6683d6e3ab --- /dev/null +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/models/OperationStatusError.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com._specs_.azure.core.lro.standard.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.models.ResponseError; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Provides status details for long running operations. + */ +@Immutable +public final class OperationStatusError implements JsonSerializable { + /* + * The unique ID of the operation. + */ + @Generated + private final String id; + + /* + * The status of the operation + */ + @Generated + private final OperationState status; + + /* + * Error object that describes the error when status is "Failed". + */ + @Generated + private ResponseError error; + + /** + * Creates an instance of OperationStatusError class. + * + * @param id the id value to set. + * @param status the status value to set. + */ + @Generated + private OperationStatusError(String id, OperationState status) { + this.id = id; + this.status = status; + } + + /** + * Get the id property: The unique ID of the operation. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the status property: The status of the operation. + * + * @return the status value. + */ + @Generated + public OperationState getStatus() { + return this.status; + } + + /** + * Get the error property: Error object that describes the error when status is "Failed". + * + * @return the error value. + */ + @Generated + public ResponseError getError() { + return this.error; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationStatusError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationStatusError if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationStatusError. + */ + @Generated + public static OperationStatusError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + OperationState status = null; + ResponseError error = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("status".equals(fieldName)) { + status = OperationState.fromString(reader.getString()); + } else if ("error".equals(fieldName)) { + error = ResponseError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + OperationStatusError deserializedOperationStatusError = new OperationStatusError(id, status); + deserializedOperationStatusError.error = error; + + return deserializedOperationStatusError; + }); + } +} diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/models/ResourceOperationStatusUserExportedUserError.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/models/ResourceOperationStatusUserExportedUserError.java new file mode 100644 index 0000000000..f93bd09a87 --- /dev/null +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/models/ResourceOperationStatusUserExportedUserError.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com._specs_.azure.core.lro.standard.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.models.ResponseError; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Provides status details for long running operations. + */ +@Immutable +public final class ResourceOperationStatusUserExportedUserError + implements JsonSerializable { + /* + * The unique ID of the operation. + */ + @Generated + private String id; + + /* + * The status of the operation + */ + @Generated + private final OperationState status; + + /* + * Error object that describes the error when status is "Failed". + */ + @Generated + private ResponseError error; + + /* + * The result of the operation. + */ + @Generated + private ExportedUser result; + + /** + * Creates an instance of ResourceOperationStatusUserExportedUserError class. + * + * @param status the status value to set. + */ + @Generated + private ResourceOperationStatusUserExportedUserError(OperationState status) { + this.status = status; + } + + /** + * Get the id property: The unique ID of the operation. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the status property: The status of the operation. + * + * @return the status value. + */ + @Generated + public OperationState getStatus() { + return this.status; + } + + /** + * Get the error property: Error object that describes the error when status is "Failed". + * + * @return the error value. + */ + @Generated + public ResponseError getError() { + return this.error; + } + + /** + * Get the result property: The result of the operation. + * + * @return the result value. + */ + @Generated + public ExportedUser getResult() { + return this.result; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeJsonField("error", this.error); + jsonWriter.writeJsonField("result", this.result); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceOperationStatusUserExportedUserError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceOperationStatusUserExportedUserError if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceOperationStatusUserExportedUserError. + */ + @Generated + public static ResourceOperationStatusUserExportedUserError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + OperationState status = null; + ResponseError error = null; + ExportedUser result = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("status".equals(fieldName)) { + status = OperationState.fromString(reader.getString()); + } else if ("error".equals(fieldName)) { + error = ResponseError.fromJson(reader); + } else if ("result".equals(fieldName)) { + result = ExportedUser.fromJson(reader); + } else { + reader.skipChildren(); + } + } + ResourceOperationStatusUserExportedUserError deserializedResourceOperationStatusUserExportedUserError + = new ResourceOperationStatusUserExportedUserError(status); + deserializedResourceOperationStatusUserExportedUserError.id = id; + deserializedResourceOperationStatusUserExportedUserError.error = error; + deserializedResourceOperationStatusUserExportedUserError.result = result; + + return deserializedResourceOperationStatusUserExportedUserError; + }); + } +} diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarAsyncClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarAsyncClient.java index a7cb562f8e..01d5fd9490 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarAsyncClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarAsyncClient.java @@ -51,7 +51,8 @@ public final class ScalarAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return azureLocation value along with {@link Response} on successful completion of {@link Mono}. + * @return represents an Azure geography region where supported resource providers live along with {@link Response} + * on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -155,7 +156,8 @@ public Mono> queryWithResponse(String region, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azureLocation value on successful completion of {@link Mono}. + * @return represents an Azure geography region where supported resource providers live on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarClient.java index 593f5fd1ea..5361d1c5eb 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarClient.java @@ -49,7 +49,7 @@ public final class ScalarClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return azureLocation value along with {@link Response}. + * @return represents an Azure geography region where supported resource providers live along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -153,7 +153,7 @@ public Response queryWithResponse(String region, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azureLocation value. + * @return represents an Azure geography region where supported resource providers live. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/implementation/AzureLocationScalarsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/implementation/AzureLocationScalarsImpl.java index 8ff921c07c..d53a790ae7 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/implementation/AzureLocationScalarsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/implementation/AzureLocationScalarsImpl.java @@ -76,7 +76,7 @@ public interface AzureLocationScalarsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/scalar/azureLocation") @@ -85,7 +85,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/azure/core/scalar/azureLocation") @@ -94,8 +94,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/azure/core/scalar/azureLocation") @ExpectedResponses({ 204 }) @@ -103,8 +103,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/azure/core/scalar/azureLocation") @ExpectedResponses({ 200 }) @@ -112,8 +112,9 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> post(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> post(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/azure/core/scalar/azureLocation") @ExpectedResponses({ 200 }) @@ -121,8 +122,9 @@ Mono> post(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response postSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/azure/core/scalar/azureLocation/header") @ExpectedResponses({ 204 }) @@ -130,8 +132,8 @@ Response postSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> headerMethod(@HeaderParam("region") String region, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> headerMethod(@HeaderParam("region") String region, RequestOptions requestOptions, + Context context); @Post("/azure/core/scalar/azureLocation/header") @ExpectedResponses({ 204 }) @@ -139,8 +141,8 @@ Mono> headerMethod(@HeaderParam("region") String region, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response headerMethodSync(@HeaderParam("region") String region, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response headerMethodSync(@HeaderParam("region") String region, RequestOptions requestOptions, + Context context); @Post("/azure/core/scalar/azureLocation/query") @ExpectedResponses({ 204 }) @@ -148,8 +150,7 @@ Response headerMethodSync(@HeaderParam("region") String region, @HeaderPar @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> query(@QueryParam("region") String region, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> query(@QueryParam("region") String region, RequestOptions requestOptions, Context context); @Post("/azure/core/scalar/azureLocation/query") @ExpectedResponses({ 204 }) @@ -157,8 +158,7 @@ Mono> query(@QueryParam("region") String region, @HeaderParam("ac @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response querySync(@QueryParam("region") String region, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response querySync(@QueryParam("region") String region, RequestOptions requestOptions, Context context); } /** @@ -174,7 +174,8 @@ Response querySync(@QueryParam("region") String region, @HeaderParam("acce * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return azureLocation value along with {@link Response} on successful completion of {@link Mono}. + * @return represents an Azure geography region where supported resource providers live along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -195,7 +196,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return azureLocation value along with {@link Response}. + * @return represents an Azure geography region where supported resource providers live along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -221,8 +222,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -243,8 +244,8 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } /** @@ -275,8 +276,9 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.post(accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.post(contentType, accept, body, requestOptions, context)); } /** @@ -307,8 +309,9 @@ public Mono> postWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.postSync(accept, body, requestOptions, Context.NONE); + return service.postSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -324,8 +327,7 @@ public Response postWithResponse(BinaryData body, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> headerMethodWithResponseAsync(String region, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.headerMethod(region, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.headerMethod(region, requestOptions, context)); } /** @@ -341,8 +343,7 @@ public Mono> headerMethodWithResponseAsync(String region, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response headerMethodWithResponse(String region, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.headerMethodSync(region, accept, requestOptions, Context.NONE); + return service.headerMethodSync(region, requestOptions, Context.NONE); } /** @@ -358,8 +359,7 @@ public Response headerMethodWithResponse(String region, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> queryWithResponseAsync(String region, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.query(region, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.query(region, requestOptions, context)); } /** @@ -375,7 +375,6 @@ public Mono> queryWithResponseAsync(String region, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response queryWithResponse(String region, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.querySync(region, accept, requestOptions, Context.NONE); + return service.querySync(region, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsAsyncClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsAsyncClient.java index 7a4b5afccb..60ce7a0d25 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsAsyncClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsAsyncClient.java @@ -76,8 +76,7 @@ public final class TraitsAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a resource, sending and receiving headers along with {@link Response} on successful completion of - * {@link Mono}. + * @return sample Model along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -113,7 +112,7 @@ public Mono> smokeTestWithResponse(int id, String foo, Requ * } * * @param id The user's id. - * @param userActionParam User action param. + * @param userActionParam The userActionParam parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -140,7 +139,7 @@ public Mono> repeatableActionWithResponse(int id, BinaryDat * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource, sending and receiving headers on successful completion of {@link Mono}. + * @return sample Model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -180,7 +179,7 @@ public Mono smokeTest(int id, String foo, RequestConditions requestConditi * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource, sending and receiving headers on successful completion of {@link Mono}. + * @return sample Model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -195,7 +194,7 @@ public Mono smokeTest(int id, String foo) { * Test for repeatable requests. * * @param id The user's id. - * @param userActionParam User action param. + * @param userActionParam The userActionParam parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsClient.java index 51fb3aa5a8..f01d7a7737 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsClient.java @@ -74,7 +74,7 @@ public final class TraitsClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a resource, sending and receiving headers along with {@link Response}. + * @return sample Model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -110,7 +110,7 @@ public Response smokeTestWithResponse(int id, String foo, RequestOpt * } * * @param id The user's id. - * @param userActionParam User action param. + * @param userActionParam The userActionParam parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -137,7 +137,7 @@ public Response repeatableActionWithResponse(int id, BinaryData user * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource, sending and receiving headers. + * @return sample Model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -176,7 +176,7 @@ public User smokeTest(int id, String foo, RequestConditions requestConditions) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource, sending and receiving headers. + * @return sample Model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -190,7 +190,7 @@ public User smokeTest(int id, String foo) { * Test for repeatable requests. * * @param id The user's id. - * @param userActionParam User action param. + * @param userActionParam The userActionParam parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/implementation/TraitsClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/implementation/TraitsClientImpl.java index 768328c2b0..4e430d067b 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/implementation/TraitsClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/implementation/TraitsClientImpl.java @@ -138,7 +138,7 @@ public interface TraitsClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> smokeTest(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("foo") String foo, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HeaderParam("foo") String foo, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/traits/user/{id}") @@ -148,7 +148,7 @@ Mono> smokeTest(@QueryParam("api-version") String apiVersio @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response smokeTestSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("foo") String foo, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HeaderParam("foo") String foo, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/azure/core/traits/user/{id}:repeatableAction") @@ -158,8 +158,9 @@ Response smokeTestSync(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> repeatableAction(@QueryParam("api-version") String apiVersion, - @PathParam("id") int id, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData userActionParam, RequestOptions requestOptions, Context context); + @PathParam("id") int id, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData userActionParam, + RequestOptions requestOptions, Context context); @Post("/azure/core/traits/user/{id}:repeatableAction") @ExpectedResponses({ 200 }) @@ -168,8 +169,8 @@ Mono> repeatableAction(@QueryParam("api-version") String ap @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response repeatableActionSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData userActionParam, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData userActionParam, RequestOptions requestOptions, Context context); } /** @@ -204,8 +205,7 @@ Response repeatableActionSync(@QueryParam("api-version") String apiV * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a resource, sending and receiving headers along with {@link Response} on successful completion of - * {@link Mono}. + * @return sample Model along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> smokeTestWithResponseAsync(int id, String foo, RequestOptions requestOptions) { @@ -246,7 +246,7 @@ public Mono> smokeTestWithResponseAsync(int id, String foo, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a resource, sending and receiving headers along with {@link Response}. + * @return sample Model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response smokeTestWithResponse(int id, String foo, RequestOptions requestOptions) { @@ -283,7 +283,7 @@ public Response smokeTestWithResponse(int id, String foo, RequestOpt * } * * @param id The user's id. - * @param userActionParam User action param. + * @param userActionParam The userActionParam parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -294,6 +294,7 @@ public Response smokeTestWithResponse(int id, String foo, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> repeatableActionWithResponseAsync(int id, BinaryData userActionParam, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; String repeatabilityRequestId = UUID.randomUUID().toString(); @@ -311,7 +312,7 @@ public Mono> repeatableActionWithResponseAsync(int id, Bina } }); return FluxUtil.withContext(context -> service.repeatableAction(this.getServiceVersion().getVersion(), id, - accept, userActionParam, requestOptionsLocal, context)); + contentType, accept, userActionParam, requestOptionsLocal, context)); } /** @@ -342,7 +343,7 @@ public Mono> repeatableActionWithResponseAsync(int id, Bina * } * * @param id The user's id. - * @param userActionParam User action param. + * @param userActionParam The userActionParam parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -353,6 +354,7 @@ public Mono> repeatableActionWithResponseAsync(int id, Bina @ServiceMethod(returns = ReturnType.SINGLE) public Response repeatableActionWithResponse(int id, BinaryData userActionParam, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; String repeatabilityRequestId = UUID.randomUUID().toString(); @@ -369,7 +371,7 @@ public Response repeatableActionWithResponse(int id, BinaryData user .set(HttpHeaderName.fromString("repeatability-first-sent"), repeatabilityFirstSent); } }); - return service.repeatableActionSync(this.getServiceVersion().getVersion(), id, accept, userActionParam, - requestOptionsLocal, Context.NONE); + return service.repeatableActionSync(this.getServiceVersion().getVersion(), id, contentType, accept, + userActionParam, requestOptionsLocal, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/authentication/apikey/implementation/ApiKeyClientImpl.java b/typespec-tests/src/main/java/com/authentication/apikey/implementation/ApiKeyClientImpl.java index e0b97150e8..12cfe4eaf4 100644 --- a/typespec-tests/src/main/java/com/authentication/apikey/implementation/ApiKeyClientImpl.java +++ b/typespec-tests/src/main/java/com/authentication/apikey/implementation/ApiKeyClientImpl.java @@ -107,8 +107,7 @@ public interface ApiKeyClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> valid(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> valid(RequestOptions requestOptions, Context context); @Get("/authentication/api-key/valid") @ExpectedResponses({ 204 }) @@ -116,7 +115,7 @@ Mono> valid(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response validSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response validSync(RequestOptions requestOptions, Context context); @Get("/authentication/api-key/invalid") @ExpectedResponses({ 204 }) @@ -124,7 +123,7 @@ Mono> valid(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> invalid(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> invalid(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/authentication/api-key/invalid") @@ -133,7 +132,7 @@ Mono> invalid(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response invalidSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response invalidSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -149,8 +148,7 @@ Response invalidSync(@HeaderParam("accept") String accept, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> validWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.valid(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.valid(requestOptions, context)); } /** @@ -165,8 +163,7 @@ public Mono> validWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.validSync(accept, requestOptions, Context.NONE); + return service.validSync(requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/authentication/http/custom/implementation/CustomClientImpl.java b/typespec-tests/src/main/java/com/authentication/http/custom/implementation/CustomClientImpl.java index a1249585f5..b6657d5c58 100644 --- a/typespec-tests/src/main/java/com/authentication/http/custom/implementation/CustomClientImpl.java +++ b/typespec-tests/src/main/java/com/authentication/http/custom/implementation/CustomClientImpl.java @@ -107,8 +107,7 @@ public interface CustomClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> valid(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> valid(RequestOptions requestOptions, Context context); @Get("/authentication/http/custom/valid") @ExpectedResponses({ 204 }) @@ -116,7 +115,7 @@ Mono> valid(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response validSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response validSync(RequestOptions requestOptions, Context context); @Get("/authentication/http/custom/invalid") @ExpectedResponses({ 204 }) @@ -124,7 +123,7 @@ Mono> valid(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> invalid(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> invalid(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/authentication/http/custom/invalid") @@ -133,7 +132,7 @@ Mono> invalid(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response invalidSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response invalidSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -149,8 +148,7 @@ Response invalidSync(@HeaderParam("accept") String accept, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> validWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.valid(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.valid(requestOptions, context)); } /** @@ -165,8 +163,7 @@ public Mono> validWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.validSync(accept, requestOptions, Context.NONE); + return service.validSync(requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/authentication/oauth2/implementation/OAuth2ClientImpl.java b/typespec-tests/src/main/java/com/authentication/oauth2/implementation/OAuth2ClientImpl.java index 6b58a78ce2..3cc7d5a24f 100644 --- a/typespec-tests/src/main/java/com/authentication/oauth2/implementation/OAuth2ClientImpl.java +++ b/typespec-tests/src/main/java/com/authentication/oauth2/implementation/OAuth2ClientImpl.java @@ -107,8 +107,7 @@ public interface OAuth2ClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> valid(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> valid(RequestOptions requestOptions, Context context); @Get("/authentication/oauth2/valid") @ExpectedResponses({ 204 }) @@ -116,7 +115,7 @@ Mono> valid(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response validSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response validSync(RequestOptions requestOptions, Context context); @Get("/authentication/oauth2/invalid") @ExpectedResponses({ 204 }) @@ -124,7 +123,7 @@ Mono> valid(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> invalid(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> invalid(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/authentication/oauth2/invalid") @@ -133,7 +132,7 @@ Mono> invalid(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response invalidSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response invalidSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -149,8 +148,7 @@ Response invalidSync(@HeaderParam("accept") String accept, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> validWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.valid(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.valid(requestOptions, context)); } /** @@ -165,8 +163,7 @@ public Mono> validWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.validSync(accept, requestOptions, Context.NONE); + return service.validSync(requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/authentication/union/implementation/UnionClientImpl.java b/typespec-tests/src/main/java/com/authentication/union/implementation/UnionClientImpl.java index e0b863d25e..4c601b975a 100644 --- a/typespec-tests/src/main/java/com/authentication/union/implementation/UnionClientImpl.java +++ b/typespec-tests/src/main/java/com/authentication/union/implementation/UnionClientImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -107,8 +106,7 @@ public interface UnionClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> validKey(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> validKey(RequestOptions requestOptions, Context context); @Get("/authentication/union/validkey") @ExpectedResponses({ 204 }) @@ -116,8 +114,7 @@ Mono> validKey(@HeaderParam("accept") String accept, RequestOptio @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response validKeySync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response validKeySync(RequestOptions requestOptions, Context context); @Get("/authentication/union/validtoken") @ExpectedResponses({ 204 }) @@ -125,8 +122,7 @@ Response validKeySync(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> validToken(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> validToken(RequestOptions requestOptions, Context context); @Get("/authentication/union/validtoken") @ExpectedResponses({ 204 }) @@ -134,8 +130,7 @@ Mono> validToken(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response validTokenSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response validTokenSync(RequestOptions requestOptions, Context context); } /** @@ -150,8 +145,7 @@ Response validTokenSync(@HeaderParam("accept") String accept, RequestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> validKeyWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.validKey(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.validKey(requestOptions, context)); } /** @@ -166,8 +160,7 @@ public Mono> validKeyWithResponseAsync(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validKeyWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.validKeySync(accept, requestOptions, Context.NONE); + return service.validKeySync(requestOptions, Context.NONE); } /** @@ -182,8 +175,7 @@ public Response validKeyWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> validTokenWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.validToken(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.validToken(requestOptions, context)); } /** @@ -198,7 +190,6 @@ public Mono> validTokenWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validTokenWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.validTokenSync(accept, requestOptions, Context.NONE); + return service.validTokenSync(requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/azure/arm/models/resources/ResourcesManager.java b/typespec-tests/src/main/java/com/azure/arm/models/resources/ResourcesManager.java index b747cb7d2d..b793a9e08e 100644 --- a/typespec-tests/src/main/java/com/azure/arm/models/resources/ResourcesManager.java +++ b/typespec-tests/src/main/java/com/azure/arm/models/resources/ResourcesManager.java @@ -51,7 +51,6 @@ private ResourcesManager(HttpPipeline httpPipeline, AzureProfile profile, Durati Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); this.clientObject = new ResourcesClientBuilder().pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) .buildClient(); diff --git a/typespec-tests/src/main/java/com/azure/arm/models/resources/fluent/NestedProxyResourcesClient.java b/typespec-tests/src/main/java/com/azure/arm/models/resources/fluent/NestedProxyResourcesClient.java index f34a4b4a5b..b8b564abc2 100644 --- a/typespec-tests/src/main/java/com/azure/arm/models/resources/fluent/NestedProxyResourcesClient.java +++ b/typespec-tests/src/main/java/com/azure/arm/models/resources/fluent/NestedProxyResourcesClient.java @@ -28,7 +28,7 @@ public interface NestedProxyResourcesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource along with {@link Response}. + * @return nested child of Top Level Tracked Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String resourceGroupName, String topLevelTrackedResourceName, @@ -43,7 +43,7 @@ Response getWithResponse(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource. + * @return nested child of Top Level Tracked Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) NestedProxyResourceInner get(String resourceGroupName, String topLevelTrackedResourceName, diff --git a/typespec-tests/src/main/java/com/azure/arm/models/resources/fluent/ResourcesClient.java b/typespec-tests/src/main/java/com/azure/arm/models/resources/fluent/ResourcesClient.java index 25a58a11d2..283224ed77 100644 --- a/typespec-tests/src/main/java/com/azure/arm/models/resources/fluent/ResourcesClient.java +++ b/typespec-tests/src/main/java/com/azure/arm/models/resources/fluent/ResourcesClient.java @@ -11,13 +11,6 @@ * The interface for ResourcesClient class. */ public interface ResourcesClient { - /** - * Gets Server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - /** * Gets Version parameter. * diff --git a/typespec-tests/src/main/java/com/azure/arm/models/resources/fluent/TopLevelTrackedResourcesClient.java b/typespec-tests/src/main/java/com/azure/arm/models/resources/fluent/TopLevelTrackedResourcesClient.java index 6fa93fd7e8..144a839621 100644 --- a/typespec-tests/src/main/java/com/azure/arm/models/resources/fluent/TopLevelTrackedResourcesClient.java +++ b/typespec-tests/src/main/java/com/azure/arm/models/resources/fluent/TopLevelTrackedResourcesClient.java @@ -27,7 +27,8 @@ public interface TopLevelTrackedResourcesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse(String resourceGroupName, @@ -41,7 +42,7 @@ Response getByResourceGroupWithResponse(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. */ @ServiceMethod(returns = ReturnType.SINGLE) TopLevelTrackedResourceInner getByResourceGroup(String resourceGroupName, String topLevelTrackedResourceName); diff --git a/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/NestedProxyResourcesClientImpl.java b/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/NestedProxyResourcesClientImpl.java index b7d7c561ec..f5ba1da066 100644 --- a/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/NestedProxyResourcesClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/NestedProxyResourcesClientImpl.java @@ -15,7 +15,6 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; @@ -69,51 +68,51 @@ public final class NestedProxyResourcesClientImpl implements NestedProxyResource * The interface defining all the services for ResourcesClientNestedProxyResources to be used by the proxy service * to perform REST calls. */ - @Host("{endpoint}") + @Host("https://management.azure.com") @ServiceInterface(name = "ResourcesClientNeste") public interface NestedProxyResourcesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.Arm.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}/nestedProxyResources/{nextedProxyResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> get(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("accept") String accept, + @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.Arm.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}/nestedProxyResources/{nextedProxyResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrReplace(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrReplace(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("accept") String accept, + @PathParam("nextedProxyResourceName") String nextedProxyResourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") NestedProxyResourceInner resource, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.Arm.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}/nestedProxyResources/{nextedProxyResourceName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("accept") String accept, + @PathParam("nextedProxyResourceName") String nextedProxyResourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") NestedProxyResourceUpdate properties, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.Arm.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}/nestedProxyResources/{nextedProxyResourceName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("accept") String accept, + @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -121,19 +120,18 @@ Mono>> delete(@HostParam("endpoint") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTopLevelTrackedResource( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTopLevelTrackedResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, + Context context); } /** @@ -145,15 +143,12 @@ Mono> listByTopLevelTrackedResourceNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource along with {@link Response} on successful completion of {@link Mono}. + * @return nested child of Top Level Tracked Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -172,9 +167,8 @@ private Mono> getWithResponseAsync(String res } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, - nextedProxyResourceName, accept, context)) + .withContext(context -> service.get(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -188,15 +182,12 @@ private Mono> getWithResponseAsync(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource along with {@link Response} on successful completion of {@link Mono}. + * @return nested child of Top Level Tracked Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -215,8 +206,8 @@ private Mono> getWithResponseAsync(String res } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, accept, context); + return service.get(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelTrackedResourceName, nextedProxyResourceName, accept, context); } /** @@ -228,7 +219,7 @@ private Mono> getWithResponseAsync(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource on successful completion of {@link Mono}. + * @return nested child of Top Level Tracked Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String topLevelTrackedResourceName, @@ -247,7 +238,7 @@ private Mono getAsync(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource along with {@link Response}. + * @return nested child of Top Level Tracked Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, @@ -265,7 +256,7 @@ public Response getWithResponse(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource. + * @return nested child of Top Level Tracked Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) public NestedProxyResourceInner get(String resourceGroupName, String topLevelTrackedResourceName, @@ -290,10 +281,6 @@ public NestedProxyResourceInner get(String resourceGroupName, String topLevelTra @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, NestedProxyResourceInner resource) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -315,11 +302,12 @@ private Mono>> createOrReplaceWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.createOrReplace(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, - nextedProxyResourceName, accept, resource, context)) + nextedProxyResourceName, contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -341,10 +329,6 @@ private Mono>> createOrReplaceWithResponseAsync(String private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, NestedProxyResourceInner resource, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -366,11 +350,11 @@ private Mono>> createOrReplaceWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, - accept, resource, context); + return service.createOrReplace(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelTrackedResourceName, nextedProxyResourceName, contentType, accept, resource, context); } /** @@ -560,10 +544,6 @@ public NestedProxyResourceInner createOrReplace(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, NestedProxyResourceUpdate properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -585,11 +565,12 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, - nextedProxyResourceName, accept, properties, context)) + .withContext(context -> service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, contentType, accept, + properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -611,10 +592,6 @@ private Mono>> updateWithResponseAsync(String resource private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, NestedProxyResourceUpdate properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -636,10 +613,11 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, accept, properties, context); + return service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelTrackedResourceName, nextedProxyResourceName, contentType, accept, properties, context); } /** @@ -825,10 +803,6 @@ public NestedProxyResourceInner update(String resourceGroupName, String topLevel @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -847,9 +821,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, - nextedProxyResourceName, accept, context)) + .withContext(context -> service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -868,10 +841,6 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -890,8 +859,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, accept, context); + return service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelTrackedResourceName, nextedProxyResourceName, accept, context); } /** @@ -1056,10 +1025,6 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelTrackedResourceSinglePageAsync(String resourceGroupName, String topLevelTrackedResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1074,9 +1039,8 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByTopLevelTrackedResource(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context)) + .withContext(context -> service.listByTopLevelTrackedResource(this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1097,10 +1061,6 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelTrackedResourceSinglePageAsync( String resourceGroupName, String topLevelTrackedResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1116,8 +1076,8 @@ private Mono> listByTopLevelTrackedResou final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByTopLevelTrackedResource(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context) + .listByTopLevelTrackedResource(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1194,6 +1154,8 @@ public PagedIterable listByTopLevelTrackedResource(Str } /** + * List NestedProxyResource resources by TopLevelTrackedResource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1209,19 +1171,16 @@ public PagedIterable listByTopLevelTrackedResource(Str if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listByTopLevelTrackedResourceNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listByTopLevelTrackedResourceNext(nextLink, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** + * List NestedProxyResource resources by TopLevelTrackedResource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1238,13 +1197,9 @@ public PagedIterable listByTopLevelTrackedResource(Str if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByTopLevelTrackedResourceNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listByTopLevelTrackedResourceNext(nextLink, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/ResourcesClientBuilder.java b/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/ResourcesClientBuilder.java index 8bd32a76e3..bd4f3456b3 100644 --- a/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/ResourcesClientBuilder.java +++ b/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/ResourcesClientBuilder.java @@ -19,22 +19,6 @@ */ @ServiceClientBuilder(serviceClients = { ResourcesClientImpl.class }) public final class ResourcesClientBuilder { - /* - * Server parameter - */ - private String endpoint; - - /** - * Sets Server parameter. - * - * @param endpoint the endpoint value. - * @return the ResourcesClientBuilder. - */ - public ResourcesClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - /* * The ID of the target subscription. The value must be an UUID. */ @@ -131,7 +115,7 @@ public ResourcesClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); ResourcesClientImpl client = new ResourcesClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId); + localDefaultPollInterval, localEnvironment, this.subscriptionId); return client; } } diff --git a/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/ResourcesClientImpl.java b/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/ResourcesClientImpl.java index 9db76dc8dd..b48ac40819 100644 --- a/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/ResourcesClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/ResourcesClientImpl.java @@ -40,20 +40,6 @@ */ @ServiceClient(builder = ResourcesClientBuilder.class) public final class ResourcesClientImpl implements ResourcesClient { - /** - * Server parameter. - */ - private final String endpoint; - - /** - * Gets Server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - /** * Version parameter. */ @@ -159,15 +145,13 @@ public NestedProxyResourcesClient getNestedProxyResources() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param endpoint Server parameter. * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ ResourcesClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, - AzureEnvironment environment, String endpoint, String subscriptionId) { + AzureEnvironment environment, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.endpoint = endpoint; this.subscriptionId = subscriptionId; this.apiVersion = "2023-12-01-preview"; this.topLevelTrackedResources = new TopLevelTrackedResourcesClientImpl(this); diff --git a/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java b/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java index d3efca83d1..a5aa94a528 100644 --- a/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java @@ -15,7 +15,6 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; @@ -69,83 +68,80 @@ public final class TopLevelTrackedResourcesClientImpl implements TopLevelTracked * The interface defining all the services for ResourcesClientTopLevelTrackedResources to be used by the proxy * service to perform REST calls. */ - @Host("{endpoint}") + @Host("https://management.azure.com") @ServiceInterface(name = "ResourcesClientTopLe") public interface TopLevelTrackedResourcesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.Arm.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.Arm.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrReplace(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrReplace(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @HeaderParam("accept") String accept, @BodyParam("application/json") TopLevelTrackedResourceInner resource, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") TopLevelTrackedResourceInner resource, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.Arm.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") TopLevelTrackedResourceUpdate properties, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.Arm.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.Arm.Models.Resources/topLevelTrackedResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + Mono> listByResourceGroup( @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Azure.Arm.Models.Resources/topLevelTrackedResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("accept") String accept, Context context); + Mono> list(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, + Context context); } /** @@ -156,15 +152,12 @@ Mono> listBySubscriptionNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource along with {@link Response} on successful completion of {@link Mono}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -179,7 +172,7 @@ private Mono> getByResourceGroupWithRespo } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.getByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -193,15 +186,12 @@ private Mono> getByResourceGroupWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource along with {@link Response} on successful completion of {@link Mono}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -216,8 +206,8 @@ private Mono> getByResourceGroupWithRespo } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context); + return service.getByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, accept, context); } /** @@ -228,7 +218,8 @@ private Mono> getByResourceGroupWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource on successful completion of {@link Mono}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, @@ -246,7 +237,8 @@ private Mono getByResourceGroupAsync(String resour * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, @@ -262,7 +254,7 @@ public Response getByResourceGroupWithResponse(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. */ @ServiceMethod(returns = ReturnType.SINGLE) public TopLevelTrackedResourceInner getByResourceGroup(String resourceGroupName, @@ -285,10 +277,6 @@ public TopLevelTrackedResourceInner getByResourceGroup(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, TopLevelTrackedResourceInner resource) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -306,11 +294,12 @@ private Mono>> createOrReplaceWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, resource, - context)) + .withContext( + context -> service.createOrReplace(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -330,10 +319,6 @@ private Mono>> createOrReplaceWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, TopLevelTrackedResourceInner resource, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -351,10 +336,11 @@ private Mono>> createOrReplaceWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, resource, context); + return service.createOrReplace(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelTrackedResourceName, contentType, accept, resource, context); } /** @@ -533,10 +519,6 @@ public TopLevelTrackedResourceInner createOrReplace(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, TopLevelTrackedResourceUpdate properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -554,11 +536,11 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, properties, - context)) + .withContext(context -> service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, contentType, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -578,10 +560,6 @@ private Mono>> updateWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, TopLevelTrackedResourceUpdate properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -599,10 +577,11 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, accept, properties, context); + return service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelTrackedResourceName, contentType, accept, properties, context); } /** @@ -778,10 +757,6 @@ public TopLevelTrackedResourceInner update(String resourceGroupName, String topL @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -796,8 +771,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context)) + .withContext(context -> service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -815,10 +790,6 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -833,8 +804,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, accept, context); + return service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelTrackedResourceName, accept, context); } /** @@ -984,10 +955,6 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -998,7 +965,7 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.listByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -1019,10 +986,6 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1034,8 +997,8 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accept, context) + .listByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1113,18 +1076,14 @@ public PagedIterable listByResourceGroup(String re */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) + .withContext( + context -> service.list(this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1142,19 +1101,13 @@ private Mono> listSinglePageAsync() */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, - context) + return service.list(this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1216,6 +1169,8 @@ public PagedIterable list(Context context) { } /** + * List TopLevelTrackedResource resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1230,20 +1185,16 @@ private Mono> listByResourceGroupNex if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listByResourceGroupNext(nextLink, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** + * List TopLevelTrackedResource resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1260,18 +1211,16 @@ private Mono> listByResourceGroupNex if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listByResourceGroupNext(nextLink, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** + * List TopLevelTrackedResource resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1286,20 +1235,16 @@ private Mono> listBySubscriptionNext if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listBySubscriptionNext(nextLink, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** + * List TopLevelTrackedResource resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1316,13 +1261,9 @@ private Mono> listBySubscriptionNext if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listBySubscriptionNext(nextLink, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/azure/arm/models/resources/models/NestedProxyResources.java b/typespec-tests/src/main/java/com/azure/arm/models/resources/models/NestedProxyResources.java index f587acc750..a05edc8401 100644 --- a/typespec-tests/src/main/java/com/azure/arm/models/resources/models/NestedProxyResources.java +++ b/typespec-tests/src/main/java/com/azure/arm/models/resources/models/NestedProxyResources.java @@ -22,7 +22,7 @@ public interface NestedProxyResources { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource along with {@link Response}. + * @return nested child of Top Level Tracked Resource along with {@link Response}. */ Response getWithResponse(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, Context context); @@ -36,7 +36,7 @@ Response getWithResponse(String resourceGroupName, String t * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource. + * @return nested child of Top Level Tracked Resource. */ NestedProxyResource get(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName); @@ -101,7 +101,7 @@ PagedIterable listByTopLevelTrackedResource(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource along with {@link Response}. + * @return nested child of Top Level Tracked Resource along with {@link Response}. */ NestedProxyResource getById(String id); @@ -113,7 +113,7 @@ PagedIterable listByTopLevelTrackedResource(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource along with {@link Response}. + * @return nested child of Top Level Tracked Resource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/typespec-tests/src/main/java/com/azure/arm/models/resources/models/TopLevelTrackedResources.java b/typespec-tests/src/main/java/com/azure/arm/models/resources/models/TopLevelTrackedResources.java index f672db60b2..5a01a4189a 100644 --- a/typespec-tests/src/main/java/com/azure/arm/models/resources/models/TopLevelTrackedResources.java +++ b/typespec-tests/src/main/java/com/azure/arm/models/resources/models/TopLevelTrackedResources.java @@ -21,7 +21,8 @@ public interface TopLevelTrackedResources { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ Response getByResourceGroupWithResponse(String resourceGroupName, String topLevelTrackedResourceName, Context context); @@ -34,7 +35,7 @@ Response getByResourceGroupWithResponse(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. */ TopLevelTrackedResource getByResourceGroup(String resourceGroupName, String topLevelTrackedResourceName); @@ -115,7 +116,8 @@ Response getByResourceGroupWithResponse(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ TopLevelTrackedResource getById(String id); @@ -127,7 +129,8 @@ Response getByResourceGroupWithResponse(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdAsyncClient.java b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdAsyncClient.java index e67c748929..3c6de2a5b3 100644 --- a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdAsyncClient.java +++ b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdAsyncClient.java @@ -44,8 +44,7 @@ public final class XmsClientRequestIdAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return operation with azure `x-ms-client-request-id` header along with {@link Response} on successful completion - * of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -61,7 +60,7 @@ public Mono> getWithResponse(RequestOptions requestOptions) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation with azure `x-ms-client-request-id` header on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClient.java b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClient.java index b5db477c0b..fdb5f059c3 100644 --- a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClient.java +++ b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClient.java @@ -42,7 +42,7 @@ public final class XmsClientRequestIdClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return operation with azure `x-ms-client-request-id` header along with {@link Response}. + * @return the {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/implementation/XmsClientRequestIdClientImpl.java b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/implementation/XmsClientRequestIdClientImpl.java index bb1d550f97..011ed0df41 100644 --- a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/implementation/XmsClientRequestIdClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/implementation/XmsClientRequestIdClientImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -109,7 +108,7 @@ public interface XmsClientRequestIdClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> get(RequestOptions requestOptions, Context context); @Get("/azure/special-headers/x-ms-client-request-id") @ExpectedResponses({ 204 }) @@ -117,7 +116,7 @@ public interface XmsClientRequestIdClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response getSync(RequestOptions requestOptions, Context context); } /** @@ -128,13 +127,11 @@ public interface XmsClientRequestIdClientService { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return operation with azure `x-ms-client-request-id` header along with {@link Response} on successful completion - * of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(requestOptions, context)); } /** @@ -145,11 +142,10 @@ public Mono> getWithResponseAsync(RequestOptions requestOptions) * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return operation with azure `x-ms-client-request-id` header along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/ArmResourceProviderManager.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/ArmResourceProviderManager.java index f8f5fc8810..6fbd69c3a4 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/ArmResourceProviderManager.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/ArmResourceProviderManager.java @@ -63,7 +63,6 @@ private ArmResourceProviderManager(HttpPipeline httpPipeline, AzureProfile profi Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); this.clientObject = new ArmResourceProviderClientBuilder().pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) .buildClient(); diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ArmResourceProviderClient.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ArmResourceProviderClient.java index 3bd6f9112f..d3263fbdfe 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ArmResourceProviderClient.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ArmResourceProviderClient.java @@ -11,13 +11,6 @@ * The interface for ArmResourceProviderClient class. */ public interface ArmResourceProviderClient { - /** - * Gets Server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - /** * Gets Version parameter. * diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildExtensionResourceInterfacesClient.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildExtensionResourceInterfacesClient.java index c4d676e38e..9c15298ed8 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildExtensionResourceInterfacesClient.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildExtensionResourceInterfacesClient.java @@ -27,7 +27,7 @@ public interface ChildExtensionResourceInterfacesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource along with {@link Response}. + * @return extensionResource of Top Level Arm Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String resourceUri, String topLevelArmResourceName, @@ -42,7 +42,7 @@ Response getWithResponse(String resourceUri, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource. + * @return extensionResource of Top Level Arm Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) ChildExtensionResourceInner get(String resourceUri, String topLevelArmResourceName, diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildResourcesInterfacesClient.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildResourcesInterfacesClient.java index c06553db4f..7b0b515c17 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildResourcesInterfacesClient.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildResourcesInterfacesClient.java @@ -28,7 +28,7 @@ public interface ChildResourcesInterfacesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource along with {@link Response}. + * @return subresource of Top Level Arm Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String resourceGroupName, String topLevelArmResourceName, @@ -43,7 +43,7 @@ Response getWithResponse(String resourceGroupName, String to * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource. + * @return subresource of Top Level Arm Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) ChildResourceInner get(String resourceGroupName, String topLevelArmResourceName, String childResourceName); diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java index 96977bf126..ddc0e6c51a 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java @@ -28,7 +28,8 @@ public interface TopLevelArmResourceInterfacesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelArmResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse(String resourceGroupName, @@ -42,7 +43,7 @@ Response getByResourceGroupWithResponse(String resourc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelArmResource. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. */ @ServiceMethod(returns = ReturnType.SINGLE) TopLevelArmResourceInner getByResourceGroup(String resourceGroupName, String topLevelArmResourceName); diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientBuilder.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientBuilder.java index 2b36c77e05..f014b39355 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientBuilder.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientBuilder.java @@ -19,22 +19,6 @@ */ @ServiceClientBuilder(serviceClients = { ArmResourceProviderClientImpl.class }) public final class ArmResourceProviderClientBuilder { - /* - * Server parameter - */ - private String endpoint; - - /** - * Sets Server parameter. - * - * @param endpoint the endpoint value. - * @return the ArmResourceProviderClientBuilder. - */ - public ArmResourceProviderClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - /* * The ID of the target subscription. The value must be an UUID. */ @@ -131,7 +115,7 @@ public ArmResourceProviderClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); ArmResourceProviderClientImpl client = new ArmResourceProviderClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId); + localDefaultPollInterval, localEnvironment, this.subscriptionId); return client; } } diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientImpl.java index 4e9ca21142..aa9d985f39 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientImpl.java @@ -43,20 +43,6 @@ */ @ServiceClient(builder = ArmResourceProviderClientBuilder.class) public final class ArmResourceProviderClientImpl implements ArmResourceProviderClient { - /** - * Server parameter. - */ - private final String endpoint; - - /** - * Gets Server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - /** * Version parameter. */ @@ -204,15 +190,13 @@ public ChildExtensionResourceInterfacesClient getChildExtensionResourceInterface * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param endpoint Server parameter. * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ ArmResourceProviderClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.endpoint = endpoint; this.subscriptionId = subscriptionId; this.apiVersion = "2023-11-01"; this.childResourcesInterfaces = new ChildResourcesInterfacesClientImpl(this); diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildExtensionResourceInterfacesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildExtensionResourceInterfacesClientImpl.java index b5767faa1e..a20d4c9cb7 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildExtensionResourceInterfacesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildExtensionResourceInterfacesClientImpl.java @@ -11,7 +11,6 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; @@ -68,58 +67,56 @@ public final class ChildExtensionResourceInterfacesClientImpl implements ChildEx * The interface defining all the services for ArmResourceProviderClientChildExtensionResourceInterfaces to be used * by the proxy service to perform REST calls. */ - @Host("{endpoint}") + @Host("https://management.azure.com") @ServiceInterface(name = "ArmResourceProviderC") public interface ChildExtensionResourceInterfacesService { @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childExtensionResources/{childExtensionResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, + Mono> get(@QueryParam("api-version") String apiVersion, + @PathParam("resourceUri") String resourceUri, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @PathParam("childExtensionResourceName") String childExtensionResourceName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/{resourceUri}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childExtensionResources/{childExtensionResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, + Mono>> createOrUpdate(@QueryParam("api-version") String apiVersion, + @PathParam("resourceUri") String resourceUri, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @PathParam("childExtensionResourceName") String childExtensionResourceName, - @HeaderParam("accept") String accept, @BodyParam("application/json") ChildExtensionResourceInner resource, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ChildExtensionResourceInner resource, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/{resourceUri}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childExtensionResources/{childExtensionResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, + Mono> update(@QueryParam("api-version") String apiVersion, + @PathParam("resourceUri") String resourceUri, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @PathParam("childExtensionResourceName") String childExtensionResourceName, - @HeaderParam("accept") String accept, @BodyParam("application/json") Object properties, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") Object properties, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/{resourceUri}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childExtensionResources/{childExtensionResourceName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, + Mono>> delete(@QueryParam("api-version") String apiVersion, + @PathParam("resourceUri") String resourceUri, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @PathParam("childExtensionResourceName") String childExtensionResourceName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childExtensionResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTopLevelArmResource( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("resourceUri") String resourceUri, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -127,8 +124,8 @@ Mono> listByTopLevelArmResource( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTopLevelArmResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, + Context context); } /** @@ -140,15 +137,12 @@ Mono> listByTopLevelArmResourceNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource along with {@link Response} on successful completion of {@link Mono}. + * @return extensionResource of Top Level Arm Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -162,8 +156,8 @@ private Mono> getWithResponseAsync(String } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - topLevelArmResourceName, childExtensionResourceName, accept, context)) + .withContext(context -> service.get(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, + childExtensionResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -177,15 +171,12 @@ private Mono> getWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource along with {@link Response} on successful completion of {@link Mono}. + * @return extensionResource of Top Level Arm Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -199,7 +190,7 @@ private Mono> getWithResponseAsync(String } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, topLevelArmResourceName, + return service.get(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, childExtensionResourceName, accept, context); } @@ -212,7 +203,7 @@ private Mono> getWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource on successful completion of {@link Mono}. + * @return extensionResource of Top Level Arm Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceUri, String topLevelArmResourceName, @@ -231,7 +222,7 @@ private Mono getAsync(String resourceUri, String to * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource along with {@link Response}. + * @return extensionResource of Top Level Arm Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceUri, String topLevelArmResourceName, @@ -248,7 +239,7 @@ public Response getWithResponse(String resourceUri, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource. + * @return extensionResource of Top Level Arm Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) public ChildExtensionResourceInner get(String resourceUri, String topLevelArmResourceName, @@ -273,10 +264,6 @@ public ChildExtensionResourceInner get(String resourceUri, String topLevelArmRes @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, ChildExtensionResourceInner resource) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -293,10 +280,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - resourceUri, topLevelArmResourceName, childExtensionResourceName, accept, resource, context)) + .withContext(context -> service.createOrUpdate(this.client.getApiVersion(), resourceUri, + topLevelArmResourceName, childExtensionResourceName, contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -318,10 +306,6 @@ private Mono>> createOrUpdateWithResponseAsync(String private Mono>> createOrUpdateWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, ChildExtensionResourceInner resource, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -338,10 +322,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - topLevelArmResourceName, childExtensionResourceName, accept, resource, context); + return service.createOrUpdate(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, + childExtensionResourceName, contentType, accept, resource, context); } /** @@ -529,10 +514,6 @@ public ChildExtensionResourceInner createOrUpdate(String resourceUri, String top @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, Object properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -547,10 +528,11 @@ private Mono> updateWithResponseAsync(Stri if (properties == null) { return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - topLevelArmResourceName, childExtensionResourceName, accept, properties, context)) + .withContext(context -> service.update(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, + childExtensionResourceName, contentType, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -571,10 +553,6 @@ private Mono> updateWithResponseAsync(Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, Object properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -589,10 +567,11 @@ private Mono> updateWithResponseAsync(Stri if (properties == null) { return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - topLevelArmResourceName, childExtensionResourceName, accept, properties, context); + return service.update(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, + childExtensionResourceName, contentType, accept, properties, context); } /** @@ -667,10 +646,6 @@ public ChildExtensionResourceInner update(String resourceUri, String topLevelArm @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -684,8 +659,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - topLevelArmResourceName, childExtensionResourceName, accept, context)) + .withContext(context -> service.delete(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, + childExtensionResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -704,10 +679,6 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -721,8 +692,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - topLevelArmResourceName, childExtensionResourceName, accept, context); + return service.delete(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, + childExtensionResourceName, accept, context); } /** @@ -886,10 +857,6 @@ public void delete(String resourceUri, String topLevelArmResourceName, String ch @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelArmResourceSinglePageAsync(String resourceUri, String topLevelArmResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -899,8 +866,8 @@ public void delete(String resourceUri, String topLevelArmResourceName, String ch } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByTopLevelArmResource(this.client.getEndpoint(), - this.client.getApiVersion(), resourceUri, topLevelArmResourceName, accept, context)) + .withContext(context -> service.listByTopLevelArmResource(this.client.getApiVersion(), resourceUri, + topLevelArmResourceName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -921,10 +888,6 @@ public void delete(String resourceUri, String topLevelArmResourceName, String ch @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelArmResourceSinglePageAsync(String resourceUri, String topLevelArmResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -935,8 +898,8 @@ public void delete(String resourceUri, String topLevelArmResourceName, String ch final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByTopLevelArmResource(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - topLevelArmResourceName, accept, context) + .listByTopLevelArmResource(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, accept, + context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1011,6 +974,8 @@ public PagedIterable listByTopLevelArmResource(Stri } /** + * List ChildExtensionResource resources by TopLevelArmResource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1026,20 +991,16 @@ public PagedIterable listByTopLevelArmResource(Stri if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByTopLevelArmResourceNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listByTopLevelArmResourceNext(nextLink, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** + * List ChildExtensionResource resources by TopLevelArmResource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1056,13 +1017,9 @@ public PagedIterable listByTopLevelArmResource(Stri if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByTopLevelArmResourceNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listByTopLevelArmResourceNext(nextLink, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java index ecbd02657b..33b394e831 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java @@ -11,7 +11,6 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Post; @@ -70,72 +69,72 @@ public final class ChildResourcesInterfacesClientImpl implements ChildResourcesI * The interface defining all the services for ArmResourceProviderClientChildResourcesInterfaces to be used by the * proxy service to perform REST calls. */ - @Host("{endpoint}") + @Host("https://management.azure.com") @ServiceInterface(name = "ArmResourceProviderC") public interface ChildResourcesInterfacesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources/{childResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> get(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("accept") String accept, + @PathParam("childResourceName") String childResourceName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources/{childResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("accept") String accept, - @BodyParam("application/json") ChildResourceInner resource, Context context); + @PathParam("childResourceName") String childResourceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ChildResourceInner resource, + Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources/{childResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> update(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("accept") String accept, - @BodyParam("application/json") ChildResourceUpdate properties, Context context); + @PathParam("childResourceName") String childResourceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ChildResourceUpdate properties, + Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources/{childResourceName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("accept") String accept, + @PathParam("childResourceName") String childResourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByTopLevelArmResource(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> listByTopLevelArmResource(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources/{childResourceName}/actionWithoutBody") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> actionWithoutBody(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> actionWithoutBody(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("accept") String accept, + @PathParam("childResourceName") String childResourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -143,8 +142,8 @@ Mono>> actionWithoutBody(@HostParam("endpoint") String @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTopLevelArmResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, + Context context); } /** @@ -156,15 +155,12 @@ Mono> listByTopLevelArmResourceNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource along with {@link Response} on successful completion of {@link Mono}. + * @return subresource of Top Level Arm Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -183,9 +179,8 @@ private Mono> getWithResponseAsync(String resourceG } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, - context)) + .withContext(context -> service.get(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, childResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -199,15 +194,12 @@ private Mono> getWithResponseAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource along with {@link Response} on successful completion of {@link Mono}. + * @return subresource of Top Level Arm Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -226,8 +218,8 @@ private Mono> getWithResponseAsync(String resourceG } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, childResourceName, accept, context); + return service.get(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, childResourceName, accept, context); } /** @@ -239,7 +231,7 @@ private Mono> getWithResponseAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource on successful completion of {@link Mono}. + * @return subresource of Top Level Arm Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String topLevelArmResourceName, @@ -258,7 +250,7 @@ private Mono getAsync(String resourceGroupName, String topLe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource along with {@link Response}. + * @return subresource of Top Level Arm Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String topLevelArmResourceName, @@ -275,7 +267,7 @@ public Response getWithResponse(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource. + * @return subresource of Top Level Arm Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) public ChildResourceInner get(String resourceGroupName, String topLevelArmResourceName, String childResourceName) { @@ -298,10 +290,6 @@ public ChildResourceInner get(String resourceGroupName, String topLevelArmResour @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, ChildResourceInner resource) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -323,11 +311,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, - resource, context)) + .withContext(context -> service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, childResourceName, contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -348,10 +336,6 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, ChildResourceInner resource, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -373,11 +357,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, - resource, context); + return service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, childResourceName, contentType, accept, resource, context); } /** @@ -559,10 +543,6 @@ public ChildResourceInner createOrUpdate(String resourceGroupName, String topLev @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, ChildResourceUpdate properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -584,11 +564,12 @@ private Mono> updateWithResponseAsync(String resour } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, - properties, context)) + .withContext(context -> service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, childResourceName, contentType, accept, properties, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -609,10 +590,6 @@ private Mono> updateWithResponseAsync(String resour @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, ChildResourceUpdate properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -634,10 +611,11 @@ private Mono> updateWithResponseAsync(String resour } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, childResourceName, accept, properties, context); + return service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, childResourceName, contentType, accept, properties, context); } /** @@ -712,10 +690,6 @@ public ChildResourceInner update(String resourceGroupName, String topLevelArmRes @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -734,9 +708,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, - context)) + .withContext(context -> service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, childResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -755,10 +728,6 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -777,8 +746,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, childResourceName, accept, context); + return service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, childResourceName, accept, context); } /** @@ -941,10 +910,6 @@ public void delete(String resourceGroupName, String topLevelArmResourceName, Str @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelArmResourceSinglePageAsync(String resourceGroupName, String topLevelArmResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -959,9 +924,8 @@ private Mono> listByTopLevelArmResourceSingleP } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByTopLevelArmResource(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context)) + .withContext(context -> service.listByTopLevelArmResource(this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -982,10 +946,6 @@ private Mono> listByTopLevelArmResourceSingleP @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelArmResourceSinglePageAsync(String resourceGroupName, String topLevelArmResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1001,8 +961,8 @@ private Mono> listByTopLevelArmResourceSingleP final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByTopLevelArmResource(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context) + .listByTopLevelArmResource(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1091,10 +1051,6 @@ public PagedIterable listByTopLevelArmResource(String resour @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> actionWithoutBodyWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1113,9 +1069,9 @@ private Mono>> actionWithoutBodyWithResponseAsync(Stri } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.actionWithoutBody(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, - context)) + .withContext( + context -> service.actionWithoutBody(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, childResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1134,10 +1090,6 @@ private Mono>> actionWithoutBodyWithResponseAsync(Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> actionWithoutBodyWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1156,9 +1108,8 @@ private Mono>> actionWithoutBodyWithResponseAsync(Stri } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.actionWithoutBody(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, - context); + return service.actionWithoutBody(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, childResourceName, accept, context); } /** @@ -1311,6 +1262,8 @@ public void actionWithoutBody(String resourceGroupName, String topLevelArmResour } /** + * List ChildResource resources by TopLevelArmResource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1325,20 +1278,16 @@ private Mono> listByTopLevelArmResourceNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByTopLevelArmResourceNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listByTopLevelArmResourceNext(nextLink, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** + * List ChildResource resources by TopLevelArmResource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1355,13 +1304,9 @@ private Mono> listByTopLevelArmResourceNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByTopLevelArmResourceNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listByTopLevelArmResourceNext(nextLink, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/CustomTemplateResourceInterfacesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/CustomTemplateResourceInterfacesClientImpl.java index f7e3bf336b..39dd40eb5f 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/CustomTemplateResourceInterfacesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/CustomTemplateResourceInterfacesClientImpl.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; @@ -62,31 +60,29 @@ public final class CustomTemplateResourceInterfacesClientImpl implements CustomT * The interface defining all the services for ArmResourceProviderClientCustomTemplateResourceInterfaces to be used * by the proxy service to perform REST calls. */ - @Host("{endpoint}") + @Host("https://management.azure.com") @ServiceInterface(name = "ArmResourceProviderC") public interface CustomTemplateResourceInterfacesService { - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/customTemplateResources/{customTemplateResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @PathParam("customTemplateResourceName") String customTemplateResourceName, - @HeaderParam("accept") String accept, @BodyParam("application/json") CustomTemplateResourceInner resource, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CustomTemplateResourceInner resource, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/customTemplateResources/{customTemplateResourceName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateLongRunning(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> updateLongRunning(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("customTemplateResourceName") String customTemplateResourceName, - @HeaderParam("accept") String accept, @BodyParam("application/json") CustomTemplateResourcePatch properties, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CustomTemplateResourcePatch properties, Context context); } /** @@ -106,10 +102,6 @@ Mono>> updateLongRunning(@HostParam("endpoint") String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String customTemplateResourceName, CustomTemplateResourceInner resource, String ifMatch, String ifNoneMatch) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -127,11 +119,12 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, ifMatch, ifNoneMatch, customTemplateResourceName, - accept, resource, context)) + .withContext(context -> service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, ifMatch, ifNoneMatch, customTemplateResourceName, contentType, accept, resource, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -154,10 +147,6 @@ private Mono>> createOrUpdateWithResponseAsync(String private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String customTemplateResourceName, CustomTemplateResourceInner resource, String ifMatch, String ifNoneMatch, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -175,11 +164,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, ifMatch, ifNoneMatch, customTemplateResourceName, - accept, resource, context); + return service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + ifMatch, ifNoneMatch, customTemplateResourceName, contentType, accept, resource, context); } /** @@ -428,10 +417,6 @@ public CustomTemplateResourceInner createOrUpdate(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateLongRunningWithResponseAsync(String resourceGroupName, String customTemplateResourceName, CustomTemplateResourcePatch properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -449,11 +434,12 @@ private Mono>> updateLongRunningWithResponseAsync(Stri } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.updateLongRunning(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, customTemplateResourceName, accept, properties, - context)) + .withContext( + context -> service.updateLongRunning(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, customTemplateResourceName, contentType, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -473,10 +459,6 @@ private Mono>> updateLongRunningWithResponseAsync(Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateLongRunningWithResponseAsync(String resourceGroupName, String customTemplateResourceName, CustomTemplateResourcePatch properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -494,11 +476,11 @@ private Mono>> updateLongRunningWithResponseAsync(Stri } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.updateLongRunning(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, customTemplateResourceName, accept, properties, - context); + return service.updateLongRunning(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, customTemplateResourceName, contentType, accept, properties, context); } /** diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/OperationsClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/OperationsClientImpl.java index a41589074e..617d380ddd 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/OperationsClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/OperationsClientImpl.java @@ -9,7 +9,6 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -59,22 +58,22 @@ public final class OperationsClientImpl implements OperationsClient { * The interface defining all the services for ArmResourceProviderClientOperations to be used by the proxy service * to perform REST calls. */ - @Host("{endpoint}") + @Host("https://management.azure.com") @ServiceInterface(name = "ArmResourceProviderC") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Cadl.ArmResourceProvider/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, Context context); + Mono> list(@QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** @@ -87,14 +86,8 @@ Mono> listNext(@PathParam(value = "nextLink", enco */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + return FluxUtil.withContext(context -> service.list(this.client.getApiVersion(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -112,13 +105,9 @@ private Mono> listSinglePageAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + return service.list(this.client.getApiVersion(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -181,6 +170,8 @@ public PagedIterable list(Context context) { } /** + * List the operations for the provider + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -195,18 +186,16 @@ private Mono> listNextSinglePageAsync(String nextL if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listNext(nextLink, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** + * List the operations for the provider + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -222,13 +211,9 @@ private Mono> listNextSinglePageAsync(String nextL if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listNext(nextLink, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java index e1ebb896ef..602ccd66dd 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java @@ -11,7 +11,6 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Post; @@ -71,74 +70,73 @@ public final class TopLevelArmResourceInterfacesClientImpl implements TopLevelAr * The interface defining all the services for ArmResourceProviderClientTopLevelArmResourceInterfaces to be used by * the proxy service to perform REST calls. */ - @Host("{endpoint}") + @Host("https://management.azure.com") @ServiceInterface(name = "ArmResourceProviderC") public interface TopLevelArmResourceInterfacesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") TopLevelArmResourceInner resource, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> update(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") TopLevelArmResourceUpdate properties, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("accept") String accept, + Mono> listByResourceGroup(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Cadl.ArmResourceProvider/topLevelArmResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("accept") String accept, Context context); + Mono> list(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/action") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> action(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> action(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -146,16 +144,16 @@ Mono>> action(@HostParam("endpoint") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, + Context context); } /** @@ -166,15 +164,12 @@ Mono> listBySubscriptionNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelArmResource along with {@link Response} on successful completion of {@link Mono}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String topLevelArmResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -189,7 +184,7 @@ private Mono> getByResourceGroupWithResponseA } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.getByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -203,15 +198,12 @@ private Mono> getByResourceGroupWithResponseA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelArmResource along with {@link Response} on successful completion of {@link Mono}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -226,8 +218,8 @@ private Mono> getByResourceGroupWithResponseA } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context); + return service.getByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, accept, context); } /** @@ -238,7 +230,8 @@ private Mono> getByResourceGroupWithResponseA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelArmResource on successful completion of {@link Mono}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, @@ -256,7 +249,8 @@ private Mono getByResourceGroupAsync(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelArmResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, @@ -272,7 +266,7 @@ public Response getByResourceGroupWithResponse(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelArmResource. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. */ @ServiceMethod(returns = ReturnType.SINGLE) public TopLevelArmResourceInner getByResourceGroup(String resourceGroupName, String topLevelArmResourceName) { @@ -294,10 +288,6 @@ public TopLevelArmResourceInner getByResourceGroup(String resourceGroupName, Str @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, TopLevelArmResourceInner resource) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -315,10 +305,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, resource, context)) + .withContext(context -> service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -338,10 +329,6 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, TopLevelArmResourceInner resource, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -359,10 +346,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, resource, context); + return service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, contentType, accept, resource, context); } /** @@ -537,10 +525,6 @@ public TopLevelArmResourceInner createOrUpdate(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, TopLevelArmResourceUpdate properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -558,9 +542,11 @@ private Mono> updateWithResponseAsync(String } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, properties, context)) + return FluxUtil + .withContext(context -> service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, contentType, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -580,10 +566,6 @@ private Mono> updateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, TopLevelArmResourceUpdate properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -601,10 +583,11 @@ private Mono> updateWithResponseAsync(String } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, accept, properties, context); + return service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, contentType, accept, properties, context); } /** @@ -675,10 +658,6 @@ public TopLevelArmResourceInner update(String resourceGroupName, String topLevel @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelArmResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -693,8 +672,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context)) + .withContext(context -> service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -712,10 +691,6 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -730,8 +705,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, accept, context); + return service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, accept, context); } /** @@ -879,10 +854,6 @@ public void delete(String resourceGroupName, String topLevelArmResourceName, Con */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -893,7 +864,7 @@ private Mono> listByResourceGroupSingleP } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.listByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -914,10 +885,6 @@ private Mono> listByResourceGroupSingleP @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -929,8 +896,8 @@ private Mono> listByResourceGroupSingleP final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accept, context) + .listByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1005,18 +972,14 @@ public PagedIterable listByResourceGroup(String resour */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) + .withContext( + context -> service.list(this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1034,19 +997,13 @@ private Mono> listSinglePageAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, - context) + return service.list(this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1118,10 +1075,6 @@ public PagedIterable list(Context context) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> actionWithResponseAsync(String resourceGroupName, String topLevelArmResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1136,8 +1089,8 @@ private Mono>> actionWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.action(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context)) + .withContext(context -> service.action(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1155,10 +1108,6 @@ private Mono>> actionWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> actionWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1173,8 +1122,8 @@ private Mono>> actionWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.action(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, accept, context); + return service.action(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, accept, context); } /** @@ -1314,6 +1263,8 @@ public ResultInner action(String resourceGroupName, String topLevelArmResourceNa } /** + * List TopLevelArmResource resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1328,20 +1279,16 @@ private Mono> listByResourceGroupNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listByResourceGroupNext(nextLink, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** + * List TopLevelArmResource resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1358,18 +1305,16 @@ private Mono> listByResourceGroupNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listByResourceGroupNext(nextLink, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** + * List TopLevelArmResource resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1384,20 +1329,16 @@ private Mono> listBySubscriptionNextSing if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listBySubscriptionNext(nextLink, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** + * List TopLevelArmResource resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1414,13 +1355,9 @@ private Mono> listBySubscriptionNextSing if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listBySubscriptionNext(nextLink, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildExtensionResourceInterfaces.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildExtensionResourceInterfaces.java index 6a967a0cc1..cbc5a6d658 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildExtensionResourceInterfaces.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildExtensionResourceInterfaces.java @@ -22,7 +22,7 @@ public interface ChildExtensionResourceInterfaces { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource along with {@link Response}. + * @return extensionResource of Top Level Arm Resource along with {@link Response}. */ Response getWithResponse(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, Context context); @@ -36,7 +36,7 @@ Response getWithResponse(String resourceUri, String topL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource. + * @return extensionResource of Top Level Arm Resource. */ ChildExtensionResource get(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName); @@ -129,7 +129,7 @@ PagedIterable listByTopLevelArmResource(String resourceU * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource along with {@link Response}. + * @return extensionResource of Top Level Arm Resource along with {@link Response}. */ ChildExtensionResource getById(String id); @@ -141,7 +141,7 @@ PagedIterable listByTopLevelArmResource(String resourceU * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource along with {@link Response}. + * @return extensionResource of Top Level Arm Resource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildResourcesInterfaces.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildResourcesInterfaces.java index 36c43f5666..fa14eee2a4 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildResourcesInterfaces.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildResourcesInterfaces.java @@ -22,7 +22,7 @@ public interface ChildResourcesInterfaces { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource along with {@link Response}. + * @return subresource of Top Level Arm Resource along with {@link Response}. */ Response getWithResponse(String resourceGroupName, String topLevelArmResourceName, String childResourceName, Context context); @@ -36,7 +36,7 @@ Response getWithResponse(String resourceGroupName, String topLeve * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource. + * @return subresource of Top Level Arm Resource. */ ChildResource get(String resourceGroupName, String topLevelArmResourceName, String childResourceName); @@ -124,7 +124,7 @@ void actionWithoutBody(String resourceGroupName, String topLevelArmResourceName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource along with {@link Response}. + * @return subresource of Top Level Arm Resource along with {@link Response}. */ ChildResource getById(String id); @@ -136,7 +136,7 @@ void actionWithoutBody(String resourceGroupName, String topLevelArmResourceName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource along with {@link Response}. + * @return subresource of Top Level Arm Resource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/TopLevelArmResourceInterfaces.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/TopLevelArmResourceInterfaces.java index b084c3eed9..abcb77f43c 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/TopLevelArmResourceInterfaces.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/TopLevelArmResourceInterfaces.java @@ -21,7 +21,8 @@ public interface TopLevelArmResourceInterfaces { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelArmResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ Response getByResourceGroupWithResponse(String resourceGroupName, String topLevelArmResourceName, Context context); @@ -34,7 +35,7 @@ Response getByResourceGroupWithResponse(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelArmResource. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. */ TopLevelArmResource getByResourceGroup(String resourceGroupName, String topLevelArmResourceName); @@ -136,7 +137,8 @@ Response getByResourceGroupWithResponse(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelArmResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ TopLevelArmResource getById(String id); @@ -148,7 +150,8 @@ Response getByResourceGroupWithResponse(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelArmResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/ArmStreamStyleSerializationManager.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/ArmStreamStyleSerializationManager.java index 7b24317712..eb39c36857 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/ArmStreamStyleSerializationManager.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/ArmStreamStyleSerializationManager.java @@ -52,7 +52,6 @@ private ArmStreamStyleSerializationManager(HttpPipeline httpPipeline, AzureProfi Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); this.clientObject = new ArmStreamStyleSerializationClientBuilder().pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) .buildClient(); diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/ArmStreamStyleSerializationClient.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/ArmStreamStyleSerializationClient.java index ce27e1bede..6c2dc1e0da 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/ArmStreamStyleSerializationClient.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/ArmStreamStyleSerializationClient.java @@ -11,13 +11,6 @@ * The interface for ArmStreamStyleSerializationClient class. */ public interface ArmStreamStyleSerializationClient { - /** - * Gets Server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - /** * Gets Version parameter. * diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientBuilder.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientBuilder.java index 9b10cf2326..d0659bf1b5 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientBuilder.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientBuilder.java @@ -19,22 +19,6 @@ */ @ServiceClientBuilder(serviceClients = { ArmStreamStyleSerializationClientImpl.class }) public final class ArmStreamStyleSerializationClientBuilder { - /* - * Server parameter - */ - private String endpoint; - - /** - * Sets Server parameter. - * - * @param endpoint the endpoint value. - * @return the ArmStreamStyleSerializationClientBuilder. - */ - public ArmStreamStyleSerializationClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - /* * The ID of the target subscription. The value must be an UUID. */ @@ -131,7 +115,7 @@ public ArmStreamStyleSerializationClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); ArmStreamStyleSerializationClientImpl client = new ArmStreamStyleSerializationClientImpl(localPipeline, - localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId); + localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId); return client; } } diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientImpl.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientImpl.java index 29c56c88aa..306a0a1e3b 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientImpl.java @@ -40,20 +40,6 @@ */ @ServiceClient(builder = ArmStreamStyleSerializationClientBuilder.class) public final class ArmStreamStyleSerializationClientImpl implements ArmStreamStyleSerializationClient { - /** - * Server parameter. - */ - private final String endpoint; - - /** - * Gets Server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - /** * Version parameter. */ @@ -159,15 +145,13 @@ public TopLevelArmResourcesClient getTopLevelArmResources() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param endpoint Server parameter. * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ ArmStreamStyleSerializationClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.endpoint = endpoint; this.subscriptionId = subscriptionId; this.apiVersion = "2023-12-01-preview"; this.fishes = new FishesClientImpl(this); diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java index 86f1103f2e..e62b2f2549 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java @@ -10,7 +10,6 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -53,22 +52,20 @@ public final class FishesClientImpl implements FishesClient { * The interface defining all the services for ArmStreamStyleSerializationClientFishes to be used by the proxy * service to perform REST calls. */ - @Host("{endpoint}") + @Host("https://management.azure.com") @ServiceInterface(name = "ArmStreamStyleSerial") public interface FishesService { @Headers({ "Content-Type: application/json" }) @Get("/model") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getModel(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - Context context); + Mono> getModel(@HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/model") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> putModel(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - @BodyParam("application/json") FishInner fish, Context context); + Mono> putModel(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") FishInner fish, Context context); } /** @@ -81,12 +78,8 @@ Mono> putModel(@HostParam("endpoint") String endpoint, @Head */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getModelWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getModel(this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.getModel(accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -102,13 +95,9 @@ private Mono> getModelWithResponseAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getModelWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getModel(this.client.getEndpoint(), accept, context); + return service.getModel(accept, context); } /** @@ -163,17 +152,14 @@ public FishInner getModel() { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> putModelWithResponseAsync(FishInner fish) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (fish == null) { return Mono.error(new IllegalArgumentException("Parameter fish is required and cannot be null.")); } else { fish.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putModel(this.client.getEndpoint(), accept, fish, context)) + return FluxUtil.withContext(context -> service.putModel(contentType, accept, fish, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -190,18 +176,15 @@ private Mono> putModelWithResponseAsync(FishInner fish) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> putModelWithResponseAsync(FishInner fish, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (fish == null) { return Mono.error(new IllegalArgumentException("Parameter fish is required and cannot be null.")); } else { fish.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.putModel(this.client.getEndpoint(), accept, fish, context); + return service.putModel(contentType, accept, fish, context); } /** diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/TopLevelArmResourcesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/TopLevelArmResourcesClientImpl.java index 7088f30ffd..32ab73105b 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/TopLevelArmResourcesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/TopLevelArmResourcesClientImpl.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.QueryParam; @@ -61,17 +59,17 @@ public final class TopLevelArmResourcesClientImpl implements TopLevelArmResource * The interface defining all the services for ArmStreamStyleSerializationClientTopLevelArmResources to be used by * the proxy service to perform REST calls. */ - @Host("{endpoint}") + @Host("https://management.azure.com") @ServiceInterface(name = "ArmStreamStyleSerial") public interface TopLevelArmResourcesService { - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmStreamStyleSerialization/topLevelArmResources/{topLevelArmResourceName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") TopLevelArmResourceTagsUpdate properties, Context context); } @@ -90,10 +88,6 @@ Mono>> update(@HostParam("endpoint") String endpoint, @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, TopLevelArmResourceTagsUpdate properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -111,9 +105,11 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, properties, context)) + return FluxUtil + .withContext(context -> service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, contentType, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -133,10 +129,6 @@ private Mono>> updateWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, TopLevelArmResourceTagsUpdate properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -154,10 +146,11 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, accept, properties, context); + return service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, contentType, accept, properties, context); } /** diff --git a/typespec-tests/src/main/java/com/cadl/builtin/implementation/BuiltinClientImpl.java b/typespec-tests/src/main/java/com/cadl/builtin/implementation/BuiltinClientImpl.java index 169d20a90e..5bfa379806 100644 --- a/typespec-tests/src/main/java/com/cadl/builtin/implementation/BuiltinClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/builtin/implementation/BuiltinClientImpl.java @@ -16,12 +16,12 @@ */ public final class BuiltinClientImpl { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public BuiltinOpsImpl getBuiltinOps() { /** * Initializes an instance of BuiltinClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public BuiltinClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public BuiltinClientImpl(String endpoint) { * Initializes an instance of BuiltinClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public BuiltinClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public BuiltinClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public BuiltinClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/builtin/implementation/BuiltinOpsImpl.java b/typespec-tests/src/main/java/com/cadl/builtin/implementation/BuiltinOpsImpl.java index f16cba11b6..7ea2c40fd9 100644 --- a/typespec-tests/src/main/java/com/cadl/builtin/implementation/BuiltinOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/builtin/implementation/BuiltinOpsImpl.java @@ -68,7 +68,7 @@ public interface BuiltinOpsService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> read(@HostParam("endpoint") String endpoint, @QueryParam("query") String queryParam, @QueryParam(value = "query-encoded", encoded = true) String queryParamEncoded, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/builtin") @ExpectedResponses({ 200 }) @@ -78,7 +78,7 @@ Mono> read(@HostParam("endpoint") String endpoint, @QueryPa @UnexpectedResponseExceptionType(HttpResponseException.class) Response readSync(@HostParam("endpoint") String endpoint, @QueryParam("query") String queryParam, @QueryParam(value = "query-encoded", encoded = true) String queryParamEncoded, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/builtin") @ExpectedResponses({ 200 }) @@ -86,8 +86,9 @@ Response readSync(@HostParam("endpoint") String endpoint, @QueryPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> write(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> write(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/builtin") @ExpectedResponses({ 200 }) @@ -95,8 +96,9 @@ Mono> write(@HostParam("endpoint") String endpoint, @HeaderParam( @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response writeSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response writeSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -295,9 +297,9 @@ public Response readWithResponse(String queryParam, String queryPara */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> writeWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.write(this.client.getEndpoint(), accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext( + context -> service.write(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -350,7 +352,7 @@ public Mono> writeWithResponseAsync(BinaryData body, RequestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Response writeWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.writeSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.writeSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/enumservice/implementation/EnumServiceClientImpl.java b/typespec-tests/src/main/java/com/cadl/enumservice/implementation/EnumServiceClientImpl.java index 23979b9a52..12b6c27112 100644 --- a/typespec-tests/src/main/java/com/cadl/enumservice/implementation/EnumServiceClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/enumservice/implementation/EnumServiceClientImpl.java @@ -47,12 +47,12 @@ public final class EnumServiceClientImpl { private final EnumServiceClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -91,7 +91,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of EnumServiceClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public EnumServiceClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -102,7 +102,7 @@ public EnumServiceClientImpl(String endpoint) { * Initializes an instance of EnumServiceClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public EnumServiceClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -113,7 +113,7 @@ public EnumServiceClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public EnumServiceClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; @@ -136,7 +136,7 @@ public interface EnumServiceClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getColor(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/enum/color") @ExpectedResponses({ 200 }) @@ -144,7 +144,7 @@ Mono> getColor(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getColorSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response getColorSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/enum/colormodel") @@ -154,7 +154,7 @@ Response getColorSync(@HostParam("endpoint") String endpoint, @Heade @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getColorModel(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/enum/colormodel") @ExpectedResponses({ 200 }) @@ -163,7 +163,7 @@ Mono> getColorModel(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getColorModelSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/colormodel") @ExpectedResponses({ 200 }) @@ -172,7 +172,7 @@ Response getColorModelSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setColorModel(@HostParam("endpoint") String endpoint, - @QueryParam("color") String color, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @QueryParam("color") String color, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/colormodel") @@ -182,7 +182,7 @@ Mono> setColorModel(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response setColorModelSync(@HostParam("endpoint") String endpoint, - @QueryParam("color") String color, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @QueryParam("color") String color, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/priority") @@ -192,7 +192,7 @@ Response setColorModelSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setPriority(@HostParam("endpoint") String endpoint, - @QueryParam("priority") String priority, @HeaderParam("accept") String accept, + @QueryParam("priority") String priority, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/priority") @@ -202,7 +202,7 @@ Mono> setPriority(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response setPrioritySync(@HostParam("endpoint") String endpoint, - @QueryParam("priority") String priority, @HeaderParam("accept") String accept, + @QueryParam("priority") String priority, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/enum/operation/state/running") @@ -212,7 +212,7 @@ Response setPrioritySync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getRunningOperation(@HostParam("endpoint") String endpoint, - @QueryParam("state") String state, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @QueryParam("state") String state, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/enum/operation/state/running") @@ -222,7 +222,7 @@ Mono> getRunningOperation(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getRunningOperationSync(@HostParam("endpoint") String endpoint, - @QueryParam("state") String state, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @QueryParam("state") String state, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/enum/operation/state") @@ -232,7 +232,7 @@ Response getRunningOperationSync(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getOperation(@HostParam("endpoint") String endpoint, - @QueryParam("state") String state, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @QueryParam("state") String state, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/enum/operation/state") @@ -242,7 +242,7 @@ Mono> getOperation(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getOperationSync(@HostParam("endpoint") String endpoint, @QueryParam("state") String state, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringenumarray") @ExpectedResponses({ 200 }) @@ -251,7 +251,7 @@ Response getOperationSync(@HostParam("endpoint") String endpoint, @Q @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setStringEnumArray(@HostParam("endpoint") String endpoint, - @QueryParam("colorArray") String colorArray, @HeaderParam("accept") String accept, + @QueryParam("colorArray") String colorArray, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringenumarray") @@ -261,7 +261,7 @@ Mono> setStringEnumArray(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response setStringEnumArraySync(@HostParam("endpoint") String endpoint, - @QueryParam("colorArray") String colorArray, @HeaderParam("accept") String accept, + @QueryParam("colorArray") String colorArray, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/intenumarray") @@ -271,7 +271,7 @@ Response setStringEnumArraySync(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setIntEnumArray(@HostParam("endpoint") String endpoint, - @QueryParam("priorityArray") String priorityArray, @HeaderParam("accept") String accept, + @QueryParam("priorityArray") String priorityArray, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/intenumarray") @@ -281,7 +281,7 @@ Mono> setIntEnumArray(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response setIntEnumArraySync(@HostParam("endpoint") String endpoint, - @QueryParam("priorityArray") String priorityArray, @HeaderParam("accept") String accept, + @QueryParam("priorityArray") String priorityArray, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringarray") @@ -291,7 +291,7 @@ Response setIntEnumArraySync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setStringArray(@HostParam("endpoint") String endpoint, - @QueryParam("stringArray") String stringArray, @HeaderParam("accept") String accept, + @QueryParam("stringArray") String stringArray, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringarray") @@ -301,7 +301,7 @@ Mono> setStringArray(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response setStringArraySync(@HostParam("endpoint") String endpoint, - @QueryParam("stringArray") String stringArray, @HeaderParam("accept") String accept, + @QueryParam("stringArray") String stringArray, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/intarray") @@ -311,7 +311,7 @@ Response setStringArraySync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setIntArray(@HostParam("endpoint") String endpoint, - @QueryParam("intArray") String intArray, @HeaderParam("accept") String accept, + @QueryParam("intArray") String intArray, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/intarray") @@ -321,7 +321,7 @@ Mono> setIntArray(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response setIntArraySync(@HostParam("endpoint") String endpoint, - @QueryParam("intArray") String intArray, @HeaderParam("accept") String accept, + @QueryParam("intArray") String intArray, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringenummulti") @@ -332,7 +332,7 @@ Response setIntArraySync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setStringEnumMulti(@HostParam("endpoint") String endpoint, @QueryParam(value = "colorArray", multipleQueryParams = true) List colorArray, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringenummulti") @ExpectedResponses({ 200 }) @@ -342,7 +342,7 @@ Mono> setStringEnumMulti(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(HttpResponseException.class) Response setStringEnumMultiSync(@HostParam("endpoint") String endpoint, @QueryParam(value = "colorArray", multipleQueryParams = true) List colorArray, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/intenummulti") @ExpectedResponses({ 200 }) @@ -352,7 +352,7 @@ Response setStringEnumMultiSync(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setIntEnumMulti(@HostParam("endpoint") String endpoint, @QueryParam(value = "priorityArray", multipleQueryParams = true) List priorityArray, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/intenummulti") @ExpectedResponses({ 200 }) @@ -362,7 +362,7 @@ Mono> setIntEnumMulti(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(HttpResponseException.class) Response setIntEnumMultiSync(@HostParam("endpoint") String endpoint, @QueryParam(value = "priorityArray", multipleQueryParams = true) List priorityArray, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringmulti") @ExpectedResponses({ 200 }) @@ -372,7 +372,7 @@ Response setIntEnumMultiSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setStringMulti(@HostParam("endpoint") String endpoint, @QueryParam(value = "stringArray", multipleQueryParams = true) List stringArray, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringmulti") @ExpectedResponses({ 200 }) @@ -382,7 +382,7 @@ Mono> setStringMulti(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(HttpResponseException.class) Response setStringMultiSync(@HostParam("endpoint") String endpoint, @QueryParam(value = "stringArray", multipleQueryParams = true) List stringArray, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/intmulti") @ExpectedResponses({ 200 }) @@ -392,7 +392,7 @@ Response setStringMultiSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setIntMulti(@HostParam("endpoint") String endpoint, @QueryParam(value = "intArray", multipleQueryParams = true) List intArray, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/intmulti") @ExpectedResponses({ 200 }) @@ -402,7 +402,7 @@ Mono> setIntMulti(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response setIntMultiSync(@HostParam("endpoint") String endpoint, @QueryParam(value = "intArray", multipleQueryParams = true) List intArray, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringenumarrayheader") @ExpectedResponses({ 200 }) @@ -411,7 +411,7 @@ Response setIntMultiSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setStringEnumArrayHeader(@HostParam("endpoint") String endpoint, - @HeaderParam("color-array") String colorArray, @HeaderParam("accept") String accept, + @HeaderParam("color-array") String colorArray, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringenumarrayheader") @@ -421,7 +421,7 @@ Mono> setStringEnumArrayHeader(@HostParam("endpoint") Strin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response setStringEnumArrayHeaderSync(@HostParam("endpoint") String endpoint, - @HeaderParam("color-array") String colorArray, @HeaderParam("accept") String accept, + @HeaderParam("color-array") String colorArray, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorModelClientImpl.java b/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorModelClientImpl.java index 8274dc5b1a..ba7a4d34da 100644 --- a/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorModelClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorModelClientImpl.java @@ -16,12 +16,12 @@ */ public final class ErrorModelClientImpl { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public ErrorOpsImpl getErrorOps() { /** * Initializes an instance of ErrorModelClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public ErrorModelClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public ErrorModelClientImpl(String endpoint) { * Initializes an instance of ErrorModelClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public ErrorModelClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public ErrorModelClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public ErrorModelClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorOpsImpl.java b/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorOpsImpl.java index d422ad091e..259b2fa4b1 100644 --- a/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorOpsImpl.java @@ -62,7 +62,7 @@ public interface ErrorOpsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> read(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> read(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/error") @@ -71,7 +71,7 @@ Mono> read(@HostParam("endpoint") String endpoint, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response readSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response readSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/cadl/flatten/FlattenAsyncClient.java b/typespec-tests/src/main/java/com/cadl/flatten/FlattenAsyncClient.java index 97cbf888db..e3c264ec57 100644 --- a/typespec-tests/src/main/java/com/cadl/flatten/FlattenAsyncClient.java +++ b/typespec-tests/src/main/java/com/cadl/flatten/FlattenAsyncClient.java @@ -66,7 +66,7 @@ public final class FlattenAsyncClient { * } * * @param id The id parameter. - * @param request The request parameter. + * @param sendRequest The sendRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -76,8 +76,8 @@ public final class FlattenAsyncClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendWithResponse(String id, BinaryData request, RequestOptions requestOptions) { - return this.serviceClient.sendWithResponseAsync(id, request, requestOptions); + public Mono> sendWithResponse(String id, BinaryData sendRequest, RequestOptions requestOptions) { + return this.serviceClient.sendWithResponseAsync(id, sendRequest, requestOptions); } /** @@ -91,7 +91,7 @@ public Mono> sendWithResponse(String id, BinaryData request, Requ * } * * @param id The id parameter. - * @param request The request parameter. + * @param sendProjectedNameRequest The sendProjectedNameRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -101,9 +101,9 @@ public Mono> sendWithResponse(String id, BinaryData request, Requ */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendProjectedNameWithResponse(String id, BinaryData request, + public Mono> sendProjectedNameWithResponse(String id, BinaryData sendProjectedNameRequest, RequestOptions requestOptions) { - return this.serviceClient.sendProjectedNameWithResponseAsync(id, request, requestOptions); + return this.serviceClient.sendProjectedNameWithResponseAsync(id, sendProjectedNameRequest, requestOptions); } /** @@ -136,7 +136,7 @@ public Mono> sendProjectedNameWithResponse(String id, BinaryData * } * * @param name The name parameter. - * @param request The request parameter. + * @param sendLongRequest The sendLongRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -146,8 +146,9 @@ public Mono> sendProjectedNameWithResponse(String id, BinaryData */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendLongWithResponse(String name, BinaryData request, RequestOptions requestOptions) { - return this.serviceClient.sendLongWithResponseAsync(name, request, requestOptions); + public Mono> sendLongWithResponse(String name, BinaryData sendLongRequest, + RequestOptions requestOptions) { + return this.serviceClient.sendLongWithResponseAsync(name, sendLongRequest, requestOptions); } /** @@ -180,7 +181,7 @@ public Mono> sendLongWithResponse(String name, BinaryData request * } * * @param id The id parameter. - * @param request The request parameter. + * @param updateRequest The updateRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -190,15 +191,16 @@ public Mono> sendLongWithResponse(String name, BinaryData request */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponse(long id, BinaryData request, RequestOptions requestOptions) { - return this.serviceClient.updateWithResponseAsync(id, request, requestOptions); + public Mono> updateWithResponse(long id, BinaryData updateRequest, + RequestOptions requestOptions) { + return this.serviceClient.updateWithResponseAsync(id, updateRequest, requestOptions); } /** * The uploadFile operation. * * @param name The name parameter. - * @param request The request parameter. + * @param uploadFileRequest The uploadFileRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -208,16 +210,17 @@ public Mono> updateWithResponse(long id, BinaryData request */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono> uploadFileWithResponse(String name, BinaryData request, RequestOptions requestOptions) { + Mono> uploadFileWithResponse(String name, BinaryData uploadFileRequest, + RequestOptions requestOptions) { // Protocol API requires serialization of parts with content-disposition and data, as operation 'uploadFile' is // 'multipart/form-data' - return this.serviceClient.uploadFileWithResponseAsync(name, request, requestOptions); + return this.serviceClient.uploadFileWithResponseAsync(name, uploadFileRequest, requestOptions); } /** * The uploadTodo operation. * - * @param request The request parameter. + * @param uploadTodoRequest The uploadTodoRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -227,10 +230,10 @@ Mono> uploadFileWithResponse(String name, BinaryData request, Req */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono> uploadTodoWithResponse(BinaryData request, RequestOptions requestOptions) { + Mono> uploadTodoWithResponse(BinaryData uploadTodoRequest, RequestOptions requestOptions) { // Protocol API requires serialization of parts with content-disposition and data, as operation 'uploadTodo' is // 'multipart/form-data' - return this.serviceClient.uploadTodoWithResponseAsync(request, requestOptions); + return this.serviceClient.uploadTodoWithResponseAsync(uploadTodoRequest, requestOptions); } /** @@ -252,9 +255,9 @@ Mono> uploadTodoWithResponse(BinaryData request, RequestOptions r public Mono send(String id, String input, User user) { // Generated convenience method for sendWithResponse RequestOptions requestOptions = new RequestOptions(); - SendRequest requestObj = new SendRequest(input).setUser(user); - BinaryData request = BinaryData.fromObject(requestObj); - return sendWithResponse(id, request, requestOptions).flatMap(FluxUtil::toMono); + SendRequest sendRequestObj = new SendRequest(input).setUser(user); + BinaryData sendRequest = BinaryData.fromObject(sendRequestObj); + return sendWithResponse(id, sendRequest, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -275,9 +278,9 @@ public Mono send(String id, String input, User user) { public Mono send(String id, String input) { // Generated convenience method for sendWithResponse RequestOptions requestOptions = new RequestOptions(); - SendRequest requestObj = new SendRequest(input); - BinaryData request = BinaryData.fromObject(requestObj); - return sendWithResponse(id, request, requestOptions).flatMap(FluxUtil::toMono); + SendRequest sendRequestObj = new SendRequest(input); + BinaryData sendRequest = BinaryData.fromObject(sendRequestObj); + return sendWithResponse(id, sendRequest, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -298,9 +301,9 @@ public Mono send(String id, String input) { public Mono sendProjectedName(String id, String fileIdentifier) { // Generated convenience method for sendProjectedNameWithResponse RequestOptions requestOptions = new RequestOptions(); - SendProjectedNameRequest requestObj = new SendProjectedNameRequest(fileIdentifier); - BinaryData request = BinaryData.fromObject(requestObj); - return sendProjectedNameWithResponse(id, request, requestOptions).flatMap(FluxUtil::toMono); + SendProjectedNameRequest sendProjectedNameRequestObj = new SendProjectedNameRequest(fileIdentifier); + BinaryData sendProjectedNameRequest = BinaryData.fromObject(sendProjectedNameRequestObj); + return sendProjectedNameWithResponse(id, sendProjectedNameRequest, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -322,7 +325,7 @@ public Mono sendLong(SendLongOptions options) { RequestOptions requestOptions = new RequestOptions(); String name = options.getName(); String filter = options.getFilter(); - SendLongRequest requestObj + SendLongRequest sendLongRequestObj = new SendLongRequest(options.getInput(), options.getDataInt(), options.getTitle(), options.getStatus()) .setUser(options.getUser()) .setDataIntOptional(options.getDataIntOptional()) @@ -330,18 +333,18 @@ public Mono sendLong(SendLongOptions options) { .setDataFloat(options.getDataFloat()) .setDescription(options.getDescription()) .setDummy(options.getDummy()); - BinaryData request = BinaryData.fromObject(requestObj); + BinaryData sendLongRequest = BinaryData.fromObject(sendLongRequestObj); if (filter != null) { requestOptions.addQueryParam("filter", filter, false); } - return sendLongWithResponse(name, request, requestOptions).flatMap(FluxUtil::toMono); + return sendLongWithResponse(name, sendLongRequest, requestOptions).flatMap(FluxUtil::toMono); } /** * The update operation. * * @param id The id parameter. - * @param request The request parameter. + * @param updateRequest The updateRequest parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -352,15 +355,15 @@ public Mono sendLong(SendLongOptions options) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono update(long id, UpdatePatchRequest request) { + public Mono update(long id, UpdatePatchRequest updateRequest) { // Generated convenience method for updateWithResponse RequestOptions requestOptions = new RequestOptions(); - JsonMergePatchHelper.getUpdatePatchRequestAccessor().prepareModelForJsonMergePatch(request, true); - BinaryData requestInBinaryData = BinaryData.fromObject(request); + JsonMergePatchHelper.getUpdatePatchRequestAccessor().prepareModelForJsonMergePatch(updateRequest, true); + BinaryData updateRequestInBinaryData = BinaryData.fromObject(updateRequest); // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. - requestInBinaryData.getLength(); - JsonMergePatchHelper.getUpdatePatchRequestAccessor().prepareModelForJsonMergePatch(request, false); - return updateWithResponse(id, requestInBinaryData, requestOptions).flatMap(FluxUtil::toMono) + updateRequestInBinaryData.getLength(); + JsonMergePatchHelper.getUpdatePatchRequestAccessor().prepareModelForJsonMergePatch(updateRequest, false); + return updateWithResponse(id, updateRequestInBinaryData, requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(TodoItem.class)); } @@ -382,14 +385,14 @@ public Mono update(long id, UpdatePatchRequest request) { public Mono uploadFile(String name, FileDataFileDetails fileData) { // Generated convenience method for uploadFileWithResponse RequestOptions requestOptions = new RequestOptions(); - UploadFileRequest requestObj = new UploadFileRequest(fileData); - BinaryData request = new MultipartFormDataHelper(requestOptions) - .serializeFileField("file_data", requestObj.getFileData().getContent(), - requestObj.getFileData().getContentType(), requestObj.getFileData().getFilename()) - .serializeTextField("constant", requestObj.getConstant()) + UploadFileRequest uploadFileRequestObj = new UploadFileRequest(fileData); + BinaryData uploadFileRequest = new MultipartFormDataHelper(requestOptions) + .serializeFileField("file_data", uploadFileRequestObj.getFileData().getContent(), + uploadFileRequestObj.getFileData().getContentType(), uploadFileRequestObj.getFileData().getFilename()) + .serializeTextField("constant", uploadFileRequestObj.getConstant()) .end() .getRequestBody(); - return uploadFileWithResponse(name, request, requestOptions).flatMap(FluxUtil::toMono); + return uploadFileWithResponse(name, uploadFileRequest, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -409,22 +412,22 @@ public Mono uploadFile(String name, FileDataFileDetails fileData) { public Mono uploadTodo(UploadTodoOptions options) { // Generated convenience method for uploadTodoWithResponse RequestOptions requestOptions = new RequestOptions(); - UploadTodoRequest requestObj + UploadTodoRequest uploadTodoRequestObj = new UploadTodoRequest(options.getTitle(), options.getStatus()).setDescription(options.getDescription()) .setDummy(options.getDummy()) .setProp1(options.getProp1()) .setProp2(options.getProp2()) .setProp3(options.getProp3()); - BinaryData request - = new MultipartFormDataHelper(requestOptions).serializeTextField("title", requestObj.getTitle()) - .serializeTextField("description", requestObj.getDescription()) - .serializeTextField("status", Objects.toString(requestObj.getStatus())) - .serializeTextField("_dummy", requestObj.getDummy()) - .serializeTextField("prop1", requestObj.getProp1()) - .serializeTextField("prop2", requestObj.getProp2()) - .serializeTextField("prop3", requestObj.getProp3()) + BinaryData uploadTodoRequest + = new MultipartFormDataHelper(requestOptions).serializeTextField("title", uploadTodoRequestObj.getTitle()) + .serializeTextField("description", uploadTodoRequestObj.getDescription()) + .serializeTextField("status", Objects.toString(uploadTodoRequestObj.getStatus())) + .serializeTextField("_dummy", uploadTodoRequestObj.getDummy()) + .serializeTextField("prop1", uploadTodoRequestObj.getProp1()) + .serializeTextField("prop2", uploadTodoRequestObj.getProp2()) + .serializeTextField("prop3", uploadTodoRequestObj.getProp3()) .end() .getRequestBody(); - return uploadTodoWithResponse(request, requestOptions).flatMap(FluxUtil::toMono); + return uploadTodoWithResponse(uploadTodoRequest, requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/typespec-tests/src/main/java/com/cadl/flatten/FlattenClient.java b/typespec-tests/src/main/java/com/cadl/flatten/FlattenClient.java index 9af9394dc0..36a6f4af4f 100644 --- a/typespec-tests/src/main/java/com/cadl/flatten/FlattenClient.java +++ b/typespec-tests/src/main/java/com/cadl/flatten/FlattenClient.java @@ -64,7 +64,7 @@ public final class FlattenClient { * } * * @param id The id parameter. - * @param request The request parameter. + * @param sendRequest The sendRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -74,8 +74,8 @@ public final class FlattenClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendWithResponse(String id, BinaryData request, RequestOptions requestOptions) { - return this.serviceClient.sendWithResponse(id, request, requestOptions); + public Response sendWithResponse(String id, BinaryData sendRequest, RequestOptions requestOptions) { + return this.serviceClient.sendWithResponse(id, sendRequest, requestOptions); } /** @@ -89,7 +89,7 @@ public Response sendWithResponse(String id, BinaryData request, RequestOpt * } * * @param id The id parameter. - * @param request The request parameter. + * @param sendProjectedNameRequest The sendProjectedNameRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -99,8 +99,9 @@ public Response sendWithResponse(String id, BinaryData request, RequestOpt */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendProjectedNameWithResponse(String id, BinaryData request, RequestOptions requestOptions) { - return this.serviceClient.sendProjectedNameWithResponse(id, request, requestOptions); + public Response sendProjectedNameWithResponse(String id, BinaryData sendProjectedNameRequest, + RequestOptions requestOptions) { + return this.serviceClient.sendProjectedNameWithResponse(id, sendProjectedNameRequest, requestOptions); } /** @@ -133,7 +134,7 @@ public Response sendProjectedNameWithResponse(String id, BinaryData reques * } * * @param name The name parameter. - * @param request The request parameter. + * @param sendLongRequest The sendLongRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -143,8 +144,8 @@ public Response sendProjectedNameWithResponse(String id, BinaryData reques */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendLongWithResponse(String name, BinaryData request, RequestOptions requestOptions) { - return this.serviceClient.sendLongWithResponse(name, request, requestOptions); + public Response sendLongWithResponse(String name, BinaryData sendLongRequest, RequestOptions requestOptions) { + return this.serviceClient.sendLongWithResponse(name, sendLongRequest, requestOptions); } /** @@ -177,7 +178,7 @@ public Response sendLongWithResponse(String name, BinaryData request, Requ * } * * @param id The id parameter. - * @param request The request parameter. + * @param updateRequest The updateRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -187,15 +188,15 @@ public Response sendLongWithResponse(String name, BinaryData request, Requ */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(long id, BinaryData request, RequestOptions requestOptions) { - return this.serviceClient.updateWithResponse(id, request, requestOptions); + public Response updateWithResponse(long id, BinaryData updateRequest, RequestOptions requestOptions) { + return this.serviceClient.updateWithResponse(id, updateRequest, requestOptions); } /** * The uploadFile operation. * * @param name The name parameter. - * @param request The request parameter. + * @param uploadFileRequest The uploadFileRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -205,16 +206,16 @@ public Response updateWithResponse(long id, BinaryData request, Requ */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Response uploadFileWithResponse(String name, BinaryData request, RequestOptions requestOptions) { + Response uploadFileWithResponse(String name, BinaryData uploadFileRequest, RequestOptions requestOptions) { // Protocol API requires serialization of parts with content-disposition and data, as operation 'uploadFile' is // 'multipart/form-data' - return this.serviceClient.uploadFileWithResponse(name, request, requestOptions); + return this.serviceClient.uploadFileWithResponse(name, uploadFileRequest, requestOptions); } /** * The uploadTodo operation. * - * @param request The request parameter. + * @param uploadTodoRequest The uploadTodoRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -224,10 +225,10 @@ Response uploadFileWithResponse(String name, BinaryData request, RequestOp */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Response uploadTodoWithResponse(BinaryData request, RequestOptions requestOptions) { + Response uploadTodoWithResponse(BinaryData uploadTodoRequest, RequestOptions requestOptions) { // Protocol API requires serialization of parts with content-disposition and data, as operation 'uploadTodo' is // 'multipart/form-data' - return this.serviceClient.uploadTodoWithResponse(request, requestOptions); + return this.serviceClient.uploadTodoWithResponse(uploadTodoRequest, requestOptions); } /** @@ -248,9 +249,9 @@ Response uploadTodoWithResponse(BinaryData request, RequestOptions request public void send(String id, String input, User user) { // Generated convenience method for sendWithResponse RequestOptions requestOptions = new RequestOptions(); - SendRequest requestObj = new SendRequest(input).setUser(user); - BinaryData request = BinaryData.fromObject(requestObj); - sendWithResponse(id, request, requestOptions).getValue(); + SendRequest sendRequestObj = new SendRequest(input).setUser(user); + BinaryData sendRequest = BinaryData.fromObject(sendRequestObj); + sendWithResponse(id, sendRequest, requestOptions).getValue(); } /** @@ -270,9 +271,9 @@ public void send(String id, String input, User user) { public void send(String id, String input) { // Generated convenience method for sendWithResponse RequestOptions requestOptions = new RequestOptions(); - SendRequest requestObj = new SendRequest(input); - BinaryData request = BinaryData.fromObject(requestObj); - sendWithResponse(id, request, requestOptions).getValue(); + SendRequest sendRequestObj = new SendRequest(input); + BinaryData sendRequest = BinaryData.fromObject(sendRequestObj); + sendWithResponse(id, sendRequest, requestOptions).getValue(); } /** @@ -292,9 +293,9 @@ public void send(String id, String input) { public void sendProjectedName(String id, String fileIdentifier) { // Generated convenience method for sendProjectedNameWithResponse RequestOptions requestOptions = new RequestOptions(); - SendProjectedNameRequest requestObj = new SendProjectedNameRequest(fileIdentifier); - BinaryData request = BinaryData.fromObject(requestObj); - sendProjectedNameWithResponse(id, request, requestOptions).getValue(); + SendProjectedNameRequest sendProjectedNameRequestObj = new SendProjectedNameRequest(fileIdentifier); + BinaryData sendProjectedNameRequest = BinaryData.fromObject(sendProjectedNameRequestObj); + sendProjectedNameWithResponse(id, sendProjectedNameRequest, requestOptions).getValue(); } /** @@ -315,7 +316,7 @@ public void sendLong(SendLongOptions options) { RequestOptions requestOptions = new RequestOptions(); String name = options.getName(); String filter = options.getFilter(); - SendLongRequest requestObj + SendLongRequest sendLongRequestObj = new SendLongRequest(options.getInput(), options.getDataInt(), options.getTitle(), options.getStatus()) .setUser(options.getUser()) .setDataIntOptional(options.getDataIntOptional()) @@ -323,18 +324,18 @@ public void sendLong(SendLongOptions options) { .setDataFloat(options.getDataFloat()) .setDescription(options.getDescription()) .setDummy(options.getDummy()); - BinaryData request = BinaryData.fromObject(requestObj); + BinaryData sendLongRequest = BinaryData.fromObject(sendLongRequestObj); if (filter != null) { requestOptions.addQueryParam("filter", filter, false); } - sendLongWithResponse(name, request, requestOptions).getValue(); + sendLongWithResponse(name, sendLongRequest, requestOptions).getValue(); } /** * The update operation. * * @param id The id parameter. - * @param request The request parameter. + * @param updateRequest The updateRequest parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -345,15 +346,15 @@ public void sendLong(SendLongOptions options) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public TodoItem update(long id, UpdatePatchRequest request) { + public TodoItem update(long id, UpdatePatchRequest updateRequest) { // Generated convenience method for updateWithResponse RequestOptions requestOptions = new RequestOptions(); - JsonMergePatchHelper.getUpdatePatchRequestAccessor().prepareModelForJsonMergePatch(request, true); - BinaryData requestInBinaryData = BinaryData.fromObject(request); + JsonMergePatchHelper.getUpdatePatchRequestAccessor().prepareModelForJsonMergePatch(updateRequest, true); + BinaryData updateRequestInBinaryData = BinaryData.fromObject(updateRequest); // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. - requestInBinaryData.getLength(); - JsonMergePatchHelper.getUpdatePatchRequestAccessor().prepareModelForJsonMergePatch(request, false); - return updateWithResponse(id, requestInBinaryData, requestOptions).getValue().toObject(TodoItem.class); + updateRequestInBinaryData.getLength(); + JsonMergePatchHelper.getUpdatePatchRequestAccessor().prepareModelForJsonMergePatch(updateRequest, false); + return updateWithResponse(id, updateRequestInBinaryData, requestOptions).getValue().toObject(TodoItem.class); } /** @@ -373,14 +374,14 @@ public TodoItem update(long id, UpdatePatchRequest request) { public void uploadFile(String name, FileDataFileDetails fileData) { // Generated convenience method for uploadFileWithResponse RequestOptions requestOptions = new RequestOptions(); - UploadFileRequest requestObj = new UploadFileRequest(fileData); - BinaryData request = new MultipartFormDataHelper(requestOptions) - .serializeFileField("file_data", requestObj.getFileData().getContent(), - requestObj.getFileData().getContentType(), requestObj.getFileData().getFilename()) - .serializeTextField("constant", requestObj.getConstant()) + UploadFileRequest uploadFileRequestObj = new UploadFileRequest(fileData); + BinaryData uploadFileRequest = new MultipartFormDataHelper(requestOptions) + .serializeFileField("file_data", uploadFileRequestObj.getFileData().getContent(), + uploadFileRequestObj.getFileData().getContentType(), uploadFileRequestObj.getFileData().getFilename()) + .serializeTextField("constant", uploadFileRequestObj.getConstant()) .end() .getRequestBody(); - uploadFileWithResponse(name, request, requestOptions).getValue(); + uploadFileWithResponse(name, uploadFileRequest, requestOptions).getValue(); } /** @@ -399,22 +400,22 @@ public void uploadFile(String name, FileDataFileDetails fileData) { public void uploadTodo(UploadTodoOptions options) { // Generated convenience method for uploadTodoWithResponse RequestOptions requestOptions = new RequestOptions(); - UploadTodoRequest requestObj + UploadTodoRequest uploadTodoRequestObj = new UploadTodoRequest(options.getTitle(), options.getStatus()).setDescription(options.getDescription()) .setDummy(options.getDummy()) .setProp1(options.getProp1()) .setProp2(options.getProp2()) .setProp3(options.getProp3()); - BinaryData request - = new MultipartFormDataHelper(requestOptions).serializeTextField("title", requestObj.getTitle()) - .serializeTextField("description", requestObj.getDescription()) - .serializeTextField("status", Objects.toString(requestObj.getStatus())) - .serializeTextField("_dummy", requestObj.getDummy()) - .serializeTextField("prop1", requestObj.getProp1()) - .serializeTextField("prop2", requestObj.getProp2()) - .serializeTextField("prop3", requestObj.getProp3()) + BinaryData uploadTodoRequest + = new MultipartFormDataHelper(requestOptions).serializeTextField("title", uploadTodoRequestObj.getTitle()) + .serializeTextField("description", uploadTodoRequestObj.getDescription()) + .serializeTextField("status", Objects.toString(uploadTodoRequestObj.getStatus())) + .serializeTextField("_dummy", uploadTodoRequestObj.getDummy()) + .serializeTextField("prop1", uploadTodoRequestObj.getProp1()) + .serializeTextField("prop2", uploadTodoRequestObj.getProp2()) + .serializeTextField("prop3", uploadTodoRequestObj.getProp3()) .end() .getRequestBody(); - uploadTodoWithResponse(request, requestOptions).getValue(); + uploadTodoWithResponse(uploadTodoRequest, requestOptions).getValue(); } } diff --git a/typespec-tests/src/main/java/com/cadl/flatten/implementation/FlattenClientImpl.java b/typespec-tests/src/main/java/com/cadl/flatten/implementation/FlattenClientImpl.java index 4fe8ec0071..4218ccb66c 100644 --- a/typespec-tests/src/main/java/com/cadl/flatten/implementation/FlattenClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/flatten/implementation/FlattenClientImpl.java @@ -46,11 +46,12 @@ public final class FlattenClientImpl { private final FlattenClientService service; /** + * Flatten. */ private final String endpoint; /** - * Gets. + * Gets Flatten. * * @return the endpoint value. */ @@ -103,7 +104,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of FlattenClient client. * - * @param endpoint + * @param endpoint Flatten. * @param serviceVersion Service version. */ public FlattenClientImpl(String endpoint, FlattenServiceVersion serviceVersion) { @@ -115,7 +116,7 @@ public FlattenClientImpl(String endpoint, FlattenServiceVersion serviceVersion) * Initializes an instance of FlattenClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint + * @param endpoint Flatten. * @param serviceVersion Service version. */ public FlattenClientImpl(HttpPipeline httpPipeline, String endpoint, FlattenServiceVersion serviceVersion) { @@ -127,7 +128,7 @@ public FlattenClientImpl(HttpPipeline httpPipeline, String endpoint, FlattenServ * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint + * @param endpoint Flatten. * @param serviceVersion Service version. */ public FlattenClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, @@ -152,8 +153,8 @@ public interface FlattenClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> send(@HostParam("endpoint") String endpoint, @QueryParam("id") String id, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData sendRequest, RequestOptions requestOptions, Context context); @Post("/flatten/send") @ExpectedResponses({ 200 }) @@ -162,8 +163,8 @@ Mono> send(@HostParam("endpoint") String endpoint, @QueryParam("i @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response sendSync(@HostParam("endpoint") String endpoint, @QueryParam("id") String id, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData sendRequest, RequestOptions requestOptions, Context context); @Post("/flatten/send-projected-name") @ExpectedResponses({ 200 }) @@ -172,8 +173,9 @@ Response sendSync(@HostParam("endpoint") String endpoint, @QueryParam("id" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> sendProjectedName(@HostParam("endpoint") String endpoint, @QueryParam("id") String id, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData sendProjectedNameRequest, RequestOptions requestOptions, + Context context); @Post("/flatten/send-projected-name") @ExpectedResponses({ 200 }) @@ -182,8 +184,9 @@ Mono> sendProjectedName(@HostParam("endpoint") String endpoint, @ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response sendProjectedNameSync(@HostParam("endpoint") String endpoint, @QueryParam("id") String id, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData sendProjectedNameRequest, RequestOptions requestOptions, + Context context); @Post("/flatten/send-long") @ExpectedResponses({ 200 }) @@ -192,8 +195,8 @@ Response sendProjectedNameSync(@HostParam("endpoint") String endpoint, @Qu @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> sendLong(@HostParam("endpoint") String endpoint, @QueryParam("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData sendLongRequest, RequestOptions requestOptions, Context context); @Post("/flatten/send-long") @ExpectedResponses({ 200 }) @@ -202,8 +205,8 @@ Mono> sendLong(@HostParam("endpoint") String endpoint, @QueryPara @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response sendLongSync(@HostParam("endpoint") String endpoint, @QueryParam("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData sendLongRequest, RequestOptions requestOptions, Context context); @Patch("/flatten/patch/{id}") @ExpectedResponses({ 200 }) @@ -212,8 +215,8 @@ Response sendLongSync(@HostParam("endpoint") String endpoint, @QueryParam( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> update(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @PathParam("id") long id, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData request, + @HeaderParam("content-type") String contentType, @PathParam("id") long id, + @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData updateRequest, RequestOptions requestOptions, Context context); @Patch("/flatten/patch/{id}") @@ -223,8 +226,8 @@ Mono> update(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response updateSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @PathParam("id") long id, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData request, + @HeaderParam("content-type") String contentType, @PathParam("id") long id, + @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData updateRequest, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -235,8 +238,9 @@ Response updateSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadFile(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("multipart/form-data") BinaryData request, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, + @BodyParam("multipart/form-data") BinaryData uploadFileRequest, RequestOptions requestOptions, + Context context); // @Multipart not supported by RestProxy @Post("/flatten/upload/{name}") @@ -246,8 +250,9 @@ Mono> uploadFile(@HostParam("endpoint") String endpoint, @PathPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadFileSync(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("multipart/form-data") BinaryData request, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, + @BodyParam("multipart/form-data") BinaryData uploadFileRequest, RequestOptions requestOptions, + Context context); // @Multipart not supported by RestProxy @Post("/flatten/upload-todo") @@ -257,8 +262,9 @@ Response uploadFileSync(@HostParam("endpoint") String endpoint, @PathParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadTodo(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("multipart/form-data") BinaryData request, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, + @BodyParam("multipart/form-data") BinaryData uploadTodoRequest, RequestOptions requestOptions, + Context context); // @Multipart not supported by RestProxy @Post("/flatten/upload-todo") @@ -268,8 +274,9 @@ Mono> uploadTodo(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadTodoSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("multipart/form-data") BinaryData request, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, + @BodyParam("multipart/form-data") BinaryData uploadTodoRequest, RequestOptions requestOptions, + Context context); } /** @@ -287,7 +294,7 @@ Response uploadTodoSync(@HostParam("endpoint") String endpoint, * } * * @param id The id parameter. - * @param request The request parameter. + * @param sendRequest The sendRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -296,10 +303,11 @@ Response uploadTodoSync(@HostParam("endpoint") String endpoint, * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendWithResponseAsync(String id, BinaryData request, RequestOptions requestOptions) { - final String accept = "application/json"; + public Mono> sendWithResponseAsync(String id, BinaryData sendRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; return FluxUtil.withContext(context -> service.send(this.getEndpoint(), id, - this.getServiceVersion().getVersion(), accept, request, requestOptions, context)); + this.getServiceVersion().getVersion(), contentType, sendRequest, requestOptions, context)); } /** @@ -317,7 +325,7 @@ public Mono> sendWithResponseAsync(String id, BinaryData request, * } * * @param id The id parameter. - * @param request The request parameter. + * @param sendRequest The sendRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -326,9 +334,9 @@ public Mono> sendWithResponseAsync(String id, BinaryData request, * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendWithResponse(String id, BinaryData request, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendSync(this.getEndpoint(), id, this.getServiceVersion().getVersion(), accept, request, + public Response sendWithResponse(String id, BinaryData sendRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + return service.sendSync(this.getEndpoint(), id, this.getServiceVersion().getVersion(), contentType, sendRequest, requestOptions, Context.NONE); } @@ -343,7 +351,7 @@ public Response sendWithResponse(String id, BinaryData request, RequestOpt * } * * @param id The id parameter. - * @param request The request parameter. + * @param sendProjectedNameRequest The sendProjectedNameRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -352,11 +360,11 @@ public Response sendWithResponse(String id, BinaryData request, RequestOpt * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendProjectedNameWithResponseAsync(String id, BinaryData request, + public Mono> sendProjectedNameWithResponseAsync(String id, BinaryData sendProjectedNameRequest, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.sendProjectedName(this.getEndpoint(), id, accept, request, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.sendProjectedName(this.getEndpoint(), id, contentType, + sendProjectedNameRequest, requestOptions, context)); } /** @@ -370,7 +378,7 @@ public Mono> sendProjectedNameWithResponseAsync(String id, Binary * } * * @param id The id parameter. - * @param request The request parameter. + * @param sendProjectedNameRequest The sendProjectedNameRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -379,9 +387,11 @@ public Mono> sendProjectedNameWithResponseAsync(String id, Binary * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendProjectedNameWithResponse(String id, BinaryData request, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendProjectedNameSync(this.getEndpoint(), id, accept, request, requestOptions, Context.NONE); + public Response sendProjectedNameWithResponse(String id, BinaryData sendProjectedNameRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; + return service.sendProjectedNameSync(this.getEndpoint(), id, contentType, sendProjectedNameRequest, + requestOptions, Context.NONE); } /** @@ -414,7 +424,7 @@ public Response sendProjectedNameWithResponse(String id, BinaryData reques * } * * @param name The name parameter. - * @param request The request parameter. + * @param sendLongRequest The sendLongRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -423,11 +433,11 @@ public Response sendProjectedNameWithResponse(String id, BinaryData reques * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendLongWithResponseAsync(String name, BinaryData request, + public Mono> sendLongWithResponseAsync(String name, BinaryData sendLongRequest, RequestOptions requestOptions) { - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil.withContext(context -> service.sendLong(this.getEndpoint(), name, - this.getServiceVersion().getVersion(), accept, request, requestOptions, context)); + this.getServiceVersion().getVersion(), contentType, sendLongRequest, requestOptions, context)); } /** @@ -460,7 +470,7 @@ public Mono> sendLongWithResponseAsync(String name, BinaryData re * } * * @param name The name parameter. - * @param request The request parameter. + * @param sendLongRequest The sendLongRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -469,10 +479,10 @@ public Mono> sendLongWithResponseAsync(String name, BinaryData re * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendLongWithResponse(String name, BinaryData request, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendLongSync(this.getEndpoint(), name, this.getServiceVersion().getVersion(), accept, request, - requestOptions, Context.NONE); + public Response sendLongWithResponse(String name, BinaryData sendLongRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + return service.sendLongSync(this.getEndpoint(), name, this.getServiceVersion().getVersion(), contentType, + sendLongRequest, requestOptions, Context.NONE); } /** @@ -505,7 +515,7 @@ public Response sendLongWithResponse(String name, BinaryData request, Requ * } * * @param id The id parameter. - * @param request The request parameter. + * @param updateRequest The updateRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -514,12 +524,12 @@ public Response sendLongWithResponse(String name, BinaryData request, Requ * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync(long id, BinaryData request, + public Mono> updateWithResponseAsync(long id, BinaryData updateRequest, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.update(this.getEndpoint(), contentType, id, accept, request, requestOptions, context)); + return FluxUtil.withContext(context -> service.update(this.getEndpoint(), contentType, id, accept, + updateRequest, requestOptions, context)); } /** @@ -552,7 +562,7 @@ public Mono> updateWithResponseAsync(long id, BinaryData re * } * * @param id The id parameter. - * @param request The request parameter. + * @param updateRequest The updateRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -561,17 +571,18 @@ public Mono> updateWithResponseAsync(long id, BinaryData re * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(long id, BinaryData request, RequestOptions requestOptions) { + public Response updateWithResponse(long id, BinaryData updateRequest, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; final String accept = "application/json"; - return service.updateSync(this.getEndpoint(), contentType, id, accept, request, requestOptions, Context.NONE); + return service.updateSync(this.getEndpoint(), contentType, id, accept, updateRequest, requestOptions, + Context.NONE); } /** * The uploadFile operation. * * @param name The name parameter. - * @param request The request parameter. + * @param uploadFileRequest The uploadFileRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -580,19 +591,18 @@ public Response updateWithResponse(long id, BinaryData request, Requ * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadFileWithResponseAsync(String name, BinaryData request, + public Mono> uploadFileWithResponseAsync(String name, BinaryData uploadFileRequest, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.uploadFile(this.getEndpoint(), name, contentType, accept, - request, requestOptions, context)); + return FluxUtil.withContext(context -> service.uploadFile(this.getEndpoint(), name, contentType, + uploadFileRequest, requestOptions, context)); } /** * The uploadFile operation. * * @param name The name parameter. - * @param request The request parameter. + * @param uploadFileRequest The uploadFileRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -601,17 +611,17 @@ public Mono> uploadFileWithResponseAsync(String name, BinaryData * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response uploadFileWithResponse(String name, BinaryData request, RequestOptions requestOptions) { + public Response uploadFileWithResponse(String name, BinaryData uploadFileRequest, + RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.uploadFileSync(this.getEndpoint(), name, contentType, accept, request, requestOptions, + return service.uploadFileSync(this.getEndpoint(), name, contentType, uploadFileRequest, requestOptions, Context.NONE); } /** * The uploadTodo operation. * - * @param request The request parameter. + * @param uploadTodoRequest The uploadTodoRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -620,17 +630,17 @@ public Response uploadFileWithResponse(String name, BinaryData request, Re * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadTodoWithResponseAsync(BinaryData request, RequestOptions requestOptions) { + public Mono> uploadTodoWithResponseAsync(BinaryData uploadTodoRequest, + RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; return FluxUtil.withContext( - context -> service.uploadTodo(this.getEndpoint(), contentType, accept, request, requestOptions, context)); + context -> service.uploadTodo(this.getEndpoint(), contentType, uploadTodoRequest, requestOptions, context)); } /** * The uploadTodo operation. * - * @param request The request parameter. + * @param uploadTodoRequest The uploadTodoRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -639,9 +649,8 @@ public Mono> uploadTodoWithResponseAsync(BinaryData request, Requ * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response uploadTodoWithResponse(BinaryData request, RequestOptions requestOptions) { + public Response uploadTodoWithResponse(BinaryData uploadTodoRequest, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.uploadTodoSync(this.getEndpoint(), contentType, accept, request, requestOptions, Context.NONE); + return service.uploadTodoSync(this.getEndpoint(), contentType, uploadTodoRequest, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/internal/InternalAsyncClient.java b/typespec-tests/src/main/java/com/cadl/internal/InternalAsyncClient.java index 37e040a125..5ef62eeb4d 100644 --- a/typespec-tests/src/main/java/com/cadl/internal/InternalAsyncClient.java +++ b/typespec-tests/src/main/java/com/cadl/internal/InternalAsyncClient.java @@ -17,9 +17,9 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; import com.cadl.internal.implementation.InternalOpsImpl; -import com.cadl.internal.implementation.models.ResponseInternal; import com.cadl.internal.models.ApiRequest; import com.cadl.internal.models.ApiResponse; +import com.cadl.internal.models.ResponseInternal; import reactor.core.publisher.Mono; /** @@ -72,7 +72,7 @@ public final class InternalAsyncClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono> postInternalWithResponse(BinaryData apiRequest, RequestOptions requestOptions) { + public Mono> postInternalWithResponse(BinaryData apiRequest, RequestOptions requestOptions) { return this.serviceClient.postInternalWithResponseAsync(apiRequest, requestOptions); } @@ -137,7 +137,7 @@ Mono> postProtocalInternalWithResponse(BinaryData body, RequestOp */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono postInternal(ApiRequest apiRequest) { + public Mono postInternal(ApiRequest apiRequest) { // Generated convenience method for postInternalWithResponse RequestOptions requestOptions = new RequestOptions(); return postInternalWithResponse(BinaryData.fromObject(apiRequest), requestOptions).flatMap(FluxUtil::toMono) diff --git a/typespec-tests/src/main/java/com/cadl/internal/InternalClient.java b/typespec-tests/src/main/java/com/cadl/internal/InternalClient.java index 0a879dadb2..83b8a458b3 100644 --- a/typespec-tests/src/main/java/com/cadl/internal/InternalClient.java +++ b/typespec-tests/src/main/java/com/cadl/internal/InternalClient.java @@ -16,9 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.cadl.internal.implementation.InternalOpsImpl; -import com.cadl.internal.implementation.models.ResponseInternal; import com.cadl.internal.models.ApiRequest; import com.cadl.internal.models.ApiResponse; +import com.cadl.internal.models.ResponseInternal; /** * Initializes a new instance of the synchronous InternalClient type. @@ -70,7 +70,7 @@ public final class InternalClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Response postInternalWithResponse(BinaryData apiRequest, RequestOptions requestOptions) { + public Response postInternalWithResponse(BinaryData apiRequest, RequestOptions requestOptions) { return this.serviceClient.postInternalWithResponse(apiRequest, requestOptions); } @@ -135,7 +135,7 @@ Response postProtocalInternalWithResponse(BinaryData body, RequestOptions */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - ResponseInternal postInternal(ApiRequest apiRequest) { + public ResponseInternal postInternal(ApiRequest apiRequest) { // Generated convenience method for postInternalWithResponse RequestOptions requestOptions = new RequestOptions(); return postInternalWithResponse(BinaryData.fromObject(apiRequest), requestOptions).getValue() diff --git a/typespec-tests/src/main/java/com/cadl/internal/implementation/InternalClientImpl.java b/typespec-tests/src/main/java/com/cadl/internal/implementation/InternalClientImpl.java index aa279b79f4..d7f1cee9ee 100644 --- a/typespec-tests/src/main/java/com/cadl/internal/implementation/InternalClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/internal/implementation/InternalClientImpl.java @@ -16,12 +16,12 @@ */ public final class InternalClientImpl { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public InternalOpsImpl getInternalOps() { /** * Initializes an instance of InternalClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public InternalClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public InternalClientImpl(String endpoint) { * Initializes an instance of InternalClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public InternalClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public InternalClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public InternalClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/internal/implementation/InternalOpsImpl.java b/typespec-tests/src/main/java/com/cadl/internal/implementation/InternalOpsImpl.java index 3f91c75c64..3da7a9f8f9 100644 --- a/typespec-tests/src/main/java/com/cadl/internal/implementation/InternalOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/internal/implementation/InternalOpsImpl.java @@ -66,8 +66,8 @@ public interface InternalOpsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> postInternal(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData apiRequest, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData apiRequest, RequestOptions requestOptions, Context context); @Post("/internal") @ExpectedResponses({ 200 }) @@ -76,8 +76,8 @@ Mono> postInternal(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response postInternalSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData apiRequest, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData apiRequest, RequestOptions requestOptions, Context context); @Get("/internal") @ExpectedResponses({ 200 }) @@ -86,7 +86,7 @@ Response postInternalSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getInternal(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/internal") @ExpectedResponses({ 200 }) @@ -95,7 +95,7 @@ Mono> getInternal(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getInternalSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/internal/protocal-internal") @ExpectedResponses({ 204 }) @@ -104,7 +104,7 @@ Response getInternalSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> postProtocalInternal(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/internal/protocal-internal") @@ -114,7 +114,7 @@ Mono> postProtocalInternal(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response postProtocalInternalSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -151,9 +151,10 @@ Response postProtocalInternalSync(@HostParam("endpoint") String endpoint, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postInternalWithResponseAsync(BinaryData apiRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postInternal(this.client.getEndpoint(), accept, apiRequest, requestOptions, context)); + return FluxUtil.withContext(context -> service.postInternal(this.client.getEndpoint(), contentType, accept, + apiRequest, requestOptions, context)); } /** @@ -188,8 +189,10 @@ public Mono> postInternalWithResponseAsync(BinaryData apiRe */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postInternalWithResponse(BinaryData apiRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.postInternalSync(this.client.getEndpoint(), accept, apiRequest, requestOptions, Context.NONE); + return service.postInternalSync(this.client.getEndpoint(), contentType, accept, apiRequest, requestOptions, + Context.NONE); } /** @@ -259,9 +262,9 @@ public Response getInternalWithResponse(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postProtocalInternalWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postProtocalInternal(this.client.getEndpoint(), accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.postProtocalInternal(this.client.getEndpoint(), contentType, + body, requestOptions, context)); } /** @@ -284,7 +287,8 @@ public Mono> postProtocalInternalWithResponseAsync(BinaryData bod */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postProtocalInternalWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.postProtocalInternalSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.postProtocalInternalSync(this.client.getEndpoint(), contentType, body, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/internal/implementation/models/ResponseInternal.java b/typespec-tests/src/main/java/com/cadl/internal/models/ResponseInternal.java similarity index 98% rename from typespec-tests/src/main/java/com/cadl/internal/implementation/models/ResponseInternal.java rename to typespec-tests/src/main/java/com/cadl/internal/models/ResponseInternal.java index 7e55a05a5d..d2a475e9f4 100644 --- a/typespec-tests/src/main/java/com/cadl/internal/implementation/models/ResponseInternal.java +++ b/typespec-tests/src/main/java/com/cadl/internal/models/ResponseInternal.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. -package com.cadl.internal.implementation.models; +package com.cadl.internal.models; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; diff --git a/typespec-tests/src/main/java/com/cadl/internal/implementation/models/ResponseInternalInner.java b/typespec-tests/src/main/java/com/cadl/internal/models/ResponseInternalInner.java similarity index 98% rename from typespec-tests/src/main/java/com/cadl/internal/implementation/models/ResponseInternalInner.java rename to typespec-tests/src/main/java/com/cadl/internal/models/ResponseInternalInner.java index 8e6b5cf0ad..c8ecd56401 100644 --- a/typespec-tests/src/main/java/com/cadl/internal/implementation/models/ResponseInternalInner.java +++ b/typespec-tests/src/main/java/com/cadl/internal/models/ResponseInternalInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. -package com.cadl.internal.implementation.models; +package com.cadl.internal.models; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; diff --git a/typespec-tests/src/main/java/com/cadl/literalservice/implementation/LiteralOpsImpl.java b/typespec-tests/src/main/java/com/cadl/literalservice/implementation/LiteralOpsImpl.java index 156f1f896b..86990b8608 100644 --- a/typespec-tests/src/main/java/com/cadl/literalservice/implementation/LiteralOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/literalservice/implementation/LiteralOpsImpl.java @@ -66,8 +66,9 @@ public interface LiteralOpsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> put(@HostParam("endpoint") String endpoint, - @QueryParam("literalParam") String literalParam, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData model, RequestOptions requestOptions, Context context); + @QueryParam("literalParam") String literalParam, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData model, + RequestOptions requestOptions, Context context); @Put("/literal/put") @ExpectedResponses({ 200 }) @@ -76,8 +77,9 @@ Mono> put(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response putSync(@HostParam("endpoint") String endpoint, - @QueryParam("literalParam") String literalParam, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData model, RequestOptions requestOptions, Context context); + @QueryParam("literalParam") String literalParam, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData model, + RequestOptions requestOptions, Context context); } /** @@ -119,9 +121,10 @@ Response putSync(@HostParam("endpoint") String endpoint, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData model, RequestOptions requestOptions) { final String literalParam = "literalParam"; + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.put(this.client.getEndpoint(), literalParam, accept, model, requestOptions, context)); + return FluxUtil.withContext(context -> service.put(this.client.getEndpoint(), literalParam, contentType, accept, + model, requestOptions, context)); } /** @@ -163,7 +166,9 @@ public Mono> putWithResponseAsync(BinaryData model, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData model, RequestOptions requestOptions) { final String literalParam = "literalParam"; + final String contentType = "application/json"; final String accept = "application/json"; - return service.putSync(this.client.getEndpoint(), literalParam, accept, model, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), literalParam, contentType, accept, model, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/literalservice/implementation/LiteralServiceClientImpl.java b/typespec-tests/src/main/java/com/cadl/literalservice/implementation/LiteralServiceClientImpl.java index a872510809..b0a0178bf1 100644 --- a/typespec-tests/src/main/java/com/cadl/literalservice/implementation/LiteralServiceClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/literalservice/implementation/LiteralServiceClientImpl.java @@ -16,12 +16,12 @@ */ public final class LiteralServiceClientImpl { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public LiteralOpsImpl getLiteralOps() { /** * Initializes an instance of LiteralServiceClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public LiteralServiceClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public LiteralServiceClientImpl(String endpoint) { * Initializes an instance of LiteralServiceClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public LiteralServiceClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public LiteralServiceClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public LiteralServiceClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/longrunning/LongRunningAsyncClient.java b/typespec-tests/src/main/java/com/cadl/longrunning/LongRunningAsyncClient.java index 20cac2bdb6..1a7edc2ceb 100644 --- a/typespec-tests/src/main/java/com/cadl/longrunning/LongRunningAsyncClient.java +++ b/typespec-tests/src/main/java/com/cadl/longrunning/LongRunningAsyncClient.java @@ -21,7 +21,6 @@ import com.cadl.longrunning.models.JobData; import com.cadl.longrunning.models.JobResult; import com.cadl.longrunning.models.JobResultResult; -import com.cadl.longrunning.models.PollResponse; import reactor.core.publisher.Mono; /** @@ -50,12 +49,12 @@ public final class LongRunningAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link Response} on successful completion of {@link Mono}. */ @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginLongRunning(RequestOptions requestOptions) { - return this.serviceClient.beginLongRunningAsync(requestOptions); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> longRunningWithResponse(RequestOptions requestOptions) { + return this.serviceClient.longRunningWithResponseAsync(requestOptions); } /** @@ -169,14 +168,14 @@ public PollerFlux beginCreateJob(BinaryData jobData, Req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return A {@link Mono} that completes when a successful response is received. */ @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginLongRunning() { - // Generated convenience method for beginLongRunningWithModel + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono longRunning() { + // Generated convenience method for longRunningWithResponse RequestOptions requestOptions = new RequestOptions(); - return serviceClient.beginLongRunningWithModelAsync(requestOptions); + return longRunningWithResponse(requestOptions).flatMap(FluxUtil::toMono); } /** diff --git a/typespec-tests/src/main/java/com/cadl/longrunning/LongRunningClient.java b/typespec-tests/src/main/java/com/cadl/longrunning/LongRunningClient.java index 0603a0a123..d6e58932c1 100644 --- a/typespec-tests/src/main/java/com/cadl/longrunning/LongRunningClient.java +++ b/typespec-tests/src/main/java/com/cadl/longrunning/LongRunningClient.java @@ -20,7 +20,6 @@ import com.cadl.longrunning.models.JobData; import com.cadl.longrunning.models.JobResult; import com.cadl.longrunning.models.JobResultResult; -import com.cadl.longrunning.models.PollResponse; /** * Initializes a new instance of the synchronous LongRunningClient type. @@ -48,12 +47,12 @@ public final class LongRunningClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link Response}. */ @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginLongRunning(RequestOptions requestOptions) { - return this.serviceClient.beginLongRunning(requestOptions); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response longRunningWithResponse(RequestOptions requestOptions) { + return this.serviceClient.longRunningWithResponse(requestOptions); } /** @@ -167,14 +166,13 @@ public SyncPoller beginCreateJob(BinaryData jobData, Req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. */ @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginLongRunning() { - // Generated convenience method for beginLongRunningWithModel + @ServiceMethod(returns = ReturnType.SINGLE) + public void longRunning() { + // Generated convenience method for longRunningWithResponse RequestOptions requestOptions = new RequestOptions(); - return serviceClient.beginLongRunningWithModel(requestOptions); + longRunningWithResponse(requestOptions).getValue(); } /** diff --git a/typespec-tests/src/main/java/com/cadl/longrunning/implementation/LongRunningClientImpl.java b/typespec-tests/src/main/java/com/cadl/longrunning/implementation/LongRunningClientImpl.java index eb6fd7fb33..a03e132f05 100644 --- a/typespec-tests/src/main/java/com/cadl/longrunning/implementation/LongRunningClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/longrunning/implementation/LongRunningClientImpl.java @@ -33,10 +33,8 @@ import com.azure.core.util.Context; import com.azure.core.util.DateTimeRfc1123; import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.DefaultPollingStrategy; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.PollingStrategyOptions; -import com.azure.core.util.polling.SyncDefaultPollingStrategy; import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; @@ -44,7 +42,6 @@ import com.cadl.longrunning.LongRunningServiceVersion; import com.cadl.longrunning.models.JobResult; import com.cadl.longrunning.models.JobResultResult; -import com.cadl.longrunning.models.PollResponse; import java.time.Duration; import java.time.OffsetDateTime; import java.util.UUID; @@ -60,12 +57,12 @@ public final class LongRunningClientImpl { private final LongRunningClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -118,7 +115,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of LongRunningClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public LongRunningClientImpl(String endpoint, LongRunningServiceVersion serviceVersion) { @@ -130,7 +127,7 @@ public LongRunningClientImpl(String endpoint, LongRunningServiceVersion serviceV * Initializes an instance of LongRunningClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public LongRunningClientImpl(HttpPipeline httpPipeline, String endpoint, LongRunningServiceVersion serviceVersion) { @@ -142,7 +139,7 @@ public LongRunningClientImpl(HttpPipeline httpPipeline, String endpoint, LongRun * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public LongRunningClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, @@ -167,8 +164,8 @@ public interface LongRunningClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> longRunning(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> longRunning(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Post("/long-running/post") @ExpectedResponses({ 202 }) @@ -176,8 +173,8 @@ Mono> longRunning(@HostParam("endpoint") String endpoint, @Header @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response longRunningSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response longRunningSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/long-running/jobs/{id}") @ExpectedResponses({ 200 }) @@ -187,7 +184,7 @@ Response longRunningSync(@HostParam("endpoint") String endpoint, @HeaderPa @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getJob(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("id") String id, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/long-running/jobs/{id}") @ExpectedResponses({ 200 }) @@ -197,7 +194,7 @@ Mono> getJob(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getJobSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("id") String id, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/long-running/jobs") @ExpectedResponses({ 202 }) @@ -206,8 +203,9 @@ Response getJobSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createJob(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData jobData, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData jobData, + RequestOptions requestOptions, Context context); @Post("/long-running/jobs") @ExpectedResponses({ 202 }) @@ -216,8 +214,9 @@ Mono> createJob(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createJobSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData jobData, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData jobData, + RequestOptions requestOptions, Context context); } /** @@ -231,10 +230,8 @@ Response createJobSync(@HostParam("endpoint") String endpoint, * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> longRunningWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.longRunning(this.getEndpoint(), accept, requestOptions, context)); + public Mono> longRunningWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil.withContext(context -> service.longRunning(this.getEndpoint(), requestOptions, context)); } /** @@ -248,93 +245,8 @@ private Mono> longRunningWithResponseAsync(RequestOptions request * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response longRunningWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.longRunningSync(this.getEndpoint(), accept, requestOptions, Context.NONE); - } - - /** - * The longRunning operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginLongRunningAsync(RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), () -> this.longRunningWithResponseAsync(requestOptions), - new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) - .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) - .setContext(requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE)), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * The longRunning operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginLongRunning(RequestOptions requestOptions) { - return SyncPoller.createPoller(Duration.ofSeconds(1), () -> this.longRunningWithResponse(requestOptions), - new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) - .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) - .setContext(requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE)), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * The longRunning operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginLongRunningWithModelAsync(RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), () -> this.longRunningWithResponseAsync(requestOptions), - new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) - .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) - .setContext(requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE)), - TypeReference.createInstance(PollResponse.class), TypeReference.createInstance(Void.class)); - } - - /** - * The longRunning operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginLongRunningWithModel(RequestOptions requestOptions) { - return SyncPoller.createPoller(Duration.ofSeconds(1), () -> this.longRunningWithResponse(requestOptions), - new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) - .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) - .setContext(requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE)), - TypeReference.createInstance(PollResponse.class), TypeReference.createInstance(Void.class)); + public Response longRunningWithResponse(RequestOptions requestOptions) { + return service.longRunningSync(this.getEndpoint(), requestOptions, Context.NONE); } /** @@ -481,6 +393,7 @@ public Response getJobWithResponse(String id, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createJobWithResponseAsync(BinaryData jobData, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; String repeatabilityRequestId = UUID.randomUUID().toString(); @@ -498,7 +411,7 @@ private Mono> createJobWithResponseAsync(BinaryData jobData } }); return FluxUtil.withContext(context -> service.createJob(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, jobData, requestOptionsLocal, context)); + this.getServiceVersion().getVersion(), contentType, accept, jobData, requestOptionsLocal, context)); } /** @@ -557,6 +470,7 @@ private Mono> createJobWithResponseAsync(BinaryData jobData */ @ServiceMethod(returns = ReturnType.SINGLE) private Response createJobWithResponse(BinaryData jobData, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; String repeatabilityRequestId = UUID.randomUUID().toString(); @@ -573,8 +487,8 @@ private Response createJobWithResponse(BinaryData jobData, RequestOp .set(HttpHeaderName.fromString("repeatability-first-sent"), repeatabilityFirstSent); } }); - return service.createJobSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, jobData, - requestOptionsLocal, Context.NONE); + return service.createJobSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept, + jobData, requestOptionsLocal, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/cadl/longrunning/models/LroOperationStatusError.java b/typespec-tests/src/main/java/com/cadl/longrunning/models/LroOperationStatusError.java new file mode 100644 index 0000000000..6604299687 --- /dev/null +++ b/typespec-tests/src/main/java/com/cadl/longrunning/models/LroOperationStatusError.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.cadl.longrunning.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.models.ResponseError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The LroOperationStatusError model. + */ +@Immutable +public final class LroOperationStatusError implements JsonSerializable { + /* + * The id property. + */ + @Generated + private String id; + + /* + * The status property. + */ + @Generated + private JobStatus status; + + /* + * The createdDateTime property. + */ + @Generated + private OffsetDateTime createdDateTime; + + /* + * The expirationDateTime property. + */ + @Generated + private OffsetDateTime expirationDateTime; + + /* + * The lastUpdateDateTime property. + */ + @Generated + private OffsetDateTime lastUpdateDateTime; + + /* + * The error property. + */ + @Generated + private ResponseError error; + + /** + * Creates an instance of LroOperationStatusError class. + */ + @Generated + private LroOperationStatusError() { + } + + /** + * Get the id property: The id property. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the status property: The status property. + * + * @return the status value. + */ + @Generated + public JobStatus getStatus() { + return this.status; + } + + /** + * Get the createdDateTime property: The createdDateTime property. + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the expirationDateTime property: The expirationDateTime property. + * + * @return the expirationDateTime value. + */ + @Generated + public OffsetDateTime getExpirationDateTime() { + return this.expirationDateTime; + } + + /** + * Get the lastUpdateDateTime property: The lastUpdateDateTime property. + * + * @return the lastUpdateDateTime value. + */ + @Generated + public OffsetDateTime getLastUpdateDateTime() { + return this.lastUpdateDateTime; + } + + /** + * Get the error property: The error property. + * + * @return the error value. + */ + @Generated + public ResponseError getError() { + return this.error; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LroOperationStatusError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LroOperationStatusError if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LroOperationStatusError. + */ + @Generated + public static LroOperationStatusError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LroOperationStatusError deserializedLroOperationStatusError = new LroOperationStatusError(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLroOperationStatusError.id = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedLroOperationStatusError.status = JobStatus.fromString(reader.getString()); + } else if ("createdDateTime".equals(fieldName)) { + deserializedLroOperationStatusError.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("expirationDateTime".equals(fieldName)) { + deserializedLroOperationStatusError.expirationDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastUpdateDateTime".equals(fieldName)) { + deserializedLroOperationStatusError.lastUpdateDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("error".equals(fieldName)) { + deserializedLroOperationStatusError.error = ResponseError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLroOperationStatusError; + }); + } +} diff --git a/typespec-tests/src/main/java/com/cadl/model/implementation/ModelClientImpl.java b/typespec-tests/src/main/java/com/cadl/model/implementation/ModelClientImpl.java index 82b8db3db3..9063724024 100644 --- a/typespec-tests/src/main/java/com/cadl/model/implementation/ModelClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/model/implementation/ModelClientImpl.java @@ -16,12 +16,12 @@ */ public final class ModelClientImpl { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public ModelOpsImpl getModelOps() { /** * Initializes an instance of ModelClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public ModelClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public ModelClientImpl(String endpoint) { * Initializes an instance of ModelClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public ModelClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public ModelClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public ModelClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/model/implementation/ModelOpsImpl.java b/typespec-tests/src/main/java/com/cadl/model/implementation/ModelOpsImpl.java index b21c38e620..a9173a6cc1 100644 --- a/typespec-tests/src/main/java/com/cadl/model/implementation/ModelOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/model/implementation/ModelOpsImpl.java @@ -64,7 +64,8 @@ public interface ModelOpsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put1(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> put1(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/model/resource1") @@ -73,7 +74,8 @@ Mono> put1(@HostParam("endpoint") String endpoint, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response put1Sync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response put1Sync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/model/resource2") @@ -82,7 +84,8 @@ Response put1Sync(@HostParam("endpoint") String endpoint, @HeaderPar @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put2(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> put2(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/model/resource2") @@ -91,7 +94,8 @@ Mono> put2(@HostParam("endpoint") String endpoint, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response put2Sync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response put2Sync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/model/resource3") @@ -100,7 +104,7 @@ Response put2Sync(@HostParam("endpoint") String endpoint, @HeaderPar @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get3(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> get3(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/model/resource3") @@ -109,7 +113,7 @@ Mono> get3(@HostParam("endpoint") String endpoint, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response get3Sync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response get3Sync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/model/nested") @@ -119,8 +123,8 @@ Response get3Sync(@HostParam("endpoint") String endpoint, @HeaderPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> putNested(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/model/nested") @ExpectedResponses({ 200 }) @@ -128,7 +132,8 @@ Mono> putNested(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putNestedSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response putNestedSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -172,9 +177,10 @@ Response putNestedSync(@HostParam("endpoint") String endpoint, @Head */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put1WithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.put1(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.put1(this.client.getEndpoint(), contentType, accept, body, requestOptions, context)); } /** @@ -217,8 +223,9 @@ public Mono> put1WithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response put1WithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.put1Sync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.put1Sync(this.client.getEndpoint(), contentType, accept, body, requestOptions, Context.NONE); } /** @@ -255,9 +262,10 @@ public Response put1WithResponse(BinaryData body, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put2WithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.put2(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.put2(this.client.getEndpoint(), contentType, accept, body, requestOptions, context)); } /** @@ -294,8 +302,9 @@ public Mono> put2WithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response put2WithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.put2Sync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.put2Sync(this.client.getEndpoint(), contentType, accept, body, requestOptions, Context.NONE); } /** @@ -387,9 +396,10 @@ public Response get3WithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNestedWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putNested(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.putNested(this.client.getEndpoint(), contentType, accept, body, + requestOptions, context)); } /** @@ -428,7 +438,9 @@ public Mono> putNestedWithResponseAsync(BinaryData body, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putNestedWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.putNestedSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.putNestedSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/MultiContentTypesClientImpl.java b/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/MultiContentTypesClientImpl.java index 085ee0e108..cf7ce9bb35 100644 --- a/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/MultiContentTypesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/MultiContentTypesClientImpl.java @@ -42,12 +42,12 @@ public final class MultiContentTypesClientImpl { private final MultiContentTypesClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -114,7 +114,7 @@ public MultipleContentTypesOnRequestsImpl getMultipleContentTypesOnRequests() { /** * Initializes an instance of MultiContentTypesClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public MultiContentTypesClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -125,7 +125,7 @@ public MultiContentTypesClientImpl(String endpoint) { * Initializes an instance of MultiContentTypesClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public MultiContentTypesClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -136,7 +136,7 @@ public MultiContentTypesClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public MultiContentTypesClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { @@ -163,8 +163,8 @@ public interface MultiContentTypesClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadWithOverload(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData data, + RequestOptions requestOptions, Context context); @Post("/upload/overload/multi-body-types") @ExpectedResponses({ 204 }) @@ -173,8 +173,8 @@ Mono> uploadWithOverload(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadWithOverloadSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData data, + RequestOptions requestOptions, Context context); } /** @@ -198,9 +198,8 @@ Response uploadWithOverloadSync(@HostParam("endpoint") String endpoint, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> uploadWithOverloadWithResponseAsync(String contentType, BinaryData data, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.uploadWithOverload(this.getEndpoint(), contentType, accept, data, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.uploadWithOverload(this.getEndpoint(), contentType, data, requestOptions, context)); } /** @@ -224,8 +223,6 @@ public Mono> uploadWithOverloadWithResponseAsync(String contentTy @ServiceMethod(returns = ReturnType.SINGLE) public Response uploadWithOverloadWithResponse(String contentType, BinaryData data, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.uploadWithOverloadSync(this.getEndpoint(), contentType, accept, data, requestOptions, - Context.NONE); + return service.uploadWithOverloadSync(this.getEndpoint(), contentType, data, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/MultipleContentTypesOnRequestsImpl.java b/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/MultipleContentTypesOnRequestsImpl.java index 46b7d1cc06..71562025f5 100644 --- a/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/MultipleContentTypesOnRequestsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/MultipleContentTypesOnRequestsImpl.java @@ -65,8 +65,8 @@ public interface MultipleContentTypesOnRequestsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadBytesWithSingleBodyTypeForMultiContentTypes(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData data, + RequestOptions requestOptions, Context context); @Post("/multiple/sharedroute/request/upload/single-body-type") @ExpectedResponses({ 204 }) @@ -75,8 +75,8 @@ Mono> uploadBytesWithSingleBodyTypeForMultiContentTypes(@HostPara @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadBytesWithSingleBodyTypeForMultiContentTypesSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData data, + RequestOptions requestOptions, Context context); @Post("/multiple/sharedroute/request/upload/multi-body-types") @ExpectedResponses({ 204 }) @@ -85,8 +85,8 @@ Response uploadBytesWithSingleBodyTypeForMultiContentTypesSync(@HostParam( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadBytesWithMultiBodyTypesForMultiContentTypes(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData data, + RequestOptions requestOptions, Context context); @Post("/multiple/sharedroute/request/upload/multi-body-types") @ExpectedResponses({ 204 }) @@ -95,8 +95,8 @@ Mono> uploadBytesWithMultiBodyTypesForMultiContentTypes(@HostPara @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadBytesWithMultiBodyTypesForMultiContentTypesSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData data, + RequestOptions requestOptions, Context context); @Post("/multiple/sharedroute/request/upload/multi-body-types") @ExpectedResponses({ 204 }) @@ -105,8 +105,8 @@ Response uploadBytesWithMultiBodyTypesForMultiContentTypesSync(@HostParam( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadJsonWithMultiBodyTypesForMultiContentTypes(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData data, + RequestOptions requestOptions, Context context); @Post("/multiple/sharedroute/request/upload/multi-body-types") @ExpectedResponses({ 204 }) @@ -115,8 +115,8 @@ Mono> uploadJsonWithMultiBodyTypesForMultiContentTypes(@HostParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadJsonWithMultiBodyTypesForMultiContentTypesSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData data, + RequestOptions requestOptions, Context context); @Post("/multiple/sharedroute/request/upload/multi-body-types") @ExpectedResponses({ 204 }) @@ -125,9 +125,8 @@ Response uploadJsonWithMultiBodyTypesForMultiContentTypesSync(@HostParam(" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadJsonOrBytesWithMultiBodyTypesForMultiContentTypes( - @HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData data, - RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); @Post("/multiple/sharedroute/request/upload/multi-body-types") @ExpectedResponses({ 204 }) @@ -136,9 +135,8 @@ Mono> uploadJsonOrBytesWithMultiBodyTypesForMultiContentTypes( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadJsonOrBytesWithMultiBodyTypesForMultiContentTypesSync( - @HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData data, - RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); } /** @@ -162,10 +160,9 @@ Response uploadJsonOrBytesWithMultiBodyTypesForMultiContentTypesSync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono> uploadBytesWithSingleBodyTypeForMultiContentTypesWithResponseAsync(String contentType, BinaryData data, RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil .withContext(context -> service.uploadBytesWithSingleBodyTypeForMultiContentTypes(this.client.getEndpoint(), - contentType, accept, data, requestOptions, context)); + contentType, data, requestOptions, context)); } /** @@ -189,9 +186,8 @@ public Mono> uploadBytesWithSingleBodyTypeForMultiContentTypesWit @ServiceMethod(returns = ReturnType.SINGLE) public Response uploadBytesWithSingleBodyTypeForMultiContentTypesWithResponse(String contentType, BinaryData data, RequestOptions requestOptions) { - final String accept = "application/json"; return service.uploadBytesWithSingleBodyTypeForMultiContentTypesSync(this.client.getEndpoint(), contentType, - accept, data, requestOptions, Context.NONE); + data, requestOptions, Context.NONE); } /** @@ -215,10 +211,9 @@ public Response uploadBytesWithSingleBodyTypeForMultiContentTypesWithRespo @ServiceMethod(returns = ReturnType.SINGLE) public Mono> uploadBytesWithMultiBodyTypesForMultiContentTypesWithResponseAsync(String contentType, BinaryData data, RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil .withContext(context -> service.uploadBytesWithMultiBodyTypesForMultiContentTypes(this.client.getEndpoint(), - contentType, accept, data, requestOptions, context)); + contentType, data, requestOptions, context)); } /** @@ -242,9 +237,8 @@ public Mono> uploadBytesWithMultiBodyTypesForMultiContentTypesWit @ServiceMethod(returns = ReturnType.SINGLE) public Response uploadBytesWithMultiBodyTypesForMultiContentTypesWithResponse(String contentType, BinaryData data, RequestOptions requestOptions) { - final String accept = "application/json"; return service.uploadBytesWithMultiBodyTypesForMultiContentTypesSync(this.client.getEndpoint(), contentType, - accept, data, requestOptions, Context.NONE); + data, requestOptions, Context.NONE); } /** @@ -270,10 +264,9 @@ public Response uploadBytesWithMultiBodyTypesForMultiContentTypesWithRespo public Mono> uploadJsonWithMultiBodyTypesForMultiContentTypesWithResponseAsync(BinaryData data, RequestOptions requestOptions) { final String contentType = "application/json"; - final String accept = "application/json"; return FluxUtil .withContext(context -> service.uploadJsonWithMultiBodyTypesForMultiContentTypes(this.client.getEndpoint(), - contentType, accept, data, requestOptions, context)); + contentType, data, requestOptions, context)); } /** @@ -299,9 +292,8 @@ public Mono> uploadJsonWithMultiBodyTypesForMultiContentTypesWith public Response uploadJsonWithMultiBodyTypesForMultiContentTypesWithResponse(BinaryData data, RequestOptions requestOptions) { final String contentType = "application/json"; - final String accept = "application/json"; return service.uploadJsonWithMultiBodyTypesForMultiContentTypesSync(this.client.getEndpoint(), contentType, - accept, data, requestOptions, Context.NONE); + data, requestOptions, Context.NONE); } /** @@ -325,9 +317,8 @@ public Response uploadJsonWithMultiBodyTypesForMultiContentTypesWithRespon @ServiceMethod(returns = ReturnType.SINGLE) public Mono> uploadJsonOrBytesWithMultiBodyTypesForMultiContentTypesWithResponseAsync( String contentType, BinaryData data, RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext(context -> service.uploadJsonOrBytesWithMultiBodyTypesForMultiContentTypes( - this.client.getEndpoint(), contentType, accept, data, requestOptions, context)); + this.client.getEndpoint(), contentType, data, requestOptions, context)); } /** @@ -351,8 +342,7 @@ public Mono> uploadJsonOrBytesWithMultiBodyTypesForMultiContentTy @ServiceMethod(returns = ReturnType.SINGLE) public Response uploadJsonOrBytesWithMultiBodyTypesForMultiContentTypesWithResponse(String contentType, BinaryData data, RequestOptions requestOptions) { - final String accept = "application/json"; return service.uploadJsonOrBytesWithMultiBodyTypesForMultiContentTypesSync(this.client.getEndpoint(), - contentType, accept, data, requestOptions, Context.NONE); + contentType, data, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/SingleContentTypesImpl.java b/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/SingleContentTypesImpl.java index cb4163656d..5ed3adbc93 100644 --- a/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/SingleContentTypesImpl.java +++ b/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/SingleContentTypesImpl.java @@ -66,7 +66,7 @@ public interface SingleContentTypesService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> downloadImageForSingleContentType(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/single/request/download/image") @ExpectedResponses({ 200 }) @@ -75,7 +75,7 @@ Mono> downloadImageForSingleContentType(@HostParam("endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response downloadImageForSingleContentTypeSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/single/request/upload/image") @ExpectedResponses({ 204 }) @@ -84,8 +84,8 @@ Response downloadImageForSingleContentTypeSync(@HostParam("endpoint" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadImageForSingleContentType(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("image/png") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("image/png") BinaryData data, + RequestOptions requestOptions, Context context); @Post("/single/request/upload/image") @ExpectedResponses({ 204 }) @@ -94,8 +94,8 @@ Mono> uploadImageForSingleContentType(@HostParam("endpoint") Stri @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadImageForSingleContentTypeSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("image/png") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("image/png") BinaryData data, + RequestOptions requestOptions, Context context); } /** @@ -163,9 +163,8 @@ public Response downloadImageForSingleContentTypeWithResponse(Reques public Mono> uploadImageForSingleContentTypeWithResponseAsync(BinaryData data, RequestOptions requestOptions) { final String contentType = "image/png"; - final String accept = "application/json"; return FluxUtil.withContext(context -> service.uploadImageForSingleContentType(this.client.getEndpoint(), - contentType, accept, data, requestOptions, context)); + contentType, data, requestOptions, context)); } /** @@ -187,8 +186,7 @@ public Mono> uploadImageForSingleContentTypeWithResponseAsync(Bin @ServiceMethod(returns = ReturnType.SINGLE) public Response uploadImageForSingleContentTypeWithResponse(BinaryData data, RequestOptions requestOptions) { final String contentType = "image/png"; - final String accept = "application/json"; - return service.uploadImageForSingleContentTypeSync(this.client.getEndpoint(), contentType, accept, data, - requestOptions, Context.NONE); + return service.uploadImageForSingleContentTypeSync(this.client.getEndpoint(), contentType, data, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/multipart/implementation/MultipartClientImpl.java b/typespec-tests/src/main/java/com/cadl/multipart/implementation/MultipartClientImpl.java index 853c9204e5..d4fa9a6181 100644 --- a/typespec-tests/src/main/java/com/cadl/multipart/implementation/MultipartClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/multipart/implementation/MultipartClientImpl.java @@ -43,12 +43,12 @@ public final class MultipartClientImpl { private final MultipartClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -87,7 +87,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of MultipartClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public MultipartClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -98,7 +98,7 @@ public MultipartClientImpl(String endpoint) { * Initializes an instance of MultipartClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public MultipartClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -109,7 +109,7 @@ public MultipartClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public MultipartClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; @@ -133,8 +133,8 @@ public interface MultipartClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> upload(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("multipart/form-data") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData data, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/upload/images/{name}") @@ -144,8 +144,8 @@ Mono> upload(@HostParam("endpoint") String endpoint, @PathParam(" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadSync(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("multipart/form-data") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData data, + RequestOptions requestOptions, Context context); } /** @@ -170,9 +170,8 @@ Response uploadSync(@HostParam("endpoint") String endpoint, @PathParam("na @ServiceMethod(returns = ReturnType.SINGLE) public Mono> uploadWithResponseAsync(String name, BinaryData data, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; return FluxUtil.withContext( - context -> service.upload(this.getEndpoint(), name, contentType, accept, data, requestOptions, context)); + context -> service.upload(this.getEndpoint(), name, contentType, data, requestOptions, context)); } /** @@ -197,7 +196,6 @@ public Mono> uploadWithResponseAsync(String name, BinaryData data @ServiceMethod(returns = ReturnType.SINGLE) public Response uploadWithResponse(String name, BinaryData data, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.uploadSync(this.getEndpoint(), name, contentType, accept, data, requestOptions, Context.NONE); + return service.uploadSync(this.getEndpoint(), name, contentType, data, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/FirstClientImpl.java b/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/FirstClientImpl.java index bf980a08cd..72350c4d9d 100644 --- a/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/FirstClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/FirstClientImpl.java @@ -44,12 +44,12 @@ public final class FirstClientImpl { private final FirstClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -102,7 +102,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of FirstClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public FirstClientImpl(String endpoint, FirstServiceVersion serviceVersion) { @@ -114,7 +114,7 @@ public FirstClientImpl(String endpoint, FirstServiceVersion serviceVersion) { * Initializes an instance of FirstClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public FirstClientImpl(HttpPipeline httpPipeline, String endpoint, FirstServiceVersion serviceVersion) { @@ -126,7 +126,7 @@ public FirstClientImpl(HttpPipeline httpPipeline, String endpoint, FirstServiceV * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public FirstClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, @@ -152,7 +152,7 @@ public interface FirstClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/client1/resources/{name}") @ExpectedResponses({ 200 }) @@ -162,7 +162,7 @@ Mono> get(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** diff --git a/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/NoApiVersionClientImpl.java b/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/NoApiVersionClientImpl.java index 12ebd54b91..bd0eb8a1b1 100644 --- a/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/NoApiVersionClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/NoApiVersionClientImpl.java @@ -5,7 +5,6 @@ package com.cadl.multipleapiversion.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -41,12 +40,12 @@ public final class NoApiVersionClientImpl { private final NoApiVersionClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -99,7 +98,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of NoApiVersionClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public NoApiVersionClientImpl(String endpoint, NoApiVersionServiceVersion serviceVersion) { @@ -111,7 +110,7 @@ public NoApiVersionClientImpl(String endpoint, NoApiVersionServiceVersion servic * Initializes an instance of NoApiVersionClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public NoApiVersionClientImpl(HttpPipeline httpPipeline, String endpoint, @@ -124,7 +123,7 @@ public NoApiVersionClientImpl(HttpPipeline httpPipeline, String endpoint, * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public NoApiVersionClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, @@ -150,8 +149,8 @@ public interface NoApiVersionClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> action(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> action(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Post("/client3") @ExpectedResponses({ 200 }) @@ -159,8 +158,8 @@ Mono> action(@HostParam("endpoint") String endpoint, @HeaderParam @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response actionSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response actionSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); } /** @@ -182,8 +181,7 @@ Response actionSync(@HostParam("endpoint") String endpoint, @HeaderParam(" */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> actionWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.action(this.getEndpoint(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.action(this.getEndpoint(), requestOptions, context)); } /** @@ -205,7 +203,6 @@ public Mono> actionWithResponseAsync(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response actionWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.actionSync(this.getEndpoint(), accept, requestOptions, Context.NONE); + return service.actionSync(this.getEndpoint(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/SecondClientImpl.java b/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/SecondClientImpl.java index 71cbdd9fb9..0e29c7149b 100644 --- a/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/SecondClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/SecondClientImpl.java @@ -44,12 +44,12 @@ public final class SecondClientImpl { private final SecondClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -102,7 +102,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of SecondClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public SecondClientImpl(String endpoint, SecondServiceVersion serviceVersion) { @@ -114,7 +114,7 @@ public SecondClientImpl(String endpoint, SecondServiceVersion serviceVersion) { * Initializes an instance of SecondClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public SecondClientImpl(HttpPipeline httpPipeline, String endpoint, SecondServiceVersion serviceVersion) { @@ -126,7 +126,7 @@ public SecondClientImpl(HttpPipeline httpPipeline, String endpoint, SecondServic * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public SecondClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, @@ -152,7 +152,7 @@ public interface SecondClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/client2/resources/{name}") @ExpectedResponses({ 200 }) @@ -162,7 +162,7 @@ Mono> get(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** diff --git a/typespec-tests/src/main/java/com/cadl/naming/NamingAsyncClient.java b/typespec-tests/src/main/java/com/cadl/naming/NamingAsyncClient.java index c9e45422e9..552ae12c97 100644 --- a/typespec-tests/src/main/java/com/cadl/naming/NamingAsyncClient.java +++ b/typespec-tests/src/main/java/com/cadl/naming/NamingAsyncClient.java @@ -87,9 +87,7 @@ public final class NamingAsyncClient { * @param name summary of name query parameter * * description of name query parameter. - * @param dataRequest summary of Request - * - * description of Request. + * @param dataRequest The dataRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -135,9 +133,7 @@ public Mono> getAnonymousWithResponse(RequestOptions reques * @param name summary of name query parameter * * description of name query parameter. - * @param dataRequest summary of Request - * - * description of Request. + * @param dataRequest The dataRequest parameter. * @param etag summary of etag header parameter * * description of etag header parameter. @@ -169,9 +165,7 @@ public Mono post(String name, DataRequest dataRequest, String etag * @param name summary of name query parameter * * description of name query parameter. - * @param dataRequest summary of Request - * - * description of Request. + * @param dataRequest The dataRequest parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. diff --git a/typespec-tests/src/main/java/com/cadl/naming/NamingClient.java b/typespec-tests/src/main/java/com/cadl/naming/NamingClient.java index f882696956..6d92c73695 100644 --- a/typespec-tests/src/main/java/com/cadl/naming/NamingClient.java +++ b/typespec-tests/src/main/java/com/cadl/naming/NamingClient.java @@ -43,7 +43,7 @@ public final class NamingClient { * Protocol method for POST operation. * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @param dataRequest summary of Request + * @param dataRequest The dataRequest parameter. * @param name summary of name query parameter * @return summary of Response along with {@link Response}. * @throws ResourceModifiedException ResourceModifiedException thrown if the request is rejected by server on status @@ -91,9 +91,7 @@ public Response getAnonymousWithResponse(RequestOptions requestOptio * @param name summary of name query parameter * * description of name query parameter. - * @param dataRequest summary of Request - * - * description of Request. + * @param dataRequest The dataRequest parameter. * @param etag summary of etag header parameter * * description of etag header parameter. @@ -125,9 +123,7 @@ public DataResponse post(String name, DataRequest dataRequest, String etag) { * @param name summary of name query parameter * * description of name query parameter. - * @param dataRequest summary of Request - * - * description of Request. + * @param dataRequest The dataRequest parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. diff --git a/typespec-tests/src/main/java/com/cadl/naming/implementation/NamingClientImpl.java b/typespec-tests/src/main/java/com/cadl/naming/implementation/NamingClientImpl.java index 0c0c5b717d..e45bea2aea 100644 --- a/typespec-tests/src/main/java/com/cadl/naming/implementation/NamingClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/naming/implementation/NamingClientImpl.java @@ -16,12 +16,12 @@ */ public final class NamingClientImpl { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public NamingOpsImpl getNamingOps() { /** * Initializes an instance of NamingClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public NamingClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public NamingClientImpl(String endpoint) { * Initializes an instance of NamingClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public NamingClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public NamingClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public NamingClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/naming/implementation/NamingOpsImpl.java b/typespec-tests/src/main/java/com/cadl/naming/implementation/NamingOpsImpl.java index 7cb9e84888..52d17e3161 100644 --- a/typespec-tests/src/main/java/com/cadl/naming/implementation/NamingOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/naming/implementation/NamingOpsImpl.java @@ -67,8 +67,8 @@ public interface NamingOpsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> post(@HostParam("endpoint") String endpoint, @QueryParam("name") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData dataRequest, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData dataRequest, RequestOptions requestOptions, Context context); @Post("/naming") @ExpectedResponses({ 200 }) @@ -77,8 +77,8 @@ Mono> post(@HostParam("endpoint") String endpoint, @QueryPa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response postSync(@HostParam("endpoint") String endpoint, @QueryParam("name") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData dataRequest, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData dataRequest, RequestOptions requestOptions, Context context); @Get("/naming") @ExpectedResponses({ 200 }) @@ -87,7 +87,7 @@ Response postSync(@HostParam("endpoint") String endpoint, @QueryPara @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getAnonymous(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/naming") @ExpectedResponses({ 200 }) @@ -96,7 +96,7 @@ Mono> getAnonymous(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getAnonymousSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -145,9 +145,7 @@ Response getAnonymousSync(@HostParam("endpoint") String endpoint, * @param name summary of name query parameter * * description of name query parameter. - * @param dataRequest summary of Request - * - * description of Request. + * @param dataRequest The dataRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -158,9 +156,10 @@ Response getAnonymousSync(@HostParam("endpoint") String endpoint, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postWithResponseAsync(String name, BinaryData dataRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.post(this.client.getEndpoint(), name, accept, dataRequest, requestOptions, context)); + return FluxUtil.withContext(context -> service.post(this.client.getEndpoint(), name, contentType, accept, + dataRequest, requestOptions, context)); } /** @@ -209,9 +208,7 @@ public Mono> postWithResponseAsync(String name, BinaryData * @param name summary of name query parameter * * description of name query parameter. - * @param dataRequest summary of Request - * - * description of Request. + * @param dataRequest The dataRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -221,8 +218,10 @@ public Mono> postWithResponseAsync(String name, BinaryData */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postWithResponse(String name, BinaryData dataRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.postSync(this.client.getEndpoint(), name, accept, dataRequest, requestOptions, Context.NONE); + return service.postSync(this.client.getEndpoint(), name, contentType, accept, dataRequest, requestOptions, + Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/cadl/optional/OptionalAsyncClient.java b/typespec-tests/src/main/java/com/cadl/optional/OptionalAsyncClient.java deleted file mode 100644 index 4222b964b2..0000000000 --- a/typespec-tests/src/main/java/com/cadl/optional/OptionalAsyncClient.java +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.cadl.optional; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.FluxUtil; -import com.cadl.optional.implementation.OptionalOpsImpl; -import com.cadl.optional.models.AllPropertiesOptional; -import com.cadl.optional.models.Optional; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the asynchronous OptionalClient type. - */ -@ServiceClient(builder = OptionalClientBuilder.class, isAsync = true) -public final class OptionalAsyncClient { - @Generated - private final OptionalOpsImpl serviceClient; - - /** - * Initializes an instance of OptionalAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - OptionalAsyncClient(OptionalOpsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The put operation. - *

Query Parameters

- * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
booleanNullableBooleanNoThe booleanNullable parameter
stringStringNoThe string parameter
stringNullableStringNoThe stringNullable parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Header Parameters

- * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
request-header-optionalStringNoThe requestHeaderOptional parameter
- * You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * - *
{@code
-     * {
-     *     boolean: Boolean (Optional)
-     *     booleanNullable: Boolean (Optional)
-     *     booleanRequired: boolean (Required)
-     *     booleanRequiredNullable: Boolean (Required)
-     *     string: String (Optional)
-     *     stringNullable: String (Optional)
-     *     stringRequired: String (Required)
-     *     stringRequiredNullable: String (Required)
-     *     bytes: byte[] (Optional)
-     *     int: Integer (Optional)
-     *     long: Long (Optional)
-     *     float: Double (Optional)
-     *     double: Double (Optional)
-     *     duration: Duration (Optional)
-     *     dateTime: OffsetDateTime (Optional)
-     *     stringList (Optional): [
-     *         String (Optional)
-     *     ]
-     *     bytesDict (Optional): {
-     *         String: byte[] (Required)
-     *     }
-     *     epochDateTimeRequiredNullable: Long (Required)
-     *     epochDateTimeNullable: Long (Optional)
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     boolean: Boolean (Optional)
-     *     booleanNullable: Boolean (Optional)
-     *     booleanRequired: Boolean (Optional)
-     *     booleanRequiredNullable: Boolean (Optional)
-     *     string: String (Optional)
-     *     stringNullable: String (Optional)
-     *     stringRequired: String (Optional)
-     *     stringRequiredNullable: String (Optional)
-     *     bytes: byte[] (Optional)
-     *     int: Integer (Optional)
-     *     long: Long (Optional)
-     *     float: Double (Optional)
-     *     double: Double (Optional)
-     *     duration: Duration (Optional)
-     *     dateTime: OffsetDateTime (Optional)
-     *     stringList (Optional): [
-     *         String (Optional)
-     *     ]
-     *     bytesDict (Optional): {
-     *         String: byte[] (Required)
-     *     }
-     *     epochDateTimeRequiredNullable: Long (Optional)
-     *     epochDateTimeNullable: Long (Optional)
-     *     immutable (Optional): {
-     *         stringReadWriteRequired: String (Required)
-     *         stringReadOnlyOptional: String (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestHeaderRequired The requestHeaderRequired parameter. - * @param booleanRequired The booleanRequired parameter. - * @param booleanRequiredNullable The booleanRequiredNullable parameter. - * @param stringRequired The stringRequired parameter. - * @param stringRequiredNullable The stringRequiredNullable parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> putWithResponse(String requestHeaderRequired, boolean booleanRequired, - Boolean booleanRequiredNullable, String stringRequired, String stringRequiredNullable, - RequestOptions requestOptions) { - return this.serviceClient.putWithResponseAsync(requestHeaderRequired, booleanRequired, booleanRequiredNullable, - stringRequired, stringRequiredNullable, requestOptions); - } - - /** - * The put operation. - * - * @param requestHeaderRequired The requestHeaderRequired parameter. - * @param booleanRequired The booleanRequired parameter. - * @param booleanRequiredNullable The booleanRequiredNullable parameter. - * @param stringRequired The stringRequired parameter. - * @param stringRequiredNullable The stringRequiredNullable parameter. - * @param requestHeaderOptional The requestHeaderOptional parameter. - * @param booleanNullable The booleanNullable parameter. - * @param string The string parameter. - * @param stringNullable The stringNullable parameter. - * @param optional The optional parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono put(String requestHeaderRequired, boolean booleanRequired, - Boolean booleanRequiredNullable, String stringRequired, String stringRequiredNullable, - String requestHeaderOptional, Boolean booleanNullable, String string, String stringNullable, - Optional optional) { - // Generated convenience method for putWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (requestHeaderOptional != null) { - requestOptions.setHeader(HttpHeaderName.fromString("request-header-optional"), requestHeaderOptional); - } - if (booleanNullable != null) { - requestOptions.addQueryParam("booleanNullable", String.valueOf(booleanNullable), false); - } - if (string != null) { - requestOptions.addQueryParam("string", string, false); - } - if (stringNullable != null) { - requestOptions.addQueryParam("stringNullable", stringNullable, false); - } - if (optional != null) { - requestOptions.setBody(BinaryData.fromObject(optional)); - } - return putWithResponse(requestHeaderRequired, booleanRequired, booleanRequiredNullable, stringRequired, - stringRequiredNullable, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(AllPropertiesOptional.class)); - } - - /** - * The put operation. - * - * @param requestHeaderRequired The requestHeaderRequired parameter. - * @param booleanRequired The booleanRequired parameter. - * @param booleanRequiredNullable The booleanRequiredNullable parameter. - * @param stringRequired The stringRequired parameter. - * @param stringRequiredNullable The stringRequiredNullable parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono put(String requestHeaderRequired, boolean booleanRequired, - Boolean booleanRequiredNullable, String stringRequired, String stringRequiredNullable) { - // Generated convenience method for putWithResponse - RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(requestHeaderRequired, booleanRequired, booleanRequiredNullable, stringRequired, - stringRequiredNullable, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(AllPropertiesOptional.class)); - } -} diff --git a/typespec-tests/src/main/java/com/cadl/optional/OptionalClient.java b/typespec-tests/src/main/java/com/cadl/optional/OptionalClient.java deleted file mode 100644 index 899ca37b27..0000000000 --- a/typespec-tests/src/main/java/com/cadl/optional/OptionalClient.java +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.cadl.optional; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.cadl.optional.implementation.OptionalOpsImpl; -import com.cadl.optional.models.AllPropertiesOptional; -import com.cadl.optional.models.Optional; - -/** - * Initializes a new instance of the synchronous OptionalClient type. - */ -@ServiceClient(builder = OptionalClientBuilder.class) -public final class OptionalClient { - @Generated - private final OptionalOpsImpl serviceClient; - - /** - * Initializes an instance of OptionalClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - OptionalClient(OptionalOpsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The put operation. - *

Query Parameters

- * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
booleanNullableBooleanNoThe booleanNullable parameter
stringStringNoThe string parameter
stringNullableStringNoThe stringNullable parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Header Parameters

- * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
request-header-optionalStringNoThe requestHeaderOptional parameter
- * You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * - *
{@code
-     * {
-     *     boolean: Boolean (Optional)
-     *     booleanNullable: Boolean (Optional)
-     *     booleanRequired: boolean (Required)
-     *     booleanRequiredNullable: Boolean (Required)
-     *     string: String (Optional)
-     *     stringNullable: String (Optional)
-     *     stringRequired: String (Required)
-     *     stringRequiredNullable: String (Required)
-     *     bytes: byte[] (Optional)
-     *     int: Integer (Optional)
-     *     long: Long (Optional)
-     *     float: Double (Optional)
-     *     double: Double (Optional)
-     *     duration: Duration (Optional)
-     *     dateTime: OffsetDateTime (Optional)
-     *     stringList (Optional): [
-     *         String (Optional)
-     *     ]
-     *     bytesDict (Optional): {
-     *         String: byte[] (Required)
-     *     }
-     *     epochDateTimeRequiredNullable: Long (Required)
-     *     epochDateTimeNullable: Long (Optional)
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     boolean: Boolean (Optional)
-     *     booleanNullable: Boolean (Optional)
-     *     booleanRequired: Boolean (Optional)
-     *     booleanRequiredNullable: Boolean (Optional)
-     *     string: String (Optional)
-     *     stringNullable: String (Optional)
-     *     stringRequired: String (Optional)
-     *     stringRequiredNullable: String (Optional)
-     *     bytes: byte[] (Optional)
-     *     int: Integer (Optional)
-     *     long: Long (Optional)
-     *     float: Double (Optional)
-     *     double: Double (Optional)
-     *     duration: Duration (Optional)
-     *     dateTime: OffsetDateTime (Optional)
-     *     stringList (Optional): [
-     *         String (Optional)
-     *     ]
-     *     bytesDict (Optional): {
-     *         String: byte[] (Required)
-     *     }
-     *     epochDateTimeRequiredNullable: Long (Optional)
-     *     epochDateTimeNullable: Long (Optional)
-     *     immutable (Optional): {
-     *         stringReadWriteRequired: String (Required)
-     *         stringReadOnlyOptional: String (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestHeaderRequired The requestHeaderRequired parameter. - * @param booleanRequired The booleanRequired parameter. - * @param booleanRequiredNullable The booleanRequiredNullable parameter. - * @param stringRequired The stringRequired parameter. - * @param stringRequiredNullable The stringRequiredNullable parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response putWithResponse(String requestHeaderRequired, boolean booleanRequired, - Boolean booleanRequiredNullable, String stringRequired, String stringRequiredNullable, - RequestOptions requestOptions) { - return this.serviceClient.putWithResponse(requestHeaderRequired, booleanRequired, booleanRequiredNullable, - stringRequired, stringRequiredNullable, requestOptions); - } - - /** - * The put operation. - * - * @param requestHeaderRequired The requestHeaderRequired parameter. - * @param booleanRequired The booleanRequired parameter. - * @param booleanRequiredNullable The booleanRequiredNullable parameter. - * @param stringRequired The stringRequired parameter. - * @param stringRequiredNullable The stringRequiredNullable parameter. - * @param requestHeaderOptional The requestHeaderOptional parameter. - * @param booleanNullable The booleanNullable parameter. - * @param string The string parameter. - * @param stringNullable The stringNullable parameter. - * @param optional The optional parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public AllPropertiesOptional put(String requestHeaderRequired, boolean booleanRequired, - Boolean booleanRequiredNullable, String stringRequired, String stringRequiredNullable, - String requestHeaderOptional, Boolean booleanNullable, String string, String stringNullable, - Optional optional) { - // Generated convenience method for putWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (requestHeaderOptional != null) { - requestOptions.setHeader(HttpHeaderName.fromString("request-header-optional"), requestHeaderOptional); - } - if (booleanNullable != null) { - requestOptions.addQueryParam("booleanNullable", String.valueOf(booleanNullable), false); - } - if (string != null) { - requestOptions.addQueryParam("string", string, false); - } - if (stringNullable != null) { - requestOptions.addQueryParam("stringNullable", stringNullable, false); - } - if (optional != null) { - requestOptions.setBody(BinaryData.fromObject(optional)); - } - return putWithResponse(requestHeaderRequired, booleanRequired, booleanRequiredNullable, stringRequired, - stringRequiredNullable, requestOptions).getValue().toObject(AllPropertiesOptional.class); - } - - /** - * The put operation. - * - * @param requestHeaderRequired The requestHeaderRequired parameter. - * @param booleanRequired The booleanRequired parameter. - * @param booleanRequiredNullable The booleanRequiredNullable parameter. - * @param stringRequired The stringRequired parameter. - * @param stringRequiredNullable The stringRequiredNullable parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public AllPropertiesOptional put(String requestHeaderRequired, boolean booleanRequired, - Boolean booleanRequiredNullable, String stringRequired, String stringRequiredNullable) { - // Generated convenience method for putWithResponse - RequestOptions requestOptions = new RequestOptions(); - return putWithResponse(requestHeaderRequired, booleanRequired, booleanRequiredNullable, stringRequired, - stringRequiredNullable, requestOptions).getValue().toObject(AllPropertiesOptional.class); - } -} diff --git a/typespec-tests/src/main/java/com/cadl/optional/OptionalClientBuilder.java b/typespec-tests/src/main/java/com/cadl/optional/OptionalClientBuilder.java deleted file mode 100644 index 509a7e7aee..0000000000 --- a/typespec-tests/src/main/java/com/cadl/optional/OptionalClientBuilder.java +++ /dev/null @@ -1,287 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.cadl.optional; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.serializer.JacksonAdapter; -import com.cadl.optional.implementation.OptionalClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * A builder for creating a new instance of the OptionalClient type. - */ -@ServiceClientBuilder(serviceClients = { OptionalClient.class, OptionalAsyncClient.class }) -public final class OptionalClientBuilder implements HttpTrait, - ConfigurationTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final Map PROPERTIES = CoreUtils.getProperties("cadl-optional.properties"); - - @Generated - private final List pipelinePolicies; - - /** - * Create an instance of the OptionalClientBuilder. - */ - @Generated - public OptionalClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public OptionalClientBuilder pipeline(HttpPipeline pipeline) { - if (this.pipeline != null && pipeline == null) { - LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured."); - } - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public OptionalClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public OptionalClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public OptionalClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public OptionalClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public OptionalClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public OptionalClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public OptionalClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the OptionalClientBuilder. - */ - @Generated - public OptionalClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of OptionalClientImpl with the provided parameters. - * - * @return an instance of OptionalClientImpl. - */ - @Generated - private OptionalClientImpl buildInnerClient() { - this.validateClient(); - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - OptionalClientImpl client - = new OptionalClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); - return client; - } - - @Generated - private void validateClient() { - // This method is invoked from 'buildInnerClient'/'buildClient' method. - // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = CoreUtils.createHttpHeadersFromClientOptions(localClientOptions); - if (headers != null) { - policies.add(new AddHeadersPolicy(headers)); - } - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .forEach(p -> policies.add(p)); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .forEach(p -> policies.add(p)); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(localHttpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of OptionalAsyncClient class. - * - * @return an instance of OptionalAsyncClient. - */ - @Generated - public OptionalAsyncClient buildAsyncClient() { - return new OptionalAsyncClient(buildInnerClient().getOptionalOps()); - } - - /** - * Builds an instance of OptionalClient class. - * - * @return an instance of OptionalClient. - */ - @Generated - public OptionalClient buildClient() { - return new OptionalClient(buildInnerClient().getOptionalOps()); - } - - private static final ClientLogger LOGGER = new ClientLogger(OptionalClientBuilder.class); -} diff --git a/typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalClientImpl.java b/typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalClientImpl.java deleted file mode 100644 index 8eee8db184..0000000000 --- a/typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalClientImpl.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.cadl.optional.implementation; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerAdapter; - -/** - * Initializes a new instance of the OptionalClient type. - */ -public final class OptionalClientImpl { - /** - * Server parameter. - */ - private final String endpoint; - - /** - * Gets Server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - * The HTTP pipeline to send requests through. - */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** - * The serializer to serialize an object into a string. - */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - public SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** - * The OptionalOpsImpl object to access its operations. - */ - private final OptionalOpsImpl optionalOps; - - /** - * Gets the OptionalOpsImpl object to access its operations. - * - * @return the OptionalOpsImpl object. - */ - public OptionalOpsImpl getOptionalOps() { - return this.optionalOps; - } - - /** - * Initializes an instance of OptionalClient client. - * - * @param endpoint Server parameter. - */ - public OptionalClientImpl(String endpoint) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint); - } - - /** - * Initializes an instance of OptionalClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. - */ - public OptionalClientImpl(HttpPipeline httpPipeline, String endpoint) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); - } - - /** - * Initializes an instance of OptionalClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. - */ - public OptionalClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - this.optionalOps = new OptionalOpsImpl(this); - } -} diff --git a/typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalOpsImpl.java b/typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalOpsImpl.java deleted file mode 100644 index e9880065ef..0000000000 --- a/typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalOpsImpl.java +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.cadl.optional.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in OptionalOps. - */ -public final class OptionalOpsImpl { - /** - * The proxy service used to perform REST calls. - */ - private final OptionalOpsService service; - - /** - * The service client containing this operation class. - */ - private final OptionalClientImpl client; - - /** - * Initializes an instance of OptionalOpsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OptionalOpsImpl(OptionalClientImpl client) { - this.service - = RestProxy.create(OptionalOpsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for OptionalClientOptionalOps to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "OptionalClientOption") - public interface OptionalOpsService { - @Put("/optional/put") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HostParam("endpoint") String endpoint, - @HeaderParam("request-header-required") String requestHeaderRequired, - @QueryParam("booleanRequired") boolean booleanRequired, - @QueryParam("booleanRequiredNullable") Boolean booleanRequiredNullable, - @QueryParam("stringRequired") String stringRequired, - @QueryParam("stringRequiredNullable") String stringRequiredNullable, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); - - @Put("/optional/put") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HostParam("endpoint") String endpoint, - @HeaderParam("request-header-required") String requestHeaderRequired, - @QueryParam("booleanRequired") boolean booleanRequired, - @QueryParam("booleanRequiredNullable") Boolean booleanRequiredNullable, - @QueryParam("stringRequired") String stringRequired, - @QueryParam("stringRequiredNullable") String stringRequiredNullable, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); - } - - /** - * The put operation. - *

Query Parameters

- * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
booleanNullableBooleanNoThe booleanNullable parameter
stringStringNoThe string parameter
stringNullableStringNoThe stringNullable parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Header Parameters

- * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
request-header-optionalStringNoThe requestHeaderOptional parameter
- * You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * - *
{@code
-     * {
-     *     boolean: Boolean (Optional)
-     *     booleanNullable: Boolean (Optional)
-     *     booleanRequired: boolean (Required)
-     *     booleanRequiredNullable: Boolean (Required)
-     *     string: String (Optional)
-     *     stringNullable: String (Optional)
-     *     stringRequired: String (Required)
-     *     stringRequiredNullable: String (Required)
-     *     bytes: byte[] (Optional)
-     *     int: Integer (Optional)
-     *     long: Long (Optional)
-     *     float: Double (Optional)
-     *     double: Double (Optional)
-     *     duration: Duration (Optional)
-     *     dateTime: OffsetDateTime (Optional)
-     *     stringList (Optional): [
-     *         String (Optional)
-     *     ]
-     *     bytesDict (Optional): {
-     *         String: byte[] (Required)
-     *     }
-     *     epochDateTimeRequiredNullable: Long (Required)
-     *     epochDateTimeNullable: Long (Optional)
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     boolean: Boolean (Optional)
-     *     booleanNullable: Boolean (Optional)
-     *     booleanRequired: Boolean (Optional)
-     *     booleanRequiredNullable: Boolean (Optional)
-     *     string: String (Optional)
-     *     stringNullable: String (Optional)
-     *     stringRequired: String (Optional)
-     *     stringRequiredNullable: String (Optional)
-     *     bytes: byte[] (Optional)
-     *     int: Integer (Optional)
-     *     long: Long (Optional)
-     *     float: Double (Optional)
-     *     double: Double (Optional)
-     *     duration: Duration (Optional)
-     *     dateTime: OffsetDateTime (Optional)
-     *     stringList (Optional): [
-     *         String (Optional)
-     *     ]
-     *     bytesDict (Optional): {
-     *         String: byte[] (Required)
-     *     }
-     *     epochDateTimeRequiredNullable: Long (Optional)
-     *     epochDateTimeNullable: Long (Optional)
-     *     immutable (Optional): {
-     *         stringReadWriteRequired: String (Required)
-     *         stringReadOnlyOptional: String (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestHeaderRequired The requestHeaderRequired parameter. - * @param booleanRequired The booleanRequired parameter. - * @param booleanRequiredNullable The booleanRequiredNullable parameter. - * @param stringRequired The stringRequired parameter. - * @param stringRequiredNullable The stringRequiredNullable parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> putWithResponseAsync(String requestHeaderRequired, boolean booleanRequired, - Boolean booleanRequiredNullable, String stringRequired, String stringRequiredNullable, - RequestOptions requestOptions) { - final String accept = "application/json"; - RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; - requestOptionsLocal.addRequestCallback(requestLocal -> { - if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { - requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); - } - }); - return FluxUtil - .withContext(context -> service.put(this.client.getEndpoint(), requestHeaderRequired, booleanRequired, - booleanRequiredNullable, stringRequired, stringRequiredNullable, accept, requestOptionsLocal, context)); - } - - /** - * The put operation. - *

Query Parameters

- * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
booleanNullableBooleanNoThe booleanNullable parameter
stringStringNoThe string parameter
stringNullableStringNoThe stringNullable parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Header Parameters

- * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
request-header-optionalStringNoThe requestHeaderOptional parameter
- * You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * - *
{@code
-     * {
-     *     boolean: Boolean (Optional)
-     *     booleanNullable: Boolean (Optional)
-     *     booleanRequired: boolean (Required)
-     *     booleanRequiredNullable: Boolean (Required)
-     *     string: String (Optional)
-     *     stringNullable: String (Optional)
-     *     stringRequired: String (Required)
-     *     stringRequiredNullable: String (Required)
-     *     bytes: byte[] (Optional)
-     *     int: Integer (Optional)
-     *     long: Long (Optional)
-     *     float: Double (Optional)
-     *     double: Double (Optional)
-     *     duration: Duration (Optional)
-     *     dateTime: OffsetDateTime (Optional)
-     *     stringList (Optional): [
-     *         String (Optional)
-     *     ]
-     *     bytesDict (Optional): {
-     *         String: byte[] (Required)
-     *     }
-     *     epochDateTimeRequiredNullable: Long (Required)
-     *     epochDateTimeNullable: Long (Optional)
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     boolean: Boolean (Optional)
-     *     booleanNullable: Boolean (Optional)
-     *     booleanRequired: Boolean (Optional)
-     *     booleanRequiredNullable: Boolean (Optional)
-     *     string: String (Optional)
-     *     stringNullable: String (Optional)
-     *     stringRequired: String (Optional)
-     *     stringRequiredNullable: String (Optional)
-     *     bytes: byte[] (Optional)
-     *     int: Integer (Optional)
-     *     long: Long (Optional)
-     *     float: Double (Optional)
-     *     double: Double (Optional)
-     *     duration: Duration (Optional)
-     *     dateTime: OffsetDateTime (Optional)
-     *     stringList (Optional): [
-     *         String (Optional)
-     *     ]
-     *     bytesDict (Optional): {
-     *         String: byte[] (Required)
-     *     }
-     *     epochDateTimeRequiredNullable: Long (Optional)
-     *     epochDateTimeNullable: Long (Optional)
-     *     immutable (Optional): {
-     *         stringReadWriteRequired: String (Required)
-     *         stringReadOnlyOptional: String (Optional)
-     *     }
-     * }
-     * }
- * - * @param requestHeaderRequired The requestHeaderRequired parameter. - * @param booleanRequired The booleanRequired parameter. - * @param booleanRequiredNullable The booleanRequiredNullable parameter. - * @param stringRequired The stringRequired parameter. - * @param stringRequiredNullable The stringRequiredNullable parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response putWithResponse(String requestHeaderRequired, boolean booleanRequired, - Boolean booleanRequiredNullable, String stringRequired, String stringRequiredNullable, - RequestOptions requestOptions) { - final String accept = "application/json"; - RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; - requestOptionsLocal.addRequestCallback(requestLocal -> { - if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { - requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); - } - }); - return service.putSync(this.client.getEndpoint(), requestHeaderRequired, booleanRequired, - booleanRequiredNullable, stringRequired, stringRequiredNullable, accept, requestOptionsLocal, Context.NONE); - } -} diff --git a/typespec-tests/src/main/java/com/cadl/optional/implementation/package-info.java b/typespec-tests/src/main/java/com/cadl/optional/implementation/package-info.java deleted file mode 100644 index 57b1a7bdaa..0000000000 --- a/typespec-tests/src/main/java/com/cadl/optional/implementation/package-info.java +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -/** - * - * Package containing the implementations for Optional. - * - */ -package com.cadl.optional.implementation; diff --git a/typespec-tests/src/main/java/com/cadl/optional/models/AllPropertiesOptional.java b/typespec-tests/src/main/java/com/cadl/optional/models/AllPropertiesOptional.java deleted file mode 100644 index b8a309e2c0..0000000000 --- a/typespec-tests/src/main/java/com/cadl/optional/models/AllPropertiesOptional.java +++ /dev/null @@ -1,462 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.cadl.optional.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.Duration; -import java.time.Instant; -import java.time.OffsetDateTime; -import java.time.ZoneOffset; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * The AllPropertiesOptional model. - */ -@Immutable -public final class AllPropertiesOptional implements JsonSerializable { - /* - * The boolean property. - */ - @Generated - private Boolean booleanProperty; - - /* - * The booleanNullable property. - */ - @Generated - private Boolean booleanNullable; - - /* - * The booleanRequired property. - */ - @Generated - private Boolean booleanRequired; - - /* - * The booleanRequiredNullable property. - */ - @Generated - private Boolean booleanRequiredNullable; - - /* - * The string property. - */ - @Generated - private String string; - - /* - * The stringNullable property. - */ - @Generated - private String stringNullable; - - /* - * The stringRequired property. - */ - @Generated - private String stringRequired; - - /* - * The stringRequiredNullable property. - */ - @Generated - private String stringRequiredNullable; - - /* - * The bytes property. - */ - @Generated - private byte[] bytes; - - /* - * The int property. - */ - @Generated - private Integer intProperty; - - /* - * The long property. - */ - @Generated - private Long longProperty; - - /* - * The float property. - */ - @Generated - private Double floatProperty; - - /* - * The double property. - */ - @Generated - private Double doubleProperty; - - /* - * The duration property. - */ - @Generated - private Duration duration; - - /* - * The dateTime property. - */ - @Generated - private OffsetDateTime dateTime; - - /* - * The stringList property. - */ - @Generated - private List stringList; - - /* - * The bytesDict property. - */ - @Generated - private Map bytesDict; - - /* - * The epochDateTimeRequiredNullable property. - */ - @Generated - private Long epochDateTimeRequiredNullable; - - /* - * The epochDateTimeNullable property. - */ - @Generated - private Long epochDateTimeNullable; - - /* - * The immutable property. - */ - @Generated - private ImmutableModel immutable; - - /** - * Creates an instance of AllPropertiesOptional class. - */ - @Generated - private AllPropertiesOptional() { - } - - /** - * Get the booleanProperty property: The boolean property. - * - * @return the booleanProperty value. - */ - @Generated - public Boolean isBooleanProperty() { - return this.booleanProperty; - } - - /** - * Get the booleanNullable property: The booleanNullable property. - * - * @return the booleanNullable value. - */ - @Generated - public Boolean isBooleanNullable() { - return this.booleanNullable; - } - - /** - * Get the booleanRequired property: The booleanRequired property. - * - * @return the booleanRequired value. - */ - @Generated - public Boolean isBooleanRequired() { - return this.booleanRequired; - } - - /** - * Get the booleanRequiredNullable property: The booleanRequiredNullable property. - * - * @return the booleanRequiredNullable value. - */ - @Generated - public Boolean isBooleanRequiredNullable() { - return this.booleanRequiredNullable; - } - - /** - * Get the string property: The string property. - * - * @return the string value. - */ - @Generated - public String getString() { - return this.string; - } - - /** - * Get the stringNullable property: The stringNullable property. - * - * @return the stringNullable value. - */ - @Generated - public String getStringNullable() { - return this.stringNullable; - } - - /** - * Get the stringRequired property: The stringRequired property. - * - * @return the stringRequired value. - */ - @Generated - public String getStringRequired() { - return this.stringRequired; - } - - /** - * Get the stringRequiredNullable property: The stringRequiredNullable property. - * - * @return the stringRequiredNullable value. - */ - @Generated - public String getStringRequiredNullable() { - return this.stringRequiredNullable; - } - - /** - * Get the bytes property: The bytes property. - * - * @return the bytes value. - */ - @Generated - public byte[] getBytes() { - return CoreUtils.clone(this.bytes); - } - - /** - * Get the intProperty property: The int property. - * - * @return the intProperty value. - */ - @Generated - public Integer getIntProperty() { - return this.intProperty; - } - - /** - * Get the longProperty property: The long property. - * - * @return the longProperty value. - */ - @Generated - public Long getLongProperty() { - return this.longProperty; - } - - /** - * Get the floatProperty property: The float property. - * - * @return the floatProperty value. - */ - @Generated - public Double getFloatProperty() { - return this.floatProperty; - } - - /** - * Get the doubleProperty property: The double property. - * - * @return the doubleProperty value. - */ - @Generated - public Double getDoubleProperty() { - return this.doubleProperty; - } - - /** - * Get the duration property: The duration property. - * - * @return the duration value. - */ - @Generated - public Duration getDuration() { - return this.duration; - } - - /** - * Get the dateTime property: The dateTime property. - * - * @return the dateTime value. - */ - @Generated - public OffsetDateTime getDateTime() { - return this.dateTime; - } - - /** - * Get the stringList property: The stringList property. - * - * @return the stringList value. - */ - @Generated - public List getStringList() { - return this.stringList; - } - - /** - * Get the bytesDict property: The bytesDict property. - * - * @return the bytesDict value. - */ - @Generated - public Map getBytesDict() { - return this.bytesDict; - } - - /** - * Get the epochDateTimeRequiredNullable property: The epochDateTimeRequiredNullable property. - * - * @return the epochDateTimeRequiredNullable value. - */ - @Generated - public OffsetDateTime getEpochDateTimeRequiredNullable() { - if (this.epochDateTimeRequiredNullable == null) { - return null; - } - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.epochDateTimeRequiredNullable), ZoneOffset.UTC); - } - - /** - * Get the epochDateTimeNullable property: The epochDateTimeNullable property. - * - * @return the epochDateTimeNullable value. - */ - @Generated - public OffsetDateTime getEpochDateTimeNullable() { - if (this.epochDateTimeNullable == null) { - return null; - } - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.epochDateTimeNullable), ZoneOffset.UTC); - } - - /** - * Get the immutable property: The immutable property. - * - * @return the immutable value. - */ - @Generated - public ImmutableModel getImmutable() { - return this.immutable; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("boolean", this.booleanProperty); - jsonWriter.writeBooleanField("booleanNullable", this.booleanNullable); - jsonWriter.writeBooleanField("booleanRequired", this.booleanRequired); - jsonWriter.writeBooleanField("booleanRequiredNullable", this.booleanRequiredNullable); - jsonWriter.writeStringField("string", this.string); - jsonWriter.writeStringField("stringNullable", this.stringNullable); - jsonWriter.writeStringField("stringRequired", this.stringRequired); - jsonWriter.writeStringField("stringRequiredNullable", this.stringRequiredNullable); - jsonWriter.writeBinaryField("bytes", this.bytes); - jsonWriter.writeNumberField("int", this.intProperty); - jsonWriter.writeNumberField("long", this.longProperty); - jsonWriter.writeNumberField("float", this.floatProperty); - jsonWriter.writeNumberField("double", this.doubleProperty); - jsonWriter.writeStringField("duration", CoreUtils.durationToStringWithDays(this.duration)); - jsonWriter.writeStringField("dateTime", - this.dateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.dateTime)); - jsonWriter.writeArrayField("stringList", this.stringList, (writer, element) -> writer.writeString(element)); - jsonWriter.writeMapField("bytesDict", this.bytesDict, (writer, element) -> writer.writeBinary(element)); - jsonWriter.writeNumberField("epochDateTimeRequiredNullable", this.epochDateTimeRequiredNullable); - jsonWriter.writeNumberField("epochDateTimeNullable", this.epochDateTimeNullable); - jsonWriter.writeJsonField("immutable", this.immutable); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AllPropertiesOptional from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AllPropertiesOptional if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the AllPropertiesOptional. - */ - @Generated - public static AllPropertiesOptional fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AllPropertiesOptional deserializedAllPropertiesOptional = new AllPropertiesOptional(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("boolean".equals(fieldName)) { - deserializedAllPropertiesOptional.booleanProperty = reader.getNullable(JsonReader::getBoolean); - } else if ("booleanNullable".equals(fieldName)) { - deserializedAllPropertiesOptional.booleanNullable = reader.getNullable(JsonReader::getBoolean); - } else if ("booleanRequired".equals(fieldName)) { - deserializedAllPropertiesOptional.booleanRequired = reader.getNullable(JsonReader::getBoolean); - } else if ("booleanRequiredNullable".equals(fieldName)) { - deserializedAllPropertiesOptional.booleanRequiredNullable - = reader.getNullable(JsonReader::getBoolean); - } else if ("string".equals(fieldName)) { - deserializedAllPropertiesOptional.string = reader.getString(); - } else if ("stringNullable".equals(fieldName)) { - deserializedAllPropertiesOptional.stringNullable = reader.getString(); - } else if ("stringRequired".equals(fieldName)) { - deserializedAllPropertiesOptional.stringRequired = reader.getString(); - } else if ("stringRequiredNullable".equals(fieldName)) { - deserializedAllPropertiesOptional.stringRequiredNullable = reader.getString(); - } else if ("bytes".equals(fieldName)) { - deserializedAllPropertiesOptional.bytes = reader.getBinary(); - } else if ("int".equals(fieldName)) { - deserializedAllPropertiesOptional.intProperty = reader.getNullable(JsonReader::getInt); - } else if ("long".equals(fieldName)) { - deserializedAllPropertiesOptional.longProperty = reader.getNullable(JsonReader::getLong); - } else if ("float".equals(fieldName)) { - deserializedAllPropertiesOptional.floatProperty = reader.getNullable(JsonReader::getDouble); - } else if ("double".equals(fieldName)) { - deserializedAllPropertiesOptional.doubleProperty = reader.getNullable(JsonReader::getDouble); - } else if ("duration".equals(fieldName)) { - deserializedAllPropertiesOptional.duration - = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); - } else if ("dateTime".equals(fieldName)) { - deserializedAllPropertiesOptional.dateTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("stringList".equals(fieldName)) { - List stringList = reader.readArray(reader1 -> reader1.getString()); - deserializedAllPropertiesOptional.stringList = stringList; - } else if ("bytesDict".equals(fieldName)) { - Map bytesDict = reader.readMap(reader1 -> reader1.getBinary()); - deserializedAllPropertiesOptional.bytesDict = bytesDict; - } else if ("epochDateTimeRequiredNullable".equals(fieldName)) { - deserializedAllPropertiesOptional.epochDateTimeRequiredNullable - = reader.getNullable(JsonReader::getLong); - } else if ("epochDateTimeNullable".equals(fieldName)) { - deserializedAllPropertiesOptional.epochDateTimeNullable = reader.getNullable(JsonReader::getLong); - } else if ("immutable".equals(fieldName)) { - deserializedAllPropertiesOptional.immutable = ImmutableModel.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAllPropertiesOptional; - }); - } -} diff --git a/typespec-tests/src/main/java/com/cadl/optional/models/ImmutableModel.java b/typespec-tests/src/main/java/com/cadl/optional/models/ImmutableModel.java deleted file mode 100644 index 6494cc8957..0000000000 --- a/typespec-tests/src/main/java/com/cadl/optional/models/ImmutableModel.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.cadl.optional.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The ImmutableModel model. - */ -@Immutable -public final class ImmutableModel implements JsonSerializable { - /* - * The stringReadWriteRequired property. - */ - @Generated - private final String stringReadWriteRequired; - - /* - * The stringReadOnlyOptional property. - */ - @Generated - private String stringReadOnlyOptional; - - /** - * Creates an instance of ImmutableModel class. - * - * @param stringReadWriteRequired the stringReadWriteRequired value to set. - */ - @Generated - private ImmutableModel(String stringReadWriteRequired) { - this.stringReadWriteRequired = stringReadWriteRequired; - } - - /** - * Get the stringReadWriteRequired property: The stringReadWriteRequired property. - * - * @return the stringReadWriteRequired value. - */ - @Generated - public String getStringReadWriteRequired() { - return this.stringReadWriteRequired; - } - - /** - * Get the stringReadOnlyOptional property: The stringReadOnlyOptional property. - * - * @return the stringReadOnlyOptional value. - */ - @Generated - public String getStringReadOnlyOptional() { - return this.stringReadOnlyOptional; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("stringReadWriteRequired", this.stringReadWriteRequired); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ImmutableModel from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ImmutableModel if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ImmutableModel. - */ - @Generated - public static ImmutableModel fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String stringReadWriteRequired = null; - String stringReadOnlyOptional = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("stringReadWriteRequired".equals(fieldName)) { - stringReadWriteRequired = reader.getString(); - } else if ("stringReadOnlyOptional".equals(fieldName)) { - stringReadOnlyOptional = reader.getString(); - } else { - reader.skipChildren(); - } - } - ImmutableModel deserializedImmutableModel = new ImmutableModel(stringReadWriteRequired); - deserializedImmutableModel.stringReadOnlyOptional = stringReadOnlyOptional; - - return deserializedImmutableModel; - }); - } -} diff --git a/typespec-tests/src/main/java/com/cadl/optional/models/Optional.java b/typespec-tests/src/main/java/com/cadl/optional/models/Optional.java deleted file mode 100644 index ed01145a4c..0000000000 --- a/typespec-tests/src/main/java/com/cadl/optional/models/Optional.java +++ /dev/null @@ -1,665 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.cadl.optional.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.Duration; -import java.time.Instant; -import java.time.OffsetDateTime; -import java.time.ZoneOffset; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * The Optional model. - */ -@Fluent -public final class Optional implements JsonSerializable { - /* - * The boolean property. - */ - @Generated - private Boolean booleanProperty; - - /* - * The booleanNullable property. - */ - @Generated - private Boolean booleanNullable; - - /* - * The booleanRequired property. - */ - @Generated - private final boolean booleanRequired; - - /* - * The booleanRequiredNullable property. - */ - @Generated - private final Boolean booleanRequiredNullable; - - /* - * The string property. - */ - @Generated - private String string; - - /* - * The stringNullable property. - */ - @Generated - private String stringNullable; - - /* - * The stringRequired property. - */ - @Generated - private final String stringRequired; - - /* - * The stringRequiredNullable property. - */ - @Generated - private final String stringRequiredNullable; - - /* - * The bytes property. - */ - @Generated - private byte[] bytes; - - /* - * The int property. - */ - @Generated - private Integer intProperty; - - /* - * The long property. - */ - @Generated - private Long longProperty; - - /* - * The float property. - */ - @Generated - private Double floatProperty; - - /* - * The double property. - */ - @Generated - private Double doubleProperty; - - /* - * The duration property. - */ - @Generated - private Duration duration; - - /* - * The dateTime property. - */ - @Generated - private OffsetDateTime dateTime; - - /* - * The stringList property. - */ - @Generated - private List stringList; - - /* - * The bytesDict property. - */ - @Generated - private Map bytesDict; - - /* - * The epochDateTimeRequiredNullable property. - */ - @Generated - private final Long epochDateTimeRequiredNullable; - - /* - * The epochDateTimeNullable property. - */ - @Generated - private Long epochDateTimeNullable; - - /** - * Creates an instance of Optional class. - * - * @param booleanRequired the booleanRequired value to set. - * @param booleanRequiredNullable the booleanRequiredNullable value to set. - * @param stringRequired the stringRequired value to set. - * @param stringRequiredNullable the stringRequiredNullable value to set. - * @param epochDateTimeRequiredNullable the epochDateTimeRequiredNullable value to set. - */ - @Generated - public Optional(boolean booleanRequired, Boolean booleanRequiredNullable, String stringRequired, - String stringRequiredNullable, OffsetDateTime epochDateTimeRequiredNullable) { - this.booleanRequired = booleanRequired; - this.booleanRequiredNullable = booleanRequiredNullable; - this.stringRequired = stringRequired; - this.stringRequiredNullable = stringRequiredNullable; - if (epochDateTimeRequiredNullable == null) { - this.epochDateTimeRequiredNullable = null; - } else { - this.epochDateTimeRequiredNullable = epochDateTimeRequiredNullable.toEpochSecond(); - } - } - - /** - * Get the booleanProperty property: The boolean property. - * - * @return the booleanProperty value. - */ - @Generated - public Boolean isBooleanProperty() { - return this.booleanProperty; - } - - /** - * Set the booleanProperty property: The boolean property. - * - * @param booleanProperty the booleanProperty value to set. - * @return the Optional object itself. - */ - @Generated - public Optional setBooleanProperty(Boolean booleanProperty) { - this.booleanProperty = booleanProperty; - return this; - } - - /** - * Get the booleanNullable property: The booleanNullable property. - * - * @return the booleanNullable value. - */ - @Generated - public Boolean isBooleanNullable() { - return this.booleanNullable; - } - - /** - * Set the booleanNullable property: The booleanNullable property. - * - * @param booleanNullable the booleanNullable value to set. - * @return the Optional object itself. - */ - @Generated - public Optional setBooleanNullable(Boolean booleanNullable) { - this.booleanNullable = booleanNullable; - return this; - } - - /** - * Get the booleanRequired property: The booleanRequired property. - * - * @return the booleanRequired value. - */ - @Generated - public boolean isBooleanRequired() { - return this.booleanRequired; - } - - /** - * Get the booleanRequiredNullable property: The booleanRequiredNullable property. - * - * @return the booleanRequiredNullable value. - */ - @Generated - public Boolean isBooleanRequiredNullable() { - return this.booleanRequiredNullable; - } - - /** - * Get the string property: The string property. - * - * @return the string value. - */ - @Generated - public String getString() { - return this.string; - } - - /** - * Set the string property: The string property. - * - * @param string the string value to set. - * @return the Optional object itself. - */ - @Generated - public Optional setString(String string) { - this.string = string; - return this; - } - - /** - * Get the stringNullable property: The stringNullable property. - * - * @return the stringNullable value. - */ - @Generated - public String getStringNullable() { - return this.stringNullable; - } - - /** - * Set the stringNullable property: The stringNullable property. - * - * @param stringNullable the stringNullable value to set. - * @return the Optional object itself. - */ - @Generated - public Optional setStringNullable(String stringNullable) { - this.stringNullable = stringNullable; - return this; - } - - /** - * Get the stringRequired property: The stringRequired property. - * - * @return the stringRequired value. - */ - @Generated - public String getStringRequired() { - return this.stringRequired; - } - - /** - * Get the stringRequiredNullable property: The stringRequiredNullable property. - * - * @return the stringRequiredNullable value. - */ - @Generated - public String getStringRequiredNullable() { - return this.stringRequiredNullable; - } - - /** - * Get the bytes property: The bytes property. - * - * @return the bytes value. - */ - @Generated - public byte[] getBytes() { - return CoreUtils.clone(this.bytes); - } - - /** - * Set the bytes property: The bytes property. - * - * @param bytes the bytes value to set. - * @return the Optional object itself. - */ - @Generated - public Optional setBytes(byte[] bytes) { - this.bytes = CoreUtils.clone(bytes); - return this; - } - - /** - * Get the intProperty property: The int property. - * - * @return the intProperty value. - */ - @Generated - public Integer getIntProperty() { - return this.intProperty; - } - - /** - * Set the intProperty property: The int property. - * - * @param intProperty the intProperty value to set. - * @return the Optional object itself. - */ - @Generated - public Optional setIntProperty(Integer intProperty) { - this.intProperty = intProperty; - return this; - } - - /** - * Get the longProperty property: The long property. - * - * @return the longProperty value. - */ - @Generated - public Long getLongProperty() { - return this.longProperty; - } - - /** - * Set the longProperty property: The long property. - * - * @param longProperty the longProperty value to set. - * @return the Optional object itself. - */ - @Generated - public Optional setLongProperty(Long longProperty) { - this.longProperty = longProperty; - return this; - } - - /** - * Get the floatProperty property: The float property. - * - * @return the floatProperty value. - */ - @Generated - public Double getFloatProperty() { - return this.floatProperty; - } - - /** - * Set the floatProperty property: The float property. - * - * @param floatProperty the floatProperty value to set. - * @return the Optional object itself. - */ - @Generated - public Optional setFloatProperty(Double floatProperty) { - this.floatProperty = floatProperty; - return this; - } - - /** - * Get the doubleProperty property: The double property. - * - * @return the doubleProperty value. - */ - @Generated - public Double getDoubleProperty() { - return this.doubleProperty; - } - - /** - * Set the doubleProperty property: The double property. - * - * @param doubleProperty the doubleProperty value to set. - * @return the Optional object itself. - */ - @Generated - public Optional setDoubleProperty(Double doubleProperty) { - this.doubleProperty = doubleProperty; - return this; - } - - /** - * Get the duration property: The duration property. - * - * @return the duration value. - */ - @Generated - public Duration getDuration() { - return this.duration; - } - - /** - * Set the duration property: The duration property. - * - * @param duration the duration value to set. - * @return the Optional object itself. - */ - @Generated - public Optional setDuration(Duration duration) { - this.duration = duration; - return this; - } - - /** - * Get the dateTime property: The dateTime property. - * - * @return the dateTime value. - */ - @Generated - public OffsetDateTime getDateTime() { - return this.dateTime; - } - - /** - * Set the dateTime property: The dateTime property. - * - * @param dateTime the dateTime value to set. - * @return the Optional object itself. - */ - @Generated - public Optional setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get the stringList property: The stringList property. - * - * @return the stringList value. - */ - @Generated - public List getStringList() { - return this.stringList; - } - - /** - * Set the stringList property: The stringList property. - * - * @param stringList the stringList value to set. - * @return the Optional object itself. - */ - @Generated - public Optional setStringList(List stringList) { - this.stringList = stringList; - return this; - } - - /** - * Get the bytesDict property: The bytesDict property. - * - * @return the bytesDict value. - */ - @Generated - public Map getBytesDict() { - return this.bytesDict; - } - - /** - * Set the bytesDict property: The bytesDict property. - * - * @param bytesDict the bytesDict value to set. - * @return the Optional object itself. - */ - @Generated - public Optional setBytesDict(Map bytesDict) { - this.bytesDict = bytesDict; - return this; - } - - /** - * Get the epochDateTimeRequiredNullable property: The epochDateTimeRequiredNullable property. - * - * @return the epochDateTimeRequiredNullable value. - */ - @Generated - public OffsetDateTime getEpochDateTimeRequiredNullable() { - if (this.epochDateTimeRequiredNullable == null) { - return null; - } - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.epochDateTimeRequiredNullable), ZoneOffset.UTC); - } - - /** - * Get the epochDateTimeNullable property: The epochDateTimeNullable property. - * - * @return the epochDateTimeNullable value. - */ - @Generated - public OffsetDateTime getEpochDateTimeNullable() { - if (this.epochDateTimeNullable == null) { - return null; - } - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.epochDateTimeNullable), ZoneOffset.UTC); - } - - /** - * Set the epochDateTimeNullable property: The epochDateTimeNullable property. - * - * @param epochDateTimeNullable the epochDateTimeNullable value to set. - * @return the Optional object itself. - */ - @Generated - public Optional setEpochDateTimeNullable(OffsetDateTime epochDateTimeNullable) { - if (epochDateTimeNullable == null) { - this.epochDateTimeNullable = null; - } else { - this.epochDateTimeNullable = epochDateTimeNullable.toEpochSecond(); - } - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("booleanRequired", this.booleanRequired); - jsonWriter.writeBooleanField("booleanRequiredNullable", this.booleanRequiredNullable); - jsonWriter.writeStringField("stringRequired", this.stringRequired); - jsonWriter.writeStringField("stringRequiredNullable", this.stringRequiredNullable); - jsonWriter.writeNumberField("epochDateTimeRequiredNullable", this.epochDateTimeRequiredNullable); - jsonWriter.writeBooleanField("boolean", this.booleanProperty); - jsonWriter.writeBooleanField("booleanNullable", this.booleanNullable); - jsonWriter.writeStringField("string", this.string); - jsonWriter.writeStringField("stringNullable", this.stringNullable); - jsonWriter.writeBinaryField("bytes", this.bytes); - jsonWriter.writeNumberField("int", this.intProperty); - jsonWriter.writeNumberField("long", this.longProperty); - jsonWriter.writeNumberField("float", this.floatProperty); - jsonWriter.writeNumberField("double", this.doubleProperty); - jsonWriter.writeStringField("duration", CoreUtils.durationToStringWithDays(this.duration)); - jsonWriter.writeStringField("dateTime", - this.dateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.dateTime)); - jsonWriter.writeArrayField("stringList", this.stringList, (writer, element) -> writer.writeString(element)); - jsonWriter.writeMapField("bytesDict", this.bytesDict, (writer, element) -> writer.writeBinary(element)); - jsonWriter.writeNumberField("epochDateTimeNullable", this.epochDateTimeNullable); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Optional from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Optional if the JsonReader was pointing to an instance of it, or null if it was pointing - * to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the Optional. - */ - @Generated - public static Optional fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - boolean booleanRequired = false; - Boolean booleanRequiredNullable = null; - String stringRequired = null; - String stringRequiredNullable = null; - OffsetDateTime epochDateTimeRequiredNullable = null; - Boolean booleanProperty = null; - Boolean booleanNullable = null; - String string = null; - String stringNullable = null; - byte[] bytes = null; - Integer intProperty = null; - Long longProperty = null; - Double floatProperty = null; - Double doubleProperty = null; - Duration duration = null; - OffsetDateTime dateTime = null; - List stringList = null; - Map bytesDict = null; - Long epochDateTimeNullable = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("booleanRequired".equals(fieldName)) { - booleanRequired = reader.getBoolean(); - } else if ("booleanRequiredNullable".equals(fieldName)) { - booleanRequiredNullable = reader.getNullable(JsonReader::getBoolean); - } else if ("stringRequired".equals(fieldName)) { - stringRequired = reader.getString(); - } else if ("stringRequiredNullable".equals(fieldName)) { - stringRequiredNullable = reader.getString(); - } else if ("epochDateTimeRequiredNullable".equals(fieldName)) { - Long epochDateTimeRequiredNullableHolder = reader.getNullable(JsonReader::getLong); - if (epochDateTimeRequiredNullableHolder != null) { - epochDateTimeRequiredNullable = OffsetDateTime - .ofInstant(Instant.ofEpochSecond(epochDateTimeRequiredNullableHolder), ZoneOffset.UTC); - } - } else if ("boolean".equals(fieldName)) { - booleanProperty = reader.getNullable(JsonReader::getBoolean); - } else if ("booleanNullable".equals(fieldName)) { - booleanNullable = reader.getNullable(JsonReader::getBoolean); - } else if ("string".equals(fieldName)) { - string = reader.getString(); - } else if ("stringNullable".equals(fieldName)) { - stringNullable = reader.getString(); - } else if ("bytes".equals(fieldName)) { - bytes = reader.getBinary(); - } else if ("int".equals(fieldName)) { - intProperty = reader.getNullable(JsonReader::getInt); - } else if ("long".equals(fieldName)) { - longProperty = reader.getNullable(JsonReader::getLong); - } else if ("float".equals(fieldName)) { - floatProperty = reader.getNullable(JsonReader::getDouble); - } else if ("double".equals(fieldName)) { - doubleProperty = reader.getNullable(JsonReader::getDouble); - } else if ("duration".equals(fieldName)) { - duration = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); - } else if ("dateTime".equals(fieldName)) { - dateTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("stringList".equals(fieldName)) { - stringList = reader.readArray(reader1 -> reader1.getString()); - } else if ("bytesDict".equals(fieldName)) { - bytesDict = reader.readMap(reader1 -> reader1.getBinary()); - } else if ("epochDateTimeNullable".equals(fieldName)) { - epochDateTimeNullable = reader.getNullable(JsonReader::getLong); - } else { - reader.skipChildren(); - } - } - Optional deserializedOptional = new Optional(booleanRequired, booleanRequiredNullable, stringRequired, - stringRequiredNullable, epochDateTimeRequiredNullable); - deserializedOptional.booleanProperty = booleanProperty; - deserializedOptional.booleanNullable = booleanNullable; - deserializedOptional.string = string; - deserializedOptional.stringNullable = stringNullable; - deserializedOptional.bytes = bytes; - deserializedOptional.intProperty = intProperty; - deserializedOptional.longProperty = longProperty; - deserializedOptional.floatProperty = floatProperty; - deserializedOptional.doubleProperty = doubleProperty; - deserializedOptional.duration = duration; - deserializedOptional.dateTime = dateTime; - deserializedOptional.stringList = stringList; - deserializedOptional.bytesDict = bytesDict; - deserializedOptional.epochDateTimeNullable = epochDateTimeNullable; - - return deserializedOptional; - }); - } -} diff --git a/typespec-tests/src/main/java/com/cadl/optional/models/package-info.java b/typespec-tests/src/main/java/com/cadl/optional/models/package-info.java deleted file mode 100644 index 6b32eea60d..0000000000 --- a/typespec-tests/src/main/java/com/cadl/optional/models/package-info.java +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -/** - * - * Package containing the data models for Optional. - * - */ -package com.cadl.optional.models; diff --git a/typespec-tests/src/main/java/com/cadl/optional/package-info.java b/typespec-tests/src/main/java/com/cadl/optional/package-info.java deleted file mode 100644 index 928b2f6905..0000000000 --- a/typespec-tests/src/main/java/com/cadl/optional/package-info.java +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -/** - * - * Package containing the classes for Optional. - * - */ -package com.cadl.optional; diff --git a/typespec-tests/src/main/java/com/cadl/partialupdate/implementation/PartialUpdateClientImpl.java b/typespec-tests/src/main/java/com/cadl/partialupdate/implementation/PartialUpdateClientImpl.java index dec63b0243..b845d53aad 100644 --- a/typespec-tests/src/main/java/com/cadl/partialupdate/implementation/PartialUpdateClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/partialupdate/implementation/PartialUpdateClientImpl.java @@ -41,12 +41,12 @@ public final class PartialUpdateClientImpl { private final PartialUpdateClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -85,7 +85,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of PartialUpdateClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public PartialUpdateClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -96,7 +96,7 @@ public PartialUpdateClientImpl(String endpoint) { * Initializes an instance of PartialUpdateClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public PartialUpdateClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -107,7 +107,7 @@ public PartialUpdateClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public PartialUpdateClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; @@ -130,7 +130,7 @@ public interface PartialUpdateClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> read(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> read(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/partialupdate") @@ -139,7 +139,7 @@ Mono> read(@HostParam("endpoint") String endpoint, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response readSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response readSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchClientImpl.java b/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchClientImpl.java index 87497b2dbd..e6cdd0a91f 100644 --- a/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchClientImpl.java @@ -16,12 +16,12 @@ */ public final class PatchClientImpl { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public PatchesImpl getPatches() { /** * Initializes an instance of PatchClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public PatchClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public PatchClientImpl(String endpoint) { * Initializes an instance of PatchClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public PatchClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public PatchClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public PatchClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchesImpl.java b/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchesImpl.java index 7b306b793a..fd130e35dc 100644 --- a/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchesImpl.java +++ b/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchesImpl.java @@ -65,7 +65,7 @@ public interface PatchesService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrUpdateResource(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -76,7 +76,7 @@ Mono> createOrUpdateResource(@HostParam("endpoint") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrUpdateResourceSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -87,7 +87,7 @@ Response createOrUpdateResourceSync(@HostParam("endpoint") String en @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrUpdateOptionalResource(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/patch/resource/optional") @@ -97,7 +97,7 @@ Mono> createOrUpdateOptionalResource(@HostParam("endpoint") @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrUpdateOptionalResourceSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/patch/fish") @@ -107,7 +107,7 @@ Response createOrUpdateOptionalResourceSync(@HostParam("endpoint") S @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrUpdateFish(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData fish, RequestOptions requestOptions, Context context); @Patch("/patch/fish") @@ -117,7 +117,7 @@ Mono> createOrUpdateFish(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrUpdateFishSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData fish, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/cadl/protocolandconvenient/implementation/ProtocolAndConvenienceOpsImpl.java b/typespec-tests/src/main/java/com/cadl/protocolandconvenient/implementation/ProtocolAndConvenienceOpsImpl.java index aefc9d2a6a..2e3b98433e 100644 --- a/typespec-tests/src/main/java/com/cadl/protocolandconvenient/implementation/ProtocolAndConvenienceOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/protocolandconvenient/implementation/ProtocolAndConvenienceOpsImpl.java @@ -94,8 +94,8 @@ public interface ProtocolAndConvenienceOpsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> onlyConvenient(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/protocolandconvenient/onlyConvenient") @ExpectedResponses({ 200 }) @@ -104,8 +104,8 @@ Mono> onlyConvenient(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response onlyConvenientSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/protocolandconvenient/onlyProtocol") @ExpectedResponses({ 200 }) @@ -114,8 +114,8 @@ Response onlyConvenientSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> onlyProtocol(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/protocolandconvenient/onlyProtocol") @ExpectedResponses({ 200 }) @@ -124,8 +124,8 @@ Mono> onlyProtocol(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response onlyProtocolSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/protocolandconvenient/bothConvenientAndProtocol") @ExpectedResponses({ 200 }) @@ -134,8 +134,8 @@ Response onlyProtocolSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> bothConvenientAndProtocol(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/protocolandconvenient/bothConvenientAndProtocol") @ExpectedResponses({ 200 }) @@ -144,8 +144,8 @@ Mono> bothConvenientAndProtocol(@HostParam("endpoint") Stri @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response bothConvenientAndProtocolSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/protocolandconvenient/errorSetting") @ExpectedResponses({ 200 }) @@ -154,8 +154,8 @@ Response bothConvenientAndProtocolSync(@HostParam("endpoint") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> errorSetting(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/protocolandconvenient/errorSetting") @ExpectedResponses({ 200 }) @@ -164,8 +164,8 @@ Mono> errorSetting(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response errorSettingSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/protocolandconvenient/resources/{name}") @ExpectedResponses({ 200, 201 }) @@ -175,8 +175,8 @@ Response errorSettingSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrReplace(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Put("/protocolandconvenient/resources/{name}") @ExpectedResponses({ 200, 201 }) @@ -186,8 +186,8 @@ Mono> createOrReplace(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrReplaceSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Get("/protocolandconvenient/resources") @ExpectedResponses({ 200 }) @@ -196,7 +196,7 @@ Response createOrReplaceSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/protocolandconvenient/resources") @@ -206,7 +206,7 @@ Mono> list(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -216,7 +216,7 @@ Response listSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -226,7 +226,7 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = tru @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -260,9 +260,10 @@ Response listNextSync(@PathParam(value = "nextLink", encoded = true) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> onlyConvenientWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.onlyConvenient(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.onlyConvenient(this.client.getEndpoint(), contentType, accept, + body, requestOptions, context)); } /** @@ -295,8 +296,10 @@ public Mono> onlyConvenientWithResponseAsync(BinaryData bod */ @ServiceMethod(returns = ReturnType.SINGLE) public Response onlyConvenientWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.onlyConvenientSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.onlyConvenientSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } /** @@ -330,9 +333,10 @@ public Response onlyConvenientWithResponse(BinaryData body, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> onlyProtocolWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.onlyProtocol(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.onlyProtocol(this.client.getEndpoint(), contentType, accept, + body, requestOptions, context)); } /** @@ -366,8 +370,10 @@ public Mono> onlyProtocolWithResponseAsync(BinaryData body, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response onlyProtocolWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.onlyProtocolSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.onlyProtocolSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } /** @@ -401,9 +407,10 @@ public Response onlyProtocolWithResponse(BinaryData body, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> bothConvenientAndProtocolWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.bothConvenientAndProtocol(this.client.getEndpoint(), accept, - body, requestOptions, context)); + return FluxUtil.withContext(context -> service.bothConvenientAndProtocol(this.client.getEndpoint(), contentType, + accept, body, requestOptions, context)); } /** @@ -436,9 +443,10 @@ public Mono> bothConvenientAndProtocolWithResponseAsync(Bin */ @ServiceMethod(returns = ReturnType.SINGLE) public Response bothConvenientAndProtocolWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.bothConvenientAndProtocolSync(this.client.getEndpoint(), accept, body, requestOptions, - Context.NONE); + return service.bothConvenientAndProtocolSync(this.client.getEndpoint(), contentType, accept, body, + requestOptions, Context.NONE); } /** @@ -471,9 +479,10 @@ public Response bothConvenientAndProtocolWithResponse(BinaryData bod */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> errorSettingWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.errorSetting(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.errorSetting(this.client.getEndpoint(), contentType, accept, + body, requestOptions, context)); } /** @@ -506,8 +515,10 @@ public Mono> errorSettingWithResponseAsync(BinaryData body, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response errorSettingWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.errorSettingSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.errorSettingSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } /** @@ -544,9 +555,11 @@ public Response errorSettingWithResponse(BinaryData body, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrReplaceWithResponseAsync(String name, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrReplace(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), name, accept, resource, requestOptions, context)); + return FluxUtil.withContext( + context -> service.createOrReplace(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + name, contentType, accept, resource, requestOptions, context)); } /** @@ -583,9 +596,10 @@ private Mono> createOrReplaceWithResponseAsync(String name, @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrReplaceWithResponse(String name, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.createOrReplaceSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - name, accept, resource, requestOptions, Context.NONE); + name, contentType, accept, resource, requestOptions, Context.NONE); } /** @@ -955,6 +969,8 @@ public PagedIterable list(RequestOptions requestOptions) { } /** + * Paging operation + * * Get the next page of items. *

Response Body Schema

* @@ -986,6 +1002,8 @@ private Mono> listNextSinglePageAsync(String nextLink, } /** + * Paging operation + * * Get the next page of items. *

Response Body Schema

* diff --git a/typespec-tests/src/main/java/com/cadl/protocolandconvenient/implementation/ProtocolAndConvenientClientImpl.java b/typespec-tests/src/main/java/com/cadl/protocolandconvenient/implementation/ProtocolAndConvenientClientImpl.java index b11dcbcb44..8c75e79e39 100644 --- a/typespec-tests/src/main/java/com/cadl/protocolandconvenient/implementation/ProtocolAndConvenientClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/protocolandconvenient/implementation/ProtocolAndConvenientClientImpl.java @@ -17,12 +17,12 @@ */ public final class ProtocolAndConvenientClientImpl { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -89,7 +89,7 @@ public ProtocolAndConvenienceOpsImpl getProtocolAndConvenienceOps() { /** * Initializes an instance of ProtocolAndConvenientClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public ProtocolAndConvenientClientImpl(String endpoint, ProtocolAndConvenientServiceVersion serviceVersion) { @@ -101,7 +101,7 @@ public ProtocolAndConvenientClientImpl(String endpoint, ProtocolAndConvenientSer * Initializes an instance of ProtocolAndConvenientClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public ProtocolAndConvenientClientImpl(HttpPipeline httpPipeline, String endpoint, @@ -114,7 +114,7 @@ public ProtocolAndConvenientClientImpl(HttpPipeline httpPipeline, String endpoin * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public ProtocolAndConvenientClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, diff --git a/typespec-tests/src/main/java/com/cadl/response/implementation/ResponseClientImpl.java b/typespec-tests/src/main/java/com/cadl/response/implementation/ResponseClientImpl.java index 50339e8d1f..3e618b8217 100644 --- a/typespec-tests/src/main/java/com/cadl/response/implementation/ResponseClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/response/implementation/ResponseClientImpl.java @@ -64,12 +64,12 @@ public final class ResponseClientImpl { private final ResponseClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -122,7 +122,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of ResponseClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public ResponseClientImpl(String endpoint, ResponseServiceVersion serviceVersion) { @@ -134,7 +134,7 @@ public ResponseClientImpl(String endpoint, ResponseServiceVersion serviceVersion * Initializes an instance of ResponseClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public ResponseClientImpl(HttpPipeline httpPipeline, String endpoint, ResponseServiceVersion serviceVersion) { @@ -146,7 +146,7 @@ public ResponseClientImpl(HttpPipeline httpPipeline, String endpoint, ResponseSe * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public ResponseClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, @@ -171,7 +171,7 @@ public interface ResponseClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getBinary(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/get-binary") @ExpectedResponses({ 200 }) @@ -179,7 +179,7 @@ Mono> getBinary(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getBinarySync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response getBinarySync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/get-array") @@ -189,7 +189,7 @@ Response getBinarySync(@HostParam("endpoint") String endpoint, @Head @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getArray(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/get-array") @ExpectedResponses({ 200 }) @@ -197,7 +197,7 @@ Mono> getArray(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getArraySync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response getArraySync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/get-another-array") @@ -207,7 +207,7 @@ Response getArraySync(@HostParam("endpoint") String endpoint, @Heade @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getAnotherArray(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/get-another-array") @ExpectedResponses({ 200 }) @@ -216,7 +216,7 @@ Mono> getAnotherArray(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getAnotherArraySync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/response/create-with-headers") @ExpectedResponses({ 201 }) @@ -225,7 +225,7 @@ Response getAnotherArraySync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createWithHeaders(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/response/create-with-headers") @ExpectedResponses({ 201 }) @@ -234,7 +234,7 @@ Mono> createWithHeaders(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createWithHeadersSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/response/delete-with-headers") @ExpectedResponses({ 204 }) @@ -242,8 +242,8 @@ Response createWithHeadersSync(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteWithHeaders(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> deleteWithHeaders(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Delete("/response/delete-with-headers") @ExpectedResponses({ 204 }) @@ -251,8 +251,8 @@ Mono> deleteWithHeaders(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteWithHeadersSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response deleteWithHeadersSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Head("/response/exists") @ExpectedResponses({ 200, 404 }) @@ -260,7 +260,7 @@ Response deleteWithHeadersSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> exists(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Head("/response/exists") @@ -269,7 +269,7 @@ Mono> exists(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response existsSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/response/lro-invalid-poll-response") @@ -279,8 +279,9 @@ Response existsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> lroInvalidPollResponse(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); @Post("/response/lro-invalid-poll-response") @ExpectedResponses({ 202 }) @@ -289,8 +290,9 @@ Mono> lroInvalidPollResponse(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response lroInvalidPollResponseSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); @Post("/response/lro-invalid-result") @ExpectedResponses({ 202 }) @@ -299,8 +301,9 @@ Response lroInvalidPollResponseSync(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> lroInvalidResult(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); @Post("/response/lro-invalid-result") @ExpectedResponses({ 202 }) @@ -309,8 +312,9 @@ Mono> lroInvalidResult(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response lroInvalidResultSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); @Get("/response/paged-string") @ExpectedResponses({ 200 }) @@ -319,7 +323,7 @@ Response lroInvalidResultSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listStrings(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/paged-string") @ExpectedResponses({ 200 }) @@ -328,7 +332,7 @@ Mono> listStrings(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listStringsSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/paged-int32") @ExpectedResponses({ 200 }) @@ -337,7 +341,7 @@ Response listStringsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listIntegers(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/paged-int32") @ExpectedResponses({ 200 }) @@ -346,7 +350,7 @@ Mono> listIntegers(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listIntegersSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -355,7 +359,7 @@ Response listIntegersSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listStringsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -365,7 +369,7 @@ Mono> listStringsNext(@PathParam(value = "nextLink", encode @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listStringsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -375,7 +379,7 @@ Response listStringsNextSync(@PathParam(value = "nextLink", encoded @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listIntegersNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -385,7 +389,7 @@ Mono> listIntegersNext(@PathParam(value = "nextLink", encod @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listIntegersNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -609,9 +613,7 @@ public Response createWithHeadersWithResponse(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteWithHeadersWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.deleteWithHeaders(this.getEndpoint(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.deleteWithHeaders(this.getEndpoint(), requestOptions, context)); } /** @@ -626,8 +628,7 @@ public Mono> deleteWithHeadersWithResponseAsync(RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithHeadersWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.deleteWithHeadersSync(this.getEndpoint(), accept, requestOptions, Context.NONE); + return service.deleteWithHeadersSync(this.getEndpoint(), requestOptions, Context.NONE); } /** @@ -696,9 +697,10 @@ public Response existsWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> lroInvalidPollResponseWithResponseAsync(BinaryData request, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.lroInvalidPollResponse(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, request, requestOptions, context)); + this.getServiceVersion().getVersion(), contentType, accept, request, requestOptions, context)); } /** @@ -724,9 +726,10 @@ private Mono> lroInvalidPollResponseWithResponseAsync(BinaryData */ @ServiceMethod(returns = ReturnType.SINGLE) private Response lroInvalidPollResponseWithResponse(BinaryData request, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.lroInvalidPollResponseSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, - request, requestOptions, Context.NONE); + return service.lroInvalidPollResponseSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + contentType, accept, request, requestOptions, Context.NONE); } /** @@ -900,9 +903,10 @@ public SyncPoller beginLroInvalidPollResponseWithMo */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> lroInvalidResultWithResponseAsync(BinaryData request, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.lroInvalidResult(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, request, requestOptions, context)); + this.getServiceVersion().getVersion(), contentType, accept, request, requestOptions, context)); } /** @@ -928,9 +932,10 @@ private Mono> lroInvalidResultWithResponseAsync(BinaryData reques */ @ServiceMethod(returns = ReturnType.SINGLE) private Response lroInvalidResultWithResponse(BinaryData request, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.lroInvalidResultSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, request, - requestOptions, Context.NONE); + return service.lroInvalidResultSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, + accept, request, requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/cadl/server/ContosoClientBuilder.java b/typespec-tests/src/main/java/com/cadl/server/ContosoClientBuilder.java index 6df345a264..09b7853e68 100644 --- a/typespec-tests/src/main/java/com/cadl/server/ContosoClientBuilder.java +++ b/typespec-tests/src/main/java/com/cadl/server/ContosoClientBuilder.java @@ -189,6 +189,24 @@ public ContosoClientBuilder endpoint(String endpoint) { return this; } + /* + * Api Version + */ + @Generated + private String apiVersion; + + /** + * Sets Api Version. + * + * @param apiVersion the apiVersion value. + * @return the ContosoClientBuilder. + */ + @Generated + public ContosoClientBuilder apiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + /* * Service version */ @@ -237,7 +255,7 @@ private ContosoClientImpl buildInnerClient() { ContosoServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : ContosoServiceVersion.getLatest(); ContosoClientImpl client = new ContosoClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), - this.endpoint, localServiceVersion); + this.endpoint, this.apiVersion, localServiceVersion); return client; } @@ -246,6 +264,7 @@ private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + Objects.requireNonNull(apiVersion, "'apiVersion' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/cadl/server/HttpbinClientBuilder.java b/typespec-tests/src/main/java/com/cadl/server/HttpbinClientBuilder.java index dadfb38252..944dd98a8c 100644 --- a/typespec-tests/src/main/java/com/cadl/server/HttpbinClientBuilder.java +++ b/typespec-tests/src/main/java/com/cadl/server/HttpbinClientBuilder.java @@ -264,6 +264,7 @@ private void validateClient() { // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(domain, "'domain' cannot be null."); Objects.requireNonNull(tld, "'tld' cannot be null."); + Objects.requireNonNull(relativePath, "'relativePath' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/cadl/server/implementation/ContosoClientImpl.java b/typespec-tests/src/main/java/com/cadl/server/implementation/ContosoClientImpl.java index ef7a6aa8f1..4bc0c43910 100644 --- a/typespec-tests/src/main/java/com/cadl/server/implementation/ContosoClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/server/implementation/ContosoClientImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; @@ -55,6 +54,20 @@ public String getEndpoint() { return this.endpoint; } + /** + * Api Version. + */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + /** * Service version. */ @@ -101,11 +114,12 @@ public SerializerAdapter getSerializerAdapter() { * Initializes an instance of ContosoClient client. * * @param endpoint Service endpoint. + * @param apiVersion Api Version. * @param serviceVersion Service version. */ - public ContosoClientImpl(String endpoint, ContosoServiceVersion serviceVersion) { + public ContosoClientImpl(String endpoint, String apiVersion, ContosoServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion, serviceVersion); } /** @@ -113,10 +127,12 @@ public ContosoClientImpl(String endpoint, ContosoServiceVersion serviceVersion) * * @param httpPipeline The HTTP pipeline to send requests through. * @param endpoint Service endpoint. + * @param apiVersion Api Version. * @param serviceVersion Service version. */ - public ContosoClientImpl(HttpPipeline httpPipeline, String endpoint, ContosoServiceVersion serviceVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + public ContosoClientImpl(HttpPipeline httpPipeline, String endpoint, String apiVersion, + ContosoServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion, serviceVersion); } /** @@ -125,13 +141,15 @@ public ContosoClientImpl(HttpPipeline httpPipeline, String endpoint, ContosoServ * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param endpoint Service endpoint. + * @param apiVersion Api Version. * @param serviceVersion Service version. */ public ContosoClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - ContosoServiceVersion serviceVersion) { + String apiVersion, ContosoServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; + this.apiVersion = apiVersion; this.serviceVersion = serviceVersion; this.service = RestProxy.create(ContosoClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -149,8 +167,7 @@ public interface ContosoClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> get(@HostParam("Endpoint") String endpoint, @HostParam("ApiVersion") String apiVersion, - @PathParam(value = "group", encoded = true) String group, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @PathParam(value = "group", encoded = true) String group, RequestOptions requestOptions, Context context); @Get("/contoso/{group}") @ExpectedResponses({ 200, 204 }) @@ -159,8 +176,7 @@ Mono> get(@HostParam("Endpoint") String endpoint, @HostParam("Api @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSync(@HostParam("Endpoint") String endpoint, @HostParam("ApiVersion") String apiVersion, - @PathParam(value = "group", encoded = true) String group, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @PathParam(value = "group", encoded = true) String group, RequestOptions requestOptions, Context context); } /** @@ -176,9 +192,8 @@ Response getSync(@HostParam("Endpoint") String endpoint, @HostParam("ApiVe */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(String group, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.getEndpoint(), this.getServiceVersion().getVersion(), - group, accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.get(this.getEndpoint(), this.getApiVersion(), group, requestOptions, context)); } /** @@ -194,8 +209,6 @@ public Mono> getWithResponseAsync(String group, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String group, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getSync(this.getEndpoint(), this.getServiceVersion().getVersion(), group, accept, requestOptions, - Context.NONE); + return service.getSync(this.getEndpoint(), this.getApiVersion(), group, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/server/implementation/HttpbinClientImpl.java b/typespec-tests/src/main/java/com/cadl/server/implementation/HttpbinClientImpl.java index 95fc0c5668..20c3a71dc2 100644 --- a/typespec-tests/src/main/java/com/cadl/server/implementation/HttpbinClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/server/implementation/HttpbinClientImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; @@ -166,8 +165,8 @@ public interface HttpbinClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> status(@HostParam("domain") String domain, @HostParam("tld") String tld, - @HostParam("relative-path") String relativePath, @PathParam("code") int code, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("relative-path") String relativePath, @PathParam("code") int code, RequestOptions requestOptions, + Context context); @Get("/status/{code}") @ExpectedResponses({ 200, 204 }) @@ -176,8 +175,8 @@ Mono> status(@HostParam("domain") String domain, @HostParam("tld" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response statusSync(@HostParam("domain") String domain, @HostParam("tld") String tld, - @HostParam("relative-path") String relativePath, @PathParam("code") int code, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("relative-path") String relativePath, @PathParam("code") int code, RequestOptions requestOptions, + Context context); } /** @@ -193,9 +192,8 @@ Response statusSync(@HostParam("domain") String domain, @HostParam("tld") */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> statusWithResponseAsync(int code, RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext(context -> service.status(this.getDomain(), this.getTld(), this.getRelativePath(), - code, accept, requestOptions, context)); + code, requestOptions, context)); } /** @@ -211,8 +209,7 @@ public Mono> statusWithResponseAsync(int code, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Response statusWithResponse(int code, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.statusSync(this.getDomain(), this.getTld(), this.getRelativePath(), code, accept, requestOptions, + return service.statusSync(this.getDomain(), this.getTld(), this.getRelativePath(), code, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/specialchars/implementation/BuiltinOpsImpl.java b/typespec-tests/src/main/java/com/cadl/specialchars/implementation/BuiltinOpsImpl.java index 5392d88b0a..95933ed802 100644 --- a/typespec-tests/src/main/java/com/cadl/specialchars/implementation/BuiltinOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/specialchars/implementation/BuiltinOpsImpl.java @@ -64,7 +64,8 @@ public interface BuiltinOpsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> read(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> read(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData readRequest, RequestOptions requestOptions, Context context); @Post("/specialchars") @@ -73,7 +74,8 @@ Mono> read(@HostParam("endpoint") String endpoint, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response readSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response readSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData readRequest, RequestOptions requestOptions, Context context); } @@ -109,9 +111,10 @@ Response readSync(@HostParam("endpoint") String endpoint, @HeaderPar */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> readWithResponseAsync(BinaryData readRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.read(this.client.getEndpoint(), accept, readRequest, requestOptions, context)); + return FluxUtil.withContext(context -> service.read(this.client.getEndpoint(), contentType, accept, readRequest, + requestOptions, context)); } /** @@ -146,7 +149,9 @@ public Mono> readWithResponseAsync(BinaryData readRequest, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response readWithResponse(BinaryData readRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.readSync(this.client.getEndpoint(), accept, readRequest, requestOptions, Context.NONE); + return service.readSync(this.client.getEndpoint(), contentType, accept, readRequest, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/specialchars/implementation/SpecialCharsClientImpl.java b/typespec-tests/src/main/java/com/cadl/specialchars/implementation/SpecialCharsClientImpl.java index 156eeb1699..a451aefaac 100644 --- a/typespec-tests/src/main/java/com/cadl/specialchars/implementation/SpecialCharsClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/specialchars/implementation/SpecialCharsClientImpl.java @@ -16,12 +16,12 @@ */ public final class SpecialCharsClientImpl { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public BuiltinOpsImpl getBuiltinOps() { /** * Initializes an instance of SpecialCharsClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public SpecialCharsClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public SpecialCharsClientImpl(String endpoint) { * Initializes an instance of SpecialCharsClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public SpecialCharsClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public SpecialCharsClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public SpecialCharsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersImpl.java b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersImpl.java index c3b31aafc6..18b60b8531 100644 --- a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersImpl.java +++ b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersImpl.java @@ -87,8 +87,8 @@ public interface EtagHeadersService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> putWithRequestHeaders(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Put("/etag-headers/resources/{name}") @ExpectedResponses({ 200, 201 }) @@ -98,8 +98,8 @@ Mono> putWithRequestHeaders(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(HttpResponseException.class) Response putWithRequestHeadersSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Patch("/etag-headers/resources/{name}") @ExpectedResponses({ 200, 201 }) @@ -109,7 +109,7 @@ Response putWithRequestHeadersSync(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchWithMatchHeaders(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -121,7 +121,7 @@ Mono> patchWithMatchHeaders(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchWithMatchHeadersSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -132,7 +132,7 @@ Response patchWithMatchHeadersSync(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithEtag(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/etag-headers/resources") @@ -142,7 +142,7 @@ Mono> listWithEtag(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithEtagSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -152,7 +152,7 @@ Response listWithEtagSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithEtagNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -162,7 +162,7 @@ Mono> listWithEtagNext(@PathParam(value = "nextLink", encod @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithEtagNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -216,9 +216,11 @@ Response listWithEtagNextSync(@PathParam(value = "nextLink", encoded @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithRequestHeadersWithResponseAsync(String name, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.putWithRequestHeaders(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), name, accept, resource, requestOptions, context)); + this.client.getServiceVersion().getVersion(), name, contentType, accept, resource, requestOptions, + context)); } /** @@ -271,9 +273,11 @@ public Mono> putWithRequestHeadersWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithRequestHeadersWithResponse(String name, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.putWithRequestHeadersSync(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), name, accept, resource, requestOptions, Context.NONE); + this.client.getServiceVersion().getVersion(), name, contentType, accept, resource, requestOptions, + Context.NONE); } /** @@ -501,6 +505,8 @@ public PagedIterable listWithEtag(RequestOptions requestOptions) { } /** + * Resource list operation template. + * * Get the next page of items. *

Response Body Schema

* @@ -533,6 +539,8 @@ private Mono> listWithEtagNextSinglePageAsync(String n } /** + * Resource list operation template. + * * Get the next page of items. *

Response Body Schema

* diff --git a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersOptionalBodiesImpl.java b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersOptionalBodiesImpl.java index b1420900f1..aa8e88bcbf 100644 --- a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersOptionalBodiesImpl.java +++ b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersOptionalBodiesImpl.java @@ -76,8 +76,8 @@ public interface EtagHeadersOptionalBodiesService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> putWithOptionalBody(@HostParam("endpoint") String endpoint, - @QueryParam("format") String format, @HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + @QueryParam("format") String format, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/etag-headers-optional-body") @ExpectedResponses({ 200 }) @@ -86,8 +86,8 @@ Mono> putWithOptionalBody(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response putWithOptionalBodySync(@HostParam("endpoint") String endpoint, - @QueryParam("format") String format, @HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + @QueryParam("format") String format, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -147,6 +147,7 @@ Response putWithOptionalBodySync(@HostParam("endpoint") String endpo @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithOptionalBodyWithResponseAsync(String format, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { @@ -154,8 +155,8 @@ public Mono> putWithOptionalBodyWithResponseAsync(String fo requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); } }); - return FluxUtil.withContext(context -> service.putWithOptionalBody(this.client.getEndpoint(), format, accept, - requestOptionsLocal, context)); + return FluxUtil.withContext(context -> service.putWithOptionalBody(this.client.getEndpoint(), format, + contentType, accept, requestOptionsLocal, context)); } /** @@ -214,6 +215,7 @@ public Mono> putWithOptionalBodyWithResponseAsync(String fo */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithOptionalBodyWithResponse(String format, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { @@ -221,7 +223,7 @@ public Response putWithOptionalBodyWithResponse(String format, Reque requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); } }); - return service.putWithOptionalBodySync(this.client.getEndpoint(), format, accept, requestOptionsLocal, - Context.NONE); + return service.putWithOptionalBodySync(this.client.getEndpoint(), format, contentType, accept, + requestOptionsLocal, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/RepeatabilityHeadersImpl.java b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/RepeatabilityHeadersImpl.java index d6e34ac0c6..41b07662a5 100644 --- a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/RepeatabilityHeadersImpl.java +++ b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/RepeatabilityHeadersImpl.java @@ -92,7 +92,7 @@ public interface RepeatabilityHeadersService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/repeatability-headers/resources/{name}") @ExpectedResponses({ 200 }) @@ -102,7 +102,7 @@ Mono> get(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/repeatability-headers/resources/{name}") @ExpectedResponses({ 200, 201 }) @@ -112,8 +112,8 @@ Response getSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> put(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Put("/repeatability-headers/resources/{name}") @ExpectedResponses({ 200, 201 }) @@ -123,8 +123,8 @@ Mono> put(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response putSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Post("/repeatability-headers/resources/{name}:post") @ExpectedResponses({ 200 }) @@ -134,7 +134,7 @@ Response putSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> post(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/repeatability-headers/resources/{name}:post") @ExpectedResponses({ 200 }) @@ -144,7 +144,7 @@ Mono> post(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response postSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/repeatability-headers/resources/{name}") @ExpectedResponses({ 200, 201 }) @@ -154,7 +154,7 @@ Response postSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createLro(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -166,7 +166,7 @@ Mono> createLro(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response createLroSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); } @@ -272,6 +272,7 @@ public Response getWithResponse(String name, RequestOptions requestO @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(String name, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; String repeatabilityRequestId = UUID.randomUUID().toString(); @@ -288,8 +289,9 @@ public Mono> putWithResponseAsync(String name, BinaryData r .set(HttpHeaderName.fromString("repeatability-first-sent"), repeatabilityFirstSent); } }); - return FluxUtil.withContext(context -> service.put(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), name, accept, resource, requestOptionsLocal, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + name, contentType, accept, resource, requestOptionsLocal, context)); } /** @@ -336,6 +338,7 @@ public Mono> putWithResponseAsync(String name, BinaryData r */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(String name, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; String repeatabilityRequestId = UUID.randomUUID().toString(); @@ -352,8 +355,8 @@ public Response putWithResponse(String name, BinaryData resource, Re .set(HttpHeaderName.fromString("repeatability-first-sent"), repeatabilityFirstSent); } }); - return service.putSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), name, accept, - resource, requestOptionsLocal, Context.NONE); + return service.putSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), name, + contentType, accept, resource, requestOptionsLocal, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/SkipSpecialHeadersImpl.java b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/SkipSpecialHeadersImpl.java index fe882ab8ec..0903fb3eeb 100644 --- a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/SkipSpecialHeadersImpl.java +++ b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/SkipSpecialHeadersImpl.java @@ -76,7 +76,7 @@ public interface SkipSpecialHeadersService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteWithSpecialHeaders(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("foo") String foo, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HeaderParam("foo") String foo, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/skip-special-headers/resources/{name}") @@ -87,7 +87,7 @@ Mono> deleteWithSpecialHeaders(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteWithSpecialHeadersSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("foo") String foo, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HeaderParam("foo") String foo, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/SpecialHeadersClientImpl.java b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/SpecialHeadersClientImpl.java index 55e36167c3..fd88cb4588 100644 --- a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/SpecialHeadersClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/SpecialHeadersClientImpl.java @@ -17,12 +17,12 @@ */ public final class SpecialHeadersClientImpl { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -131,7 +131,7 @@ public SkipSpecialHeadersImpl getSkipSpecialHeaders() { /** * Initializes an instance of SpecialHeadersClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public SpecialHeadersClientImpl(String endpoint, SpecialHeadersServiceVersion serviceVersion) { @@ -143,7 +143,7 @@ public SpecialHeadersClientImpl(String endpoint, SpecialHeadersServiceVersion se * Initializes an instance of SpecialHeadersClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public SpecialHeadersClientImpl(HttpPipeline httpPipeline, String endpoint, @@ -156,7 +156,7 @@ public SpecialHeadersClientImpl(HttpPipeline httpPipeline, String endpoint, * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public SpecialHeadersClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, diff --git a/typespec-tests/src/main/java/com/cadl/union/UnionAsyncClient.java b/typespec-tests/src/main/java/com/cadl/union/UnionAsyncClient.java index a9f2954204..cf6c83781e 100644 --- a/typespec-tests/src/main/java/com/cadl/union/UnionAsyncClient.java +++ b/typespec-tests/src/main/java/com/cadl/union/UnionAsyncClient.java @@ -58,7 +58,7 @@ public final class UnionAsyncClient { * } * * @param id The id parameter. - * @param request The request parameter. + * @param sendRequest The sendRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -68,8 +68,8 @@ public final class UnionAsyncClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendWithResponse(String id, BinaryData request, RequestOptions requestOptions) { - return this.serviceClient.sendWithResponseAsync(id, request, requestOptions); + public Mono> sendWithResponse(String id, BinaryData sendRequest, RequestOptions requestOptions) { + return this.serviceClient.sendWithResponseAsync(id, sendRequest, requestOptions); } /** @@ -97,7 +97,7 @@ public Mono> sendWithResponse(String id, BinaryData request, Requ * } * * @param id The id parameter. - * @param request The request parameter. + * @param sendLongRequest The sendLongRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -107,8 +107,9 @@ public Mono> sendWithResponse(String id, BinaryData request, Requ */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendLongWithResponse(String id, BinaryData request, RequestOptions requestOptions) { - return this.serviceClient.sendLongWithResponseAsync(id, request, requestOptions); + public Mono> sendLongWithResponse(String id, BinaryData sendLongRequest, + RequestOptions requestOptions) { + return this.serviceClient.sendLongWithResponseAsync(id, sendLongRequest, requestOptions); } /** @@ -190,9 +191,9 @@ public PollerFlux beginGenerate(RequestOptions requestOp public Mono send(String id, BinaryData input, User user) { // Generated convenience method for sendWithResponse RequestOptions requestOptions = new RequestOptions(); - SendRequest requestObj = new SendRequest(input).setUser(user); - BinaryData request = BinaryData.fromObject(requestObj); - return sendWithResponse(id, request, requestOptions).flatMap(FluxUtil::toMono); + SendRequest sendRequestObj = new SendRequest(input).setUser(user); + BinaryData sendRequest = BinaryData.fromObject(sendRequestObj); + return sendWithResponse(id, sendRequest, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -213,9 +214,9 @@ public Mono send(String id, BinaryData input, User user) { public Mono send(String id, BinaryData input) { // Generated convenience method for sendWithResponse RequestOptions requestOptions = new RequestOptions(); - SendRequest requestObj = new SendRequest(input); - BinaryData request = BinaryData.fromObject(requestObj); - return sendWithResponse(id, request, requestOptions).flatMap(FluxUtil::toMono); + SendRequest sendRequestObj = new SendRequest(input); + BinaryData sendRequest = BinaryData.fromObject(sendRequestObj); + return sendWithResponse(id, sendRequest, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -237,16 +238,16 @@ public Mono sendLong(SendLongOptions options) { RequestOptions requestOptions = new RequestOptions(); String id = options.getId(); String filter = options.getFilter(); - SendLongRequest requestObj + SendLongRequest sendLongRequestObj = new SendLongRequest(options.getInput(), options.getDataInt()).setUser(options.getUser()) .setDataUnion(options.getDataUnion()) .setDataLong(options.getDataLong()) .setDataFloat(options.getDataFloat()); - BinaryData request = BinaryData.fromObject(requestObj); + BinaryData sendLongRequest = BinaryData.fromObject(sendLongRequestObj); if (filter != null) { requestOptions.addQueryParam("filter", filter, false); } - return sendLongWithResponse(id, request, requestOptions).flatMap(FluxUtil::toMono); + return sendLongWithResponse(id, sendLongRequest, requestOptions).flatMap(FluxUtil::toMono); } /** diff --git a/typespec-tests/src/main/java/com/cadl/union/UnionClient.java b/typespec-tests/src/main/java/com/cadl/union/UnionClient.java index 98f1039c4e..ed19ddb792 100644 --- a/typespec-tests/src/main/java/com/cadl/union/UnionClient.java +++ b/typespec-tests/src/main/java/com/cadl/union/UnionClient.java @@ -56,7 +56,7 @@ public final class UnionClient { * } * * @param id The id parameter. - * @param request The request parameter. + * @param sendRequest The sendRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -66,8 +66,8 @@ public final class UnionClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendWithResponse(String id, BinaryData request, RequestOptions requestOptions) { - return this.serviceClient.sendWithResponse(id, request, requestOptions); + public Response sendWithResponse(String id, BinaryData sendRequest, RequestOptions requestOptions) { + return this.serviceClient.sendWithResponse(id, sendRequest, requestOptions); } /** @@ -95,7 +95,7 @@ public Response sendWithResponse(String id, BinaryData request, RequestOpt * } * * @param id The id parameter. - * @param request The request parameter. + * @param sendLongRequest The sendLongRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -105,8 +105,8 @@ public Response sendWithResponse(String id, BinaryData request, RequestOpt */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendLongWithResponse(String id, BinaryData request, RequestOptions requestOptions) { - return this.serviceClient.sendLongWithResponse(id, request, requestOptions); + public Response sendLongWithResponse(String id, BinaryData sendLongRequest, RequestOptions requestOptions) { + return this.serviceClient.sendLongWithResponse(id, sendLongRequest, requestOptions); } /** @@ -187,9 +187,9 @@ public SyncPoller beginGenerate(RequestOptions requestOp public void send(String id, BinaryData input, User user) { // Generated convenience method for sendWithResponse RequestOptions requestOptions = new RequestOptions(); - SendRequest requestObj = new SendRequest(input).setUser(user); - BinaryData request = BinaryData.fromObject(requestObj); - sendWithResponse(id, request, requestOptions).getValue(); + SendRequest sendRequestObj = new SendRequest(input).setUser(user); + BinaryData sendRequest = BinaryData.fromObject(sendRequestObj); + sendWithResponse(id, sendRequest, requestOptions).getValue(); } /** @@ -209,9 +209,9 @@ public void send(String id, BinaryData input, User user) { public void send(String id, BinaryData input) { // Generated convenience method for sendWithResponse RequestOptions requestOptions = new RequestOptions(); - SendRequest requestObj = new SendRequest(input); - BinaryData request = BinaryData.fromObject(requestObj); - sendWithResponse(id, request, requestOptions).getValue(); + SendRequest sendRequestObj = new SendRequest(input); + BinaryData sendRequest = BinaryData.fromObject(sendRequestObj); + sendWithResponse(id, sendRequest, requestOptions).getValue(); } /** @@ -232,16 +232,16 @@ public void sendLong(SendLongOptions options) { RequestOptions requestOptions = new RequestOptions(); String id = options.getId(); String filter = options.getFilter(); - SendLongRequest requestObj + SendLongRequest sendLongRequestObj = new SendLongRequest(options.getInput(), options.getDataInt()).setUser(options.getUser()) .setDataUnion(options.getDataUnion()) .setDataLong(options.getDataLong()) .setDataFloat(options.getDataFloat()); - BinaryData request = BinaryData.fromObject(requestObj); + BinaryData sendLongRequest = BinaryData.fromObject(sendLongRequestObj); if (filter != null) { requestOptions.addQueryParam("filter", filter, false); } - sendLongWithResponse(id, request, requestOptions).getValue(); + sendLongWithResponse(id, sendLongRequest, requestOptions).getValue(); } /** diff --git a/typespec-tests/src/main/java/com/cadl/union/implementation/UnionClientImpl.java b/typespec-tests/src/main/java/com/cadl/union/implementation/UnionClientImpl.java index 240291b036..c2598deaec 100644 --- a/typespec-tests/src/main/java/com/cadl/union/implementation/UnionClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/union/implementation/UnionClientImpl.java @@ -17,11 +17,12 @@ */ public final class UnionClientImpl { /** + * Union. */ private final String endpoint; /** - * Gets. + * Gets Union. * * @return the endpoint value. */ @@ -88,7 +89,7 @@ public UnionFlattenOpsImpl getUnionFlattenOps() { /** * Initializes an instance of UnionClient client. * - * @param endpoint + * @param endpoint Union. * @param serviceVersion Service version. */ public UnionClientImpl(String endpoint, UnionServiceVersion serviceVersion) { @@ -100,7 +101,7 @@ public UnionClientImpl(String endpoint, UnionServiceVersion serviceVersion) { * Initializes an instance of UnionClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint + * @param endpoint Union. * @param serviceVersion Service version. */ public UnionClientImpl(HttpPipeline httpPipeline, String endpoint, UnionServiceVersion serviceVersion) { @@ -112,7 +113,7 @@ public UnionClientImpl(HttpPipeline httpPipeline, String endpoint, UnionServiceV * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint + * @param endpoint Union. * @param serviceVersion Service version. */ public UnionClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, diff --git a/typespec-tests/src/main/java/com/cadl/union/implementation/UnionFlattenOpsImpl.java b/typespec-tests/src/main/java/com/cadl/union/implementation/UnionFlattenOpsImpl.java index 1bad303211..9a7ee5cd53 100644 --- a/typespec-tests/src/main/java/com/cadl/union/implementation/UnionFlattenOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/union/implementation/UnionFlattenOpsImpl.java @@ -84,8 +84,8 @@ public interface UnionFlattenOpsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> send(@HostParam("endpoint") String endpoint, @QueryParam("id") String id, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData sendRequest, RequestOptions requestOptions, Context context); @Post("/union/send") @ExpectedResponses({ 200 }) @@ -94,8 +94,8 @@ Mono> send(@HostParam("endpoint") String endpoint, @QueryParam("i @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response sendSync(@HostParam("endpoint") String endpoint, @QueryParam("id") String id, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData sendRequest, RequestOptions requestOptions, Context context); @Post("/union/send-long") @ExpectedResponses({ 200 }) @@ -104,8 +104,8 @@ Response sendSync(@HostParam("endpoint") String endpoint, @QueryParam("id" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> sendLong(@HostParam("endpoint") String endpoint, @QueryParam("id") String id, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData sendLongRequest, RequestOptions requestOptions, Context context); @Post("/union/send-long") @ExpectedResponses({ 200 }) @@ -114,8 +114,8 @@ Mono> sendLong(@HostParam("endpoint") String endpoint, @QueryPara @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response sendLongSync(@HostParam("endpoint") String endpoint, @QueryParam("id") String id, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData sendLongRequest, RequestOptions requestOptions, Context context); @Get("/union/param") @ExpectedResponses({ 200 }) @@ -123,8 +123,8 @@ Response sendLongSync(@HostParam("endpoint") String endpoint, @QueryParam( @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> get(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/union/param") @ExpectedResponses({ 200 }) @@ -132,8 +132,7 @@ Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response getSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); @Post("/union/generate") @ExpectedResponses({ 202 }) @@ -142,7 +141,7 @@ Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("acc @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> generate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/union/generate") @@ -152,7 +151,7 @@ Mono> generate(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response generateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -170,7 +169,7 @@ Response generateSync(@HostParam("endpoint") String endpoint, * } * * @param id The id parameter. - * @param request The request parameter. + * @param sendRequest The sendRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -179,10 +178,11 @@ Response generateSync(@HostParam("endpoint") String endpoint, * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendWithResponseAsync(String id, BinaryData request, RequestOptions requestOptions) { - final String accept = "application/json"; + public Mono> sendWithResponseAsync(String id, BinaryData sendRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; return FluxUtil.withContext(context -> service.send(this.client.getEndpoint(), id, - this.client.getServiceVersion().getVersion(), accept, request, requestOptions, context)); + this.client.getServiceVersion().getVersion(), contentType, sendRequest, requestOptions, context)); } /** @@ -199,7 +199,7 @@ public Mono> sendWithResponseAsync(String id, BinaryData request, * } * * @param id The id parameter. - * @param request The request parameter. + * @param sendRequest The sendRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -208,10 +208,10 @@ public Mono> sendWithResponseAsync(String id, BinaryData request, * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendWithResponse(String id, BinaryData request, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendSync(this.client.getEndpoint(), id, this.client.getServiceVersion().getVersion(), accept, - request, requestOptions, Context.NONE); + public Response sendWithResponse(String id, BinaryData sendRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + return service.sendSync(this.client.getEndpoint(), id, this.client.getServiceVersion().getVersion(), + contentType, sendRequest, requestOptions, Context.NONE); } /** @@ -239,7 +239,7 @@ public Response sendWithResponse(String id, BinaryData request, RequestOpt * } * * @param id The id parameter. - * @param request The request parameter. + * @param sendLongRequest The sendLongRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -248,11 +248,11 @@ public Response sendWithResponse(String id, BinaryData request, RequestOpt * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendLongWithResponseAsync(String id, BinaryData request, + public Mono> sendLongWithResponseAsync(String id, BinaryData sendLongRequest, RequestOptions requestOptions) { - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil.withContext(context -> service.sendLong(this.client.getEndpoint(), id, - this.client.getServiceVersion().getVersion(), accept, request, requestOptions, context)); + this.client.getServiceVersion().getVersion(), contentType, sendLongRequest, requestOptions, context)); } /** @@ -280,7 +280,7 @@ public Mono> sendLongWithResponseAsync(String id, BinaryData requ * } * * @param id The id parameter. - * @param request The request parameter. + * @param sendLongRequest The sendLongRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -289,10 +289,10 @@ public Mono> sendLongWithResponseAsync(String id, BinaryData requ * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendLongWithResponse(String id, BinaryData request, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendLongSync(this.client.getEndpoint(), id, this.client.getServiceVersion().getVersion(), accept, - request, requestOptions, Context.NONE); + public Response sendLongWithResponse(String id, BinaryData sendLongRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + return service.sendLongSync(this.client.getEndpoint(), id, this.client.getServiceVersion().getVersion(), + contentType, sendLongRequest, requestOptions, Context.NONE); } /** @@ -314,8 +314,7 @@ public Response sendLongWithResponse(String id, BinaryData request, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), requestOptions, context)); } /** @@ -337,8 +336,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/cadl/union/models/OperationState.java b/typespec-tests/src/main/java/com/cadl/union/models/OperationState.java new file mode 100644 index 0000000000..202a15ce22 --- /dev/null +++ b/typespec-tests/src/main/java/com/cadl/union/models/OperationState.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.cadl.union.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum describing allowed operation states. + */ +public final class OperationState extends ExpandableStringEnum { + /** + * The operation has not started. + */ + @Generated + public static final OperationState NOT_STARTED = fromString("NotStarted"); + + /** + * The operation is in progress. + */ + @Generated + public static final OperationState RUNNING = fromString("Running"); + + /** + * The operation has completed successfully. + */ + @Generated + public static final OperationState SUCCEEDED = fromString("Succeeded"); + + /** + * The operation has failed. + */ + @Generated + public static final OperationState FAILED = fromString("Failed"); + + /** + * The operation has been canceled by the user. + */ + @Generated + public static final OperationState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of OperationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public OperationState() { + } + + /** + * Creates or finds a OperationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationState. + */ + @Generated + public static OperationState fromString(String name) { + return fromString(name, OperationState.class); + } + + /** + * Gets known OperationState values. + * + * @return known OperationState values. + */ + @Generated + public static Collection values() { + return values(OperationState.class); + } +} diff --git a/typespec-tests/src/main/java/com/cadl/union/models/ResourceOperationStatusOperationStatusResultError.java b/typespec-tests/src/main/java/com/cadl/union/models/ResourceOperationStatusOperationStatusResultError.java new file mode 100644 index 0000000000..42e3ddbf64 --- /dev/null +++ b/typespec-tests/src/main/java/com/cadl/union/models/ResourceOperationStatusOperationStatusResultError.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.cadl.union.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.models.ResponseError; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Provides status details for long running operations. + */ +@Immutable +public final class ResourceOperationStatusOperationStatusResultError + implements JsonSerializable { + /* + * The unique ID of the operation. + */ + @Generated + private String id; + + /* + * The status of the operation + */ + @Generated + private final OperationState status; + + /* + * Error object that describes the error when status is "Failed". + */ + @Generated + private ResponseError error; + + /* + * The result of the operation. + */ + @Generated + private Result result; + + /** + * Creates an instance of ResourceOperationStatusOperationStatusResultError class. + * + * @param status the status value to set. + */ + @Generated + private ResourceOperationStatusOperationStatusResultError(OperationState status) { + this.status = status; + } + + /** + * Get the id property: The unique ID of the operation. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the status property: The status of the operation. + * + * @return the status value. + */ + @Generated + public OperationState getStatus() { + return this.status; + } + + /** + * Get the error property: Error object that describes the error when status is "Failed". + * + * @return the error value. + */ + @Generated + public ResponseError getError() { + return this.error; + } + + /** + * Get the result property: The result of the operation. + * + * @return the result value. + */ + @Generated + public Result getResult() { + return this.result; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeJsonField("error", this.error); + jsonWriter.writeJsonField("result", this.result); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceOperationStatusOperationStatusResultError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceOperationStatusOperationStatusResultError if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceOperationStatusOperationStatusResultError. + */ + @Generated + public static ResourceOperationStatusOperationStatusResultError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + OperationState status = null; + ResponseError error = null; + Result result = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("status".equals(fieldName)) { + status = OperationState.fromString(reader.getString()); + } else if ("error".equals(fieldName)) { + error = ResponseError.fromJson(reader); + } else if ("result".equals(fieldName)) { + result = Result.fromJson(reader); + } else { + reader.skipChildren(); + } + } + ResourceOperationStatusOperationStatusResultError deserializedResourceOperationStatusOperationStatusResultError + = new ResourceOperationStatusOperationStatusResultError(status); + deserializedResourceOperationStatusOperationStatusResultError.id = id; + deserializedResourceOperationStatusOperationStatusResultError.error = error; + deserializedResourceOperationStatusOperationStatusResultError.result = result; + + return deserializedResourceOperationStatusOperationStatusResultError; + }); + } +} diff --git a/typespec-tests/src/main/java/com/cadl/versioning/implementation/VersioningClientImpl.java b/typespec-tests/src/main/java/com/cadl/versioning/implementation/VersioningClientImpl.java index 52829b6d51..b64dbb93fa 100644 --- a/typespec-tests/src/main/java/com/cadl/versioning/implementation/VersioningClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/versioning/implementation/VersioningClientImpl.java @@ -17,12 +17,12 @@ */ public final class VersioningClientImpl { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -89,7 +89,7 @@ public VersioningOpsImpl getVersioningOps() { /** * Initializes an instance of VersioningClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public VersioningClientImpl(String endpoint, VersioningServiceVersion serviceVersion) { @@ -101,7 +101,7 @@ public VersioningClientImpl(String endpoint, VersioningServiceVersion serviceVer * Initializes an instance of VersioningClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public VersioningClientImpl(HttpPipeline httpPipeline, String endpoint, VersioningServiceVersion serviceVersion) { @@ -113,7 +113,7 @@ public VersioningClientImpl(HttpPipeline httpPipeline, String endpoint, Versioni * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public VersioningClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, diff --git a/typespec-tests/src/main/java/com/cadl/versioning/implementation/VersioningOpsImpl.java b/typespec-tests/src/main/java/com/cadl/versioning/implementation/VersioningOpsImpl.java index dda7074b57..e32901663d 100644 --- a/typespec-tests/src/main/java/com/cadl/versioning/implementation/VersioningOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/versioning/implementation/VersioningOpsImpl.java @@ -95,7 +95,7 @@ public interface VersioningOpsService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> export(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/versioning/resources/{name}:export") @ExpectedResponses({ 202 }) @@ -105,7 +105,7 @@ Mono> export(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response exportSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/versioning/resources") @ExpectedResponses({ 200 }) @@ -114,7 +114,7 @@ Response exportSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/versioning/resources") @@ -124,7 +124,7 @@ Mono> list(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/versioning/resources/{name}") @@ -135,8 +135,8 @@ Response listSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createLongRunning(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Put("/versioning/resources/{name}") @ExpectedResponses({ 200, 201 }) @@ -146,8 +146,8 @@ Mono> createLongRunning(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(HttpResponseException.class) Response createLongRunningSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -156,7 +156,7 @@ Response createLongRunningSync(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -166,7 +166,7 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = tru @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -657,9 +657,11 @@ public PagedIterable list(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createLongRunningWithResponseAsync(String name, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.createLongRunning(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), name, accept, resource, requestOptions, context)); + this.client.getServiceVersion().getVersion(), name, contentType, accept, resource, requestOptions, + context)); } /** @@ -696,9 +698,10 @@ private Mono> createLongRunningWithResponseAsync(String nam @ServiceMethod(returns = ReturnType.SINGLE) private Response createLongRunningWithResponse(String name, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.createLongRunningSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - name, accept, resource, requestOptions, Context.NONE); + name, contentType, accept, resource, requestOptions, Context.NONE); } /** @@ -886,6 +889,8 @@ public SyncPoller beginCreateLongRunningWithMode } /** + * Resource list operation template. + * * Get the next page of items. *

Response Body Schema

* @@ -917,6 +922,8 @@ private Mono> listNextSinglePageAsync(String nextLink, } /** + * Resource list operation template. + * * Get the next page of items. *

Response Body Schema

* diff --git a/typespec-tests/src/main/java/com/cadl/versioning/models/OperationState.java b/typespec-tests/src/main/java/com/cadl/versioning/models/OperationState.java new file mode 100644 index 0000000000..a7a4931780 --- /dev/null +++ b/typespec-tests/src/main/java/com/cadl/versioning/models/OperationState.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.cadl.versioning.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum describing allowed operation states. + */ +public final class OperationState extends ExpandableStringEnum { + /** + * The operation has not started. + */ + @Generated + public static final OperationState NOT_STARTED = fromString("NotStarted"); + + /** + * The operation is in progress. + */ + @Generated + public static final OperationState RUNNING = fromString("Running"); + + /** + * The operation has completed successfully. + */ + @Generated + public static final OperationState SUCCEEDED = fromString("Succeeded"); + + /** + * The operation has failed. + */ + @Generated + public static final OperationState FAILED = fromString("Failed"); + + /** + * The operation has been canceled by the user. + */ + @Generated + public static final OperationState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of OperationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public OperationState() { + } + + /** + * Creates or finds a OperationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationState. + */ + @Generated + public static OperationState fromString(String name) { + return fromString(name, OperationState.class); + } + + /** + * Gets known OperationState values. + * + * @return known OperationState values. + */ + @Generated + public static Collection values() { + return values(OperationState.class); + } +} diff --git a/typespec-tests/src/main/java/com/cadl/versioning/models/ResourceOperationStatusResourceExportedResourceError.java b/typespec-tests/src/main/java/com/cadl/versioning/models/ResourceOperationStatusResourceExportedResourceError.java new file mode 100644 index 0000000000..de9a241510 --- /dev/null +++ b/typespec-tests/src/main/java/com/cadl/versioning/models/ResourceOperationStatusResourceExportedResourceError.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.cadl.versioning.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.models.ResponseError; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Provides status details for long running operations. + */ +@Immutable +public final class ResourceOperationStatusResourceExportedResourceError + implements JsonSerializable { + /* + * The unique ID of the operation. + */ + @Generated + private String id; + + /* + * The status of the operation + */ + @Generated + private final OperationState status; + + /* + * Error object that describes the error when status is "Failed". + */ + @Generated + private ResponseError error; + + /* + * The result of the operation. + */ + @Generated + private ExportedResource result; + + /** + * Creates an instance of ResourceOperationStatusResourceExportedResourceError class. + * + * @param status the status value to set. + */ + @Generated + private ResourceOperationStatusResourceExportedResourceError(OperationState status) { + this.status = status; + } + + /** + * Get the id property: The unique ID of the operation. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the status property: The status of the operation. + * + * @return the status value. + */ + @Generated + public OperationState getStatus() { + return this.status; + } + + /** + * Get the error property: Error object that describes the error when status is "Failed". + * + * @return the error value. + */ + @Generated + public ResponseError getError() { + return this.error; + } + + /** + * Get the result property: The result of the operation. + * + * @return the result value. + */ + @Generated + public ExportedResource getResult() { + return this.result; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeJsonField("error", this.error); + jsonWriter.writeJsonField("result", this.result); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceOperationStatusResourceExportedResourceError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceOperationStatusResourceExportedResourceError if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceOperationStatusResourceExportedResourceError. + */ + @Generated + public static ResourceOperationStatusResourceExportedResourceError fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + OperationState status = null; + ResponseError error = null; + ExportedResource result = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("status".equals(fieldName)) { + status = OperationState.fromString(reader.getString()); + } else if ("error".equals(fieldName)) { + error = ResponseError.fromJson(reader); + } else if ("result".equals(fieldName)) { + result = ExportedResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + ResourceOperationStatusResourceExportedResourceError deserializedResourceOperationStatusResourceExportedResourceError + = new ResourceOperationStatusResourceExportedResourceError(status); + deserializedResourceOperationStatusResourceExportedResourceError.id = id; + deserializedResourceOperationStatusResourceExportedResourceError.error = error; + deserializedResourceOperationStatusResourceExportedResourceError.result = result; + + return deserializedResourceOperationStatusResourceExportedResourceError; + }); + } +} diff --git a/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityClientImpl.java b/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityClientImpl.java index e5b08514f9..e7e9451941 100644 --- a/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityClientImpl.java @@ -44,12 +44,12 @@ public final class VisibilityClientImpl { private final VisibilityClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -116,7 +116,7 @@ public VisibilityWritesImpl getVisibilityWrites() { /** * Initializes an instance of VisibilityClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public VisibilityClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -127,7 +127,7 @@ public VisibilityClientImpl(String endpoint) { * Initializes an instance of VisibilityClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public VisibilityClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -138,7 +138,7 @@ public VisibilityClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public VisibilityClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; @@ -162,7 +162,7 @@ public interface VisibilityClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/visibility/read") @@ -171,7 +171,7 @@ Mono> get(@HostParam("endpoint") String endpoint, @HeaderPa @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/visibility/write") @@ -180,7 +180,8 @@ Response getSync(@HostParam("endpoint") String endpoint, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> create(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> create(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData dog, RequestOptions requestOptions, Context context); @Put("/visibility/write") @@ -189,7 +190,8 @@ Mono> create(@HostParam("endpoint") String endpoint, @Heade @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response createSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData dog, RequestOptions requestOptions, Context context); @Post("/visibility/query") @@ -198,7 +200,8 @@ Response createSync(@HostParam("endpoint") String endpoint, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> query(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> query(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData dog, RequestOptions requestOptions, Context context); @Post("/visibility/query") @@ -207,7 +210,8 @@ Mono> query(@HostParam("endpoint") String endpoint, @Header @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response querySync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response querySync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData dog, RequestOptions requestOptions, Context context); @Put("/visibility/roundtrip") @@ -217,8 +221,8 @@ Response querySync(@HostParam("endpoint") String endpoint, @HeaderPa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> roundtrip(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/visibility/roundtrip") @ExpectedResponses({ 200 }) @@ -226,7 +230,8 @@ Mono> roundtrip(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response roundtripSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response roundtripSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -310,9 +315,10 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createWithResponseAsync(BinaryData dog, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.getEndpoint(), accept, dog, requestOptions, context)); + return FluxUtil.withContext( + context -> service.create(this.getEndpoint(), contentType, accept, dog, requestOptions, context)); } /** @@ -345,8 +351,9 @@ public Mono> createWithResponseAsync(BinaryData dog, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createWithResponse(BinaryData dog, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createSync(this.getEndpoint(), accept, dog, requestOptions, Context.NONE); + return service.createSync(this.getEndpoint(), contentType, accept, dog, requestOptions, Context.NONE); } /** @@ -380,8 +387,10 @@ public Response createWithResponse(BinaryData dog, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> queryWithResponseAsync(BinaryData dog, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.query(this.getEndpoint(), accept, dog, requestOptions, context)); + return FluxUtil.withContext( + context -> service.query(this.getEndpoint(), contentType, accept, dog, requestOptions, context)); } /** @@ -415,8 +424,9 @@ public Mono> queryWithResponseAsync(BinaryData dog, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response queryWithResponse(BinaryData dog, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.querySync(this.getEndpoint(), accept, dog, requestOptions, Context.NONE); + return service.querySync(this.getEndpoint(), contentType, accept, dog, requestOptions, Context.NONE); } /** @@ -449,9 +459,10 @@ public Response queryWithResponse(BinaryData dog, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> roundtripWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.roundtrip(this.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.roundtrip(this.getEndpoint(), contentType, accept, body, requestOptions, context)); } /** @@ -484,7 +495,8 @@ public Mono> roundtripWithResponseAsync(BinaryData body, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response roundtripWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.roundtripSync(this.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.roundtripSync(this.getEndpoint(), contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityReadsImpl.java b/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityReadsImpl.java index 1f963da1e5..0cc46f0a42 100644 --- a/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityReadsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityReadsImpl.java @@ -63,7 +63,7 @@ public interface VisibilityReadsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/read") @@ -72,7 +72,7 @@ Mono> get(@HostParam("endpoint") String endpoint, @HeaderPa @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityWritesImpl.java b/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityWritesImpl.java index f9949728ad..19648f316f 100644 --- a/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityWritesImpl.java +++ b/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityWritesImpl.java @@ -64,7 +64,8 @@ public interface VisibilityWritesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> create(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> create(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData dog, RequestOptions requestOptions, Context context); @Put("/write") @@ -73,7 +74,8 @@ Mono> create(@HostParam("endpoint") String endpoint, @Heade @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response createSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData dog, RequestOptions requestOptions, Context context); } @@ -107,9 +109,10 @@ Response createSync(@HostParam("endpoint") String endpoint, @HeaderP */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createWithResponseAsync(BinaryData dog, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), accept, dog, requestOptions, context)); + return FluxUtil.withContext( + context -> service.create(this.client.getEndpoint(), contentType, accept, dog, requestOptions, context)); } /** @@ -142,7 +145,8 @@ public Mono> createWithResponseAsync(BinaryData dog, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createWithResponse(BinaryData dog, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createSync(this.client.getEndpoint(), accept, dog, requestOptions, Context.NONE); + return service.createSync(this.client.getEndpoint(), contentType, accept, dog, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/wiretype/implementation/WireTypeClientImpl.java b/typespec-tests/src/main/java/com/cadl/wiretype/implementation/WireTypeClientImpl.java index f6f76dd425..8a6e2a8d30 100644 --- a/typespec-tests/src/main/java/com/cadl/wiretype/implementation/WireTypeClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/wiretype/implementation/WireTypeClientImpl.java @@ -16,12 +16,12 @@ */ public final class WireTypeClientImpl { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public WireTypeOpsImpl getWireTypeOps() { /** * Initializes an instance of WireTypeClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public WireTypeClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public WireTypeClientImpl(String endpoint) { * Initializes an instance of WireTypeClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public WireTypeClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public WireTypeClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public WireTypeClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/wiretype/implementation/WireTypeOpsImpl.java b/typespec-tests/src/main/java/com/cadl/wiretype/implementation/WireTypeOpsImpl.java index c539a58403..3ba14099ad 100644 --- a/typespec-tests/src/main/java/com/cadl/wiretype/implementation/WireTypeOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/wiretype/implementation/WireTypeOpsImpl.java @@ -65,8 +65,8 @@ public interface WireTypeOpsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> superClassMismatch(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData subClass, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData subClass, RequestOptions requestOptions, Context context); @Put("/wireType/superClassMismatch") @ExpectedResponses({ 200 }) @@ -75,8 +75,8 @@ Mono> superClassMismatch(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response superClassMismatchSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData subClass, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData subClass, RequestOptions requestOptions, Context context); @Put("/wireType/subClassMismatch") @ExpectedResponses({ 200 }) @@ -85,8 +85,8 @@ Response superClassMismatchSync(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> subClassMismatch(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData subClassMismatch, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData subClassMismatch, RequestOptions requestOptions, Context context); @Put("/wireType/subClassMismatch") @ExpectedResponses({ 200 }) @@ -95,8 +95,8 @@ Mono> subClassMismatch(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response subClassMismatchSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData subClassMismatch, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData subClassMismatch, RequestOptions requestOptions, Context context); @Put("/wireType/bothClassMismatch") @ExpectedResponses({ 200 }) @@ -105,8 +105,9 @@ Response subClassMismatchSync(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> bothClassMismatch(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData subClassBothMismatch, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData subClassBothMismatch, RequestOptions requestOptions, + Context context); @Put("/wireType/bothClassMismatch") @ExpectedResponses({ 200 }) @@ -115,8 +116,9 @@ Mono> bothClassMismatch(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response bothClassMismatchSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData subClassBothMismatch, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData subClassBothMismatch, RequestOptions requestOptions, + Context context); } /** @@ -150,9 +152,10 @@ Response bothClassMismatchSync(@HostParam("endpoint") String endpoin @ServiceMethod(returns = ReturnType.SINGLE) public Mono> superClassMismatchWithResponseAsync(BinaryData subClass, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.superClassMismatch(this.client.getEndpoint(), accept, subClass, - requestOptions, context)); + return FluxUtil.withContext(context -> service.superClassMismatch(this.client.getEndpoint(), contentType, + accept, subClass, requestOptions, context)); } /** @@ -185,8 +188,9 @@ public Mono> superClassMismatchWithResponseAsync(BinaryData */ @ServiceMethod(returns = ReturnType.SINGLE) public Response superClassMismatchWithResponse(BinaryData subClass, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.superClassMismatchSync(this.client.getEndpoint(), accept, subClass, requestOptions, + return service.superClassMismatchSync(this.client.getEndpoint(), contentType, accept, subClass, requestOptions, Context.NONE); } @@ -221,8 +225,9 @@ public Response superClassMismatchWithResponse(BinaryData subClass, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> subClassMismatchWithResponseAsync(BinaryData subClassMismatch, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.subClassMismatch(this.client.getEndpoint(), accept, + return FluxUtil.withContext(context -> service.subClassMismatch(this.client.getEndpoint(), contentType, accept, subClassMismatch, requestOptions, context)); } @@ -257,9 +262,10 @@ public Mono> subClassMismatchWithResponseAsync(BinaryData s @ServiceMethod(returns = ReturnType.SINGLE) public Response subClassMismatchWithResponse(BinaryData subClassMismatch, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.subClassMismatchSync(this.client.getEndpoint(), accept, subClassMismatch, requestOptions, - Context.NONE); + return service.subClassMismatchSync(this.client.getEndpoint(), contentType, accept, subClassMismatch, + requestOptions, Context.NONE); } /** @@ -293,8 +299,9 @@ public Response subClassMismatchWithResponse(BinaryData subClassMism @ServiceMethod(returns = ReturnType.SINGLE) public Mono> bothClassMismatchWithResponseAsync(BinaryData subClassBothMismatch, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.bothClassMismatch(this.client.getEndpoint(), accept, + return FluxUtil.withContext(context -> service.bothClassMismatch(this.client.getEndpoint(), contentType, accept, subClassBothMismatch, requestOptions, context)); } @@ -329,8 +336,9 @@ public Mono> bothClassMismatchWithResponseAsync(BinaryData @ServiceMethod(returns = ReturnType.SINGLE) public Response bothClassMismatchWithResponse(BinaryData subClassBothMismatch, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.bothClassMismatchSync(this.client.getEndpoint(), accept, subClassBothMismatch, requestOptions, - Context.NONE); + return service.bothClassMismatchSync(this.client.getEndpoint(), contentType, accept, subClassBothMismatch, + requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/naming/implementation/ModelsImpl.java b/typespec-tests/src/main/java/com/client/naming/implementation/ModelsImpl.java index 90de3ba70b..a051101a98 100644 --- a/typespec-tests/src/main/java/com/client/naming/implementation/ModelsImpl.java +++ b/typespec-tests/src/main/java/com/client/naming/implementation/ModelsImpl.java @@ -62,7 +62,7 @@ public interface ModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> client(@HeaderParam("accept") String accept, + Mono> client(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData clientModel, RequestOptions requestOptions, Context context); @Post("/client/naming/model/client") @@ -71,7 +71,7 @@ Mono> client(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response clientSync(@HeaderParam("accept") String accept, + Response clientSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData clientModel, RequestOptions requestOptions, Context context); @Post("/client/naming/model/language") @@ -80,7 +80,7 @@ Response clientSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> language(@HeaderParam("accept") String accept, + Mono> language(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData javaModel, RequestOptions requestOptions, Context context); @Post("/client/naming/model/language") @@ -89,7 +89,7 @@ Mono> language(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response languageSync(@HeaderParam("accept") String accept, + Response languageSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData javaModel, RequestOptions requestOptions, Context context); } @@ -113,8 +113,8 @@ Response languageSync(@HeaderParam("accept") String accept, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> clientWithResponseAsync(BinaryData clientModel, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.client(accept, clientModel, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.client(contentType, clientModel, requestOptions, context)); } /** @@ -137,8 +137,8 @@ public Mono> clientWithResponseAsync(BinaryData clientModel, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response clientWithResponse(BinaryData clientModel, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.clientSync(accept, clientModel, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.clientSync(contentType, clientModel, requestOptions, Context.NONE); } /** @@ -161,8 +161,8 @@ public Response clientWithResponse(BinaryData clientModel, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> languageWithResponseAsync(BinaryData javaModel, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.language(accept, javaModel, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.language(contentType, javaModel, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> languageWithResponseAsync(BinaryData javaModel, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response languageWithResponse(BinaryData javaModel, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.languageSync(accept, javaModel, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.languageSync(contentType, javaModel, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/naming/implementation/NamingClientImpl.java b/typespec-tests/src/main/java/com/client/naming/implementation/NamingClientImpl.java index 9ed5aa375d..ae149bc935 100644 --- a/typespec-tests/src/main/java/com/client/naming/implementation/NamingClientImpl.java +++ b/typespec-tests/src/main/java/com/client/naming/implementation/NamingClientImpl.java @@ -141,8 +141,7 @@ public interface NamingClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> clientName(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> clientName(RequestOptions requestOptions, Context context); @Post("/client/naming/operation") @ExpectedResponses({ 204 }) @@ -150,8 +149,7 @@ Mono> clientName(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response clientNameSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response clientNameSync(RequestOptions requestOptions, Context context); @Post("/client/naming/parameter") @ExpectedResponses({ 204 }) @@ -159,8 +157,8 @@ Response clientNameSync(@HeaderParam("accept") String accept, RequestOptio @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> parameter(@QueryParam("defaultName") String clientName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> parameter(@QueryParam("defaultName") String clientName, RequestOptions requestOptions, + Context context); @Post("/client/naming/parameter") @ExpectedResponses({ 204 }) @@ -168,8 +166,8 @@ Mono> parameter(@QueryParam("defaultName") String clientName, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response parameterSync(@QueryParam("defaultName") String clientName, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response parameterSync(@QueryParam("defaultName") String clientName, RequestOptions requestOptions, + Context context); @Post("/client/naming/property/client") @ExpectedResponses({ 204 }) @@ -177,7 +175,7 @@ Response parameterSync(@QueryParam("defaultName") String clientName, @Head @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> client(@HeaderParam("accept") String accept, + Mono> client(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData clientNameModel, RequestOptions requestOptions, Context context); @Post("/client/naming/property/client") @@ -186,7 +184,7 @@ Mono> client(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response clientSync(@HeaderParam("accept") String accept, + Response clientSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData clientNameModel, RequestOptions requestOptions, Context context); @Post("/client/naming/property/language") @@ -195,7 +193,7 @@ Response clientSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> language(@HeaderParam("accept") String accept, + Mono> language(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData languageClientNameModel, RequestOptions requestOptions, Context context); @@ -205,7 +203,7 @@ Mono> language(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response languageSync(@HeaderParam("accept") String accept, + Response languageSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData languageClientNameModel, RequestOptions requestOptions, Context context); @@ -215,7 +213,7 @@ Response languageSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> compatibleWithEncodedName(@HeaderParam("accept") String accept, + Mono> compatibleWithEncodedName(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData clientNameAndJsonEncodedNameModel, RequestOptions requestOptions, Context context); @@ -225,7 +223,7 @@ Mono> compatibleWithEncodedName(@HeaderParam("accept") String acc @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response compatibleWithEncodedNameSync(@HeaderParam("accept") String accept, + Response compatibleWithEncodedNameSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData clientNameAndJsonEncodedNameModel, RequestOptions requestOptions, Context context); @@ -235,8 +233,8 @@ Response compatibleWithEncodedNameSync(@HeaderParam("accept") String accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> request(@HeaderParam("default-name") String clientName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> request(@HeaderParam("default-name") String clientName, RequestOptions requestOptions, + Context context); @Post("/client/naming/header") @ExpectedResponses({ 204 }) @@ -244,8 +242,8 @@ Mono> request(@HeaderParam("default-name") String clientName, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requestSync(@HeaderParam("default-name") String clientName, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response requestSync(@HeaderParam("default-name") String clientName, RequestOptions requestOptions, + Context context); @Get("/client/naming/header") @ExpectedResponses({ 204 }) @@ -253,8 +251,7 @@ Response requestSync(@HeaderParam("default-name") String clientName, @Head @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> response(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> response(RequestOptions requestOptions, Context context); @Get("/client/naming/header") @ExpectedResponses({ 204 }) @@ -262,8 +259,7 @@ Mono> response(@HeaderParam("accept") String accept, RequestOptio @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response responseSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response responseSync(RequestOptions requestOptions, Context context); } /** @@ -278,8 +274,7 @@ Response responseSync(@HeaderParam("accept") String accept, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> clientNameWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.clientName(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.clientName(requestOptions, context)); } /** @@ -294,8 +289,7 @@ public Mono> clientNameWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response clientNameWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.clientNameSync(accept, requestOptions, Context.NONE); + return service.clientNameSync(requestOptions, Context.NONE); } /** @@ -311,8 +305,7 @@ public Response clientNameWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> parameterWithResponseAsync(String clientName, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.parameter(clientName, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.parameter(clientName, requestOptions, context)); } /** @@ -328,8 +321,7 @@ public Mono> parameterWithResponseAsync(String clientName, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response parameterWithResponse(String clientName, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.parameterSync(clientName, accept, requestOptions, Context.NONE); + return service.parameterSync(clientName, requestOptions, Context.NONE); } /** @@ -352,8 +344,8 @@ public Response parameterWithResponse(String clientName, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> clientWithResponseAsync(BinaryData clientNameModel, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.client(accept, clientNameModel, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.client(contentType, clientNameModel, requestOptions, context)); } /** @@ -376,8 +368,8 @@ public Mono> clientWithResponseAsync(BinaryData clientNameModel, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response clientWithResponse(BinaryData clientNameModel, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.clientSync(accept, clientNameModel, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.clientSync(contentType, clientNameModel, requestOptions, Context.NONE); } /** @@ -401,9 +393,9 @@ public Response clientWithResponse(BinaryData clientNameModel, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Mono> languageWithResponseAsync(BinaryData languageClientNameModel, RequestOptions requestOptions) { - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil - .withContext(context -> service.language(accept, languageClientNameModel, requestOptions, context)); + .withContext(context -> service.language(contentType, languageClientNameModel, requestOptions, context)); } /** @@ -426,8 +418,8 @@ public Mono> languageWithResponseAsync(BinaryData languageClientN */ @ServiceMethod(returns = ReturnType.SINGLE) public Response languageWithResponse(BinaryData languageClientNameModel, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.languageSync(accept, languageClientNameModel, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.languageSync(contentType, languageClientNameModel, requestOptions, Context.NONE); } /** @@ -451,8 +443,8 @@ public Response languageWithResponse(BinaryData languageClientNameModel, R @ServiceMethod(returns = ReturnType.SINGLE) public Mono> compatibleWithEncodedNameWithResponseAsync(BinaryData clientNameAndJsonEncodedNameModel, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.compatibleWithEncodedName(accept, + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.compatibleWithEncodedName(contentType, clientNameAndJsonEncodedNameModel, requestOptions, context)); } @@ -477,8 +469,8 @@ public Mono> compatibleWithEncodedNameWithResponseAsync(BinaryDat @ServiceMethod(returns = ReturnType.SINGLE) public Response compatibleWithEncodedNameWithResponse(BinaryData clientNameAndJsonEncodedNameModel, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.compatibleWithEncodedNameSync(accept, clientNameAndJsonEncodedNameModel, requestOptions, + final String contentType = "application/json"; + return service.compatibleWithEncodedNameSync(contentType, clientNameAndJsonEncodedNameModel, requestOptions, Context.NONE); } @@ -495,8 +487,7 @@ public Response compatibleWithEncodedNameWithResponse(BinaryData clientNam */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> requestWithResponseAsync(String clientName, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.request(clientName, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.request(clientName, requestOptions, context)); } /** @@ -512,8 +503,7 @@ public Mono> requestWithResponseAsync(String clientName, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response requestWithResponse(String clientName, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.requestSync(clientName, accept, requestOptions, Context.NONE); + return service.requestSync(clientName, requestOptions, Context.NONE); } /** @@ -528,8 +518,7 @@ public Response requestWithResponse(String clientName, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.response(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.response(requestOptions, context)); } /** @@ -544,7 +533,6 @@ public Mono> responseWithResponseAsync(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response responseWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.responseSync(accept, requestOptions, Context.NONE); + return service.responseSync(requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/naming/implementation/UnionEnumsImpl.java b/typespec-tests/src/main/java/com/client/naming/implementation/UnionEnumsImpl.java index 5e4fab48e7..b7ff363129 100644 --- a/typespec-tests/src/main/java/com/client/naming/implementation/UnionEnumsImpl.java +++ b/typespec-tests/src/main/java/com/client/naming/implementation/UnionEnumsImpl.java @@ -63,7 +63,7 @@ public interface UnionEnumsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unionEnumName(@HeaderParam("accept") String accept, + Mono> unionEnumName(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/client/naming/union-enum/union-enum-name") @@ -72,7 +72,7 @@ Mono> unionEnumName(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unionEnumNameSync(@HeaderParam("accept") String accept, + Response unionEnumNameSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/client/naming/union-enum/union-enum-member-name") @@ -81,7 +81,7 @@ Response unionEnumNameSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unionEnumMemberName(@HeaderParam("accept") String accept, + Mono> unionEnumMemberName(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/client/naming/union-enum/union-enum-member-name") @@ -90,7 +90,7 @@ Mono> unionEnumMemberName(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unionEnumMemberNameSync(@HeaderParam("accept") String accept, + Response unionEnumMemberNameSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -112,8 +112,8 @@ Response unionEnumMemberNameSync(@HeaderParam("accept") String accept, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unionEnumNameWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.unionEnumName(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.unionEnumName(contentType, body, requestOptions, context)); } /** @@ -134,8 +134,8 @@ public Mono> unionEnumNameWithResponseAsync(BinaryData body, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response unionEnumNameWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.unionEnumNameSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.unionEnumNameSync(contentType, body, requestOptions, Context.NONE); } /** @@ -156,8 +156,8 @@ public Response unionEnumNameWithResponse(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unionEnumMemberNameWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.unionEnumMemberName(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.unionEnumMemberName(contentType, body, requestOptions, context)); } /** @@ -178,7 +178,7 @@ public Mono> unionEnumMemberNameWithResponseAsync(BinaryData body */ @ServiceMethod(returns = ReturnType.SINGLE) public Response unionEnumMemberNameWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.unionEnumMemberNameSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.unionEnumMemberNameSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/BarAsyncClient.java b/typespec-tests/src/main/java/com/client/structure/service/BarAsyncClient.java index bbe990bbf5..8f79908e4a 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/BarAsyncClient.java +++ b/typespec-tests/src/main/java/com/client/structure/service/BarAsyncClient.java @@ -37,7 +37,7 @@ public final class BarAsyncClient { } /** - * The five operation. + * The nine operation. * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -48,46 +48,12 @@ public final class BarAsyncClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> fiveWithResponse(RequestOptions requestOptions) { - return this.serviceClient.fiveWithResponseAsync(requestOptions); + public Mono> nineWithResponse(RequestOptions requestOptions) { + return this.serviceClient.nineWithResponseAsync(requestOptions); } /** - * The six operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sixWithResponse(RequestOptions requestOptions) { - return this.serviceClient.sixWithResponseAsync(requestOptions); - } - - /** - * The five operation. - * - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono five() { - // Generated convenience method for fiveWithResponse - RequestOptions requestOptions = new RequestOptions(); - return fiveWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The six operation. + * The nine operation. * * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -98,9 +64,9 @@ public Mono five() { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono six() { - // Generated convenience method for sixWithResponse + public Mono nine() { + // Generated convenience method for nineWithResponse RequestOptions requestOptions = new RequestOptions(); - return sixWithResponse(requestOptions).flatMap(FluxUtil::toMono); + return nineWithResponse(requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/BarClient.java b/typespec-tests/src/main/java/com/client/structure/service/BarClient.java index 143f32d994..674e32e86d 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/BarClient.java +++ b/typespec-tests/src/main/java/com/client/structure/service/BarClient.java @@ -35,7 +35,7 @@ public final class BarClient { } /** - * The five operation. + * The nine operation. * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -46,45 +46,12 @@ public final class BarClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response fiveWithResponse(RequestOptions requestOptions) { - return this.serviceClient.fiveWithResponse(requestOptions); + public Response nineWithResponse(RequestOptions requestOptions) { + return this.serviceClient.nineWithResponse(requestOptions); } /** - * The six operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response sixWithResponse(RequestOptions requestOptions) { - return this.serviceClient.sixWithResponse(requestOptions); - } - - /** - * The five operation. - * - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void five() { - // Generated convenience method for fiveWithResponse - RequestOptions requestOptions = new RequestOptions(); - fiveWithResponse(requestOptions).getValue(); - } - - /** - * The six operation. + * The nine operation. * * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -94,9 +61,9 @@ public void five() { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void six() { - // Generated convenience method for sixWithResponse + public void nine() { + // Generated convenience method for nineWithResponse RequestOptions requestOptions = new RequestOptions(); - sixWithResponse(requestOptions).getValue(); + nineWithResponse(requestOptions).getValue(); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/BazFooAsyncClient.java b/typespec-tests/src/main/java/com/client/structure/service/BazAsyncClient.java similarity index 91% rename from typespec-tests/src/main/java/com/client/structure/service/BazFooAsyncClient.java rename to typespec-tests/src/main/java/com/client/structure/service/BazAsyncClient.java index 148e5f967e..75b42367f2 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/BazFooAsyncClient.java +++ b/typespec-tests/src/main/java/com/client/structure/service/BazAsyncClient.java @@ -15,24 +15,24 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.FluxUtil; -import com.client.structure.service.implementation.BazFoosImpl; +import com.client.structure.service.implementation.BazesImpl; import reactor.core.publisher.Mono; /** * Initializes a new instance of the asynchronous ServiceClientClient type. */ @ServiceClient(builder = ServiceClientClientBuilder.class, isAsync = true) -public final class BazFooAsyncClient { +public final class BazAsyncClient { @Generated - private final BazFoosImpl serviceClient; + private final BazesImpl serviceClient; /** - * Initializes an instance of BazFooAsyncClient class. + * Initializes an instance of BazAsyncClient class. * * @param serviceClient the service client implementation. */ @Generated - BazFooAsyncClient(BazFoosImpl serviceClient) { + BazAsyncClient(BazesImpl serviceClient) { this.serviceClient = serviceClient; } diff --git a/typespec-tests/src/main/java/com/client/structure/service/BazFooClient.java b/typespec-tests/src/main/java/com/client/structure/service/BazClient.java similarity index 91% rename from typespec-tests/src/main/java/com/client/structure/service/BazFooClient.java rename to typespec-tests/src/main/java/com/client/structure/service/BazClient.java index ad4d877d21..99c1653bb4 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/BazFooClient.java +++ b/typespec-tests/src/main/java/com/client/structure/service/BazClient.java @@ -14,23 +14,23 @@ import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; -import com.client.structure.service.implementation.BazFoosImpl; +import com.client.structure.service.implementation.BazesImpl; /** * Initializes a new instance of the synchronous ServiceClientClient type. */ @ServiceClient(builder = ServiceClientClientBuilder.class) -public final class BazFooClient { +public final class BazClient { @Generated - private final BazFoosImpl serviceClient; + private final BazesImpl serviceClient; /** - * Initializes an instance of BazFooClient class. + * Initializes an instance of BazClient class. * * @param serviceClient the service client implementation. */ @Generated - BazFooClient(BazFoosImpl serviceClient) { + BazClient(BazesImpl serviceClient) { this.serviceClient = serviceClient; } diff --git a/typespec-tests/src/main/java/com/client/structure/service/FooAsyncClient.java b/typespec-tests/src/main/java/com/client/structure/service/FooAsyncClient.java index 59cad1963c..6f00f9b921 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/FooAsyncClient.java +++ b/typespec-tests/src/main/java/com/client/structure/service/FooAsyncClient.java @@ -37,7 +37,7 @@ public final class FooAsyncClient { } /** - * The three operation. + * The seven operation. * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -48,46 +48,12 @@ public final class FooAsyncClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> threeWithResponse(RequestOptions requestOptions) { - return this.serviceClient.threeWithResponseAsync(requestOptions); + public Mono> sevenWithResponse(RequestOptions requestOptions) { + return this.serviceClient.sevenWithResponseAsync(requestOptions); } /** - * The four operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> fourWithResponse(RequestOptions requestOptions) { - return this.serviceClient.fourWithResponseAsync(requestOptions); - } - - /** - * The three operation. - * - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono three() { - // Generated convenience method for threeWithResponse - RequestOptions requestOptions = new RequestOptions(); - return threeWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The four operation. + * The seven operation. * * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -98,9 +64,9 @@ public Mono three() { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono four() { - // Generated convenience method for fourWithResponse + public Mono seven() { + // Generated convenience method for sevenWithResponse RequestOptions requestOptions = new RequestOptions(); - return fourWithResponse(requestOptions).flatMap(FluxUtil::toMono); + return sevenWithResponse(requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/FooClient.java b/typespec-tests/src/main/java/com/client/structure/service/FooClient.java index 1117edf9dc..73c6686240 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/FooClient.java +++ b/typespec-tests/src/main/java/com/client/structure/service/FooClient.java @@ -35,7 +35,7 @@ public final class FooClient { } /** - * The three operation. + * The seven operation. * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -46,45 +46,12 @@ public final class FooClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response threeWithResponse(RequestOptions requestOptions) { - return this.serviceClient.threeWithResponse(requestOptions); + public Response sevenWithResponse(RequestOptions requestOptions) { + return this.serviceClient.sevenWithResponse(requestOptions); } /** - * The four operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response fourWithResponse(RequestOptions requestOptions) { - return this.serviceClient.fourWithResponse(requestOptions); - } - - /** - * The three operation. - * - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void three() { - // Generated convenience method for threeWithResponse - RequestOptions requestOptions = new RequestOptions(); - threeWithResponse(requestOptions).getValue(); - } - - /** - * The four operation. + * The seven operation. * * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -94,9 +61,9 @@ public void three() { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void four() { - // Generated convenience method for fourWithResponse + public void seven() { + // Generated convenience method for sevenWithResponse RequestOptions requestOptions = new RequestOptions(); - fourWithResponse(requestOptions).getValue(); + sevenWithResponse(requestOptions).getValue(); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/QuxAsyncClient.java b/typespec-tests/src/main/java/com/client/structure/service/QuxAsyncClient.java index e030c34110..f49c3673c8 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/QuxAsyncClient.java +++ b/typespec-tests/src/main/java/com/client/structure/service/QuxAsyncClient.java @@ -52,6 +52,22 @@ public Mono> eightWithResponse(RequestOptions requestOptions) { return this.serviceClient.eightWithResponseAsync(requestOptions); } + /** + * The nine operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> nineWithResponse(RequestOptions requestOptions) { + return this.serviceClient.nineWithResponseAsync(requestOptions); + } + /** * The eight operation. * @@ -69,4 +85,22 @@ public Mono eight() { RequestOptions requestOptions = new RequestOptions(); return eightWithResponse(requestOptions).flatMap(FluxUtil::toMono); } + + /** + * The nine operation. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono nine() { + // Generated convenience method for nineWithResponse + RequestOptions requestOptions = new RequestOptions(); + return nineWithResponse(requestOptions).flatMap(FluxUtil::toMono); + } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/QuxBarAsyncClient.java b/typespec-tests/src/main/java/com/client/structure/service/QuxBarAsyncClient.java deleted file mode 100644 index 0b2b66db87..0000000000 --- a/typespec-tests/src/main/java/com/client/structure/service/QuxBarAsyncClient.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.client.structure.service; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.FluxUtil; -import com.client.structure.service.implementation.QuxBarsImpl; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the asynchronous ServiceClientClient type. - */ -@ServiceClient(builder = ServiceClientClientBuilder.class, isAsync = true) -public final class QuxBarAsyncClient { - @Generated - private final QuxBarsImpl serviceClient; - - /** - * Initializes an instance of QuxBarAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - QuxBarAsyncClient(QuxBarsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The nine operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> nineWithResponse(RequestOptions requestOptions) { - return this.serviceClient.nineWithResponseAsync(requestOptions); - } - - /** - * The nine operation. - * - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono nine() { - // Generated convenience method for nineWithResponse - RequestOptions requestOptions = new RequestOptions(); - return nineWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } -} diff --git a/typespec-tests/src/main/java/com/client/structure/service/QuxBarClient.java b/typespec-tests/src/main/java/com/client/structure/service/QuxBarClient.java deleted file mode 100644 index e78b9258e7..0000000000 --- a/typespec-tests/src/main/java/com/client/structure/service/QuxBarClient.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.client.structure.service; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.client.structure.service.implementation.QuxBarsImpl; - -/** - * Initializes a new instance of the synchronous ServiceClientClient type. - */ -@ServiceClient(builder = ServiceClientClientBuilder.class) -public final class QuxBarClient { - @Generated - private final QuxBarsImpl serviceClient; - - /** - * Initializes an instance of QuxBarClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - QuxBarClient(QuxBarsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The nine operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response nineWithResponse(RequestOptions requestOptions) { - return this.serviceClient.nineWithResponse(requestOptions); - } - - /** - * The nine operation. - * - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void nine() { - // Generated convenience method for nineWithResponse - RequestOptions requestOptions = new RequestOptions(); - nineWithResponse(requestOptions).getValue(); - } -} diff --git a/typespec-tests/src/main/java/com/client/structure/service/QuxClient.java b/typespec-tests/src/main/java/com/client/structure/service/QuxClient.java index 0bc793ca58..c369e62d6f 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/QuxClient.java +++ b/typespec-tests/src/main/java/com/client/structure/service/QuxClient.java @@ -50,6 +50,22 @@ public Response eightWithResponse(RequestOptions requestOptions) { return this.serviceClient.eightWithResponse(requestOptions); } + /** + * The nine operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response nineWithResponse(RequestOptions requestOptions) { + return this.serviceClient.nineWithResponse(requestOptions); + } + /** * The eight operation. * @@ -66,4 +82,21 @@ public void eight() { RequestOptions requestOptions = new RequestOptions(); eightWithResponse(requestOptions).getValue(); } + + /** + * The nine operation. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void nine() { + // Generated convenience method for nineWithResponse + RequestOptions requestOptions = new RequestOptions(); + nineWithResponse(requestOptions).getValue(); + } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/ServiceClientClientBuilder.java b/typespec-tests/src/main/java/com/client/structure/service/ServiceClientClientBuilder.java index b162ae1114..68d24f132d 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/ServiceClientClientBuilder.java +++ b/typespec-tests/src/main/java/com/client/structure/service/ServiceClientClientBuilder.java @@ -43,15 +43,17 @@ @ServiceClientBuilder( serviceClients = { ServiceClientClient.class, - BazFooClient.class, + BazClient.class, + FooClient.class, QuxClient.class, - QuxBarClient.class, + BarClient.class, FooClient.class, BarClient.class, ServiceClientAsyncClient.class, - BazFooAsyncClient.class, + BazAsyncClient.class, + FooAsyncClient.class, QuxAsyncClient.class, - QuxBarAsyncClient.class, + BarAsyncClient.class, FooAsyncClient.class, BarAsyncClient.class }) public final class ServiceClientClientBuilder implements HttpTrait, @@ -307,13 +309,23 @@ public ServiceClientAsyncClient buildAsyncClient() { } /** - * Builds an instance of BazFooAsyncClient class. + * Builds an instance of BazAsyncClient class. + * + * @return an instance of BazAsyncClient. + */ + @Generated + public BazAsyncClient buildBazAsyncClient() { + return new BazAsyncClient(buildInnerClient().getBazes()); + } + + /** + * Builds an instance of FooAsyncClient class. * - * @return an instance of BazFooAsyncClient. + * @return an instance of FooAsyncClient. */ @Generated - public BazFooAsyncClient buildBazFooAsyncClient() { - return new BazFooAsyncClient(buildInnerClient().getBazFoos()); + public FooAsyncClient buildFooAsyncClient() { + return new FooAsyncClient(buildInnerClient().getFoos()); } /** @@ -327,13 +339,13 @@ public QuxAsyncClient buildQuxAsyncClient() { } /** - * Builds an instance of QuxBarAsyncClient class. + * Builds an instance of BarAsyncClient class. * - * @return an instance of QuxBarAsyncClient. + * @return an instance of BarAsyncClient. */ @Generated - public QuxBarAsyncClient buildQuxBarAsyncClient() { - return new QuxBarAsyncClient(buildInnerClient().getQuxBars()); + public BarAsyncClient buildBarAsyncClient() { + return new BarAsyncClient(buildInnerClient().getBars()); } /** @@ -343,7 +355,7 @@ public QuxBarAsyncClient buildQuxBarAsyncClient() { */ @Generated public FooAsyncClient buildFooAsyncClient() { - return new FooAsyncClient(buildInnerClient().getFoos()); + return new FooAsyncClient(buildInnerClient().getFoosOperations()); } /** @@ -353,7 +365,7 @@ public FooAsyncClient buildFooAsyncClient() { */ @Generated public BarAsyncClient buildBarAsyncClient() { - return new BarAsyncClient(buildInnerClient().getBars()); + return new BarAsyncClient(buildInnerClient().getBarsOperations()); } /** @@ -367,13 +379,23 @@ public ServiceClientClient buildClient() { } /** - * Builds an instance of BazFooClient class. + * Builds an instance of BazClient class. * - * @return an instance of BazFooClient. + * @return an instance of BazClient. */ @Generated - public BazFooClient buildBazFooClient() { - return new BazFooClient(buildInnerClient().getBazFoos()); + public BazClient buildBazClient() { + return new BazClient(buildInnerClient().getBazes()); + } + + /** + * Builds an instance of FooClient class. + * + * @return an instance of FooClient. + */ + @Generated + public FooClient buildFooClient() { + return new FooClient(buildInnerClient().getFoos()); } /** @@ -387,13 +409,13 @@ public QuxClient buildQuxClient() { } /** - * Builds an instance of QuxBarClient class. + * Builds an instance of BarClient class. * - * @return an instance of QuxBarClient. + * @return an instance of BarClient. */ @Generated - public QuxBarClient buildQuxBarClient() { - return new QuxBarClient(buildInnerClient().getQuxBars()); + public BarClient buildBarClient() { + return new BarClient(buildInnerClient().getBars()); } /** @@ -403,7 +425,7 @@ public QuxBarClient buildQuxBarClient() { */ @Generated public FooClient buildFooClient() { - return new FooClient(buildInnerClient().getFoos()); + return new FooClient(buildInnerClient().getFoosOperations()); } /** @@ -413,7 +435,7 @@ public FooClient buildFooClient() { */ @Generated public BarClient buildBarClient() { - return new BarClient(buildInnerClient().getBars()); + return new BarClient(buildInnerClient().getBarsOperations()); } private static final ClientLogger LOGGER = new ClientLogger(ServiceClientClientBuilder.class); diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/BarsImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/BarsImpl.java index 310679abf4..742dfdc2b5 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/BarsImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/BarsImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -55,79 +54,27 @@ public final class BarsImpl { @Host("{endpoint}/client/structure/{client}") @ServiceInterface(name = "ServiceClientClientB") public interface BarsService { - @Post("/five") + @Post("/nine") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> five(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> nine(@HostParam("endpoint") String endpoint, @HostParam("client") String client, + RequestOptions requestOptions, Context context); - @Post("/five") + @Post("/nine") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response fiveSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - - @Post("/six") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> six(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - - @Post("/six") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sixSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - } - - /** - * The five operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> fiveWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.five(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); - } - - /** - * The five operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response fiveWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.fiveSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + Response nineSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, + RequestOptions requestOptions, Context context); } /** - * The six operation. + * The nine operation. * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -137,14 +84,13 @@ public Response fiveWithResponse(RequestOptions requestOptions) { * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sixWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.six(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + public Mono> nineWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> service.nine(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** - * The six operation. + * The nine operation. * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -154,9 +100,7 @@ public Mono> sixWithResponseAsync(RequestOptions requestOptions) * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response sixWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sixSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + public Response nineWithResponse(RequestOptions requestOptions) { + return service.nineSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/BarsOperationsImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/BarsOperationsImpl.java new file mode 100644 index 0000000000..cadfd0af7a --- /dev/null +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/BarsOperationsImpl.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.client.structure.service.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in BarsOperations. + */ +public final class BarsOperationsImpl { + /** + * The proxy service used to perform REST calls. + */ + private final BarsService service; + + /** + * The service client containing this operation class. + */ + private final ServiceClientClientImpl client; + + /** + * Initializes an instance of BarsOperationsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BarsOperationsImpl(ServiceClientClientImpl client) { + this.service = RestProxy.create(BarsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceClientClientBarsOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}/client/structure/{client}") + @ServiceInterface(name = "ServiceClientClientB") + public interface BarsService { + @Post("/five") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> five(@HostParam("endpoint") String endpoint, @HostParam("client") String client, + RequestOptions requestOptions, Context context); + + @Post("/five") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response fiveSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, + RequestOptions requestOptions, Context context); + + @Post("/six") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> six(@HostParam("endpoint") String endpoint, @HostParam("client") String client, + RequestOptions requestOptions, Context context); + + @Post("/six") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response sixSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, + RequestOptions requestOptions, Context context); + } + + /** + * The five operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> fiveWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> service.five(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); + } + + /** + * The five operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response fiveWithResponse(RequestOptions requestOptions) { + return service.fiveSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); + } + + /** + * The six operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> sixWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> service.six(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); + } + + /** + * The six operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response sixWithResponse(RequestOptions requestOptions) { + return service.sixSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); + } +} diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/BazFoosImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/BazesImpl.java similarity index 81% rename from typespec-tests/src/main/java/com/client/structure/service/implementation/BazFoosImpl.java rename to typespec-tests/src/main/java/com/client/structure/service/implementation/BazesImpl.java index 93f545ee85..465ec4f84c 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/BazFoosImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/BazesImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -25,13 +24,13 @@ import reactor.core.publisher.Mono; /** - * An instance of this class provides access to all the operations defined in BazFoos. + * An instance of this class provides access to all the operations defined in Bazes. */ -public final class BazFoosImpl { +public final class BazesImpl { /** * The proxy service used to perform REST calls. */ - private final BazFoosService service; + private final BazesService service; /** * The service client containing this operation class. @@ -39,22 +38,22 @@ public final class BazFoosImpl { private final ServiceClientClientImpl client; /** - * Initializes an instance of BazFoosImpl. + * Initializes an instance of BazesImpl. * * @param client the instance of the service client containing this operation class. */ - BazFoosImpl(ServiceClientClientImpl client) { - this.service = RestProxy.create(BazFoosService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + BazesImpl(ServiceClientClientImpl client) { + this.service = RestProxy.create(BazesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for ServiceClientClientBazFoos to be used by the proxy service to perform + * The interface defining all the services for ServiceClientClientBazes to be used by the proxy service to perform * REST calls. */ @Host("{endpoint}/client/structure/{client}") @ServiceInterface(name = "ServiceClientClientB") - public interface BazFoosService { + public interface BazesService { @Post("/seven") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -62,7 +61,7 @@ public interface BazFoosService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> seven(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/seven") @ExpectedResponses({ 204 }) @@ -71,7 +70,7 @@ Mono> seven(@HostParam("endpoint") String endpoint, @HostParam("c @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response sevenSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -86,9 +85,8 @@ Response sevenSync(@HostParam("endpoint") String endpoint, @HostParam("cli */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sevenWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.seven(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.seven(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -103,8 +101,6 @@ public Mono> sevenWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sevenWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sevenSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.sevenSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/ClientAClientImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/ClientAClientImpl.java index b0d94bf2d0..0522be5c4f 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/ClientAClientImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/ClientAClientImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -147,7 +146,7 @@ public interface ClientAClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedOne(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/one") @ExpectedResponses({ 204 }) @@ -156,7 +155,7 @@ Mono> renamedOne(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedOneSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/three") @ExpectedResponses({ 204 }) @@ -165,7 +164,7 @@ Response renamedOneSync(@HostParam("endpoint") String endpoint, @HostParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedThree(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/three") @ExpectedResponses({ 204 }) @@ -174,7 +173,7 @@ Mono> renamedThree(@HostParam("endpoint") String endpoint, @HostP @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedThreeSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/five") @ExpectedResponses({ 204 }) @@ -183,7 +182,7 @@ Response renamedThreeSync(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedFive(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/five") @ExpectedResponses({ 204 }) @@ -192,7 +191,7 @@ Mono> renamedFive(@HostParam("endpoint") String endpoint, @HostPa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedFiveSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -207,9 +206,8 @@ Response renamedFiveSync(@HostParam("endpoint") String endpoint, @HostPara */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedOneWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.renamedOne(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.renamedOne(this.getEndpoint(), this.getClient(), requestOptions, context)); } /** @@ -224,8 +222,7 @@ public Mono> renamedOneWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedOneWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.renamedOneSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); + return service.renamedOneSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); } /** @@ -240,9 +237,8 @@ public Response renamedOneWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedThreeWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext( - context -> service.renamedThree(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); + context -> service.renamedThree(this.getEndpoint(), this.getClient(), requestOptions, context)); } /** @@ -257,8 +253,7 @@ public Mono> renamedThreeWithResponseAsync(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedThreeWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.renamedThreeSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); + return service.renamedThreeSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); } /** @@ -273,9 +268,8 @@ public Response renamedThreeWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedFiveWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.renamedFive(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.renamedFive(this.getEndpoint(), this.getClient(), requestOptions, context)); } /** @@ -290,7 +284,6 @@ public Mono> renamedFiveWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedFiveWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.renamedFiveSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); + return service.renamedFiveSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/ClientBClientImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/ClientBClientImpl.java index 15a1ba56f1..e52b68219d 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/ClientBClientImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/ClientBClientImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -147,7 +146,7 @@ public interface ClientBClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedTwo(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/two") @ExpectedResponses({ 204 }) @@ -156,7 +155,7 @@ Mono> renamedTwo(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedTwoSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/four") @ExpectedResponses({ 204 }) @@ -165,7 +164,7 @@ Response renamedTwoSync(@HostParam("endpoint") String endpoint, @HostParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedFour(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/four") @ExpectedResponses({ 204 }) @@ -174,7 +173,7 @@ Mono> renamedFour(@HostParam("endpoint") String endpoint, @HostPa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedFourSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/six") @ExpectedResponses({ 204 }) @@ -183,7 +182,7 @@ Response renamedFourSync(@HostParam("endpoint") String endpoint, @HostPara @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedSix(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/six") @ExpectedResponses({ 204 }) @@ -192,7 +191,7 @@ Mono> renamedSix(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedSixSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -207,9 +206,8 @@ Response renamedSixSync(@HostParam("endpoint") String endpoint, @HostParam */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedTwoWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.renamedTwo(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.renamedTwo(this.getEndpoint(), this.getClient(), requestOptions, context)); } /** @@ -224,8 +222,7 @@ public Mono> renamedTwoWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedTwoWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.renamedTwoSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); + return service.renamedTwoSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); } /** @@ -240,9 +237,8 @@ public Response renamedTwoWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedFourWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.renamedFour(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.renamedFour(this.getEndpoint(), this.getClient(), requestOptions, context)); } /** @@ -257,8 +253,7 @@ public Mono> renamedFourWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedFourWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.renamedFourSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); + return service.renamedFourSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); } /** @@ -273,9 +268,8 @@ public Response renamedFourWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedSixWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.renamedSix(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.renamedSix(this.getEndpoint(), this.getClient(), requestOptions, context)); } /** @@ -290,7 +284,6 @@ public Mono> renamedSixWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedSixWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.renamedSixSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); + return service.renamedSixSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/FoosImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/FoosImpl.java index 424e5a6589..6e0139b80b 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/FoosImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/FoosImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -55,79 +54,27 @@ public final class FoosImpl { @Host("{endpoint}/client/structure/{client}") @ServiceInterface(name = "ServiceClientClientF") public interface FoosService { - @Post("/three") + @Post("/seven") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> three(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> seven(@HostParam("endpoint") String endpoint, @HostParam("client") String client, + RequestOptions requestOptions, Context context); - @Post("/three") + @Post("/seven") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response threeSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - - @Post("/four") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> four(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - - @Post("/four") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response fourSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - } - - /** - * The three operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> threeWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.three(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); - } - - /** - * The three operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response threeWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.threeSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + Response sevenSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, + RequestOptions requestOptions, Context context); } /** - * The four operation. + * The seven operation. * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -137,14 +84,13 @@ public Response threeWithResponse(RequestOptions requestOptions) { * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> fourWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.four(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + public Mono> sevenWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> service.seven(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** - * The four operation. + * The seven operation. * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -154,9 +100,7 @@ public Mono> fourWithResponseAsync(RequestOptions requestOptions) * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response fourWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.fourSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + public Response sevenWithResponse(RequestOptions requestOptions) { + return service.sevenSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/FoosOperationsImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/FoosOperationsImpl.java new file mode 100644 index 0000000000..76337fde7d --- /dev/null +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/FoosOperationsImpl.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.client.structure.service.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FoosOperations. + */ +public final class FoosOperationsImpl { + /** + * The proxy service used to perform REST calls. + */ + private final FoosService service; + + /** + * The service client containing this operation class. + */ + private final ServiceClientClientImpl client; + + /** + * Initializes an instance of FoosOperationsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FoosOperationsImpl(ServiceClientClientImpl client) { + this.service = RestProxy.create(FoosService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceClientClientFoosOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}/client/structure/{client}") + @ServiceInterface(name = "ServiceClientClientF") + public interface FoosService { + @Post("/three") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> three(@HostParam("endpoint") String endpoint, @HostParam("client") String client, + RequestOptions requestOptions, Context context); + + @Post("/three") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response threeSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, + RequestOptions requestOptions, Context context); + + @Post("/four") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> four(@HostParam("endpoint") String endpoint, @HostParam("client") String client, + RequestOptions requestOptions, Context context); + + @Post("/four") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response fourSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, + RequestOptions requestOptions, Context context); + } + + /** + * The three operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> threeWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> service.three(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); + } + + /** + * The three operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response threeWithResponse(RequestOptions requestOptions) { + return service.threeSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); + } + + /** + * The four operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> fourWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> service.four(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); + } + + /** + * The four operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response fourWithResponse(RequestOptions requestOptions) { + return service.fourSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); + } +} diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/Group1sImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/Group1sImpl.java index 68238b8d42..bdd1938e5b 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/Group1sImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/Group1sImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -62,7 +61,7 @@ public interface Group1sService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> one(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/one") @ExpectedResponses({ 204 }) @@ -71,7 +70,7 @@ Mono> one(@HostParam("endpoint") String endpoint, @HostParam("cli @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response oneSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/three") @ExpectedResponses({ 204 }) @@ -80,7 +79,7 @@ Response oneSync(@HostParam("endpoint") String endpoint, @HostParam("clien @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> three(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/three") @ExpectedResponses({ 204 }) @@ -89,7 +88,7 @@ Mono> three(@HostParam("endpoint") String endpoint, @HostParam("c @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response threeSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/four") @ExpectedResponses({ 204 }) @@ -98,7 +97,7 @@ Response threeSync(@HostParam("endpoint") String endpoint, @HostParam("cli @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> four(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/four") @ExpectedResponses({ 204 }) @@ -107,7 +106,7 @@ Mono> four(@HostParam("endpoint") String endpoint, @HostParam("cl @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response fourSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -122,9 +121,8 @@ Response fourSync(@HostParam("endpoint") String endpoint, @HostParam("clie */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> oneWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.one(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.one(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -139,9 +137,7 @@ public Mono> oneWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response oneWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.oneSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.oneSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } /** @@ -156,9 +152,8 @@ public Response oneWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> threeWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.three(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.three(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -173,9 +168,7 @@ public Mono> threeWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response threeWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.threeSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.threeSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } /** @@ -190,9 +183,8 @@ public Response threeWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fourWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.four(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.four(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -207,8 +199,6 @@ public Mono> fourWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fourWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.fourSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.fourSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/Group2sImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/Group2sImpl.java index 44db47a66c..01e5b55919 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/Group2sImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/Group2sImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -62,7 +61,7 @@ public interface Group2sService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> two(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/two") @ExpectedResponses({ 204 }) @@ -71,7 +70,7 @@ Mono> two(@HostParam("endpoint") String endpoint, @HostParam("cli @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response twoSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/five") @ExpectedResponses({ 204 }) @@ -80,7 +79,7 @@ Response twoSync(@HostParam("endpoint") String endpoint, @HostParam("clien @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> five(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/five") @ExpectedResponses({ 204 }) @@ -89,7 +88,7 @@ Mono> five(@HostParam("endpoint") String endpoint, @HostParam("cl @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response fiveSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/six") @ExpectedResponses({ 204 }) @@ -98,7 +97,7 @@ Response fiveSync(@HostParam("endpoint") String endpoint, @HostParam("clie @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> six(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/six") @ExpectedResponses({ 204 }) @@ -107,7 +106,7 @@ Mono> six(@HostParam("endpoint") String endpoint, @HostParam("cli @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response sixSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -122,9 +121,8 @@ Response sixSync(@HostParam("endpoint") String endpoint, @HostParam("clien */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> twoWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.two(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.two(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -139,9 +137,7 @@ public Mono> twoWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response twoWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.twoSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.twoSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } /** @@ -156,9 +152,8 @@ public Response twoWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fiveWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.five(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.five(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -173,9 +168,7 @@ public Mono> fiveWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fiveWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.fiveSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.fiveSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } /** @@ -190,9 +183,8 @@ public Response fiveWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sixWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.six(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.six(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -207,8 +199,6 @@ public Mono> sixWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sixWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sixSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.sixSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/GroupsImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/GroupsImpl.java index a2b4164e04..3d53989732 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/GroupsImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/GroupsImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -62,7 +61,7 @@ public interface GroupsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedTwo(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/two") @ExpectedResponses({ 204 }) @@ -71,7 +70,7 @@ Mono> renamedTwo(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedTwoSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/four") @ExpectedResponses({ 204 }) @@ -80,7 +79,7 @@ Response renamedTwoSync(@HostParam("endpoint") String endpoint, @HostParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedFour(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/four") @ExpectedResponses({ 204 }) @@ -89,7 +88,7 @@ Mono> renamedFour(@HostParam("endpoint") String endpoint, @HostPa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedFourSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/six") @ExpectedResponses({ 204 }) @@ -98,7 +97,7 @@ Response renamedFourSync(@HostParam("endpoint") String endpoint, @HostPara @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedSix(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/six") @ExpectedResponses({ 204 }) @@ -107,7 +106,7 @@ Mono> renamedSix(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedSixSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -122,9 +121,8 @@ Response renamedSixSync(@HostParam("endpoint") String endpoint, @HostParam */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedTwoWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.renamedTwo(this.client.getEndpoint(), this.client.getClient(), - accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.renamedTwo(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -139,9 +137,7 @@ public Mono> renamedTwoWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedTwoWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.renamedTwoSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.renamedTwoSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } /** @@ -156,9 +152,8 @@ public Response renamedTwoWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedFourWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext(context -> service.renamedFour(this.client.getEndpoint(), this.client.getClient(), - accept, requestOptions, context)); + requestOptions, context)); } /** @@ -173,8 +168,7 @@ public Mono> renamedFourWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedFourWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.renamedFourSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, + return service.renamedFourSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } @@ -190,9 +184,8 @@ public Response renamedFourWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedSixWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.renamedSix(this.client.getEndpoint(), this.client.getClient(), - accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.renamedSix(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -207,8 +200,6 @@ public Mono> renamedSixWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedSixWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.renamedSixSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.renamedSixSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/QuxBarsImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/QuxBarsImpl.java deleted file mode 100644 index 04b716e90d..0000000000 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/QuxBarsImpl.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.client.structure.service.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in QuxBars. - */ -public final class QuxBarsImpl { - /** - * The proxy service used to perform REST calls. - */ - private final QuxBarsService service; - - /** - * The service client containing this operation class. - */ - private final ServiceClientClientImpl client; - - /** - * Initializes an instance of QuxBarsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - QuxBarsImpl(ServiceClientClientImpl client) { - this.service = RestProxy.create(QuxBarsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ServiceClientClientQuxBars to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}/client/structure/{client}") - @ServiceInterface(name = "ServiceClientClientQ") - public interface QuxBarsService { - @Post("/nine") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> nine(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - - @Post("/nine") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response nineSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - } - - /** - * The nine operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> nineWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.nine(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); - } - - /** - * The nine operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response nineWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.nineSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); - } -} diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/QuxesImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/QuxesImpl.java index 4ef2e29bea..e680d627cc 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/QuxesImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/QuxesImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -62,7 +61,7 @@ public interface QuxesService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> eight(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/eight") @ExpectedResponses({ 204 }) @@ -71,7 +70,25 @@ Mono> eight(@HostParam("endpoint") String endpoint, @HostParam("c @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response eightSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); + + @Post("/nine") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> nine(@HostParam("endpoint") String endpoint, @HostParam("client") String client, + RequestOptions requestOptions, Context context); + + @Post("/nine") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response nineSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, + RequestOptions requestOptions, Context context); } /** @@ -86,9 +103,8 @@ Response eightSync(@HostParam("endpoint") String endpoint, @HostParam("cli */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> eightWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.eight(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.eight(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -103,8 +119,37 @@ public Mono> eightWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response eightWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.eightSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.eightSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); + } + + /** + * The nine operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> nineWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> service.nine(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); + } + + /** + * The nine operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response nineWithResponse(RequestOptions requestOptions) { + return service.nineSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/RenamedOperationClientImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/RenamedOperationClientImpl.java index 2c13fe09ce..a0727fb3f3 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/RenamedOperationClientImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/RenamedOperationClientImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -164,7 +163,7 @@ public interface RenamedOperationClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedOne(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/one") @ExpectedResponses({ 204 }) @@ -173,7 +172,7 @@ Mono> renamedOne(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedOneSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/three") @ExpectedResponses({ 204 }) @@ -182,7 +181,7 @@ Response renamedOneSync(@HostParam("endpoint") String endpoint, @HostParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedThree(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/three") @ExpectedResponses({ 204 }) @@ -191,7 +190,7 @@ Mono> renamedThree(@HostParam("endpoint") String endpoint, @HostP @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedThreeSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/five") @ExpectedResponses({ 204 }) @@ -200,7 +199,7 @@ Response renamedThreeSync(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedFive(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/five") @ExpectedResponses({ 204 }) @@ -209,7 +208,7 @@ Mono> renamedFive(@HostParam("endpoint") String endpoint, @HostPa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedFiveSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -224,9 +223,8 @@ Response renamedFiveSync(@HostParam("endpoint") String endpoint, @HostPara */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedOneWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.renamedOne(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.renamedOne(this.getEndpoint(), this.getClient(), requestOptions, context)); } /** @@ -241,8 +239,7 @@ public Mono> renamedOneWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedOneWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.renamedOneSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); + return service.renamedOneSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); } /** @@ -257,9 +254,8 @@ public Response renamedOneWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedThreeWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext( - context -> service.renamedThree(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); + context -> service.renamedThree(this.getEndpoint(), this.getClient(), requestOptions, context)); } /** @@ -274,8 +270,7 @@ public Mono> renamedThreeWithResponseAsync(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedThreeWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.renamedThreeSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); + return service.renamedThreeSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); } /** @@ -290,9 +285,8 @@ public Response renamedThreeWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedFiveWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.renamedFive(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.renamedFive(this.getEndpoint(), this.getClient(), requestOptions, context)); } /** @@ -307,7 +301,6 @@ public Mono> renamedFiveWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedFiveWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.renamedFiveSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); + return service.renamedFiveSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/ServiceClientClientImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/ServiceClientClientImpl.java index 83b972b012..467ae6d16c 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/ServiceClientClientImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/ServiceClientClientImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -96,17 +95,31 @@ public SerializerAdapter getSerializerAdapter() { } /** - * The BazFoosImpl object to access its operations. + * The BazesImpl object to access its operations. */ - private final BazFoosImpl bazFoos; + private final BazesImpl bazes; /** - * Gets the BazFoosImpl object to access its operations. + * Gets the BazesImpl object to access its operations. * - * @return the BazFoosImpl object. + * @return the BazesImpl object. */ - public BazFoosImpl getBazFoos() { - return this.bazFoos; + public BazesImpl getBazes() { + return this.bazes; + } + + /** + * The FoosImpl object to access its operations. + */ + private final FoosImpl foos; + + /** + * Gets the FoosImpl object to access its operations. + * + * @return the FoosImpl object. + */ + public FoosImpl getFoos() { + return this.foos; } /** @@ -124,45 +137,45 @@ public QuxesImpl getQuxes() { } /** - * The QuxBarsImpl object to access its operations. + * The BarsImpl object to access its operations. */ - private final QuxBarsImpl quxBars; + private final BarsImpl bars; /** - * Gets the QuxBarsImpl object to access its operations. + * Gets the BarsImpl object to access its operations. * - * @return the QuxBarsImpl object. + * @return the BarsImpl object. */ - public QuxBarsImpl getQuxBars() { - return this.quxBars; + public BarsImpl getBars() { + return this.bars; } /** - * The FoosImpl object to access its operations. + * The FoosOperationsImpl object to access its operations. */ - private final FoosImpl foos; + private final FoosOperationsImpl foosOperations; /** - * Gets the FoosImpl object to access its operations. + * Gets the FoosOperationsImpl object to access its operations. * - * @return the FoosImpl object. + * @return the FoosOperationsImpl object. */ - public FoosImpl getFoos() { - return this.foos; + public FoosOperationsImpl getFoosOperations() { + return this.foosOperations; } /** - * The BarsImpl object to access its operations. + * The BarsOperationsImpl object to access its operations. */ - private final BarsImpl bars; + private final BarsOperationsImpl barsOperations; /** - * Gets the BarsImpl object to access its operations. + * Gets the BarsOperationsImpl object to access its operations. * - * @return the BarsImpl object. + * @return the BarsOperationsImpl object. */ - public BarsImpl getBars() { - return this.bars; + public BarsOperationsImpl getBarsOperations() { + return this.barsOperations; } /** @@ -201,11 +214,12 @@ public ServiceClientClientImpl(HttpPipeline httpPipeline, SerializerAdapter seri this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; this.client = client; - this.bazFoos = new BazFoosImpl(this); - this.quxes = new QuxesImpl(this); - this.quxBars = new QuxBarsImpl(this); + this.bazes = new BazesImpl(this); this.foos = new FoosImpl(this); + this.quxes = new QuxesImpl(this); this.bars = new BarsImpl(this); + this.foosOperations = new FoosOperationsImpl(this); + this.barsOperations = new BarsOperationsImpl(this); this.service = RestProxy.create(ServiceClientClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -224,7 +238,7 @@ public interface ServiceClientClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> one(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/one") @ExpectedResponses({ 204 }) @@ -233,7 +247,7 @@ Mono> one(@HostParam("endpoint") String endpoint, @HostParam("cli @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response oneSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/two") @ExpectedResponses({ 204 }) @@ -242,7 +256,7 @@ Response oneSync(@HostParam("endpoint") String endpoint, @HostParam("clien @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> two(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/two") @ExpectedResponses({ 204 }) @@ -251,7 +265,7 @@ Mono> two(@HostParam("endpoint") String endpoint, @HostParam("cli @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response twoSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -266,9 +280,8 @@ Response twoSync(@HostParam("endpoint") String endpoint, @HostParam("clien */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> oneWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.one(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); + .withContext(context -> service.one(this.getEndpoint(), this.getClient(), requestOptions, context)); } /** @@ -283,8 +296,7 @@ public Mono> oneWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response oneWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.oneSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); + return service.oneSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); } /** @@ -299,9 +311,8 @@ public Response oneWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> twoWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.two(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); + .withContext(context -> service.two(this.getEndpoint(), this.getClient(), requestOptions, context)); } /** @@ -316,7 +327,6 @@ public Mono> twoWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response twoWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.twoSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); + return service.twoSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/bytes/implementation/HeadersImpl.java b/typespec-tests/src/main/java/com/encode/bytes/implementation/HeadersImpl.java index ade2fdb28e..6ff5c712a4 100644 --- a/typespec-tests/src/main/java/com/encode/bytes/implementation/HeadersImpl.java +++ b/typespec-tests/src/main/java/com/encode/bytes/implementation/HeadersImpl.java @@ -66,8 +66,8 @@ public interface HeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> defaultMethod(@HeaderParam("value") String value, RequestOptions requestOptions, + Context context); @Get("/encode/bytes/header/default") @ExpectedResponses({ 204 }) @@ -75,8 +75,8 @@ Mono> defaultMethod(@HeaderParam("value") String value, @HeaderPa @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response defaultMethodSync(@HeaderParam("value") String value, RequestOptions requestOptions, + Context context); @Get("/encode/bytes/header/base64") @ExpectedResponses({ 204 }) @@ -84,8 +84,7 @@ Response defaultMethodSync(@HeaderParam("value") String value, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64(@HeaderParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> base64(@HeaderParam("value") String value, RequestOptions requestOptions, Context context); @Get("/encode/bytes/header/base64") @ExpectedResponses({ 204 }) @@ -93,8 +92,7 @@ Mono> base64(@HeaderParam("value") String value, @HeaderParam("ac @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64Sync(@HeaderParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response base64Sync(@HeaderParam("value") String value, RequestOptions requestOptions, Context context); @Get("/encode/bytes/header/base64url") @ExpectedResponses({ 204 }) @@ -102,8 +100,8 @@ Response base64Sync(@HeaderParam("value") String value, @HeaderParam("acce @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64url(@HeaderParam("value") Base64Url value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> base64url(@HeaderParam("value") Base64Url value, RequestOptions requestOptions, + Context context); @Get("/encode/bytes/header/base64url") @ExpectedResponses({ 204 }) @@ -111,8 +109,8 @@ Mono> base64url(@HeaderParam("value") Base64Url value, @HeaderPar @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlSync(@HeaderParam("value") Base64Url value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response base64urlSync(@HeaderParam("value") Base64Url value, RequestOptions requestOptions, + Context context); @Get("/encode/bytes/header/base64url-array") @ExpectedResponses({ 204 }) @@ -120,8 +118,8 @@ Response base64urlSync(@HeaderParam("value") Base64Url value, @HeaderParam @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64urlArray(@HeaderParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> base64urlArray(@HeaderParam("value") String value, RequestOptions requestOptions, + Context context); @Get("/encode/bytes/header/base64url-array") @ExpectedResponses({ 204 }) @@ -129,8 +127,8 @@ Mono> base64urlArray(@HeaderParam("value") String value, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlArraySync(@HeaderParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response base64urlArraySync(@HeaderParam("value") String value, RequestOptions requestOptions, + Context context); } /** @@ -146,9 +144,8 @@ Response base64urlArraySync(@HeaderParam("value") String value, @HeaderPar */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(byte[] value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = Base64Util.encodeToString(value); - return FluxUtil.withContext(context -> service.defaultMethod(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.defaultMethod(valueConverted, requestOptions, context)); } /** @@ -164,9 +161,8 @@ public Mono> defaultMethodWithResponseAsync(byte[] value, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(byte[] value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = Base64Util.encodeToString(value); - return service.defaultMethodSync(valueConverted, accept, requestOptions, Context.NONE); + return service.defaultMethodSync(valueConverted, requestOptions, Context.NONE); } /** @@ -182,9 +178,8 @@ public Response defaultMethodWithResponse(byte[] value, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64WithResponseAsync(byte[] value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = Base64Util.encodeToString(value); - return FluxUtil.withContext(context -> service.base64(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64(valueConverted, requestOptions, context)); } /** @@ -200,9 +195,8 @@ public Mono> base64WithResponseAsync(byte[] value, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64WithResponse(byte[] value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = Base64Util.encodeToString(value); - return service.base64Sync(valueConverted, accept, requestOptions, Context.NONE); + return service.base64Sync(valueConverted, requestOptions, Context.NONE); } /** @@ -218,9 +212,8 @@ public Response base64WithResponse(byte[] value, RequestOptions requestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64urlWithResponseAsync(byte[] value, RequestOptions requestOptions) { - final String accept = "application/json"; Base64Url valueConverted = Base64Url.encode(value); - return FluxUtil.withContext(context -> service.base64url(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64url(valueConverted, requestOptions, context)); } /** @@ -236,9 +229,8 @@ public Mono> base64urlWithResponseAsync(byte[] value, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64urlWithResponse(byte[] value, RequestOptions requestOptions) { - final String accept = "application/json"; Base64Url valueConverted = Base64Url.encode(value); - return service.base64urlSync(valueConverted, accept, requestOptions, Context.NONE); + return service.base64urlSync(valueConverted, requestOptions, Context.NONE); } /** @@ -254,12 +246,11 @@ public Response base64urlWithResponse(byte[] value, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64urlArrayWithResponseAsync(List value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( value.stream().map(paramItemValue -> Base64Url.encode(paramItemValue)).collect(Collectors.toList()), CollectionFormat.CSV); - return FluxUtil.withContext(context -> service.base64urlArray(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64urlArray(valueConverted, requestOptions, context)); } /** @@ -275,11 +266,10 @@ public Mono> base64urlArrayWithResponseAsync(List value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64urlArrayWithResponse(List value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( value.stream().map(paramItemValue -> Base64Url.encode(paramItemValue)).collect(Collectors.toList()), CollectionFormat.CSV); - return service.base64urlArraySync(valueConverted, accept, requestOptions, Context.NONE); + return service.base64urlArraySync(valueConverted, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/bytes/implementation/PropertiesImpl.java b/typespec-tests/src/main/java/com/encode/bytes/implementation/PropertiesImpl.java index bbf7991a31..fadb0b0f01 100644 --- a/typespec-tests/src/main/java/com/encode/bytes/implementation/PropertiesImpl.java +++ b/typespec-tests/src/main/java/com/encode/bytes/implementation/PropertiesImpl.java @@ -63,8 +63,9 @@ public interface PropertiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> defaultMethod(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/default") @ExpectedResponses({ 200 }) @@ -72,8 +73,9 @@ Mono> defaultMethod(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response defaultMethodSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/base64") @ExpectedResponses({ 200 }) @@ -81,8 +83,9 @@ Response defaultMethodSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> base64(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/base64") @ExpectedResponses({ 200 }) @@ -90,8 +93,9 @@ Mono> base64(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64Sync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response base64Sync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/base64url") @ExpectedResponses({ 200 }) @@ -99,8 +103,9 @@ Response base64Sync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64url(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> base64url(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/base64url") @ExpectedResponses({ 200 }) @@ -108,8 +113,9 @@ Mono> base64url(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response base64urlSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/base64url-array") @ExpectedResponses({ 200 }) @@ -117,8 +123,9 @@ Response base64urlSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64urlArray(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> base64urlArray(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/base64url-array") @ExpectedResponses({ 200 }) @@ -126,8 +133,9 @@ Mono> base64urlArray(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlArraySync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response base64urlArraySync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -158,8 +166,10 @@ Response base64urlArraySync(@HeaderParam("accept") String accept, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.defaultMethod(accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.defaultMethod(contentType, accept, body, requestOptions, context)); } /** @@ -190,8 +200,9 @@ public Mono> defaultMethodWithResponseAsync(BinaryData body */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.defaultMethodSync(accept, body, requestOptions, Context.NONE); + return service.defaultMethodSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -222,8 +233,9 @@ public Response defaultMethodWithResponse(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64WithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.base64(accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64(contentType, accept, body, requestOptions, context)); } /** @@ -254,8 +266,9 @@ public Mono> base64WithResponseAsync(BinaryData body, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64WithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.base64Sync(accept, body, requestOptions, Context.NONE); + return service.base64Sync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -286,8 +299,9 @@ public Response base64WithResponse(BinaryData body, RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64urlWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.base64url(accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64url(contentType, accept, body, requestOptions, context)); } /** @@ -318,8 +332,9 @@ public Mono> base64urlWithResponseAsync(BinaryData body, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64urlWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.base64urlSync(accept, body, requestOptions, Context.NONE); + return service.base64urlSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -354,8 +369,10 @@ public Response base64urlWithResponse(BinaryData body, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64urlArrayWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.base64urlArray(accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.base64urlArray(contentType, accept, body, requestOptions, context)); } /** @@ -390,7 +407,8 @@ public Mono> base64urlArrayWithResponseAsync(BinaryData bod */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64urlArrayWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.base64urlArraySync(accept, body, requestOptions, Context.NONE); + return service.base64urlArraySync(contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/bytes/implementation/QueriesImpl.java b/typespec-tests/src/main/java/com/encode/bytes/implementation/QueriesImpl.java index a902ff21d0..176ea4989f 100644 --- a/typespec-tests/src/main/java/com/encode/bytes/implementation/QueriesImpl.java +++ b/typespec-tests/src/main/java/com/encode/bytes/implementation/QueriesImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -67,8 +66,8 @@ public interface QueriesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@QueryParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> defaultMethod(@QueryParam("value") String value, RequestOptions requestOptions, + Context context); @Get("/encode/bytes/query/default") @ExpectedResponses({ 204 }) @@ -76,8 +75,8 @@ Mono> defaultMethod(@QueryParam("value") String value, @HeaderPar @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@QueryParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response defaultMethodSync(@QueryParam("value") String value, RequestOptions requestOptions, + Context context); @Get("/encode/bytes/query/base64") @ExpectedResponses({ 204 }) @@ -85,8 +84,7 @@ Response defaultMethodSync(@QueryParam("value") String value, @HeaderParam @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64(@QueryParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> base64(@QueryParam("value") String value, RequestOptions requestOptions, Context context); @Get("/encode/bytes/query/base64") @ExpectedResponses({ 204 }) @@ -94,8 +92,7 @@ Mono> base64(@QueryParam("value") String value, @HeaderParam("acc @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64Sync(@QueryParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response base64Sync(@QueryParam("value") String value, RequestOptions requestOptions, Context context); @Get("/encode/bytes/query/base64url") @ExpectedResponses({ 204 }) @@ -103,8 +100,8 @@ Response base64Sync(@QueryParam("value") String value, @HeaderParam("accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64url(@QueryParam("value") Base64Url value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> base64url(@QueryParam("value") Base64Url value, RequestOptions requestOptions, + Context context); @Get("/encode/bytes/query/base64url") @ExpectedResponses({ 204 }) @@ -112,8 +109,8 @@ Mono> base64url(@QueryParam("value") Base64Url value, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlSync(@QueryParam("value") Base64Url value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response base64urlSync(@QueryParam("value") Base64Url value, RequestOptions requestOptions, + Context context); @Get("/encode/bytes/query/base64url-array") @ExpectedResponses({ 204 }) @@ -121,8 +118,8 @@ Response base64urlSync(@QueryParam("value") Base64Url value, @HeaderParam( @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64urlArray(@QueryParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> base64urlArray(@QueryParam("value") String value, RequestOptions requestOptions, + Context context); @Get("/encode/bytes/query/base64url-array") @ExpectedResponses({ 204 }) @@ -130,8 +127,8 @@ Mono> base64urlArray(@QueryParam("value") String value, @HeaderPa @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlArraySync(@QueryParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response base64urlArraySync(@QueryParam("value") String value, RequestOptions requestOptions, + Context context); } /** @@ -147,9 +144,8 @@ Response base64urlArraySync(@QueryParam("value") String value, @HeaderPara */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(byte[] value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = Base64Util.encodeToString(value); - return FluxUtil.withContext(context -> service.defaultMethod(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.defaultMethod(valueConverted, requestOptions, context)); } /** @@ -165,9 +161,8 @@ public Mono> defaultMethodWithResponseAsync(byte[] value, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(byte[] value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = Base64Util.encodeToString(value); - return service.defaultMethodSync(valueConverted, accept, requestOptions, Context.NONE); + return service.defaultMethodSync(valueConverted, requestOptions, Context.NONE); } /** @@ -183,9 +178,8 @@ public Response defaultMethodWithResponse(byte[] value, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64WithResponseAsync(byte[] value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = Base64Util.encodeToString(value); - return FluxUtil.withContext(context -> service.base64(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64(valueConverted, requestOptions, context)); } /** @@ -201,9 +195,8 @@ public Mono> base64WithResponseAsync(byte[] value, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64WithResponse(byte[] value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = Base64Util.encodeToString(value); - return service.base64Sync(valueConverted, accept, requestOptions, Context.NONE); + return service.base64Sync(valueConverted, requestOptions, Context.NONE); } /** @@ -219,9 +212,8 @@ public Response base64WithResponse(byte[] value, RequestOptions requestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64urlWithResponseAsync(byte[] value, RequestOptions requestOptions) { - final String accept = "application/json"; Base64Url valueConverted = Base64Url.encode(value); - return FluxUtil.withContext(context -> service.base64url(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64url(valueConverted, requestOptions, context)); } /** @@ -237,9 +229,8 @@ public Mono> base64urlWithResponseAsync(byte[] value, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64urlWithResponse(byte[] value, RequestOptions requestOptions) { - final String accept = "application/json"; Base64Url valueConverted = Base64Url.encode(value); - return service.base64urlSync(valueConverted, accept, requestOptions, Context.NONE); + return service.base64urlSync(valueConverted, requestOptions, Context.NONE); } /** @@ -255,12 +246,11 @@ public Response base64urlWithResponse(byte[] value, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64urlArrayWithResponseAsync(List value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( value.stream().map(paramItemValue -> Base64Url.encode(paramItemValue)).collect(Collectors.toList()), CollectionFormat.CSV); - return FluxUtil.withContext(context -> service.base64urlArray(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64urlArray(valueConverted, requestOptions, context)); } /** @@ -276,11 +266,10 @@ public Mono> base64urlArrayWithResponseAsync(List value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64urlArrayWithResponse(List value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( value.stream().map(paramItemValue -> Base64Url.encode(paramItemValue)).collect(Collectors.toList()), CollectionFormat.CSV); - return service.base64urlArraySync(valueConverted, accept, requestOptions, Context.NONE); + return service.base64urlArraySync(valueConverted, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/bytes/implementation/RequestBodiesImpl.java b/typespec-tests/src/main/java/com/encode/bytes/implementation/RequestBodiesImpl.java index 762be5849e..0d8c967708 100644 --- a/typespec-tests/src/main/java/com/encode/bytes/implementation/RequestBodiesImpl.java +++ b/typespec-tests/src/main/java/com/encode/bytes/implementation/RequestBodiesImpl.java @@ -63,7 +63,7 @@ public interface RequestBodiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("accept") String accept, + Mono> defaultMethod(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/default") @@ -72,7 +72,7 @@ Mono> defaultMethod(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("accept") String accept, + Response defaultMethodSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/octet-stream") @@ -81,9 +81,8 @@ Response defaultMethodSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> octetStream(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/octet-stream") BinaryData value, - RequestOptions requestOptions, Context context); + Mono> octetStream(@HeaderParam("content-type") String contentType, + @BodyParam("application/octet-stream") BinaryData value, RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/octet-stream") @ExpectedResponses({ 204 }) @@ -91,9 +90,8 @@ Mono> octetStream(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response octetStreamSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/octet-stream") BinaryData value, - RequestOptions requestOptions, Context context); + Response octetStreamSync(@HeaderParam("content-type") String contentType, + @BodyParam("application/octet-stream") BinaryData value, RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/custom-content-type") @ExpectedResponses({ 204 }) @@ -101,9 +99,8 @@ Response octetStreamSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> customContentType(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("image/png") BinaryData value, - RequestOptions requestOptions, Context context); + Mono> customContentType(@HeaderParam("content-type") String contentType, + @BodyParam("image/png") BinaryData value, RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/custom-content-type") @ExpectedResponses({ 204 }) @@ -111,9 +108,8 @@ Mono> customContentType(@HeaderParam("Content-Type") String conte @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response customContentTypeSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("image/png") BinaryData value, - RequestOptions requestOptions, Context context); + Response customContentTypeSync(@HeaderParam("content-type") String contentType, + @BodyParam("image/png") BinaryData value, RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/base64") @ExpectedResponses({ 204 }) @@ -121,7 +117,7 @@ Response customContentTypeSync(@HeaderParam("Content-Type") String content @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64(@HeaderParam("accept") String accept, + Mono> base64(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/base64") @@ -130,8 +126,8 @@ Mono> base64(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64Sync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData value, - RequestOptions requestOptions, Context context); + Response base64Sync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/base64url") @ExpectedResponses({ 204 }) @@ -139,7 +135,7 @@ Response base64Sync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64url(@HeaderParam("accept") String accept, + Mono> base64url(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/base64url") @@ -148,7 +144,7 @@ Mono> base64url(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlSync(@HeaderParam("accept") String accept, + Response base64urlSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); } @@ -170,8 +166,8 @@ Response base64urlSync(@HeaderParam("accept") String accept, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(BinaryData value, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.defaultMethod(accept, value, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.defaultMethod(contentType, value, requestOptions, context)); } /** @@ -192,8 +188,8 @@ public Mono> defaultMethodWithResponseAsync(BinaryData value, Req */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(BinaryData value, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.defaultMethodSync(accept, value, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.defaultMethodSync(contentType, value, requestOptions, Context.NONE); } /** @@ -215,9 +211,7 @@ public Response defaultMethodWithResponse(BinaryData value, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> octetStreamWithResponseAsync(BinaryData value, RequestOptions requestOptions) { final String contentType = "application/octet-stream"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.octetStream(contentType, accept, value, requestOptions, context)); + return FluxUtil.withContext(context -> service.octetStream(contentType, value, requestOptions, context)); } /** @@ -239,8 +233,7 @@ public Mono> octetStreamWithResponseAsync(BinaryData value, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response octetStreamWithResponse(BinaryData value, RequestOptions requestOptions) { final String contentType = "application/octet-stream"; - final String accept = "application/json"; - return service.octetStreamSync(contentType, accept, value, requestOptions, Context.NONE); + return service.octetStreamSync(contentType, value, requestOptions, Context.NONE); } /** @@ -262,9 +255,7 @@ public Response octetStreamWithResponse(BinaryData value, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> customContentTypeWithResponseAsync(BinaryData value, RequestOptions requestOptions) { final String contentType = "image/png"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.customContentType(contentType, accept, value, requestOptions, context)); + return FluxUtil.withContext(context -> service.customContentType(contentType, value, requestOptions, context)); } /** @@ -286,8 +277,7 @@ public Mono> customContentTypeWithResponseAsync(BinaryData value, @ServiceMethod(returns = ReturnType.SINGLE) public Response customContentTypeWithResponse(BinaryData value, RequestOptions requestOptions) { final String contentType = "image/png"; - final String accept = "application/json"; - return service.customContentTypeSync(contentType, accept, value, requestOptions, Context.NONE); + return service.customContentTypeSync(contentType, value, requestOptions, Context.NONE); } /** @@ -308,8 +298,8 @@ public Response customContentTypeWithResponse(BinaryData value, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64WithResponseAsync(BinaryData value, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.base64(accept, value, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.base64(contentType, value, requestOptions, context)); } /** @@ -330,8 +320,8 @@ public Mono> base64WithResponseAsync(BinaryData value, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64WithResponse(BinaryData value, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.base64Sync(accept, value, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.base64Sync(contentType, value, requestOptions, Context.NONE); } /** @@ -352,8 +342,8 @@ public Response base64WithResponse(BinaryData value, RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64urlWithResponseAsync(BinaryData value, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.base64url(accept, value, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.base64url(contentType, value, requestOptions, context)); } /** @@ -374,7 +364,7 @@ public Mono> base64urlWithResponseAsync(BinaryData value, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64urlWithResponse(BinaryData value, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.base64urlSync(accept, value, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.base64urlSync(contentType, value, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/bytes/implementation/ResponseBodiesImpl.java b/typespec-tests/src/main/java/com/encode/bytes/implementation/ResponseBodiesImpl.java index 771602d9f8..7aa9f06c83 100644 --- a/typespec-tests/src/main/java/com/encode/bytes/implementation/ResponseBodiesImpl.java +++ b/typespec-tests/src/main/java/com/encode/bytes/implementation/ResponseBodiesImpl.java @@ -62,7 +62,7 @@ public interface ResponseBodiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> defaultMethod(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/default") @@ -71,7 +71,7 @@ Mono> defaultMethod(@HeaderParam("accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response defaultMethodSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/octet-stream") @@ -80,7 +80,7 @@ Response defaultMethodSync(@HeaderParam("accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> octetStream(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> octetStream(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/octet-stream") @@ -89,7 +89,7 @@ Mono> octetStream(@HeaderParam("accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response octetStreamSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response octetStreamSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/custom-content-type") @@ -98,7 +98,7 @@ Response octetStreamSync(@HeaderParam("accept") String accept, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> customContentType(@HeaderParam("accept") String accept, + Mono> customContentType(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/custom-content-type") @@ -107,7 +107,7 @@ Mono> customContentType(@HeaderParam("accept") String accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response customContentTypeSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response customContentTypeSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/base64") @@ -116,7 +116,7 @@ Response customContentTypeSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> base64(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/base64") @@ -125,7 +125,7 @@ Mono> base64(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64Sync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response base64Sync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/base64url") @@ -134,7 +134,7 @@ Response base64Sync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64url(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> base64url(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/base64url") @@ -143,7 +143,7 @@ Mono> base64url(@HeaderParam("accept") String accept, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response base64urlSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/encode/datetime/implementation/HeadersImpl.java b/typespec-tests/src/main/java/com/encode/datetime/implementation/HeadersImpl.java index 1df2acf9e8..a28340f48f 100644 --- a/typespec-tests/src/main/java/com/encode/datetime/implementation/HeadersImpl.java +++ b/typespec-tests/src/main/java/com/encode/datetime/implementation/HeadersImpl.java @@ -66,8 +66,8 @@ public interface HeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("value") DateTimeRfc1123 value, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> defaultMethod(@HeaderParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/header/default") @ExpectedResponses({ 204 }) @@ -75,8 +75,8 @@ Mono> defaultMethod(@HeaderParam("value") DateTimeRfc1123 value, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("value") DateTimeRfc1123 value, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response defaultMethodSync(@HeaderParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/header/rfc3339") @ExpectedResponses({ 204 }) @@ -84,8 +84,8 @@ Response defaultMethodSync(@HeaderParam("value") DateTimeRfc1123 value, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc3339(@HeaderParam("value") OffsetDateTime value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> rfc3339(@HeaderParam("value") OffsetDateTime value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/header/rfc3339") @ExpectedResponses({ 204 }) @@ -93,8 +93,8 @@ Mono> rfc3339(@HeaderParam("value") OffsetDateTime value, @Header @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc3339Sync(@HeaderParam("value") OffsetDateTime value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response rfc3339Sync(@HeaderParam("value") OffsetDateTime value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/header/rfc7231") @ExpectedResponses({ 204 }) @@ -102,8 +102,8 @@ Response rfc3339Sync(@HeaderParam("value") OffsetDateTime value, @HeaderPa @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc7231(@HeaderParam("value") DateTimeRfc1123 value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> rfc7231(@HeaderParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/header/rfc7231") @ExpectedResponses({ 204 }) @@ -111,8 +111,8 @@ Mono> rfc7231(@HeaderParam("value") DateTimeRfc1123 value, @Heade @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc7231Sync(@HeaderParam("value") DateTimeRfc1123 value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response rfc7231Sync(@HeaderParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/header/unix-timestamp") @ExpectedResponses({ 204 }) @@ -120,8 +120,8 @@ Response rfc7231Sync(@HeaderParam("value") DateTimeRfc1123 value, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestamp(@HeaderParam("value") long value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> unixTimestamp(@HeaderParam("value") long value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/header/unix-timestamp") @ExpectedResponses({ 204 }) @@ -129,8 +129,8 @@ Mono> unixTimestamp(@HeaderParam("value") long value, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampSync(@HeaderParam("value") long value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response unixTimestampSync(@HeaderParam("value") long value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/header/unix-timestamp-array") @ExpectedResponses({ 204 }) @@ -138,8 +138,8 @@ Response unixTimestampSync(@HeaderParam("value") long value, @HeaderParam( @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestampArray(@HeaderParam("value") String value, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> unixTimestampArray(@HeaderParam("value") String value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/header/unix-timestamp-array") @ExpectedResponses({ 204 }) @@ -147,8 +147,8 @@ Mono> unixTimestampArray(@HeaderParam("value") String value, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampArraySync(@HeaderParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response unixTimestampArraySync(@HeaderParam("value") String value, RequestOptions requestOptions, + Context context); } /** @@ -164,9 +164,8 @@ Response unixTimestampArraySync(@HeaderParam("value") String value, @Heade */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; DateTimeRfc1123 valueConverted = new DateTimeRfc1123(value); - return FluxUtil.withContext(context -> service.defaultMethod(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.defaultMethod(valueConverted, requestOptions, context)); } /** @@ -182,9 +181,8 @@ public Mono> defaultMethodWithResponseAsync(OffsetDateTime value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; DateTimeRfc1123 valueConverted = new DateTimeRfc1123(value); - return service.defaultMethodSync(valueConverted, accept, requestOptions, Context.NONE); + return service.defaultMethodSync(valueConverted, requestOptions, Context.NONE); } /** @@ -200,8 +198,7 @@ public Response defaultMethodWithResponse(OffsetDateTime value, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc3339WithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.rfc3339(value, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.rfc3339(value, requestOptions, context)); } /** @@ -217,8 +214,7 @@ public Mono> rfc3339WithResponseAsync(OffsetDateTime value, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc3339WithResponse(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.rfc3339Sync(value, accept, requestOptions, Context.NONE); + return service.rfc3339Sync(value, requestOptions, Context.NONE); } /** @@ -234,9 +230,8 @@ public Response rfc3339WithResponse(OffsetDateTime value, RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc7231WithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; DateTimeRfc1123 valueConverted = new DateTimeRfc1123(value); - return FluxUtil.withContext(context -> service.rfc7231(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.rfc7231(valueConverted, requestOptions, context)); } /** @@ -252,9 +247,8 @@ public Mono> rfc7231WithResponseAsync(OffsetDateTime value, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc7231WithResponse(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; DateTimeRfc1123 valueConverted = new DateTimeRfc1123(value); - return service.rfc7231Sync(valueConverted, accept, requestOptions, Context.NONE); + return service.rfc7231Sync(valueConverted, requestOptions, Context.NONE); } /** @@ -270,9 +264,8 @@ public Response rfc7231WithResponse(OffsetDateTime value, RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unixTimestampWithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; long valueConverted = value.toEpochSecond(); - return FluxUtil.withContext(context -> service.unixTimestamp(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.unixTimestamp(valueConverted, requestOptions, context)); } /** @@ -288,9 +281,8 @@ public Mono> unixTimestampWithResponseAsync(OffsetDateTime value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response unixTimestampWithResponse(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; long valueConverted = value.toEpochSecond(); - return service.unixTimestampSync(valueConverted, accept, requestOptions, Context.NONE); + return service.unixTimestampSync(valueConverted, requestOptions, Context.NONE); } /** @@ -307,13 +299,11 @@ public Response unixTimestampWithResponse(OffsetDateTime value, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unixTimestampArrayWithResponseAsync(List value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( value.stream().map(paramItemValue -> paramItemValue.toEpochSecond()).collect(Collectors.toList()), CollectionFormat.CSV); - return FluxUtil - .withContext(context -> service.unixTimestampArray(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.unixTimestampArray(valueConverted, requestOptions, context)); } /** @@ -329,11 +319,10 @@ public Mono> unixTimestampArrayWithResponseAsync(List unixTimestampArrayWithResponse(List value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( value.stream().map(paramItemValue -> paramItemValue.toEpochSecond()).collect(Collectors.toList()), CollectionFormat.CSV); - return service.unixTimestampArraySync(valueConverted, accept, requestOptions, Context.NONE); + return service.unixTimestampArraySync(valueConverted, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/datetime/implementation/PropertiesImpl.java b/typespec-tests/src/main/java/com/encode/datetime/implementation/PropertiesImpl.java index 6fed967c47..7b1be1ade9 100644 --- a/typespec-tests/src/main/java/com/encode/datetime/implementation/PropertiesImpl.java +++ b/typespec-tests/src/main/java/com/encode/datetime/implementation/PropertiesImpl.java @@ -63,8 +63,9 @@ public interface PropertiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> defaultMethod(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/default") @ExpectedResponses({ 200 }) @@ -72,8 +73,9 @@ Mono> defaultMethod(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response defaultMethodSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/rfc3339") @ExpectedResponses({ 200 }) @@ -81,8 +83,9 @@ Response defaultMethodSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc3339(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> rfc3339(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/rfc3339") @ExpectedResponses({ 200 }) @@ -90,8 +93,9 @@ Mono> rfc3339(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc3339Sync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response rfc3339Sync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/rfc7231") @ExpectedResponses({ 200 }) @@ -99,8 +103,9 @@ Response rfc3339Sync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc7231(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> rfc7231(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/rfc7231") @ExpectedResponses({ 200 }) @@ -108,8 +113,9 @@ Mono> rfc7231(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc7231Sync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response rfc7231Sync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/unix-timestamp") @ExpectedResponses({ 200 }) @@ -117,8 +123,9 @@ Response rfc7231Sync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestamp(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> unixTimestamp(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/unix-timestamp") @ExpectedResponses({ 200 }) @@ -126,8 +133,9 @@ Mono> unixTimestamp(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response unixTimestampSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/unix-timestamp-array") @ExpectedResponses({ 200 }) @@ -135,8 +143,9 @@ Response unixTimestampSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestampArray(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> unixTimestampArray(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/unix-timestamp-array") @ExpectedResponses({ 200 }) @@ -144,8 +153,9 @@ Mono> unixTimestampArray(@HeaderParam("accept") String acce @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampArraySync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response unixTimestampArraySync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -176,8 +186,10 @@ Response unixTimestampArraySync(@HeaderParam("accept") String accept */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.defaultMethod(accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.defaultMethod(contentType, accept, body, requestOptions, context)); } /** @@ -208,8 +220,9 @@ public Mono> defaultMethodWithResponseAsync(BinaryData body */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.defaultMethodSync(accept, body, requestOptions, Context.NONE); + return service.defaultMethodSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -240,8 +253,9 @@ public Response defaultMethodWithResponse(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc3339WithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.rfc3339(accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.rfc3339(contentType, accept, body, requestOptions, context)); } /** @@ -272,8 +286,9 @@ public Mono> rfc3339WithResponseAsync(BinaryData body, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc3339WithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.rfc3339Sync(accept, body, requestOptions, Context.NONE); + return service.rfc3339Sync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -304,8 +319,9 @@ public Response rfc3339WithResponse(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc7231WithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.rfc7231(accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.rfc7231(contentType, accept, body, requestOptions, context)); } /** @@ -336,8 +352,9 @@ public Mono> rfc7231WithResponseAsync(BinaryData body, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc7231WithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.rfc7231Sync(accept, body, requestOptions, Context.NONE); + return service.rfc7231Sync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -368,8 +385,10 @@ public Response rfc7231WithResponse(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unixTimestampWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.unixTimestamp(accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.unixTimestamp(contentType, accept, body, requestOptions, context)); } /** @@ -400,8 +419,9 @@ public Mono> unixTimestampWithResponseAsync(BinaryData body */ @ServiceMethod(returns = ReturnType.SINGLE) public Response unixTimestampWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.unixTimestampSync(accept, body, requestOptions, Context.NONE); + return service.unixTimestampSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -437,8 +457,10 @@ public Response unixTimestampWithResponse(BinaryData body, RequestOp @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unixTimestampArrayWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.unixTimestampArray(accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.unixTimestampArray(contentType, accept, body, requestOptions, context)); } /** @@ -473,7 +495,8 @@ public Mono> unixTimestampArrayWithResponseAsync(BinaryData */ @ServiceMethod(returns = ReturnType.SINGLE) public Response unixTimestampArrayWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.unixTimestampArraySync(accept, body, requestOptions, Context.NONE); + return service.unixTimestampArraySync(contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/datetime/implementation/QueriesImpl.java b/typespec-tests/src/main/java/com/encode/datetime/implementation/QueriesImpl.java index 9aa4c27e97..c093cd7e19 100644 --- a/typespec-tests/src/main/java/com/encode/datetime/implementation/QueriesImpl.java +++ b/typespec-tests/src/main/java/com/encode/datetime/implementation/QueriesImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -67,8 +66,8 @@ public interface QueriesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@QueryParam("value") OffsetDateTime value, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> defaultMethod(@QueryParam("value") OffsetDateTime value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/query/default") @ExpectedResponses({ 204 }) @@ -76,8 +75,8 @@ Mono> defaultMethod(@QueryParam("value") OffsetDateTime value, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@QueryParam("value") OffsetDateTime value, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response defaultMethodSync(@QueryParam("value") OffsetDateTime value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/query/rfc3339") @ExpectedResponses({ 204 }) @@ -85,8 +84,8 @@ Response defaultMethodSync(@QueryParam("value") OffsetDateTime value, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc3339(@QueryParam("value") OffsetDateTime value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> rfc3339(@QueryParam("value") OffsetDateTime value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/query/rfc3339") @ExpectedResponses({ 204 }) @@ -94,8 +93,8 @@ Mono> rfc3339(@QueryParam("value") OffsetDateTime value, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc3339Sync(@QueryParam("value") OffsetDateTime value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response rfc3339Sync(@QueryParam("value") OffsetDateTime value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/query/rfc7231") @ExpectedResponses({ 204 }) @@ -103,8 +102,8 @@ Response rfc3339Sync(@QueryParam("value") OffsetDateTime value, @HeaderPar @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc7231(@QueryParam("value") DateTimeRfc1123 value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> rfc7231(@QueryParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/query/rfc7231") @ExpectedResponses({ 204 }) @@ -112,8 +111,8 @@ Mono> rfc7231(@QueryParam("value") DateTimeRfc1123 value, @Header @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc7231Sync(@QueryParam("value") DateTimeRfc1123 value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response rfc7231Sync(@QueryParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/query/unix-timestamp") @ExpectedResponses({ 204 }) @@ -121,8 +120,8 @@ Response rfc7231Sync(@QueryParam("value") DateTimeRfc1123 value, @HeaderPa @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestamp(@QueryParam("value") long value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> unixTimestamp(@QueryParam("value") long value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/query/unix-timestamp") @ExpectedResponses({ 204 }) @@ -130,8 +129,8 @@ Mono> unixTimestamp(@QueryParam("value") long value, @HeaderParam @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampSync(@QueryParam("value") long value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response unixTimestampSync(@QueryParam("value") long value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/query/unix-timestamp-array") @ExpectedResponses({ 204 }) @@ -139,8 +138,8 @@ Response unixTimestampSync(@QueryParam("value") long value, @HeaderParam(" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestampArray(@QueryParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> unixTimestampArray(@QueryParam("value") String value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/query/unix-timestamp-array") @ExpectedResponses({ 204 }) @@ -148,8 +147,8 @@ Mono> unixTimestampArray(@QueryParam("value") String value, @Head @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampArraySync(@QueryParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response unixTimestampArraySync(@QueryParam("value") String value, RequestOptions requestOptions, + Context context); } /** @@ -165,8 +164,7 @@ Response unixTimestampArraySync(@QueryParam("value") String value, @Header */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.defaultMethod(value, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.defaultMethod(value, requestOptions, context)); } /** @@ -182,8 +180,7 @@ public Mono> defaultMethodWithResponseAsync(OffsetDateTime value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.defaultMethodSync(value, accept, requestOptions, Context.NONE); + return service.defaultMethodSync(value, requestOptions, Context.NONE); } /** @@ -199,8 +196,7 @@ public Response defaultMethodWithResponse(OffsetDateTime value, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc3339WithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.rfc3339(value, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.rfc3339(value, requestOptions, context)); } /** @@ -216,8 +212,7 @@ public Mono> rfc3339WithResponseAsync(OffsetDateTime value, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc3339WithResponse(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.rfc3339Sync(value, accept, requestOptions, Context.NONE); + return service.rfc3339Sync(value, requestOptions, Context.NONE); } /** @@ -233,9 +228,8 @@ public Response rfc3339WithResponse(OffsetDateTime value, RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc7231WithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; DateTimeRfc1123 valueConverted = new DateTimeRfc1123(value); - return FluxUtil.withContext(context -> service.rfc7231(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.rfc7231(valueConverted, requestOptions, context)); } /** @@ -251,9 +245,8 @@ public Mono> rfc7231WithResponseAsync(OffsetDateTime value, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc7231WithResponse(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; DateTimeRfc1123 valueConverted = new DateTimeRfc1123(value); - return service.rfc7231Sync(valueConverted, accept, requestOptions, Context.NONE); + return service.rfc7231Sync(valueConverted, requestOptions, Context.NONE); } /** @@ -269,9 +262,8 @@ public Response rfc7231WithResponse(OffsetDateTime value, RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unixTimestampWithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; long valueConverted = value.toEpochSecond(); - return FluxUtil.withContext(context -> service.unixTimestamp(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.unixTimestamp(valueConverted, requestOptions, context)); } /** @@ -287,9 +279,8 @@ public Mono> unixTimestampWithResponseAsync(OffsetDateTime value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response unixTimestampWithResponse(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; long valueConverted = value.toEpochSecond(); - return service.unixTimestampSync(valueConverted, accept, requestOptions, Context.NONE); + return service.unixTimestampSync(valueConverted, requestOptions, Context.NONE); } /** @@ -306,13 +297,11 @@ public Response unixTimestampWithResponse(OffsetDateTime value, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unixTimestampArrayWithResponseAsync(List value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( value.stream().map(paramItemValue -> paramItemValue.toEpochSecond()).collect(Collectors.toList()), CollectionFormat.CSV); - return FluxUtil - .withContext(context -> service.unixTimestampArray(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.unixTimestampArray(valueConverted, requestOptions, context)); } /** @@ -328,11 +317,10 @@ public Mono> unixTimestampArrayWithResponseAsync(List unixTimestampArrayWithResponse(List value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( value.stream().map(paramItemValue -> paramItemValue.toEpochSecond()).collect(Collectors.toList()), CollectionFormat.CSV); - return service.unixTimestampArraySync(valueConverted, accept, requestOptions, Context.NONE); + return service.unixTimestampArraySync(valueConverted, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/datetime/implementation/ResponseHeadersImpl.java b/typespec-tests/src/main/java/com/encode/datetime/implementation/ResponseHeadersImpl.java index c731513bbb..5f01e18700 100644 --- a/typespec-tests/src/main/java/com/encode/datetime/implementation/ResponseHeadersImpl.java +++ b/typespec-tests/src/main/java/com/encode/datetime/implementation/ResponseHeadersImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -61,8 +60,7 @@ public interface ResponseHeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> defaultMethod(RequestOptions requestOptions, Context context); @Get("/encode/datetime/responseheader/default") @ExpectedResponses({ 204 }) @@ -70,8 +68,7 @@ Mono> defaultMethod(@HeaderParam("accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response defaultMethodSync(RequestOptions requestOptions, Context context); @Get("/encode/datetime/responseheader/rfc3339") @ExpectedResponses({ 204 }) @@ -79,8 +76,7 @@ Response defaultMethodSync(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc3339(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> rfc3339(RequestOptions requestOptions, Context context); @Get("/encode/datetime/responseheader/rfc3339") @ExpectedResponses({ 204 }) @@ -88,8 +84,7 @@ Mono> rfc3339(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc3339Sync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response rfc3339Sync(RequestOptions requestOptions, Context context); @Get("/encode/datetime/responseheader/rfc7231") @ExpectedResponses({ 204 }) @@ -97,8 +92,7 @@ Response rfc3339Sync(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc7231(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> rfc7231(RequestOptions requestOptions, Context context); @Get("/encode/datetime/responseheader/rfc7231") @ExpectedResponses({ 204 }) @@ -106,8 +100,7 @@ Mono> rfc7231(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc7231Sync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response rfc7231Sync(RequestOptions requestOptions, Context context); @Get("/encode/datetime/responseheader/unix-timestamp") @ExpectedResponses({ 204 }) @@ -115,8 +108,7 @@ Response rfc7231Sync(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestamp(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> unixTimestamp(RequestOptions requestOptions, Context context); @Get("/encode/datetime/responseheader/unix-timestamp") @ExpectedResponses({ 204 }) @@ -124,8 +116,7 @@ Mono> unixTimestamp(@HeaderParam("accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response unixTimestampSync(RequestOptions requestOptions, Context context); } /** @@ -140,8 +131,7 @@ Response unixTimestampSync(@HeaderParam("accept") String accept, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.defaultMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.defaultMethod(requestOptions, context)); } /** @@ -156,8 +146,7 @@ public Mono> defaultMethodWithResponseAsync(RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.defaultMethodSync(accept, requestOptions, Context.NONE); + return service.defaultMethodSync(requestOptions, Context.NONE); } /** @@ -172,8 +161,7 @@ public Response defaultMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc3339WithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.rfc3339(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.rfc3339(requestOptions, context)); } /** @@ -188,8 +176,7 @@ public Mono> rfc3339WithResponseAsync(RequestOptions requestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc3339WithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.rfc3339Sync(accept, requestOptions, Context.NONE); + return service.rfc3339Sync(requestOptions, Context.NONE); } /** @@ -204,8 +191,7 @@ public Response rfc3339WithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc7231WithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.rfc7231(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.rfc7231(requestOptions, context)); } /** @@ -220,8 +206,7 @@ public Mono> rfc7231WithResponseAsync(RequestOptions requestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc7231WithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.rfc7231Sync(accept, requestOptions, Context.NONE); + return service.rfc7231Sync(requestOptions, Context.NONE); } /** @@ -236,8 +221,7 @@ public Response rfc7231WithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unixTimestampWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.unixTimestamp(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.unixTimestamp(requestOptions, context)); } /** @@ -252,7 +236,6 @@ public Mono> unixTimestampWithResponseAsync(RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response unixTimestampWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.unixTimestampSync(accept, requestOptions, Context.NONE); + return service.unixTimestampSync(requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/duration/implementation/HeadersImpl.java b/typespec-tests/src/main/java/com/encode/duration/implementation/HeadersImpl.java index 602448ae71..466082b506 100644 --- a/typespec-tests/src/main/java/com/encode/duration/implementation/HeadersImpl.java +++ b/typespec-tests/src/main/java/com/encode/duration/implementation/HeadersImpl.java @@ -64,8 +64,8 @@ public interface HeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("duration") Duration duration, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> defaultMethod(@HeaderParam("duration") Duration duration, RequestOptions requestOptions, + Context context); @Get("/encode/duration/header/default") @ExpectedResponses({ 204 }) @@ -73,8 +73,8 @@ Mono> defaultMethod(@HeaderParam("duration") Duration duration, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("duration") Duration duration, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response defaultMethodSync(@HeaderParam("duration") Duration duration, RequestOptions requestOptions, + Context context); @Get("/encode/duration/header/iso8601") @ExpectedResponses({ 204 }) @@ -82,8 +82,8 @@ Response defaultMethodSync(@HeaderParam("duration") Duration duration, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> iso8601(@HeaderParam("duration") Duration duration, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> iso8601(@HeaderParam("duration") Duration duration, RequestOptions requestOptions, + Context context); @Get("/encode/duration/header/iso8601") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> iso8601(@HeaderParam("duration") Duration duration, @Header @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response iso8601Sync(@HeaderParam("duration") Duration duration, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response iso8601Sync(@HeaderParam("duration") Duration duration, RequestOptions requestOptions, + Context context); @Get("/encode/duration/header/iso8601-array") @ExpectedResponses({ 204 }) @@ -100,8 +100,8 @@ Response iso8601Sync(@HeaderParam("duration") Duration duration, @HeaderPa @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> iso8601Array(@HeaderParam("duration") String duration, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> iso8601Array(@HeaderParam("duration") String duration, RequestOptions requestOptions, + Context context); @Get("/encode/duration/header/iso8601-array") @ExpectedResponses({ 204 }) @@ -109,8 +109,8 @@ Mono> iso8601Array(@HeaderParam("duration") String duration, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response iso8601ArraySync(@HeaderParam("duration") String duration, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response iso8601ArraySync(@HeaderParam("duration") String duration, RequestOptions requestOptions, + Context context); @Get("/encode/duration/header/int32-seconds") @ExpectedResponses({ 204 }) @@ -118,8 +118,8 @@ Response iso8601ArraySync(@HeaderParam("duration") String duration, @Heade @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> int32Seconds(@HeaderParam("duration") long duration, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> int32Seconds(@HeaderParam("duration") long duration, RequestOptions requestOptions, + Context context); @Get("/encode/duration/header/int32-seconds") @ExpectedResponses({ 204 }) @@ -127,8 +127,8 @@ Mono> int32Seconds(@HeaderParam("duration") long duration, @Heade @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response int32SecondsSync(@HeaderParam("duration") long duration, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response int32SecondsSync(@HeaderParam("duration") long duration, RequestOptions requestOptions, + Context context); @Get("/encode/duration/header/float-seconds") @ExpectedResponses({ 204 }) @@ -136,8 +136,8 @@ Response int32SecondsSync(@HeaderParam("duration") long duration, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> floatSeconds(@HeaderParam("duration") double duration, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> floatSeconds(@HeaderParam("duration") double duration, RequestOptions requestOptions, + Context context); @Get("/encode/duration/header/float-seconds") @ExpectedResponses({ 204 }) @@ -145,8 +145,8 @@ Mono> floatSeconds(@HeaderParam("duration") double duration, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response floatSecondsSync(@HeaderParam("duration") double duration, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response floatSecondsSync(@HeaderParam("duration") double duration, RequestOptions requestOptions, + Context context); @Get("/encode/duration/header/float64-seconds") @ExpectedResponses({ 204 }) @@ -154,8 +154,8 @@ Response floatSecondsSync(@HeaderParam("duration") double duration, @Heade @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> float64Seconds(@HeaderParam("duration") double duration, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> float64Seconds(@HeaderParam("duration") double duration, RequestOptions requestOptions, + Context context); @Get("/encode/duration/header/float64-seconds") @ExpectedResponses({ 204 }) @@ -163,8 +163,8 @@ Mono> float64Seconds(@HeaderParam("duration") double duration, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response float64SecondsSync(@HeaderParam("duration") double duration, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response float64SecondsSync(@HeaderParam("duration") double duration, RequestOptions requestOptions, + Context context); } /** @@ -180,8 +180,7 @@ Response float64SecondsSync(@HeaderParam("duration") double duration, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(Duration duration, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.defaultMethod(duration, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.defaultMethod(duration, requestOptions, context)); } /** @@ -197,8 +196,7 @@ public Mono> defaultMethodWithResponseAsync(Duration duration, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(Duration duration, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.defaultMethodSync(duration, accept, requestOptions, Context.NONE); + return service.defaultMethodSync(duration, requestOptions, Context.NONE); } /** @@ -214,8 +212,7 @@ public Response defaultMethodWithResponse(Duration duration, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> iso8601WithResponseAsync(Duration duration, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.iso8601(duration, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.iso8601(duration, requestOptions, context)); } /** @@ -231,8 +228,7 @@ public Mono> iso8601WithResponseAsync(Duration duration, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response iso8601WithResponse(Duration duration, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.iso8601Sync(duration, accept, requestOptions, Context.NONE); + return service.iso8601Sync(duration, requestOptions, Context.NONE); } /** @@ -248,11 +244,9 @@ public Response iso8601WithResponse(Duration duration, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> iso8601ArrayWithResponseAsync(List duration, RequestOptions requestOptions) { - final String accept = "application/json"; String durationConverted = JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(duration, CollectionFormat.CSV); - return FluxUtil - .withContext(context -> service.iso8601Array(durationConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.iso8601Array(durationConverted, requestOptions, context)); } /** @@ -268,10 +262,9 @@ public Mono> iso8601ArrayWithResponseAsync(List duratio */ @ServiceMethod(returns = ReturnType.SINGLE) public Response iso8601ArrayWithResponse(List duration, RequestOptions requestOptions) { - final String accept = "application/json"; String durationConverted = JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(duration, CollectionFormat.CSV); - return service.iso8601ArraySync(durationConverted, accept, requestOptions, Context.NONE); + return service.iso8601ArraySync(durationConverted, requestOptions, Context.NONE); } /** @@ -287,10 +280,8 @@ public Response iso8601ArrayWithResponse(List duration, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> int32SecondsWithResponseAsync(Duration duration, RequestOptions requestOptions) { - final String accept = "application/json"; long durationConverted = duration.getSeconds(); - return FluxUtil - .withContext(context -> service.int32Seconds(durationConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.int32Seconds(durationConverted, requestOptions, context)); } /** @@ -306,9 +297,8 @@ public Mono> int32SecondsWithResponseAsync(Duration duration, Req */ @ServiceMethod(returns = ReturnType.SINGLE) public Response int32SecondsWithResponse(Duration duration, RequestOptions requestOptions) { - final String accept = "application/json"; long durationConverted = duration.getSeconds(); - return service.int32SecondsSync(durationConverted, accept, requestOptions, Context.NONE); + return service.int32SecondsSync(durationConverted, requestOptions, Context.NONE); } /** @@ -324,10 +314,8 @@ public Response int32SecondsWithResponse(Duration duration, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> floatSecondsWithResponseAsync(Duration duration, RequestOptions requestOptions) { - final String accept = "application/json"; double durationConverted = (double) duration.toNanos() / 1000_000_000L; - return FluxUtil - .withContext(context -> service.floatSeconds(durationConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.floatSeconds(durationConverted, requestOptions, context)); } /** @@ -343,9 +331,8 @@ public Mono> floatSecondsWithResponseAsync(Duration duration, Req */ @ServiceMethod(returns = ReturnType.SINGLE) public Response floatSecondsWithResponse(Duration duration, RequestOptions requestOptions) { - final String accept = "application/json"; double durationConverted = (double) duration.toNanos() / 1000_000_000L; - return service.floatSecondsSync(durationConverted, accept, requestOptions, Context.NONE); + return service.floatSecondsSync(durationConverted, requestOptions, Context.NONE); } /** @@ -361,10 +348,8 @@ public Response floatSecondsWithResponse(Duration duration, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> float64SecondsWithResponseAsync(Duration duration, RequestOptions requestOptions) { - final String accept = "application/json"; double durationConverted = (double) duration.toNanos() / 1000_000_000L; - return FluxUtil - .withContext(context -> service.float64Seconds(durationConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.float64Seconds(durationConverted, requestOptions, context)); } /** @@ -380,8 +365,7 @@ public Mono> float64SecondsWithResponseAsync(Duration duration, R */ @ServiceMethod(returns = ReturnType.SINGLE) public Response float64SecondsWithResponse(Duration duration, RequestOptions requestOptions) { - final String accept = "application/json"; double durationConverted = (double) duration.toNanos() / 1000_000_000L; - return service.float64SecondsSync(durationConverted, accept, requestOptions, Context.NONE); + return service.float64SecondsSync(durationConverted, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/duration/implementation/PropertiesImpl.java b/typespec-tests/src/main/java/com/encode/duration/implementation/PropertiesImpl.java index b21e32a5c1..5c97a30990 100644 --- a/typespec-tests/src/main/java/com/encode/duration/implementation/PropertiesImpl.java +++ b/typespec-tests/src/main/java/com/encode/duration/implementation/PropertiesImpl.java @@ -63,8 +63,9 @@ public interface PropertiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> defaultMethod(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/duration/property/default") @ExpectedResponses({ 200 }) @@ -72,8 +73,9 @@ Mono> defaultMethod(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response defaultMethodSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/duration/property/iso8601") @ExpectedResponses({ 200 }) @@ -81,8 +83,9 @@ Response defaultMethodSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> iso8601(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> iso8601(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/duration/property/iso8601") @ExpectedResponses({ 200 }) @@ -90,8 +93,9 @@ Mono> iso8601(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response iso8601Sync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response iso8601Sync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/duration/property/int32-seconds") @ExpectedResponses({ 200 }) @@ -99,8 +103,9 @@ Response iso8601Sync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> int32Seconds(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> int32Seconds(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/duration/property/int32-seconds") @ExpectedResponses({ 200 }) @@ -108,8 +113,9 @@ Mono> int32Seconds(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response int32SecondsSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response int32SecondsSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/duration/property/float-seconds") @ExpectedResponses({ 200 }) @@ -117,8 +123,9 @@ Response int32SecondsSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> floatSeconds(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> floatSeconds(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/duration/property/float-seconds") @ExpectedResponses({ 200 }) @@ -126,8 +133,9 @@ Mono> floatSeconds(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response floatSecondsSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response floatSecondsSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/duration/property/float64-seconds") @ExpectedResponses({ 200 }) @@ -135,8 +143,9 @@ Response floatSecondsSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> float64Seconds(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> float64Seconds(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/duration/property/float64-seconds") @ExpectedResponses({ 200 }) @@ -144,8 +153,9 @@ Mono> float64Seconds(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response float64SecondsSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response float64SecondsSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/duration/property/float-seconds-array") @ExpectedResponses({ 200 }) @@ -153,8 +163,9 @@ Response float64SecondsSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> floatSecondsArray(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> floatSecondsArray(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/duration/property/float-seconds-array") @ExpectedResponses({ 200 }) @@ -162,8 +173,9 @@ Mono> floatSecondsArray(@HeaderParam("accept") String accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response floatSecondsArraySync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response floatSecondsArraySync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -194,8 +206,10 @@ Response floatSecondsArraySync(@HeaderParam("accept") String accept, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.defaultMethod(accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.defaultMethod(contentType, accept, body, requestOptions, context)); } /** @@ -226,8 +240,9 @@ public Mono> defaultMethodWithResponseAsync(BinaryData body */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.defaultMethodSync(accept, body, requestOptions, Context.NONE); + return service.defaultMethodSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -258,8 +273,9 @@ public Response defaultMethodWithResponse(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> iso8601WithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.iso8601(accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.iso8601(contentType, accept, body, requestOptions, context)); } /** @@ -290,8 +306,9 @@ public Mono> iso8601WithResponseAsync(BinaryData body, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response iso8601WithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.iso8601Sync(accept, body, requestOptions, Context.NONE); + return service.iso8601Sync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -322,8 +339,10 @@ public Response iso8601WithResponse(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> int32SecondsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.int32Seconds(accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.int32Seconds(contentType, accept, body, requestOptions, context)); } /** @@ -354,8 +373,9 @@ public Mono> int32SecondsWithResponseAsync(BinaryData body, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response int32SecondsWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.int32SecondsSync(accept, body, requestOptions, Context.NONE); + return service.int32SecondsSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -386,8 +406,10 @@ public Response int32SecondsWithResponse(BinaryData body, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> floatSecondsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.floatSeconds(accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.floatSeconds(contentType, accept, body, requestOptions, context)); } /** @@ -418,8 +440,9 @@ public Mono> floatSecondsWithResponseAsync(BinaryData body, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response floatSecondsWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.floatSecondsSync(accept, body, requestOptions, Context.NONE); + return service.floatSecondsSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -450,8 +473,10 @@ public Response floatSecondsWithResponse(BinaryData body, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> float64SecondsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.float64Seconds(accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.float64Seconds(contentType, accept, body, requestOptions, context)); } /** @@ -482,8 +507,9 @@ public Mono> float64SecondsWithResponseAsync(BinaryData bod */ @ServiceMethod(returns = ReturnType.SINGLE) public Response float64SecondsWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.float64SecondsSync(accept, body, requestOptions, Context.NONE); + return service.float64SecondsSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -519,8 +545,10 @@ public Response float64SecondsWithResponse(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Mono> floatSecondsArrayWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.floatSecondsArray(accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.floatSecondsArray(contentType, accept, body, requestOptions, context)); } /** @@ -555,7 +583,8 @@ public Mono> floatSecondsArrayWithResponseAsync(BinaryData */ @ServiceMethod(returns = ReturnType.SINGLE) public Response floatSecondsArrayWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.floatSecondsArraySync(accept, body, requestOptions, Context.NONE); + return service.floatSecondsArraySync(contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/duration/implementation/QueriesImpl.java b/typespec-tests/src/main/java/com/encode/duration/implementation/QueriesImpl.java index ad2e6d2387..bccb586fc2 100644 --- a/typespec-tests/src/main/java/com/encode/duration/implementation/QueriesImpl.java +++ b/typespec-tests/src/main/java/com/encode/duration/implementation/QueriesImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -66,8 +65,8 @@ public interface QueriesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@QueryParam("input") Duration input, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> defaultMethod(@QueryParam("input") Duration input, RequestOptions requestOptions, + Context context); @Get("/encode/duration/query/default") @ExpectedResponses({ 204 }) @@ -75,8 +74,8 @@ Mono> defaultMethod(@QueryParam("input") Duration input, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@QueryParam("input") Duration input, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response defaultMethodSync(@QueryParam("input") Duration input, RequestOptions requestOptions, + Context context); @Get("/encode/duration/query/iso8601") @ExpectedResponses({ 204 }) @@ -84,8 +83,8 @@ Response defaultMethodSync(@QueryParam("input") Duration input, @HeaderPar @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> iso8601(@QueryParam("input") Duration input, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> iso8601(@QueryParam("input") Duration input, RequestOptions requestOptions, + Context context); @Get("/encode/duration/query/iso8601") @ExpectedResponses({ 204 }) @@ -93,8 +92,7 @@ Mono> iso8601(@QueryParam("input") Duration input, @HeaderParam(" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response iso8601Sync(@QueryParam("input") Duration input, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response iso8601Sync(@QueryParam("input") Duration input, RequestOptions requestOptions, Context context); @Get("/encode/duration/query/int32-seconds") @ExpectedResponses({ 204 }) @@ -102,8 +100,8 @@ Response iso8601Sync(@QueryParam("input") Duration input, @HeaderParam("ac @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> int32Seconds(@QueryParam("input") long input, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> int32Seconds(@QueryParam("input") long input, RequestOptions requestOptions, + Context context); @Get("/encode/duration/query/int32-seconds") @ExpectedResponses({ 204 }) @@ -111,8 +109,8 @@ Mono> int32Seconds(@QueryParam("input") long input, @HeaderParam( @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response int32SecondsSync(@QueryParam("input") long input, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response int32SecondsSync(@QueryParam("input") long input, RequestOptions requestOptions, + Context context); @Get("/encode/duration/query/float-seconds") @ExpectedResponses({ 204 }) @@ -120,8 +118,8 @@ Response int32SecondsSync(@QueryParam("input") long input, @HeaderParam("a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> floatSeconds(@QueryParam("input") double input, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> floatSeconds(@QueryParam("input") double input, RequestOptions requestOptions, + Context context); @Get("/encode/duration/query/float-seconds") @ExpectedResponses({ 204 }) @@ -129,8 +127,8 @@ Mono> floatSeconds(@QueryParam("input") double input, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response floatSecondsSync(@QueryParam("input") double input, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response floatSecondsSync(@QueryParam("input") double input, RequestOptions requestOptions, + Context context); @Get("/encode/duration/query/float64-seconds") @ExpectedResponses({ 204 }) @@ -138,8 +136,8 @@ Response floatSecondsSync(@QueryParam("input") double input, @HeaderParam( @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> float64Seconds(@QueryParam("input") double input, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> float64Seconds(@QueryParam("input") double input, RequestOptions requestOptions, + Context context); @Get("/encode/duration/query/float64-seconds") @ExpectedResponses({ 204 }) @@ -147,8 +145,8 @@ Mono> float64Seconds(@QueryParam("input") double input, @HeaderPa @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response float64SecondsSync(@QueryParam("input") double input, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response float64SecondsSync(@QueryParam("input") double input, RequestOptions requestOptions, + Context context); @Get("/encode/duration/query/int32-seconds-array") @ExpectedResponses({ 204 }) @@ -156,8 +154,8 @@ Response float64SecondsSync(@QueryParam("input") double input, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> int32SecondsArray(@QueryParam("input") String input, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> int32SecondsArray(@QueryParam("input") String input, RequestOptions requestOptions, + Context context); @Get("/encode/duration/query/int32-seconds-array") @ExpectedResponses({ 204 }) @@ -165,8 +163,8 @@ Mono> int32SecondsArray(@QueryParam("input") String input, @Heade @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response int32SecondsArraySync(@QueryParam("input") String input, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response int32SecondsArraySync(@QueryParam("input") String input, RequestOptions requestOptions, + Context context); } /** @@ -182,8 +180,7 @@ Response int32SecondsArraySync(@QueryParam("input") String input, @HeaderP */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(Duration input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.defaultMethod(input, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.defaultMethod(input, requestOptions, context)); } /** @@ -199,8 +196,7 @@ public Mono> defaultMethodWithResponseAsync(Duration input, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(Duration input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.defaultMethodSync(input, accept, requestOptions, Context.NONE); + return service.defaultMethodSync(input, requestOptions, Context.NONE); } /** @@ -216,8 +212,7 @@ public Response defaultMethodWithResponse(Duration input, RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> iso8601WithResponseAsync(Duration input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.iso8601(input, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.iso8601(input, requestOptions, context)); } /** @@ -233,8 +228,7 @@ public Mono> iso8601WithResponseAsync(Duration input, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response iso8601WithResponse(Duration input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.iso8601Sync(input, accept, requestOptions, Context.NONE); + return service.iso8601Sync(input, requestOptions, Context.NONE); } /** @@ -250,9 +244,8 @@ public Response iso8601WithResponse(Duration input, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> int32SecondsWithResponseAsync(Duration input, RequestOptions requestOptions) { - final String accept = "application/json"; long inputConverted = input.getSeconds(); - return FluxUtil.withContext(context -> service.int32Seconds(inputConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.int32Seconds(inputConverted, requestOptions, context)); } /** @@ -268,9 +261,8 @@ public Mono> int32SecondsWithResponseAsync(Duration input, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response int32SecondsWithResponse(Duration input, RequestOptions requestOptions) { - final String accept = "application/json"; long inputConverted = input.getSeconds(); - return service.int32SecondsSync(inputConverted, accept, requestOptions, Context.NONE); + return service.int32SecondsSync(inputConverted, requestOptions, Context.NONE); } /** @@ -286,9 +278,8 @@ public Response int32SecondsWithResponse(Duration input, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> floatSecondsWithResponseAsync(Duration input, RequestOptions requestOptions) { - final String accept = "application/json"; double inputConverted = (double) input.toNanos() / 1000_000_000L; - return FluxUtil.withContext(context -> service.floatSeconds(inputConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.floatSeconds(inputConverted, requestOptions, context)); } /** @@ -304,9 +295,8 @@ public Mono> floatSecondsWithResponseAsync(Duration input, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response floatSecondsWithResponse(Duration input, RequestOptions requestOptions) { - final String accept = "application/json"; double inputConverted = (double) input.toNanos() / 1000_000_000L; - return service.floatSecondsSync(inputConverted, accept, requestOptions, Context.NONE); + return service.floatSecondsSync(inputConverted, requestOptions, Context.NONE); } /** @@ -322,9 +312,8 @@ public Response floatSecondsWithResponse(Duration input, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> float64SecondsWithResponseAsync(Duration input, RequestOptions requestOptions) { - final String accept = "application/json"; double inputConverted = (double) input.toNanos() / 1000_000_000L; - return FluxUtil.withContext(context -> service.float64Seconds(inputConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.float64Seconds(inputConverted, requestOptions, context)); } /** @@ -340,9 +329,8 @@ public Mono> float64SecondsWithResponseAsync(Duration input, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response float64SecondsWithResponse(Duration input, RequestOptions requestOptions) { - final String accept = "application/json"; double inputConverted = (double) input.toNanos() / 1000_000_000L; - return service.float64SecondsSync(inputConverted, accept, requestOptions, Context.NONE); + return service.float64SecondsSync(inputConverted, requestOptions, Context.NONE); } /** @@ -359,13 +347,11 @@ public Response float64SecondsWithResponse(Duration input, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> int32SecondsArrayWithResponseAsync(List input, RequestOptions requestOptions) { - final String accept = "application/json"; String inputConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( input.stream().map(paramItemValue -> paramItemValue.getSeconds()).collect(Collectors.toList()), CollectionFormat.CSV); - return FluxUtil - .withContext(context -> service.int32SecondsArray(inputConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.int32SecondsArray(inputConverted, requestOptions, context)); } /** @@ -381,11 +367,10 @@ public Mono> int32SecondsArrayWithResponseAsync(List in */ @ServiceMethod(returns = ReturnType.SINGLE) public Response int32SecondsArrayWithResponse(List input, RequestOptions requestOptions) { - final String accept = "application/json"; String inputConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( input.stream().map(paramItemValue -> paramItemValue.getSeconds()).collect(Collectors.toList()), CollectionFormat.CSV); - return service.int32SecondsArraySync(inputConverted, accept, requestOptions, Context.NONE); + return service.int32SecondsArraySync(inputConverted, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/basic/implementation/ExplicitBodiesImpl.java b/typespec-tests/src/main/java/com/parameters/basic/implementation/ExplicitBodiesImpl.java index 0da230c5da..b8fba3c8c3 100644 --- a/typespec-tests/src/main/java/com/parameters/basic/implementation/ExplicitBodiesImpl.java +++ b/typespec-tests/src/main/java/com/parameters/basic/implementation/ExplicitBodiesImpl.java @@ -63,7 +63,7 @@ public interface ExplicitBodiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> simple(@HeaderParam("accept") String accept, + Mono> simple(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/parameters/basic/explicit-body/simple") @@ -72,8 +72,8 @@ Mono> simple(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response simpleSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response simpleSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -96,8 +96,8 @@ Response simpleSync(@HeaderParam("accept") String accept, @BodyParam("appl */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> simpleWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.simple(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.simple(contentType, body, requestOptions, context)); } /** @@ -120,7 +120,7 @@ public Mono> simpleWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response simpleWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.simpleSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.simpleSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/basic/implementation/ImplicitBodiesImpl.java b/typespec-tests/src/main/java/com/parameters/basic/implementation/ImplicitBodiesImpl.java index e6488ff8c4..94e75bcb9d 100644 --- a/typespec-tests/src/main/java/com/parameters/basic/implementation/ImplicitBodiesImpl.java +++ b/typespec-tests/src/main/java/com/parameters/basic/implementation/ImplicitBodiesImpl.java @@ -63,7 +63,7 @@ public interface ImplicitBodiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> simple(@HeaderParam("accept") String accept, + Mono> simple(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData simpleRequest, RequestOptions requestOptions, Context context); @Put("/parameters/basic/implicit-body/simple") @@ -72,7 +72,7 @@ Mono> simple(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response simpleSync(@HeaderParam("accept") String accept, + Response simpleSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData simpleRequest, RequestOptions requestOptions, Context context); } @@ -96,8 +96,8 @@ Response simpleSync(@HeaderParam("accept") String accept, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> simpleWithResponseAsync(BinaryData simpleRequest, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.simple(accept, simpleRequest, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.simple(contentType, simpleRequest, requestOptions, context)); } /** @@ -120,7 +120,7 @@ public Mono> simpleWithResponseAsync(BinaryData simpleRequest, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response simpleWithResponse(BinaryData simpleRequest, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.simpleSync(accept, simpleRequest, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.simpleSync(contentType, simpleRequest, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/BodyOptionalityClientImpl.java b/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/BodyOptionalityClientImpl.java index ea96a36d13..aa69cfa6b6 100644 --- a/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/BodyOptionalityClientImpl.java +++ b/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/BodyOptionalityClientImpl.java @@ -126,7 +126,7 @@ public interface BodyOptionalityClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> requiredExplicit(@HeaderParam("accept") String accept, + Mono> requiredExplicit(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/parameters/body-optionality/required-explicit") @@ -135,7 +135,7 @@ Mono> requiredExplicit(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requiredExplicitSync(@HeaderParam("accept") String accept, + Response requiredExplicitSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/parameters/body-optionality/required-implicit") @@ -144,7 +144,7 @@ Response requiredExplicitSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> requiredImplicit(@HeaderParam("accept") String accept, + Mono> requiredImplicit(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData bodyModel, RequestOptions requestOptions, Context context); @Post("/parameters/body-optionality/required-implicit") @@ -153,7 +153,7 @@ Mono> requiredImplicit(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requiredImplicitSync(@HeaderParam("accept") String accept, + Response requiredImplicitSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData bodyModel, RequestOptions requestOptions, Context context); } @@ -177,8 +177,8 @@ Response requiredImplicitSync(@HeaderParam("accept") String accept, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> requiredExplicitWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.requiredExplicit(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.requiredExplicit(contentType, body, requestOptions, context)); } /** @@ -201,8 +201,8 @@ public Mono> requiredExplicitWithResponseAsync(BinaryData body, R */ @ServiceMethod(returns = ReturnType.SINGLE) public Response requiredExplicitWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.requiredExplicitSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.requiredExplicitSync(contentType, body, requestOptions, Context.NONE); } /** @@ -225,8 +225,9 @@ public Response requiredExplicitWithResponse(BinaryData body, RequestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> requiredImplicitWithResponseAsync(BinaryData bodyModel, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.requiredImplicit(accept, bodyModel, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil + .withContext(context -> service.requiredImplicit(contentType, bodyModel, requestOptions, context)); } /** @@ -249,7 +250,7 @@ public Mono> requiredImplicitWithResponseAsync(BinaryData bodyMod */ @ServiceMethod(returns = ReturnType.SINGLE) public Response requiredImplicitWithResponse(BinaryData bodyModel, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.requiredImplicitSync(accept, bodyModel, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.requiredImplicitSync(contentType, bodyModel, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/OptionalExplicitsImpl.java b/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/OptionalExplicitsImpl.java index b5891f80be..766827b3df 100644 --- a/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/OptionalExplicitsImpl.java +++ b/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/OptionalExplicitsImpl.java @@ -62,7 +62,8 @@ public interface OptionalExplicitsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> set(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> set(@HeaderParam("Content-Type") String contentType, RequestOptions requestOptions, + Context context); @Post("/parameters/body-optionality/optional-explicit/set") @ExpectedResponses({ 204 }) @@ -70,7 +71,8 @@ public interface OptionalExplicitsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response setSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response setSync(@HeaderParam("Content-Type") String contentType, RequestOptions requestOptions, + Context context); @Post("/parameters/body-optionality/optional-explicit/omit") @ExpectedResponses({ 204 }) @@ -78,7 +80,8 @@ public interface OptionalExplicitsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> omit(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> omit(@HeaderParam("Content-Type") String contentType, RequestOptions requestOptions, + Context context); @Post("/parameters/body-optionality/optional-explicit/omit") @ExpectedResponses({ 204 }) @@ -86,7 +89,8 @@ public interface OptionalExplicitsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response omitSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response omitSync(@HeaderParam("Content-Type") String contentType, RequestOptions requestOptions, + Context context); } /** @@ -108,14 +112,14 @@ public interface OptionalExplicitsService { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> setWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; + final String contentType = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); } }); - return FluxUtil.withContext(context -> service.set(accept, requestOptionsLocal, context)); + return FluxUtil.withContext(context -> service.set(contentType, requestOptionsLocal, context)); } /** @@ -137,14 +141,14 @@ public Mono> setWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response setWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; + final String contentType = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); } }); - return service.setSync(accept, requestOptionsLocal, Context.NONE); + return service.setSync(contentType, requestOptionsLocal, Context.NONE); } /** @@ -166,14 +170,14 @@ public Response setWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> omitWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; + final String contentType = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); } }); - return FluxUtil.withContext(context -> service.omit(accept, requestOptionsLocal, context)); + return FluxUtil.withContext(context -> service.omit(contentType, requestOptionsLocal, context)); } /** @@ -195,13 +199,13 @@ public Mono> omitWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response omitWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; + final String contentType = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); } }); - return service.omitSync(accept, requestOptionsLocal, Context.NONE); + return service.omitSync(contentType, requestOptionsLocal, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/HeadersImpl.java b/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/HeadersImpl.java index 267582535c..6e220ab978 100644 --- a/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/HeadersImpl.java +++ b/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/HeadersImpl.java @@ -63,8 +63,7 @@ public interface HeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> csv(@HeaderParam("colors") String colors, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> csv(@HeaderParam("colors") String colors, RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/header/csv") @ExpectedResponses({ 204 }) @@ -72,8 +71,7 @@ Mono> csv(@HeaderParam("colors") String colors, @HeaderParam("acc @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response csvSync(@HeaderParam("colors") String colors, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response csvSync(@HeaderParam("colors") String colors, RequestOptions requestOptions, Context context); } /** @@ -89,11 +87,10 @@ Response csvSync(@HeaderParam("colors") String colors, @HeaderParam("accep */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> csvWithResponseAsync(List colors, RequestOptions requestOptions) { - final String accept = "application/json"; String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return FluxUtil.withContext(context -> service.csv(colorsConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.csv(colorsConverted, requestOptions, context)); } /** @@ -109,10 +106,9 @@ public Mono> csvWithResponseAsync(List colors, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response csvWithResponse(List colors, RequestOptions requestOptions) { - final String accept = "application/json"; String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return service.csvSync(colorsConverted, accept, requestOptions, Context.NONE); + return service.csvSync(colorsConverted, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/QueriesImpl.java b/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/QueriesImpl.java index b55f7842f8..695c4a5eab 100644 --- a/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/QueriesImpl.java +++ b/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/QueriesImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -65,7 +64,7 @@ public interface QueriesService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> multi(@QueryParam(value = "colors", multipleQueryParams = true) List colors, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/multi") @ExpectedResponses({ 204 }) @@ -74,7 +73,7 @@ Mono> multi(@QueryParam(value = "colors", multipleQueryParams = t @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response multiSync(@QueryParam(value = "colors", multipleQueryParams = true) List colors, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/ssv") @ExpectedResponses({ 204 }) @@ -82,8 +81,7 @@ Response multiSync(@QueryParam(value = "colors", multipleQueryParams = tru @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> ssv(@QueryParam("colors") String colors, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> ssv(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/ssv") @ExpectedResponses({ 204 }) @@ -91,8 +89,7 @@ Mono> ssv(@QueryParam("colors") String colors, @HeaderParam("acce @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response ssvSync(@QueryParam("colors") String colors, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response ssvSync(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/tsv") @ExpectedResponses({ 204 }) @@ -100,8 +97,7 @@ Response ssvSync(@QueryParam("colors") String colors, @HeaderParam("accept @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> tsv(@QueryParam("colors") String colors, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> tsv(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/tsv") @ExpectedResponses({ 204 }) @@ -109,8 +105,7 @@ Mono> tsv(@QueryParam("colors") String colors, @HeaderParam("acce @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response tsvSync(@QueryParam("colors") String colors, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response tsvSync(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/pipes") @ExpectedResponses({ 204 }) @@ -118,8 +113,7 @@ Response tsvSync(@QueryParam("colors") String colors, @HeaderParam("accept @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> pipes(@QueryParam("colors") String colors, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> pipes(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/pipes") @ExpectedResponses({ 204 }) @@ -127,8 +121,7 @@ Mono> pipes(@QueryParam("colors") String colors, @HeaderParam("ac @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response pipesSync(@QueryParam("colors") String colors, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response pipesSync(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/csv") @ExpectedResponses({ 204 }) @@ -136,8 +129,7 @@ Response pipesSync(@QueryParam("colors") String colors, @HeaderParam("acce @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> csv(@QueryParam("colors") String colors, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> csv(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/csv") @ExpectedResponses({ 204 }) @@ -145,8 +137,7 @@ Mono> csv(@QueryParam("colors") String colors, @HeaderParam("acce @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response csvSync(@QueryParam("colors") String colors, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response csvSync(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context); } /** @@ -162,10 +153,9 @@ Response csvSync(@QueryParam("colors") String colors, @HeaderParam("accept */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> multiWithResponseAsync(List colors, RequestOptions requestOptions) { - final String accept = "application/json"; List colorsConverted = colors.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return FluxUtil.withContext(context -> service.multi(colorsConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.multi(colorsConverted, requestOptions, context)); } /** @@ -181,10 +171,9 @@ public Mono> multiWithResponseAsync(List colors, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response multiWithResponse(List colors, RequestOptions requestOptions) { - final String accept = "application/json"; List colorsConverted = colors.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return service.multiSync(colorsConverted, accept, requestOptions, Context.NONE); + return service.multiSync(colorsConverted, requestOptions, Context.NONE); } /** @@ -200,11 +189,10 @@ public Response multiWithResponse(List colors, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> ssvWithResponseAsync(List colors, RequestOptions requestOptions) { - final String accept = "application/json"; String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(" ")); - return FluxUtil.withContext(context -> service.ssv(colorsConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.ssv(colorsConverted, requestOptions, context)); } /** @@ -220,11 +208,10 @@ public Mono> ssvWithResponseAsync(List colors, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response ssvWithResponse(List colors, RequestOptions requestOptions) { - final String accept = "application/json"; String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(" ")); - return service.ssvSync(colorsConverted, accept, requestOptions, Context.NONE); + return service.ssvSync(colorsConverted, requestOptions, Context.NONE); } /** @@ -240,11 +227,10 @@ public Response ssvWithResponse(List colors, RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> tsvWithResponseAsync(List colors, RequestOptions requestOptions) { - final String accept = "application/json"; String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining("\t")); - return FluxUtil.withContext(context -> service.tsv(colorsConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.tsv(colorsConverted, requestOptions, context)); } /** @@ -260,11 +246,10 @@ public Mono> tsvWithResponseAsync(List colors, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response tsvWithResponse(List colors, RequestOptions requestOptions) { - final String accept = "application/json"; String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining("\t")); - return service.tsvSync(colorsConverted, accept, requestOptions, Context.NONE); + return service.tsvSync(colorsConverted, requestOptions, Context.NONE); } /** @@ -280,11 +265,10 @@ public Response tsvWithResponse(List colors, RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> pipesWithResponseAsync(List colors, RequestOptions requestOptions) { - final String accept = "application/json"; String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining("|")); - return FluxUtil.withContext(context -> service.pipes(colorsConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.pipes(colorsConverted, requestOptions, context)); } /** @@ -300,11 +284,10 @@ public Mono> pipesWithResponseAsync(List colors, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response pipesWithResponse(List colors, RequestOptions requestOptions) { - final String accept = "application/json"; String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining("|")); - return service.pipesSync(colorsConverted, accept, requestOptions, Context.NONE); + return service.pipesSync(colorsConverted, requestOptions, Context.NONE); } /** @@ -320,11 +303,10 @@ public Response pipesWithResponse(List colors, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> csvWithResponseAsync(List colors, RequestOptions requestOptions) { - final String accept = "application/json"; String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return FluxUtil.withContext(context -> service.csv(colorsConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.csv(colorsConverted, requestOptions, context)); } /** @@ -340,10 +322,9 @@ public Mono> csvWithResponseAsync(List colors, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response csvWithResponse(List colors, RequestOptions requestOptions) { - final String accept = "application/json"; String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return service.csvSync(colorsConverted, accept, requestOptions, Context.NONE); + return service.csvSync(colorsConverted, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/spread/AliasAsyncClient.java b/typespec-tests/src/main/java/com/parameters/spread/AliasAsyncClient.java index 3b6905e66c..1bc86e295c 100644 --- a/typespec-tests/src/main/java/com/parameters/spread/AliasAsyncClient.java +++ b/typespec-tests/src/main/java/com/parameters/spread/AliasAsyncClient.java @@ -78,7 +78,7 @@ public Mono> spreadAsRequestBodyWithResponse(BinaryData spreadAsR * * @param id The id parameter. * @param xMsTestHeader The xMsTestHeader parameter. - * @param request The request parameter. + * @param spreadAsRequestParameterRequest The spreadAsRequestParameterRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -89,8 +89,9 @@ public Mono> spreadAsRequestBodyWithResponse(BinaryData spreadAsR @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono> spreadAsRequestParameterWithResponse(String id, String xMsTestHeader, - BinaryData request, RequestOptions requestOptions) { - return this.serviceClient.spreadAsRequestParameterWithResponseAsync(id, xMsTestHeader, request, requestOptions); + BinaryData spreadAsRequestParameterRequest, RequestOptions requestOptions) { + return this.serviceClient.spreadAsRequestParameterWithResponseAsync(id, xMsTestHeader, + spreadAsRequestParameterRequest, requestOptions); } /** @@ -110,7 +111,7 @@ public Mono> spreadAsRequestParameterWithResponse(String id, Stri * * @param id The id parameter. * @param xMsTestHeader The xMsTestHeader parameter. - * @param request The request parameter. + * @param spreadWithMultipleParametersRequest The spreadWithMultipleParametersRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -121,9 +122,9 @@ public Mono> spreadAsRequestParameterWithResponse(String id, Stri @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono> spreadWithMultipleParametersWithResponse(String id, String xMsTestHeader, - BinaryData request, RequestOptions requestOptions) { - return this.serviceClient.spreadWithMultipleParametersWithResponseAsync(id, xMsTestHeader, request, - requestOptions); + BinaryData spreadWithMultipleParametersRequest, RequestOptions requestOptions) { + return this.serviceClient.spreadWithMultipleParametersWithResponseAsync(id, xMsTestHeader, + spreadWithMultipleParametersRequest, requestOptions); } /** @@ -167,9 +168,9 @@ public Mono spreadAsRequestBody(String name) { public Mono spreadAsRequestParameter(String id, String xMsTestHeader, String name) { // Generated convenience method for spreadAsRequestParameterWithResponse RequestOptions requestOptions = new RequestOptions(); - SpreadAsRequestParameterRequest requestObj = new SpreadAsRequestParameterRequest(name); - BinaryData request = BinaryData.fromObject(requestObj); - return spreadAsRequestParameterWithResponse(id, xMsTestHeader, request, requestOptions) + SpreadAsRequestParameterRequest spreadAsRequestParameterRequestObj = new SpreadAsRequestParameterRequest(name); + BinaryData spreadAsRequestParameterRequest = BinaryData.fromObject(spreadAsRequestParameterRequestObj); + return spreadAsRequestParameterWithResponse(id, xMsTestHeader, spreadAsRequestParameterRequest, requestOptions) .flatMap(FluxUtil::toMono); } @@ -192,10 +193,11 @@ public Mono spreadWithMultipleParameters(SpreadWithMultipleParametersOptio RequestOptions requestOptions = new RequestOptions(); String id = options.getId(); String xMsTestHeader = options.getXMsTestHeader(); - SpreadWithMultipleParametersRequest requestObj = new SpreadWithMultipleParametersRequest(options.getProp1(), - options.getProp2(), options.getProp3(), options.getProp4(), options.getProp5(), options.getProp6()); - BinaryData request = BinaryData.fromObject(requestObj); - return spreadWithMultipleParametersWithResponse(id, xMsTestHeader, request, requestOptions) - .flatMap(FluxUtil::toMono); + SpreadWithMultipleParametersRequest spreadWithMultipleParametersRequestObj + = new SpreadWithMultipleParametersRequest(options.getProp1(), options.getProp2(), options.getProp3(), + options.getProp4(), options.getProp5(), options.getProp6()); + BinaryData spreadWithMultipleParametersRequest = BinaryData.fromObject(spreadWithMultipleParametersRequestObj); + return spreadWithMultipleParametersWithResponse(id, xMsTestHeader, spreadWithMultipleParametersRequest, + requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/typespec-tests/src/main/java/com/parameters/spread/AliasClient.java b/typespec-tests/src/main/java/com/parameters/spread/AliasClient.java index d163e2282d..e0e081738a 100644 --- a/typespec-tests/src/main/java/com/parameters/spread/AliasClient.java +++ b/typespec-tests/src/main/java/com/parameters/spread/AliasClient.java @@ -76,7 +76,7 @@ public Response spreadAsRequestBodyWithResponse(BinaryData spreadAsRequest * * @param id The id parameter. * @param xMsTestHeader The xMsTestHeader parameter. - * @param request The request parameter. + * @param spreadAsRequestParameterRequest The spreadAsRequestParameterRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -86,9 +86,10 @@ public Response spreadAsRequestBodyWithResponse(BinaryData spreadAsRequest */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response spreadAsRequestParameterWithResponse(String id, String xMsTestHeader, BinaryData request, - RequestOptions requestOptions) { - return this.serviceClient.spreadAsRequestParameterWithResponse(id, xMsTestHeader, request, requestOptions); + public Response spreadAsRequestParameterWithResponse(String id, String xMsTestHeader, + BinaryData spreadAsRequestParameterRequest, RequestOptions requestOptions) { + return this.serviceClient.spreadAsRequestParameterWithResponse(id, xMsTestHeader, + spreadAsRequestParameterRequest, requestOptions); } /** @@ -108,7 +109,7 @@ public Response spreadAsRequestParameterWithResponse(String id, String xMs * * @param id The id parameter. * @param xMsTestHeader The xMsTestHeader parameter. - * @param request The request parameter. + * @param spreadWithMultipleParametersRequest The spreadWithMultipleParametersRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -118,9 +119,10 @@ public Response spreadAsRequestParameterWithResponse(String id, String xMs */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response spreadWithMultipleParametersWithResponse(String id, String xMsTestHeader, BinaryData request, - RequestOptions requestOptions) { - return this.serviceClient.spreadWithMultipleParametersWithResponse(id, xMsTestHeader, request, requestOptions); + public Response spreadWithMultipleParametersWithResponse(String id, String xMsTestHeader, + BinaryData spreadWithMultipleParametersRequest, RequestOptions requestOptions) { + return this.serviceClient.spreadWithMultipleParametersWithResponse(id, xMsTestHeader, + spreadWithMultipleParametersRequest, requestOptions); } /** @@ -162,9 +164,10 @@ public void spreadAsRequestBody(String name) { public void spreadAsRequestParameter(String id, String xMsTestHeader, String name) { // Generated convenience method for spreadAsRequestParameterWithResponse RequestOptions requestOptions = new RequestOptions(); - SpreadAsRequestParameterRequest requestObj = new SpreadAsRequestParameterRequest(name); - BinaryData request = BinaryData.fromObject(requestObj); - spreadAsRequestParameterWithResponse(id, xMsTestHeader, request, requestOptions).getValue(); + SpreadAsRequestParameterRequest spreadAsRequestParameterRequestObj = new SpreadAsRequestParameterRequest(name); + BinaryData spreadAsRequestParameterRequest = BinaryData.fromObject(spreadAsRequestParameterRequestObj); + spreadAsRequestParameterWithResponse(id, xMsTestHeader, spreadAsRequestParameterRequest, requestOptions) + .getValue(); } /** @@ -185,9 +188,11 @@ public void spreadWithMultipleParameters(SpreadWithMultipleParametersOptions opt RequestOptions requestOptions = new RequestOptions(); String id = options.getId(); String xMsTestHeader = options.getXMsTestHeader(); - SpreadWithMultipleParametersRequest requestObj = new SpreadWithMultipleParametersRequest(options.getProp1(), - options.getProp2(), options.getProp3(), options.getProp4(), options.getProp5(), options.getProp6()); - BinaryData request = BinaryData.fromObject(requestObj); - spreadWithMultipleParametersWithResponse(id, xMsTestHeader, request, requestOptions).getValue(); + SpreadWithMultipleParametersRequest spreadWithMultipleParametersRequestObj + = new SpreadWithMultipleParametersRequest(options.getProp1(), options.getProp2(), options.getProp3(), + options.getProp4(), options.getProp5(), options.getProp6()); + BinaryData spreadWithMultipleParametersRequest = BinaryData.fromObject(spreadWithMultipleParametersRequestObj); + spreadWithMultipleParametersWithResponse(id, xMsTestHeader, spreadWithMultipleParametersRequest, requestOptions) + .getValue(); } } diff --git a/typespec-tests/src/main/java/com/parameters/spread/ModelAsyncClient.java b/typespec-tests/src/main/java/com/parameters/spread/ModelAsyncClient.java index 5d560ed155..9658ce5d9b 100644 --- a/typespec-tests/src/main/java/com/parameters/spread/ModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/parameters/spread/ModelAsyncClient.java @@ -49,7 +49,7 @@ public final class ModelAsyncClient { * } * } * - * @param bodyParameter This is a simple model. + * @param bodyParameter The bodyParameter parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -147,7 +147,7 @@ public Mono> spreadCompositeRequestWithResponse(String name, Stri * * @param name The name parameter. * @param testHeader The testHeader parameter. - * @param compositeRequestMix This is a model with non-body http request decorator. + * @param compositeRequestMix The compositeRequestMix parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -166,7 +166,7 @@ public Mono> spreadCompositeRequestMixWithResponse(String name, S /** * The spreadAsRequestBody operation. * - * @param bodyParameter This is a simple model. + * @param bodyParameter The bodyParameter parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -255,7 +255,7 @@ public Mono spreadCompositeRequest(String name, String testHeader, BodyPar * * @param name The name parameter. * @param testHeader The testHeader parameter. - * @param compositeRequestMix This is a model with non-body http request decorator. + * @param compositeRequestMix The compositeRequestMix parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. diff --git a/typespec-tests/src/main/java/com/parameters/spread/ModelClient.java b/typespec-tests/src/main/java/com/parameters/spread/ModelClient.java index 162a7ae04b..2d939811e9 100644 --- a/typespec-tests/src/main/java/com/parameters/spread/ModelClient.java +++ b/typespec-tests/src/main/java/com/parameters/spread/ModelClient.java @@ -47,7 +47,7 @@ public final class ModelClient { * } * } * - * @param bodyParameter This is a simple model. + * @param bodyParameter The bodyParameter parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -144,7 +144,7 @@ public Response spreadCompositeRequestWithResponse(String name, String tes * * @param name The name parameter. * @param testHeader The testHeader parameter. - * @param compositeRequestMix This is a model with non-body http request decorator. + * @param compositeRequestMix The compositeRequestMix parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -163,7 +163,7 @@ public Response spreadCompositeRequestMixWithResponse(String name, String /** * The spreadAsRequestBody operation. * - * @param bodyParameter This is a simple model. + * @param bodyParameter The bodyParameter parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -244,7 +244,7 @@ public void spreadCompositeRequest(String name, String testHeader, BodyParameter * * @param name The name parameter. * @param testHeader The testHeader parameter. - * @param compositeRequestMix This is a model with non-body http request decorator. + * @param compositeRequestMix The compositeRequestMix parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. diff --git a/typespec-tests/src/main/java/com/parameters/spread/implementation/AliasImpl.java b/typespec-tests/src/main/java/com/parameters/spread/implementation/AliasImpl.java index b991b74332..2c723ca0d0 100644 --- a/typespec-tests/src/main/java/com/parameters/spread/implementation/AliasImpl.java +++ b/typespec-tests/src/main/java/com/parameters/spread/implementation/AliasImpl.java @@ -63,7 +63,7 @@ public interface AliasService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> spreadAsRequestBody(@HeaderParam("accept") String accept, + Mono> spreadAsRequestBody(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData spreadAsRequestBodyRequest, RequestOptions requestOptions, Context context); @@ -73,7 +73,7 @@ Mono> spreadAsRequestBody(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response spreadAsRequestBodySync(@HeaderParam("accept") String accept, + Response spreadAsRequestBodySync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData spreadAsRequestBodyRequest, RequestOptions requestOptions, Context context); @@ -84,8 +84,9 @@ Response spreadAsRequestBodySync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> spreadAsRequestParameter(@PathParam("id") String id, - @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData spreadAsRequestParameterRequest, RequestOptions requestOptions, + Context context); @Put("/parameters/spread/alias/request-parameter/{id}") @ExpectedResponses({ 204 }) @@ -94,8 +95,9 @@ Mono> spreadAsRequestParameter(@PathParam("id") String id, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response spreadAsRequestParameterSync(@PathParam("id") String id, - @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData spreadAsRequestParameterRequest, RequestOptions requestOptions, + Context context); @Put("/parameters/spread/alias/multiple-parameters/{id}") @ExpectedResponses({ 204 }) @@ -104,8 +106,9 @@ Response spreadAsRequestParameterSync(@PathParam("id") String id, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> spreadWithMultipleParameters(@PathParam("id") String id, - @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData spreadWithMultipleParametersRequest, + RequestOptions requestOptions, Context context); @Put("/parameters/spread/alias/multiple-parameters/{id}") @ExpectedResponses({ 204 }) @@ -114,8 +117,9 @@ Mono> spreadWithMultipleParameters(@PathParam("id") String id, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response spreadWithMultipleParametersSync(@PathParam("id") String id, - @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData spreadWithMultipleParametersRequest, + RequestOptions requestOptions, Context context); } /** @@ -139,9 +143,9 @@ Response spreadWithMultipleParametersSync(@PathParam("id") String id, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> spreadAsRequestBodyWithResponseAsync(BinaryData spreadAsRequestBodyRequest, RequestOptions requestOptions) { - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil.withContext( - context -> service.spreadAsRequestBody(accept, spreadAsRequestBodyRequest, requestOptions, context)); + context -> service.spreadAsRequestBody(contentType, spreadAsRequestBodyRequest, requestOptions, context)); } /** @@ -165,8 +169,8 @@ public Mono> spreadAsRequestBodyWithResponseAsync(BinaryData spre @ServiceMethod(returns = ReturnType.SINGLE) public Response spreadAsRequestBodyWithResponse(BinaryData spreadAsRequestBodyRequest, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.spreadAsRequestBodySync(accept, spreadAsRequestBodyRequest, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.spreadAsRequestBodySync(contentType, spreadAsRequestBodyRequest, requestOptions, Context.NONE); } /** @@ -181,7 +185,7 @@ public Response spreadAsRequestBodyWithResponse(BinaryData spreadAsRequest * * @param id The id parameter. * @param xMsTestHeader The xMsTestHeader parameter. - * @param request The request parameter. + * @param spreadAsRequestParameterRequest The spreadAsRequestParameterRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -191,10 +195,10 @@ public Response spreadAsRequestBodyWithResponse(BinaryData spreadAsRequest */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> spreadAsRequestParameterWithResponseAsync(String id, String xMsTestHeader, - BinaryData request, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.spreadAsRequestParameter(id, xMsTestHeader, accept, request, requestOptions, context)); + BinaryData spreadAsRequestParameterRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.spreadAsRequestParameter(id, xMsTestHeader, contentType, + spreadAsRequestParameterRequest, requestOptions, context)); } /** @@ -209,7 +213,7 @@ public Mono> spreadAsRequestParameterWithResponseAsync(String id, * * @param id The id parameter. * @param xMsTestHeader The xMsTestHeader parameter. - * @param request The request parameter. + * @param spreadAsRequestParameterRequest The spreadAsRequestParameterRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -218,10 +222,11 @@ public Mono> spreadAsRequestParameterWithResponseAsync(String id, * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response spreadAsRequestParameterWithResponse(String id, String xMsTestHeader, BinaryData request, - RequestOptions requestOptions) { - final String accept = "application/json"; - return service.spreadAsRequestParameterSync(id, xMsTestHeader, accept, request, requestOptions, Context.NONE); + public Response spreadAsRequestParameterWithResponse(String id, String xMsTestHeader, + BinaryData spreadAsRequestParameterRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + return service.spreadAsRequestParameterSync(id, xMsTestHeader, contentType, spreadAsRequestParameterRequest, + requestOptions, Context.NONE); } /** @@ -241,7 +246,7 @@ public Response spreadAsRequestParameterWithResponse(String id, String xMs * * @param id The id parameter. * @param xMsTestHeader The xMsTestHeader parameter. - * @param request The request parameter. + * @param spreadWithMultipleParametersRequest The spreadWithMultipleParametersRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -251,10 +256,10 @@ public Response spreadAsRequestParameterWithResponse(String id, String xMs */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> spreadWithMultipleParametersWithResponseAsync(String id, String xMsTestHeader, - BinaryData request, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.spreadWithMultipleParameters(id, xMsTestHeader, accept, request, - requestOptions, context)); + BinaryData spreadWithMultipleParametersRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.spreadWithMultipleParameters(id, xMsTestHeader, contentType, + spreadWithMultipleParametersRequest, requestOptions, context)); } /** @@ -274,7 +279,7 @@ public Mono> spreadWithMultipleParametersWithResponseAsync(String * * @param id The id parameter. * @param xMsTestHeader The xMsTestHeader parameter. - * @param request The request parameter. + * @param spreadWithMultipleParametersRequest The spreadWithMultipleParametersRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -283,10 +288,10 @@ public Mono> spreadWithMultipleParametersWithResponseAsync(String * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response spreadWithMultipleParametersWithResponse(String id, String xMsTestHeader, BinaryData request, - RequestOptions requestOptions) { - final String accept = "application/json"; - return service.spreadWithMultipleParametersSync(id, xMsTestHeader, accept, request, requestOptions, - Context.NONE); + public Response spreadWithMultipleParametersWithResponse(String id, String xMsTestHeader, + BinaryData spreadWithMultipleParametersRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + return service.spreadWithMultipleParametersSync(id, xMsTestHeader, contentType, + spreadWithMultipleParametersRequest, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/spread/implementation/ModelsImpl.java b/typespec-tests/src/main/java/com/parameters/spread/implementation/ModelsImpl.java index ba34bb436d..59c7c427fd 100644 --- a/typespec-tests/src/main/java/com/parameters/spread/implementation/ModelsImpl.java +++ b/typespec-tests/src/main/java/com/parameters/spread/implementation/ModelsImpl.java @@ -63,7 +63,7 @@ public interface ModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> spreadAsRequestBody(@HeaderParam("accept") String accept, + Mono> spreadAsRequestBody(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData bodyParameter, RequestOptions requestOptions, Context context); @Put("/parameters/spread/model/request-body") @@ -72,7 +72,7 @@ Mono> spreadAsRequestBody(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response spreadAsRequestBodySync(@HeaderParam("accept") String accept, + Response spreadAsRequestBodySync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData bodyParameter, RequestOptions requestOptions, Context context); @Put("/parameters/spread/model/composite-request-only-with-body") @@ -81,7 +81,7 @@ Response spreadAsRequestBodySync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> spreadCompositeRequestOnlyWithBody(@HeaderParam("accept") String accept, + Mono> spreadCompositeRequestOnlyWithBody(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/parameters/spread/model/composite-request-only-with-body") @@ -90,7 +90,7 @@ Mono> spreadCompositeRequestOnlyWithBody(@HeaderParam("accept") S @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response spreadCompositeRequestOnlyWithBodySync(@HeaderParam("accept") String accept, + Response spreadCompositeRequestOnlyWithBodySync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/parameters/spread/model/composite-request-without-body/{name}") @@ -100,8 +100,7 @@ Response spreadCompositeRequestOnlyWithBodySync(@HeaderParam("accept") Str @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> spreadCompositeRequestWithoutBody(@PathParam("name") String name, - @HeaderParam("test-header") String testHeader, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HeaderParam("test-header") String testHeader, RequestOptions requestOptions, Context context); @Put("/parameters/spread/model/composite-request-without-body/{name}") @ExpectedResponses({ 204 }) @@ -110,8 +109,7 @@ Mono> spreadCompositeRequestWithoutBody(@PathParam("name") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response spreadCompositeRequestWithoutBodySync(@PathParam("name") String name, - @HeaderParam("test-header") String testHeader, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HeaderParam("test-header") String testHeader, RequestOptions requestOptions, Context context); @Put("/parameters/spread/model/composite-request/{name}") @ExpectedResponses({ 204 }) @@ -120,7 +118,7 @@ Response spreadCompositeRequestWithoutBodySync(@PathParam("name") String n @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> spreadCompositeRequest(@PathParam("name") String name, - @HeaderParam("test-header") String testHeader, @HeaderParam("accept") String accept, + @HeaderParam("test-header") String testHeader, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/parameters/spread/model/composite-request/{name}") @@ -130,7 +128,7 @@ Mono> spreadCompositeRequest(@PathParam("name") String name, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response spreadCompositeRequestSync(@PathParam("name") String name, - @HeaderParam("test-header") String testHeader, @HeaderParam("accept") String accept, + @HeaderParam("test-header") String testHeader, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/parameters/spread/model/composite-request-mix/{name}") @@ -140,7 +138,7 @@ Response spreadCompositeRequestSync(@PathParam("name") String name, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> spreadCompositeRequestMix(@PathParam("name") String name, - @HeaderParam("test-header") String testHeader, @HeaderParam("accept") String accept, + @HeaderParam("test-header") String testHeader, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData compositeRequestMix, RequestOptions requestOptions, Context context); @@ -151,7 +149,7 @@ Mono> spreadCompositeRequestMix(@PathParam("name") String name, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response spreadCompositeRequestMixSync(@PathParam("name") String name, - @HeaderParam("test-header") String testHeader, @HeaderParam("accept") String accept, + @HeaderParam("test-header") String testHeader, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData compositeRequestMix, RequestOptions requestOptions, Context context); } @@ -166,7 +164,7 @@ Response spreadCompositeRequestMixSync(@PathParam("name") String name, * } * } * - * @param bodyParameter This is a simple model. + * @param bodyParameter The bodyParameter parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -177,9 +175,9 @@ Response spreadCompositeRequestMixSync(@PathParam("name") String name, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> spreadAsRequestBodyWithResponseAsync(BinaryData bodyParameter, RequestOptions requestOptions) { - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil - .withContext(context -> service.spreadAsRequestBody(accept, bodyParameter, requestOptions, context)); + .withContext(context -> service.spreadAsRequestBody(contentType, bodyParameter, requestOptions, context)); } /** @@ -192,7 +190,7 @@ public Mono> spreadAsRequestBodyWithResponseAsync(BinaryData body * } * } * - * @param bodyParameter This is a simple model. + * @param bodyParameter The bodyParameter parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -202,8 +200,8 @@ public Mono> spreadAsRequestBodyWithResponseAsync(BinaryData body */ @ServiceMethod(returns = ReturnType.SINGLE) public Response spreadAsRequestBodyWithResponse(BinaryData bodyParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.spreadAsRequestBodySync(accept, bodyParameter, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.spreadAsRequestBodySync(contentType, bodyParameter, requestOptions, Context.NONE); } /** @@ -227,9 +225,9 @@ public Response spreadAsRequestBodyWithResponse(BinaryData bodyParameter, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> spreadCompositeRequestOnlyWithBodyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.spreadCompositeRequestOnlyWithBody(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext( + context -> service.spreadCompositeRequestOnlyWithBody(contentType, body, requestOptions, context)); } /** @@ -253,8 +251,8 @@ public Mono> spreadCompositeRequestOnlyWithBodyWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Response spreadCompositeRequestOnlyWithBodyWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.spreadCompositeRequestOnlyWithBodySync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.spreadCompositeRequestOnlyWithBodySync(contentType, body, requestOptions, Context.NONE); } /** @@ -272,9 +270,8 @@ public Response spreadCompositeRequestOnlyWithBodyWithResponse(BinaryData @ServiceMethod(returns = ReturnType.SINGLE) public Mono> spreadCompositeRequestWithoutBodyWithResponseAsync(String name, String testHeader, RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext( - context -> service.spreadCompositeRequestWithoutBody(name, testHeader, accept, requestOptions, context)); + context -> service.spreadCompositeRequestWithoutBody(name, testHeader, requestOptions, context)); } /** @@ -292,8 +289,7 @@ public Mono> spreadCompositeRequestWithoutBodyWithResponseAsync(S @ServiceMethod(returns = ReturnType.SINGLE) public Response spreadCompositeRequestWithoutBodyWithResponse(String name, String testHeader, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.spreadCompositeRequestWithoutBodySync(name, testHeader, accept, requestOptions, Context.NONE); + return service.spreadCompositeRequestWithoutBodySync(name, testHeader, requestOptions, Context.NONE); } /** @@ -319,9 +315,9 @@ public Response spreadCompositeRequestWithoutBodyWithResponse(String name, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> spreadCompositeRequestWithResponseAsync(String name, String testHeader, BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil.withContext( - context -> service.spreadCompositeRequest(name, testHeader, accept, body, requestOptions, context)); + context -> service.spreadCompositeRequest(name, testHeader, contentType, body, requestOptions, context)); } /** @@ -347,8 +343,8 @@ public Mono> spreadCompositeRequestWithResponseAsync(String name, @ServiceMethod(returns = ReturnType.SINGLE) public Response spreadCompositeRequestWithResponse(String name, String testHeader, BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.spreadCompositeRequestSync(name, testHeader, accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.spreadCompositeRequestSync(name, testHeader, contentType, body, requestOptions, Context.NONE); } /** @@ -363,7 +359,7 @@ public Response spreadCompositeRequestWithResponse(String name, String tes * * @param name The name parameter. * @param testHeader The testHeader parameter. - * @param compositeRequestMix This is a model with non-body http request decorator. + * @param compositeRequestMix The compositeRequestMix parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -374,8 +370,8 @@ public Response spreadCompositeRequestWithResponse(String name, String tes @ServiceMethod(returns = ReturnType.SINGLE) public Mono> spreadCompositeRequestMixWithResponseAsync(String name, String testHeader, BinaryData compositeRequestMix, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.spreadCompositeRequestMix(name, testHeader, accept, + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.spreadCompositeRequestMix(name, testHeader, contentType, compositeRequestMix, requestOptions, context)); } @@ -391,7 +387,7 @@ public Mono> spreadCompositeRequestMixWithResponseAsync(String na * * @param name The name parameter. * @param testHeader The testHeader parameter. - * @param compositeRequestMix This is a model with non-body http request decorator. + * @param compositeRequestMix The compositeRequestMix parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -402,8 +398,8 @@ public Mono> spreadCompositeRequestMixWithResponseAsync(String na @ServiceMethod(returns = ReturnType.SINGLE) public Response spreadCompositeRequestMixWithResponse(String name, String testHeader, BinaryData compositeRequestMix, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.spreadCompositeRequestMixSync(name, testHeader, accept, compositeRequestMix, requestOptions, + final String contentType = "application/json"; + return service.spreadCompositeRequestMixSync(name, testHeader, contentType, compositeRequestMix, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/payload/jsonmergepatch/implementation/JsonMergePatchClientImpl.java b/typespec-tests/src/main/java/com/payload/jsonmergepatch/implementation/JsonMergePatchClientImpl.java index fdd1cb6e35..cfe0492c3f 100644 --- a/typespec-tests/src/main/java/com/payload/jsonmergepatch/implementation/JsonMergePatchClientImpl.java +++ b/typespec-tests/src/main/java/com/payload/jsonmergepatch/implementation/JsonMergePatchClientImpl.java @@ -113,8 +113,9 @@ public interface JsonMergePatchClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createResource(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> createResource(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/json-merge-patch/create/resource") @ExpectedResponses({ 200 }) @@ -122,8 +123,9 @@ Mono> createResource(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createResourceSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response createResourceSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/json-merge-patch/update/resource") @ExpectedResponses({ 200 }) @@ -131,8 +133,8 @@ Response createResourceSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> updateResource(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + Mono> updateResource(@HeaderParam("content-type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/json-merge-patch/update/resource") @@ -141,8 +143,8 @@ Mono> updateResource(@HeaderParam("Content-Type") String co @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response updateResourceSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + Response updateResourceSync(@HeaderParam("content-type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/json-merge-patch/update/resource/optional") @@ -151,8 +153,8 @@ Response updateResourceSync(@HeaderParam("Content-Type") String cont @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> updateOptionalResource(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> updateOptionalResource(@HeaderParam("content-type") String contentType, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/json-merge-patch/update/resource/optional") @ExpectedResponses({ 200 }) @@ -160,8 +162,8 @@ Mono> updateOptionalResource(@HeaderParam("Content-Type") S @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response updateOptionalResourceSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response updateOptionalResourceSync(@HeaderParam("content-type") String contentType, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -224,8 +226,10 @@ Response updateOptionalResourceSync(@HeaderParam("Content-Type") Str */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createResourceWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createResource(accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.createResource(contentType, accept, body, requestOptions, context)); } /** @@ -288,8 +292,9 @@ public Mono> createResourceWithResponseAsync(BinaryData bod */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createResourceWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createResourceSync(accept, body, requestOptions, Context.NONE); + return service.createResourceSync(contentType, accept, body, requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/payload/mediatype/implementation/StringBodiesImpl.java b/typespec-tests/src/main/java/com/payload/mediatype/implementation/StringBodiesImpl.java index e513ab62de..205b382e4c 100644 --- a/typespec-tests/src/main/java/com/payload/mediatype/implementation/StringBodiesImpl.java +++ b/typespec-tests/src/main/java/com/payload/mediatype/implementation/StringBodiesImpl.java @@ -64,9 +64,8 @@ public interface StringBodiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> sendAsText(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("text/plain") BinaryData text, - RequestOptions requestOptions, Context context); + Mono> sendAsText(@HeaderParam("content-type") String contentType, + @BodyParam("text/plain") BinaryData text, RequestOptions requestOptions, Context context); @Post("/payload/media-type/string-body/sendAsText") @ExpectedResponses({ 200 }) @@ -74,9 +73,8 @@ Mono> sendAsText(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendAsTextSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("text/plain") BinaryData text, - RequestOptions requestOptions, Context context); + Response sendAsTextSync(@HeaderParam("content-type") String contentType, + @BodyParam("text/plain") BinaryData text, RequestOptions requestOptions, Context context); @Get("/payload/media-type/string-body/getAsText") @ExpectedResponses({ 200 }) @@ -84,7 +82,7 @@ Response sendAsTextSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAsText(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAsText(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/payload/media-type/string-body/getAsText") @@ -93,7 +91,7 @@ Mono> getAsText(@HeaderParam("accept") String accept, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAsTextSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAsTextSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/payload/media-type/string-body/sendAsJson") @@ -102,9 +100,8 @@ Response getAsTextSync(@HeaderParam("accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> sendAsJson(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData text, - RequestOptions requestOptions, Context context); + Mono> sendAsJson(@HeaderParam("content-type") String contentType, + @BodyParam("application/json") BinaryData text, RequestOptions requestOptions, Context context); @Post("/payload/media-type/string-body/sendAsJson") @ExpectedResponses({ 200 }) @@ -112,9 +109,8 @@ Mono> sendAsJson(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendAsJsonSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData text, - RequestOptions requestOptions, Context context); + Response sendAsJsonSync(@HeaderParam("content-type") String contentType, + @BodyParam("application/json") BinaryData text, RequestOptions requestOptions, Context context); @Get("/payload/media-type/string-body/getAsJson") @ExpectedResponses({ 200 }) @@ -122,7 +118,7 @@ Response sendAsJsonSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAsJson(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAsJson(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/payload/media-type/string-body/getAsJson") @@ -131,7 +127,7 @@ Mono> getAsJson(@HeaderParam("accept") String accept, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAsJsonSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAsJsonSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -154,8 +150,7 @@ Response getAsJsonSync(@HeaderParam("accept") String accept, Request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendAsTextWithResponseAsync(BinaryData text, RequestOptions requestOptions) { final String contentType = "text/plain"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.sendAsText(contentType, accept, text, requestOptions, context)); + return FluxUtil.withContext(context -> service.sendAsText(contentType, text, requestOptions, context)); } /** @@ -177,8 +172,7 @@ public Mono> sendAsTextWithResponseAsync(BinaryData text, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response sendAsTextWithResponse(BinaryData text, RequestOptions requestOptions) { final String contentType = "text/plain"; - final String accept = "application/json"; - return service.sendAsTextSync(contentType, accept, text, requestOptions, Context.NONE); + return service.sendAsTextSync(contentType, text, requestOptions, Context.NONE); } /** @@ -242,8 +236,7 @@ public Response getAsTextWithResponse(RequestOptions requestOptions) @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendAsJsonWithResponseAsync(BinaryData text, RequestOptions requestOptions) { final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.sendAsJson(contentType, accept, text, requestOptions, context)); + return FluxUtil.withContext(context -> service.sendAsJson(contentType, text, requestOptions, context)); } /** @@ -265,8 +258,7 @@ public Mono> sendAsJsonWithResponseAsync(BinaryData text, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response sendAsJsonWithResponse(BinaryData text, RequestOptions requestOptions) { final String contentType = "application/json"; - final String accept = "application/json"; - return service.sendAsJsonSync(contentType, accept, text, requestOptions, Context.NONE); + return service.sendAsJsonSync(contentType, text, requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/payload/multipart/MultiPartAsyncClient.java b/typespec-tests/src/main/java/com/payload/multipart/MultiPartAsyncClient.java index 92b5389c20..a9998c3c2c 100644 --- a/typespec-tests/src/main/java/com/payload/multipart/MultiPartAsyncClient.java +++ b/typespec-tests/src/main/java/com/payload/multipart/MultiPartAsyncClient.java @@ -184,7 +184,7 @@ Mono> checkFileNameAndContentTypeWithResponse(BinaryData body, Re /** * Test content-type: multipart/form-data. * - * @param request The request parameter. + * @param anonymousModelRequest The anonymousModelRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -194,10 +194,10 @@ Mono> checkFileNameAndContentTypeWithResponse(BinaryData body, Re */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono> anonymousModelWithResponse(BinaryData request, RequestOptions requestOptions) { + Mono> anonymousModelWithResponse(BinaryData anonymousModelRequest, RequestOptions requestOptions) { // Protocol API requires serialization of parts with content-disposition and data, as operation 'anonymousModel' // is 'multipart/form-data' - return this.serviceClient.anonymousModelWithResponseAsync(request, requestOptions); + return this.serviceClient.anonymousModelWithResponseAsync(anonymousModelRequest, requestOptions); } /** @@ -403,12 +403,14 @@ public Mono checkFileNameAndContentType(MultiPartRequest body) { public Mono anonymousModel(ProfileImageFileDetails profileImage) { // Generated convenience method for anonymousModelWithResponse RequestOptions requestOptions = new RequestOptions(); - AnonymousModelRequest requestObj = new AnonymousModelRequest(profileImage); - BinaryData request = new MultipartFormDataHelper(requestOptions) - .serializeFileField("profileImage", requestObj.getProfileImage().getContent(), - requestObj.getProfileImage().getContentType(), requestObj.getProfileImage().getFilename()) - .end() - .getRequestBody(); - return anonymousModelWithResponse(request, requestOptions).flatMap(FluxUtil::toMono); + AnonymousModelRequest anonymousModelRequestObj = new AnonymousModelRequest(profileImage); + BinaryData anonymousModelRequest + = new MultipartFormDataHelper(requestOptions) + .serializeFileField("profileImage", anonymousModelRequestObj.getProfileImage().getContent(), + anonymousModelRequestObj.getProfileImage().getContentType(), + anonymousModelRequestObj.getProfileImage().getFilename()) + .end() + .getRequestBody(); + return anonymousModelWithResponse(anonymousModelRequest, requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/typespec-tests/src/main/java/com/payload/multipart/MultiPartClient.java b/typespec-tests/src/main/java/com/payload/multipart/MultiPartClient.java index 7d5e8c1362..ee58a1c551 100644 --- a/typespec-tests/src/main/java/com/payload/multipart/MultiPartClient.java +++ b/typespec-tests/src/main/java/com/payload/multipart/MultiPartClient.java @@ -182,7 +182,7 @@ Response checkFileNameAndContentTypeWithResponse(BinaryData body, RequestO /** * Test content-type: multipart/form-data. * - * @param request The request parameter. + * @param anonymousModelRequest The anonymousModelRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -192,10 +192,10 @@ Response checkFileNameAndContentTypeWithResponse(BinaryData body, RequestO */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Response anonymousModelWithResponse(BinaryData request, RequestOptions requestOptions) { + Response anonymousModelWithResponse(BinaryData anonymousModelRequest, RequestOptions requestOptions) { // Protocol API requires serialization of parts with content-disposition and data, as operation 'anonymousModel' // is 'multipart/form-data' - return this.serviceClient.anonymousModelWithResponse(request, requestOptions); + return this.serviceClient.anonymousModelWithResponse(anonymousModelRequest, requestOptions); } /** @@ -391,12 +391,14 @@ public void checkFileNameAndContentType(MultiPartRequest body) { public void anonymousModel(ProfileImageFileDetails profileImage) { // Generated convenience method for anonymousModelWithResponse RequestOptions requestOptions = new RequestOptions(); - AnonymousModelRequest requestObj = new AnonymousModelRequest(profileImage); - BinaryData request = new MultipartFormDataHelper(requestOptions) - .serializeFileField("profileImage", requestObj.getProfileImage().getContent(), - requestObj.getProfileImage().getContentType(), requestObj.getProfileImage().getFilename()) - .end() - .getRequestBody(); - anonymousModelWithResponse(request, requestOptions).getValue(); + AnonymousModelRequest anonymousModelRequestObj = new AnonymousModelRequest(profileImage); + BinaryData anonymousModelRequest + = new MultipartFormDataHelper(requestOptions) + .serializeFileField("profileImage", anonymousModelRequestObj.getProfileImage().getContent(), + anonymousModelRequestObj.getProfileImage().getContentType(), + anonymousModelRequestObj.getProfileImage().getFilename()) + .end() + .getRequestBody(); + anonymousModelWithResponse(anonymousModelRequest, requestOptions).getValue(); } } diff --git a/typespec-tests/src/main/java/com/payload/multipart/implementation/FormDatasImpl.java b/typespec-tests/src/main/java/com/payload/multipart/implementation/FormDatasImpl.java index fb0060c5d4..d34df545a8 100644 --- a/typespec-tests/src/main/java/com/payload/multipart/implementation/FormDatasImpl.java +++ b/typespec-tests/src/main/java/com/payload/multipart/implementation/FormDatasImpl.java @@ -64,9 +64,8 @@ public interface FormDatasService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> basic(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> basic(@HeaderParam("content-type") String contentType, + @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/mixed-parts") @@ -75,7 +74,7 @@ Mono> basic(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response basicSync(@HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + Response basicSync(@HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -85,9 +84,8 @@ Response basicSync(@HeaderParam("Content-Type") String contentType, @Heade @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> complex(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> complex(@HeaderParam("content-type") String contentType, + @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/complex-parts") @@ -96,9 +94,8 @@ Mono> complex(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response complexSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, - RequestOptions requestOptions, Context context); + Response complexSync(@HeaderParam("content-type") String contentType, + @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/json-part") @@ -107,9 +104,8 @@ Response complexSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> jsonPart(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> jsonPart(@HeaderParam("content-type") String contentType, + @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/json-part") @@ -118,9 +114,8 @@ Mono> jsonPart(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response jsonPartSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, - RequestOptions requestOptions, Context context); + Response jsonPartSync(@HeaderParam("content-type") String contentType, + @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/binary-array-parts") @@ -129,9 +124,8 @@ Response jsonPartSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> binaryArrayParts(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> binaryArrayParts(@HeaderParam("content-type") String contentType, + @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/binary-array-parts") @@ -140,9 +134,8 @@ Mono> binaryArrayParts(@HeaderParam("Content-Type") String conten @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response binaryArrayPartsSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, - RequestOptions requestOptions, Context context); + Response binaryArrayPartsSync(@HeaderParam("content-type") String contentType, + @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/json-array-parts") @@ -151,9 +144,8 @@ Response binaryArrayPartsSync(@HeaderParam("Content-Type") String contentT @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> jsonArrayParts(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> jsonArrayParts(@HeaderParam("content-type") String contentType, + @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/json-array-parts") @@ -162,9 +154,8 @@ Mono> jsonArrayParts(@HeaderParam("Content-Type") String contentT @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response jsonArrayPartsSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, - RequestOptions requestOptions, Context context); + Response jsonArrayPartsSync(@HeaderParam("content-type") String contentType, + @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/multi-binary-parts") @@ -173,9 +164,8 @@ Response jsonArrayPartsSync(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> multiBinaryParts(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> multiBinaryParts(@HeaderParam("content-type") String contentType, + @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/multi-binary-parts") @@ -184,9 +174,8 @@ Mono> multiBinaryParts(@HeaderParam("Content-Type") String conten @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response multiBinaryPartsSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, - RequestOptions requestOptions, Context context); + Response multiBinaryPartsSync(@HeaderParam("content-type") String contentType, + @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/check-filename-and-content-type") @@ -195,9 +184,8 @@ Response multiBinaryPartsSync(@HeaderParam("Content-Type") String contentT @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> checkFileNameAndContentType(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> checkFileNameAndContentType(@HeaderParam("content-type") String contentType, + @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/check-filename-and-content-type") @@ -206,9 +194,8 @@ Mono> checkFileNameAndContentType(@HeaderParam("Content-Type") St @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response checkFileNameAndContentTypeSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, - RequestOptions requestOptions, Context context); + Response checkFileNameAndContentTypeSync(@HeaderParam("content-type") String contentType, + @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/anonymous-model") @@ -217,9 +204,9 @@ Response checkFileNameAndContentTypeSync(@HeaderParam("Content-Type") Stri @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> anonymousModel(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData request, - RequestOptions requestOptions, Context context); + Mono> anonymousModel(@HeaderParam("content-type") String contentType, + @BodyParam("multipart/form-data") BinaryData anonymousModelRequest, RequestOptions requestOptions, + Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/anonymous-model") @@ -228,9 +215,9 @@ Mono> anonymousModel(@HeaderParam("Content-Type") String contentT @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response anonymousModelSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData request, - RequestOptions requestOptions, Context context); + Response anonymousModelSync(@HeaderParam("content-type") String contentType, + @BodyParam("multipart/form-data") BinaryData anonymousModelRequest, RequestOptions requestOptions, + Context context); } /** @@ -247,8 +234,7 @@ Response anonymousModelSync(@HeaderParam("Content-Type") String contentTyp @ServiceMethod(returns = ReturnType.SINGLE) public Mono> basicWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.basic(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.basic(contentType, body, requestOptions, context)); } /** @@ -265,8 +251,7 @@ public Mono> basicWithResponseAsync(BinaryData body, RequestOptio @ServiceMethod(returns = ReturnType.SINGLE) public Response basicWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.basicSync(contentType, accept, body, requestOptions, Context.NONE); + return service.basicSync(contentType, body, requestOptions, Context.NONE); } /** @@ -283,8 +268,7 @@ public Response basicWithResponse(BinaryData body, RequestOptions requestO @ServiceMethod(returns = ReturnType.SINGLE) public Mono> complexWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.complex(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.complex(contentType, body, requestOptions, context)); } /** @@ -301,8 +285,7 @@ public Mono> complexWithResponseAsync(BinaryData body, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response complexWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.complexSync(contentType, accept, body, requestOptions, Context.NONE); + return service.complexSync(contentType, body, requestOptions, Context.NONE); } /** @@ -319,8 +302,7 @@ public Response complexWithResponse(BinaryData body, RequestOptions reques @ServiceMethod(returns = ReturnType.SINGLE) public Mono> jsonPartWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.jsonPart(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.jsonPart(contentType, body, requestOptions, context)); } /** @@ -337,8 +319,7 @@ public Mono> jsonPartWithResponseAsync(BinaryData body, RequestOp @ServiceMethod(returns = ReturnType.SINGLE) public Response jsonPartWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.jsonPartSync(contentType, accept, body, requestOptions, Context.NONE); + return service.jsonPartSync(contentType, body, requestOptions, Context.NONE); } /** @@ -355,9 +336,7 @@ public Response jsonPartWithResponse(BinaryData body, RequestOptions reque @ServiceMethod(returns = ReturnType.SINGLE) public Mono> binaryArrayPartsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.binaryArrayParts(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.binaryArrayParts(contentType, body, requestOptions, context)); } /** @@ -374,8 +353,7 @@ public Mono> binaryArrayPartsWithResponseAsync(BinaryData body, R @ServiceMethod(returns = ReturnType.SINGLE) public Response binaryArrayPartsWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.binaryArrayPartsSync(contentType, accept, body, requestOptions, Context.NONE); + return service.binaryArrayPartsSync(contentType, body, requestOptions, Context.NONE); } /** @@ -392,9 +370,7 @@ public Response binaryArrayPartsWithResponse(BinaryData body, RequestOptio @ServiceMethod(returns = ReturnType.SINGLE) public Mono> jsonArrayPartsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.jsonArrayParts(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.jsonArrayParts(contentType, body, requestOptions, context)); } /** @@ -411,8 +387,7 @@ public Mono> jsonArrayPartsWithResponseAsync(BinaryData body, Req @ServiceMethod(returns = ReturnType.SINGLE) public Response jsonArrayPartsWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.jsonArrayPartsSync(contentType, accept, body, requestOptions, Context.NONE); + return service.jsonArrayPartsSync(contentType, body, requestOptions, Context.NONE); } /** @@ -429,9 +404,7 @@ public Response jsonArrayPartsWithResponse(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> multiBinaryPartsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.multiBinaryParts(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.multiBinaryParts(contentType, body, requestOptions, context)); } /** @@ -448,8 +421,7 @@ public Mono> multiBinaryPartsWithResponseAsync(BinaryData body, R @ServiceMethod(returns = ReturnType.SINGLE) public Response multiBinaryPartsWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.multiBinaryPartsSync(contentType, accept, body, requestOptions, Context.NONE); + return service.multiBinaryPartsSync(contentType, body, requestOptions, Context.NONE); } /** @@ -467,9 +439,8 @@ public Response multiBinaryPartsWithResponse(BinaryData body, RequestOptio public Mono> checkFileNameAndContentTypeWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.checkFileNameAndContentType(contentType, accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.checkFileNameAndContentType(contentType, body, requestOptions, context)); } /** @@ -486,14 +457,13 @@ public Mono> checkFileNameAndContentTypeWithResponseAsync(BinaryD @ServiceMethod(returns = ReturnType.SINGLE) public Response checkFileNameAndContentTypeWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.checkFileNameAndContentTypeSync(contentType, accept, body, requestOptions, Context.NONE); + return service.checkFileNameAndContentTypeSync(contentType, body, requestOptions, Context.NONE); } /** * Test content-type: multipart/form-data. * - * @param request The request parameter. + * @param anonymousModelRequest The anonymousModelRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -502,17 +472,17 @@ public Response checkFileNameAndContentTypeWithResponse(BinaryData body, R * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> anonymousModelWithResponseAsync(BinaryData request, RequestOptions requestOptions) { + public Mono> anonymousModelWithResponseAsync(BinaryData anonymousModelRequest, + RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.anonymousModel(contentType, accept, request, requestOptions, context)); + return FluxUtil.withContext( + context -> service.anonymousModel(contentType, anonymousModelRequest, requestOptions, context)); } /** * Test content-type: multipart/form-data. * - * @param request The request parameter. + * @param anonymousModelRequest The anonymousModelRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -521,9 +491,8 @@ public Mono> anonymousModelWithResponseAsync(BinaryData request, * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response anonymousModelWithResponse(BinaryData request, RequestOptions requestOptions) { + public Response anonymousModelWithResponse(BinaryData anonymousModelRequest, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.anonymousModelSync(contentType, accept, request, requestOptions, Context.NONE); + return service.anonymousModelSync(contentType, anonymousModelRequest, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/payload/pageable/implementation/PageableClientImpl.java b/typespec-tests/src/main/java/com/payload/pageable/implementation/PageableClientImpl.java index 6e4347e371..7f63146b5f 100644 --- a/typespec-tests/src/main/java/com/payload/pageable/implementation/PageableClientImpl.java +++ b/typespec-tests/src/main/java/com/payload/pageable/implementation/PageableClientImpl.java @@ -117,7 +117,7 @@ public interface PageableClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> list(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/payload/pageable") @@ -126,7 +126,7 @@ Mono> list(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response listSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -136,7 +136,7 @@ Response listSync(@HeaderParam("accept") String accept, RequestOptio @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -145,7 +145,7 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = tru @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -319,6 +319,8 @@ public PagedIterable list(RequestOptions requestOptions) { } /** + * List users + * * Get the next page of items. *

Response Body Schema

* @@ -345,6 +347,8 @@ private Mono> listNextSinglePageAsync(String nextLink, } /** + * List users + * * Get the next page of items. *

Response Body Schema

* diff --git a/typespec-tests/src/main/java/com/resiliency/servicedriven/ResiliencyServiceDrivenClientBuilder.java b/typespec-tests/src/main/java/com/resiliency/servicedriven/ResiliencyServiceDrivenClientBuilder.java index e56acf8643..a833d3c4d1 100644 --- a/typespec-tests/src/main/java/com/resiliency/servicedriven/ResiliencyServiceDrivenClientBuilder.java +++ b/typespec-tests/src/main/java/com/resiliency/servicedriven/ResiliencyServiceDrivenClientBuilder.java @@ -213,6 +213,24 @@ public ResiliencyServiceDrivenClientBuilder serviceDeploymentVersion(String serv return this; } + /* + * Pass in either 'v1' or 'v2'. This represents the API version of a service. + */ + @Generated + private String apiVersion; + + /** + * Sets Pass in either 'v1' or 'v2'. This represents the API version of a service. + * + * @param apiVersion the apiVersion value. + * @return the ResiliencyServiceDrivenClientBuilder. + */ + @Generated + public ResiliencyServiceDrivenClientBuilder apiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + /* * Service version */ @@ -262,7 +280,7 @@ private ResiliencyServiceDrivenClientImpl buildInnerClient() { = (serviceVersion != null) ? serviceVersion : ServiceDrivenServiceVersion.getLatest(); ResiliencyServiceDrivenClientImpl client = new ResiliencyServiceDrivenClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), - this.endpoint, this.serviceDeploymentVersion, localServiceVersion); + this.endpoint, this.serviceDeploymentVersion, this.apiVersion, localServiceVersion); return client; } @@ -272,6 +290,7 @@ private void validateClient() { // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); Objects.requireNonNull(serviceDeploymentVersion, "'serviceDeploymentVersion' cannot be null."); + Objects.requireNonNull(apiVersion, "'apiVersion' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/resiliency/servicedriven/implementation/ResiliencyServiceDrivenClientImpl.java b/typespec-tests/src/main/java/com/resiliency/servicedriven/implementation/ResiliencyServiceDrivenClientImpl.java index 0ab9638406..9bf3d7c0bb 100644 --- a/typespec-tests/src/main/java/com/resiliency/servicedriven/implementation/ResiliencyServiceDrivenClientImpl.java +++ b/typespec-tests/src/main/java/com/resiliency/servicedriven/implementation/ResiliencyServiceDrivenClientImpl.java @@ -8,7 +8,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; import com.azure.core.annotation.Head; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.QueryParam; @@ -75,6 +74,20 @@ public String getServiceDeploymentVersion() { return this.serviceDeploymentVersion; } + /** + * Pass in either 'v1' or 'v2'. This represents the API version of a service. + */ + private final String apiVersion; + + /** + * Gets Pass in either 'v1' or 'v2'. This represents the API version of a service. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + /** * Service version. */ @@ -124,12 +137,14 @@ public SerializerAdapter getSerializerAdapter() { * @param serviceDeploymentVersion Pass in either 'v1' or 'v2'. This represents a version of the service deployment * in history. 'v1' is for the deployment when the service had only one api version. 'v2' is for the deployment when * the service had api-versions 'v1' and 'v2'. + * @param apiVersion Pass in either 'v1' or 'v2'. This represents the API version of a service. * @param serviceVersion Service version. */ - public ResiliencyServiceDrivenClientImpl(String endpoint, String serviceDeploymentVersion, + public ResiliencyServiceDrivenClientImpl(String endpoint, String serviceDeploymentVersion, String apiVersion, ServiceDrivenServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceDeploymentVersion, serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceDeploymentVersion, apiVersion, + serviceVersion); } /** @@ -140,12 +155,13 @@ public ResiliencyServiceDrivenClientImpl(String endpoint, String serviceDeployme * @param serviceDeploymentVersion Pass in either 'v1' or 'v2'. This represents a version of the service deployment * in history. 'v1' is for the deployment when the service had only one api version. 'v2' is for the deployment when * the service had api-versions 'v1' and 'v2'. + * @param apiVersion Pass in either 'v1' or 'v2'. This represents the API version of a service. * @param serviceVersion Service version. */ public ResiliencyServiceDrivenClientImpl(HttpPipeline httpPipeline, String endpoint, - String serviceDeploymentVersion, ServiceDrivenServiceVersion serviceVersion) { + String serviceDeploymentVersion, String apiVersion, ServiceDrivenServiceVersion serviceVersion) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceDeploymentVersion, - serviceVersion); + apiVersion, serviceVersion); } /** @@ -157,14 +173,17 @@ public ResiliencyServiceDrivenClientImpl(HttpPipeline httpPipeline, String endpo * @param serviceDeploymentVersion Pass in either 'v1' or 'v2'. This represents a version of the service deployment * in history. 'v1' is for the deployment when the service had only one api version. 'v2' is for the deployment when * the service had api-versions 'v1' and 'v2'. + * @param apiVersion Pass in either 'v1' or 'v2'. This represents the API version of a service. * @param serviceVersion Service version. */ public ResiliencyServiceDrivenClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint, String serviceDeploymentVersion, ServiceDrivenServiceVersion serviceVersion) { + String endpoint, String serviceDeploymentVersion, String apiVersion, + ServiceDrivenServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; this.serviceDeploymentVersion = serviceDeploymentVersion; + this.apiVersion = apiVersion; this.serviceVersion = serviceVersion; this.service = RestProxy.create(ResiliencyServiceDrivenClientService.class, this.httpPipeline, this.getSerializerAdapter()); @@ -185,8 +204,7 @@ public interface ResiliencyServiceDrivenClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> addOperation(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Delete("/add-operation") @ExpectedResponses({ 204 }) @@ -196,8 +214,7 @@ Mono> addOperation(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response addOperationSync(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Head("/add-optional-param/from-none") @ExpectedResponses({ 204 }) @@ -207,8 +224,7 @@ Response addOperationSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> fromNone(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Head("/add-optional-param/from-none") @ExpectedResponses({ 204 }) @@ -218,8 +234,7 @@ Mono> fromNone(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response fromNoneSync(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Get("/add-optional-param/from-one-required") @ExpectedResponses({ 204 }) @@ -230,7 +245,7 @@ Response fromNoneSync(@HostParam("endpoint") String endpoint, Mono> fromOneRequired(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, @HostParam("apiVersion") String apiVersion, @QueryParam("parameter") String parameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Get("/add-optional-param/from-one-required") @ExpectedResponses({ 204 }) @@ -241,7 +256,7 @@ Mono> fromOneRequired(@HostParam("endpoint") String endpoint, Response fromOneRequiredSync(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, @HostParam("apiVersion") String apiVersion, @QueryParam("parameter") String parameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Get("/add-optional-param/from-one-optional") @ExpectedResponses({ 204 }) @@ -251,8 +266,7 @@ Response fromOneRequiredSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> fromOneOptional(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Get("/add-optional-param/from-one-optional") @ExpectedResponses({ 204 }) @@ -262,8 +276,7 @@ Mono> fromOneOptional(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response fromOneOptionalSync(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); } /** @@ -278,10 +291,8 @@ Response fromOneOptionalSync(@HostParam("endpoint") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> addOperationWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.addOperation(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.addOperation(this.getEndpoint(), + this.getServiceDeploymentVersion(), this.getApiVersion(), requestOptions, context)); } /** @@ -296,9 +307,8 @@ public Mono> addOperationWithResponseAsync(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response addOperationWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.addOperationSync(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.addOperationSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), + requestOptions, Context.NONE); } /** @@ -320,9 +330,8 @@ public Response addOperationWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromNoneWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext(context -> service.fromNone(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), accept, requestOptions, context)); + this.getApiVersion(), requestOptions, context)); } /** @@ -344,9 +353,8 @@ public Mono> fromNoneWithResponseAsync(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromNoneWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.fromNoneSync(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.fromNoneSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), + requestOptions, Context.NONE); } /** @@ -370,10 +378,8 @@ public Response fromNoneWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromOneRequiredWithResponseAsync(String parameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.fromOneRequired(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), parameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.fromOneRequired(this.getEndpoint(), + this.getServiceDeploymentVersion(), this.getApiVersion(), parameter, requestOptions, context)); } /** @@ -397,9 +403,8 @@ public Mono> fromOneRequiredWithResponseAsync(String parameter, R */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromOneRequiredWithResponse(String parameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.fromOneRequiredSync(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), parameter, accept, requestOptions, Context.NONE); + return service.fromOneRequiredSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), + parameter, requestOptions, Context.NONE); } /** @@ -423,10 +428,8 @@ public Response fromOneRequiredWithResponse(String parameter, RequestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromOneOptionalWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.fromOneOptional(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.fromOneOptional(this.getEndpoint(), + this.getServiceDeploymentVersion(), this.getApiVersion(), requestOptions, context)); } /** @@ -450,8 +453,7 @@ public Mono> fromOneOptionalWithResponseAsync(RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromOneOptionalWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.fromOneOptionalSync(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.fromOneOptionalSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), + requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/ResiliencyServiceDrivenClientBuilder.java b/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/ResiliencyServiceDrivenClientBuilder.java index 4b851ce32d..1e2ca9c103 100644 --- a/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/ResiliencyServiceDrivenClientBuilder.java +++ b/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/ResiliencyServiceDrivenClientBuilder.java @@ -213,6 +213,26 @@ public ResiliencyServiceDrivenClientBuilder serviceDeploymentVersion(String serv return this; } + /* + * Pass in 'v1'. This represents the API version of the service. Will grow up in the next deployment to be both 'v1' + * and 'v2' + */ + @Generated + private String apiVersion; + + /** + * Sets Pass in 'v1'. This represents the API version of the service. Will grow up in the next deployment to be both + * 'v1' and 'v2'. + * + * @param apiVersion the apiVersion value. + * @return the ResiliencyServiceDrivenClientBuilder. + */ + @Generated + public ResiliencyServiceDrivenClientBuilder apiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + /* * Service version */ @@ -262,7 +282,7 @@ private ResiliencyServiceDrivenClientImpl buildInnerClient() { = (serviceVersion != null) ? serviceVersion : ServiceDrivenServiceVersion.getLatest(); ResiliencyServiceDrivenClientImpl client = new ResiliencyServiceDrivenClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), - this.endpoint, this.serviceDeploymentVersion, localServiceVersion); + this.endpoint, this.serviceDeploymentVersion, this.apiVersion, localServiceVersion); return client; } @@ -272,6 +292,7 @@ private void validateClient() { // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); Objects.requireNonNull(serviceDeploymentVersion, "'serviceDeploymentVersion' cannot be null."); + Objects.requireNonNull(apiVersion, "'apiVersion' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/implementation/ResiliencyServiceDrivenClientImpl.java b/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/implementation/ResiliencyServiceDrivenClientImpl.java index e52308a2ad..dde4ef8910 100644 --- a/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/implementation/ResiliencyServiceDrivenClientImpl.java +++ b/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/implementation/ResiliencyServiceDrivenClientImpl.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; import com.azure.core.annotation.Head; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.QueryParam; @@ -74,6 +73,22 @@ public String getServiceDeploymentVersion() { return this.serviceDeploymentVersion; } + /** + * Pass in 'v1'. This represents the API version of the service. Will grow up in the next deployment to be both 'v1' + * and 'v2'. + */ + private final String apiVersion; + + /** + * Gets Pass in 'v1'. This represents the API version of the service. Will grow up in the next deployment to be both + * 'v1' and 'v2'. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + /** * Service version. */ @@ -123,12 +138,15 @@ public SerializerAdapter getSerializerAdapter() { * @param serviceDeploymentVersion Pass in either 'v1' or 'v2'. This represents a version of the service deployment * in history. 'v1' is for the deployment when the service had only one api version. 'v2' is for the deployment when * the service had api-versions 'v1' and 'v2'. + * @param apiVersion Pass in 'v1'. This represents the API version of the service. Will grow up in the next + * deployment to be both 'v1' and 'v2'. * @param serviceVersion Service version. */ - public ResiliencyServiceDrivenClientImpl(String endpoint, String serviceDeploymentVersion, + public ResiliencyServiceDrivenClientImpl(String endpoint, String serviceDeploymentVersion, String apiVersion, ServiceDrivenServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceDeploymentVersion, serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceDeploymentVersion, apiVersion, + serviceVersion); } /** @@ -139,12 +157,14 @@ public ResiliencyServiceDrivenClientImpl(String endpoint, String serviceDeployme * @param serviceDeploymentVersion Pass in either 'v1' or 'v2'. This represents a version of the service deployment * in history. 'v1' is for the deployment when the service had only one api version. 'v2' is for the deployment when * the service had api-versions 'v1' and 'v2'. + * @param apiVersion Pass in 'v1'. This represents the API version of the service. Will grow up in the next + * deployment to be both 'v1' and 'v2'. * @param serviceVersion Service version. */ public ResiliencyServiceDrivenClientImpl(HttpPipeline httpPipeline, String endpoint, - String serviceDeploymentVersion, ServiceDrivenServiceVersion serviceVersion) { + String serviceDeploymentVersion, String apiVersion, ServiceDrivenServiceVersion serviceVersion) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceDeploymentVersion, - serviceVersion); + apiVersion, serviceVersion); } /** @@ -156,14 +176,18 @@ public ResiliencyServiceDrivenClientImpl(HttpPipeline httpPipeline, String endpo * @param serviceDeploymentVersion Pass in either 'v1' or 'v2'. This represents a version of the service deployment * in history. 'v1' is for the deployment when the service had only one api version. 'v2' is for the deployment when * the service had api-versions 'v1' and 'v2'. + * @param apiVersion Pass in 'v1'. This represents the API version of the service. Will grow up in the next + * deployment to be both 'v1' and 'v2'. * @param serviceVersion Service version. */ public ResiliencyServiceDrivenClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint, String serviceDeploymentVersion, ServiceDrivenServiceVersion serviceVersion) { + String endpoint, String serviceDeploymentVersion, String apiVersion, + ServiceDrivenServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; this.serviceDeploymentVersion = serviceDeploymentVersion; + this.apiVersion = apiVersion; this.serviceVersion = serviceVersion; this.service = RestProxy.create(ResiliencyServiceDrivenClientService.class, this.httpPipeline, this.getSerializerAdapter()); @@ -184,8 +208,7 @@ public interface ResiliencyServiceDrivenClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> fromNone(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Head("/add-optional-param/from-none") @ExpectedResponses({ 204 }) @@ -195,8 +218,7 @@ Mono> fromNone(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response fromNoneSync(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Get("/add-optional-param/from-one-required") @ExpectedResponses({ 204 }) @@ -207,7 +229,7 @@ Response fromNoneSync(@HostParam("endpoint") String endpoint, Mono> fromOneRequired(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, @HostParam("apiVersion") String apiVersion, @QueryParam("parameter") String parameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Get("/add-optional-param/from-one-required") @ExpectedResponses({ 204 }) @@ -218,7 +240,7 @@ Mono> fromOneRequired(@HostParam("endpoint") String endpoint, Response fromOneRequiredSync(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, @HostParam("apiVersion") String apiVersion, @QueryParam("parameter") String parameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Get("/add-optional-param/from-one-optional") @ExpectedResponses({ 204 }) @@ -228,8 +250,7 @@ Response fromOneRequiredSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> fromOneOptional(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Get("/add-optional-param/from-one-optional") @ExpectedResponses({ 204 }) @@ -239,8 +260,7 @@ Mono> fromOneOptional(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response fromOneOptionalSync(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); } /** @@ -256,9 +276,8 @@ Response fromOneOptionalSync(@HostParam("endpoint") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromNoneWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext(context -> service.fromNone(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), accept, requestOptions, context)); + this.getApiVersion(), requestOptions, context)); } /** @@ -274,9 +293,8 @@ public Mono> fromNoneWithResponseAsync(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromNoneWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.fromNoneSync(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.fromNoneSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), + requestOptions, Context.NONE); } /** @@ -293,10 +311,8 @@ public Response fromNoneWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromOneRequiredWithResponseAsync(String parameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.fromOneRequired(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), parameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.fromOneRequired(this.getEndpoint(), + this.getServiceDeploymentVersion(), this.getApiVersion(), parameter, requestOptions, context)); } /** @@ -313,9 +329,8 @@ public Mono> fromOneRequiredWithResponseAsync(String parameter, R */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromOneRequiredWithResponse(String parameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.fromOneRequiredSync(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), parameter, accept, requestOptions, Context.NONE); + return service.fromOneRequiredSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), + parameter, requestOptions, Context.NONE); } /** @@ -338,10 +353,8 @@ public Response fromOneRequiredWithResponse(String parameter, RequestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromOneOptionalWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.fromOneOptional(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.fromOneOptional(this.getEndpoint(), + this.getServiceDeploymentVersion(), this.getApiVersion(), requestOptions, context)); } /** @@ -364,8 +377,7 @@ public Mono> fromOneOptionalWithResponseAsync(RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromOneOptionalWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.fromOneOptionalSync(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.fromOneOptionalSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), + requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/serialization/encodedname/json/implementation/PropertiesImpl.java b/typespec-tests/src/main/java/com/serialization/encodedname/json/implementation/PropertiesImpl.java index 4813f6bc7b..b8c236060f 100644 --- a/typespec-tests/src/main/java/com/serialization/encodedname/json/implementation/PropertiesImpl.java +++ b/typespec-tests/src/main/java/com/serialization/encodedname/json/implementation/PropertiesImpl.java @@ -64,7 +64,7 @@ public interface PropertiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("accept") String accept, + Mono> send(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData jsonEncodedNameModel, RequestOptions requestOptions, Context context); @@ -74,7 +74,7 @@ Mono> send(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("accept") String accept, + Response sendSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData jsonEncodedNameModel, RequestOptions requestOptions, Context context); @@ -84,7 +84,7 @@ Response sendSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/serialization/encoded-name/json/property") @@ -93,7 +93,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -117,8 +117,9 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData jsonEncodedNameModel, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.send(accept, jsonEncodedNameModel, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil + .withContext(context -> service.send(contentType, jsonEncodedNameModel, requestOptions, context)); } /** @@ -141,8 +142,8 @@ public Mono> sendWithResponseAsync(BinaryData jsonEncodedNameMode */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData jsonEncodedNameModel, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendSync(accept, jsonEncodedNameModel, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sendSync(contentType, jsonEncodedNameModel, requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/server/endpoint/notdefined/implementation/NotDefinedClientImpl.java b/typespec-tests/src/main/java/com/server/endpoint/notdefined/implementation/NotDefinedClientImpl.java index 8d282a971e..7cce6d2572 100644 --- a/typespec-tests/src/main/java/com/server/endpoint/notdefined/implementation/NotDefinedClientImpl.java +++ b/typespec-tests/src/main/java/com/server/endpoint/notdefined/implementation/NotDefinedClientImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Head; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.ReturnType; @@ -40,12 +39,12 @@ public final class NotDefinedClientImpl { private final NotDefinedClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -84,7 +83,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of NotDefinedClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public NotDefinedClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -95,7 +94,7 @@ public NotDefinedClientImpl(String endpoint) { * Initializes an instance of NotDefinedClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public NotDefinedClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -106,7 +105,7 @@ public NotDefinedClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public NotDefinedClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; @@ -128,8 +127,8 @@ public interface NotDefinedClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> valid(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> valid(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Head("/server/endpoint/not-defined/valid") @ExpectedResponses({ 200 }) @@ -137,8 +136,8 @@ Mono> valid(@HostParam("endpoint") String endpoint, @HeaderParam( @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response validSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response validSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); } /** @@ -153,8 +152,7 @@ Response validSync(@HostParam("endpoint") String endpoint, @HeaderParam("a */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> validWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.valid(this.getEndpoint(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.valid(this.getEndpoint(), requestOptions, context)); } /** @@ -169,7 +167,6 @@ public Mono> validWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.validSync(this.getEndpoint(), accept, requestOptions, Context.NONE); + return service.validSync(this.getEndpoint(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/server/path/multiple/MultipleClientBuilder.java b/typespec-tests/src/main/java/com/server/path/multiple/MultipleClientBuilder.java index 1ebc0bd08f..4ebb6b9d97 100644 --- a/typespec-tests/src/main/java/com/server/path/multiple/MultipleClientBuilder.java +++ b/typespec-tests/src/main/java/com/server/path/multiple/MultipleClientBuilder.java @@ -189,6 +189,24 @@ public MultipleClientBuilder endpoint(String endpoint) { return this; } + /* + * Pass in v1.0 for API version. + */ + @Generated + private String apiVersion; + + /** + * Sets Pass in v1.0 for API version. + * + * @param apiVersion the apiVersion value. + * @return the MultipleClientBuilder. + */ + @Generated + public MultipleClientBuilder apiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + /* * Service version */ @@ -237,7 +255,7 @@ private MultipleClientImpl buildInnerClient() { MultipleServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : MultipleServiceVersion.getLatest(); MultipleClientImpl client = new MultipleClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, this.apiVersion, localServiceVersion); return client; } @@ -246,6 +264,7 @@ private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + Objects.requireNonNull(apiVersion, "'apiVersion' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/server/path/multiple/implementation/MultipleClientImpl.java b/typespec-tests/src/main/java/com/server/path/multiple/implementation/MultipleClientImpl.java index 93144cb321..ba725b365e 100644 --- a/typespec-tests/src/main/java/com/server/path/multiple/implementation/MultipleClientImpl.java +++ b/typespec-tests/src/main/java/com/server/path/multiple/implementation/MultipleClientImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; @@ -55,6 +54,20 @@ public String getEndpoint() { return this.endpoint; } + /** + * Pass in v1.0 for API version. + */ + private final String apiVersion; + + /** + * Gets Pass in v1.0 for API version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + /** * Service version. */ @@ -101,11 +114,12 @@ public SerializerAdapter getSerializerAdapter() { * Initializes an instance of MultipleClient client. * * @param endpoint Pass in http://localhost:3000 for endpoint. + * @param apiVersion Pass in v1.0 for API version. * @param serviceVersion Service version. */ - public MultipleClientImpl(String endpoint, MultipleServiceVersion serviceVersion) { + public MultipleClientImpl(String endpoint, String apiVersion, MultipleServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion, serviceVersion); } /** @@ -113,10 +127,12 @@ public MultipleClientImpl(String endpoint, MultipleServiceVersion serviceVersion * * @param httpPipeline The HTTP pipeline to send requests through. * @param endpoint Pass in http://localhost:3000 for endpoint. + * @param apiVersion Pass in v1.0 for API version. * @param serviceVersion Service version. */ - public MultipleClientImpl(HttpPipeline httpPipeline, String endpoint, MultipleServiceVersion serviceVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + public MultipleClientImpl(HttpPipeline httpPipeline, String endpoint, String apiVersion, + MultipleServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion, serviceVersion); } /** @@ -125,13 +141,15 @@ public MultipleClientImpl(HttpPipeline httpPipeline, String endpoint, MultipleSe * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param endpoint Pass in http://localhost:3000 for endpoint. + * @param apiVersion Pass in v1.0 for API version. * @param serviceVersion Service version. */ public MultipleClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - MultipleServiceVersion serviceVersion) { + String apiVersion, MultipleServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; + this.apiVersion = apiVersion; this.serviceVersion = serviceVersion; this.service = RestProxy.create(MultipleClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -149,8 +167,7 @@ public interface MultipleClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> noOperationParams(@HostParam("endpoint") String endpoint, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Get("/") @ExpectedResponses({ 204 }) @@ -159,8 +176,7 @@ Mono> noOperationParams(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response noOperationParamsSync(@HostParam("endpoint") String endpoint, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Get("/{keyword}") @ExpectedResponses({ 204 }) @@ -170,7 +186,7 @@ Response noOperationParamsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withOperationPathParam(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("keyword") String keyword, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Get("/{keyword}") @ExpectedResponses({ 204 }) @@ -180,7 +196,7 @@ Mono> withOperationPathParam(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(HttpResponseException.class) Response withOperationPathParamSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("keyword") String keyword, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -195,9 +211,8 @@ Response withOperationPathParamSync(@HostParam("endpoint") String endpoint */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> noOperationParamsWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.noOperationParams(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.noOperationParams(this.getEndpoint(), this.getApiVersion(), requestOptions, context)); } /** @@ -212,9 +227,7 @@ public Mono> noOperationParamsWithResponseAsync(RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response noOperationParamsWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.noOperationParamsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, - requestOptions, Context.NONE); + return service.noOperationParamsSync(this.getEndpoint(), this.getApiVersion(), requestOptions, Context.NONE); } /** @@ -230,9 +243,8 @@ public Response noOperationParamsWithResponse(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withOperationPathParamWithResponseAsync(String keyword, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withOperationPathParam(this.getEndpoint(), - this.getServiceVersion().getVersion(), keyword, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withOperationPathParam(this.getEndpoint(), this.getApiVersion(), + keyword, requestOptions, context)); } /** @@ -248,8 +260,7 @@ public Mono> withOperationPathParamWithResponseAsync(String keywo */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withOperationPathParamWithResponse(String keyword, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withOperationPathParamSync(this.getEndpoint(), this.getServiceVersion().getVersion(), keyword, - accept, requestOptions, Context.NONE); + return service.withOperationPathParamSync(this.getEndpoint(), this.getApiVersion(), keyword, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/server/path/single/implementation/SingleClientImpl.java b/typespec-tests/src/main/java/com/server/path/single/implementation/SingleClientImpl.java index bfd0a77abe..59c6962adc 100644 --- a/typespec-tests/src/main/java/com/server/path/single/implementation/SingleClientImpl.java +++ b/typespec-tests/src/main/java/com/server/path/single/implementation/SingleClientImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Head; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.ReturnType; @@ -127,8 +126,8 @@ public interface SingleClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> myOp(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> myOp(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Head("/server/path/single/myOp") @ExpectedResponses({ 200 }) @@ -136,8 +135,7 @@ Mono> myOp(@HostParam("endpoint") String endpoint, @HeaderParam(" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response myOpSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response myOpSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); } /** @@ -152,8 +150,7 @@ Response myOpSync(@HostParam("endpoint") String endpoint, @HeaderParam("ac */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> myOpWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.myOp(this.getEndpoint(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.myOp(this.getEndpoint(), requestOptions, context)); } /** @@ -168,7 +165,6 @@ public Mono> myOpWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response myOpWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.myOpSync(this.getEndpoint(), accept, requestOptions, Context.NONE); + return service.myOpSync(this.getEndpoint(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/server/versions/notversioned/implementation/NotVersionedClientImpl.java b/typespec-tests/src/main/java/com/server/versions/notversioned/implementation/NotVersionedClientImpl.java index 25d41d2449..eff9b16d95 100644 --- a/typespec-tests/src/main/java/com/server/versions/notversioned/implementation/NotVersionedClientImpl.java +++ b/typespec-tests/src/main/java/com/server/versions/notversioned/implementation/NotVersionedClientImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Head; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; @@ -131,8 +130,8 @@ public interface NotVersionedClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withoutApiVersion(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> withoutApiVersion(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Head("/server/versions/not-versioned/without-api-version") @ExpectedResponses({ 200 }) @@ -140,8 +139,8 @@ Mono> withoutApiVersion(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withoutApiVersionSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response withoutApiVersionSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Head("/server/versions/not-versioned/with-query-api-version") @ExpectedResponses({ 200 }) @@ -150,8 +149,7 @@ Response withoutApiVersionSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withQueryApiVersion(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); @Head("/server/versions/not-versioned/with-query-api-version") @ExpectedResponses({ 200 }) @@ -160,8 +158,7 @@ Mono> withQueryApiVersion(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response withQueryApiVersionSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); @Head("/server/versions/not-versioned/with-path-api-version/{apiVersion}") @ExpectedResponses({ 200 }) @@ -170,8 +167,7 @@ Response withQueryApiVersionSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withPathApiVersion(@HostParam("endpoint") String endpoint, - @PathParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @PathParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Head("/server/versions/not-versioned/with-path-api-version/{apiVersion}") @ExpectedResponses({ 200 }) @@ -180,8 +176,7 @@ Mono> withPathApiVersion(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response withPathApiVersionSync(@HostParam("endpoint") String endpoint, - @PathParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @PathParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); } /** @@ -196,9 +191,7 @@ Response withPathApiVersionSync(@HostParam("endpoint") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withoutApiVersionWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.withoutApiVersion(this.getEndpoint(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withoutApiVersion(this.getEndpoint(), requestOptions, context)); } /** @@ -213,8 +206,7 @@ public Mono> withoutApiVersionWithResponseAsync(RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withoutApiVersionWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withoutApiVersionSync(this.getEndpoint(), accept, requestOptions, Context.NONE); + return service.withoutApiVersionSync(this.getEndpoint(), requestOptions, Context.NONE); } /** @@ -230,9 +222,8 @@ public Response withoutApiVersionWithResponse(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withQueryApiVersionWithResponseAsync(String apiVersion, RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext( - context -> service.withQueryApiVersion(this.getEndpoint(), apiVersion, accept, requestOptions, context)); + context -> service.withQueryApiVersion(this.getEndpoint(), apiVersion, requestOptions, context)); } /** @@ -248,8 +239,7 @@ public Mono> withQueryApiVersionWithResponseAsync(String apiVersi */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withQueryApiVersionWithResponse(String apiVersion, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withQueryApiVersionSync(this.getEndpoint(), apiVersion, accept, requestOptions, Context.NONE); + return service.withQueryApiVersionSync(this.getEndpoint(), apiVersion, requestOptions, Context.NONE); } /** @@ -265,9 +255,8 @@ public Response withQueryApiVersionWithResponse(String apiVersion, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withPathApiVersionWithResponseAsync(String apiVersion, RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext( - context -> service.withPathApiVersion(this.getEndpoint(), apiVersion, accept, requestOptions, context)); + context -> service.withPathApiVersion(this.getEndpoint(), apiVersion, requestOptions, context)); } /** @@ -283,7 +272,6 @@ public Mono> withPathApiVersionWithResponseAsync(String apiVersio */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withPathApiVersionWithResponse(String apiVersion, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withPathApiVersionSync(this.getEndpoint(), apiVersion, accept, requestOptions, Context.NONE); + return service.withPathApiVersionSync(this.getEndpoint(), apiVersion, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/server/versions/versioned/implementation/VersionedClientImpl.java b/typespec-tests/src/main/java/com/server/versions/versioned/implementation/VersionedClientImpl.java index fae0a0f208..70b6ff082e 100644 --- a/typespec-tests/src/main/java/com/server/versions/versioned/implementation/VersionedClientImpl.java +++ b/typespec-tests/src/main/java/com/server/versions/versioned/implementation/VersionedClientImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Head; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; @@ -150,8 +149,8 @@ public interface VersionedClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withoutApiVersion(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> withoutApiVersion(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Head("/server/versions/versioned/without-api-version") @ExpectedResponses({ 200 }) @@ -159,8 +158,8 @@ Mono> withoutApiVersion(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withoutApiVersionSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response withoutApiVersionSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Head("/server/versions/versioned/with-query-api-version") @ExpectedResponses({ 200 }) @@ -169,8 +168,7 @@ Response withoutApiVersionSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withQueryApiVersion(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); @Head("/server/versions/versioned/with-query-api-version") @ExpectedResponses({ 200 }) @@ -179,8 +177,7 @@ Mono> withQueryApiVersion(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response withQueryApiVersionSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); @Head("/server/versions/versioned/with-path-api-version/{apiVersion}") @ExpectedResponses({ 200 }) @@ -189,8 +186,7 @@ Response withQueryApiVersionSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withPathApiVersion(@HostParam("endpoint") String endpoint, - @PathParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @PathParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Head("/server/versions/versioned/with-path-api-version/{apiVersion}") @ExpectedResponses({ 200 }) @@ -199,8 +195,7 @@ Mono> withPathApiVersion(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response withPathApiVersionSync(@HostParam("endpoint") String endpoint, - @PathParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @PathParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Head("/server/versions/versioned/with-query-old-api-version") @ExpectedResponses({ 200 }) @@ -209,8 +204,7 @@ Response withPathApiVersionSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withQueryOldApiVersion(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); @Head("/server/versions/versioned/with-query-old-api-version") @ExpectedResponses({ 200 }) @@ -219,8 +213,7 @@ Mono> withQueryOldApiVersion(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response withQueryOldApiVersionSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); } /** @@ -235,9 +228,7 @@ Response withQueryOldApiVersionSync(@HostParam("endpoint") String endpoint */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withoutApiVersionWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.withoutApiVersion(this.getEndpoint(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withoutApiVersion(this.getEndpoint(), requestOptions, context)); } /** @@ -252,8 +243,7 @@ public Mono> withoutApiVersionWithResponseAsync(RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withoutApiVersionWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withoutApiVersionSync(this.getEndpoint(), accept, requestOptions, Context.NONE); + return service.withoutApiVersionSync(this.getEndpoint(), requestOptions, Context.NONE); } /** @@ -268,9 +258,8 @@ public Response withoutApiVersionWithResponse(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withQueryApiVersionWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext(context -> service.withQueryApiVersion(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, requestOptions, context)); + this.getServiceVersion().getVersion(), requestOptions, context)); } /** @@ -285,8 +274,7 @@ public Mono> withQueryApiVersionWithResponseAsync(RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withQueryApiVersionWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withQueryApiVersionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + return service.withQueryApiVersionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), requestOptions, Context.NONE); } @@ -302,9 +290,8 @@ public Response withQueryApiVersionWithResponse(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withPathApiVersionWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext(context -> service.withPathApiVersion(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, requestOptions, context)); + this.getServiceVersion().getVersion(), requestOptions, context)); } /** @@ -319,9 +306,8 @@ public Mono> withPathApiVersionWithResponseAsync(RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withPathApiVersionWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withPathApiVersionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, - requestOptions, Context.NONE); + return service.withPathApiVersionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), requestOptions, + Context.NONE); } /** @@ -336,9 +322,8 @@ public Response withPathApiVersionWithResponse(RequestOptions requestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withQueryOldApiVersionWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext(context -> service.withQueryOldApiVersion(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, requestOptions, context)); + this.getServiceVersion().getVersion(), requestOptions, context)); } /** @@ -353,8 +338,7 @@ public Mono> withQueryOldApiVersionWithResponseAsync(RequestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withQueryOldApiVersionWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withQueryOldApiVersionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + return service.withQueryOldApiVersionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/specialheaders/conditionalrequest/implementation/ConditionalRequestClientImpl.java b/typespec-tests/src/main/java/com/specialheaders/conditionalrequest/implementation/ConditionalRequestClientImpl.java index b5b4d489a0..df7fa365a0 100644 --- a/typespec-tests/src/main/java/com/specialheaders/conditionalrequest/implementation/ConditionalRequestClientImpl.java +++ b/typespec-tests/src/main/java/com/specialheaders/conditionalrequest/implementation/ConditionalRequestClientImpl.java @@ -5,7 +5,6 @@ package com.specialheaders.conditionalrequest.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; @@ -109,8 +108,7 @@ public interface ConditionalRequestClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> postIfMatch(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> postIfMatch(RequestOptions requestOptions, Context context); @Post("/special-headers/conditional-request/if-match") @ExpectedResponses({ 204 }) @@ -118,8 +116,7 @@ Mono> postIfMatch(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postIfMatchSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response postIfMatchSync(RequestOptions requestOptions, Context context); @Post("/special-headers/conditional-request/if-none-match") @ExpectedResponses({ 204 }) @@ -127,8 +124,7 @@ Response postIfMatchSync(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> postIfNoneMatch(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> postIfNoneMatch(RequestOptions requestOptions, Context context); @Post("/special-headers/conditional-request/if-none-match") @ExpectedResponses({ 204 }) @@ -136,8 +132,7 @@ Mono> postIfNoneMatch(@HeaderParam("accept") String accept, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postIfNoneMatchSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response postIfNoneMatchSync(RequestOptions requestOptions, Context context); } /** @@ -160,8 +155,7 @@ Response postIfNoneMatchSync(@HeaderParam("accept") String accept, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postIfMatchWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.postIfMatch(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.postIfMatch(requestOptions, context)); } /** @@ -184,8 +178,7 @@ public Mono> postIfMatchWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postIfMatchWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.postIfMatchSync(accept, requestOptions, Context.NONE); + return service.postIfMatchSync(requestOptions, Context.NONE); } /** @@ -208,8 +201,7 @@ public Response postIfMatchWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postIfNoneMatchWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.postIfNoneMatch(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.postIfNoneMatch(requestOptions, context)); } /** @@ -232,7 +224,6 @@ public Mono> postIfNoneMatchWithResponseAsync(RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postIfNoneMatchWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.postIfNoneMatchSync(accept, requestOptions, Context.NONE); + return service.postIfNoneMatchSync(requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/specialheaders/repeatability/implementation/RepeatabilityClientImpl.java b/typespec-tests/src/main/java/com/specialheaders/repeatability/implementation/RepeatabilityClientImpl.java index f358743524..d507692c4c 100644 --- a/typespec-tests/src/main/java/com/specialheaders/repeatability/implementation/RepeatabilityClientImpl.java +++ b/typespec-tests/src/main/java/com/specialheaders/repeatability/implementation/RepeatabilityClientImpl.java @@ -5,7 +5,6 @@ package com.specialheaders.repeatability.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; @@ -113,8 +112,7 @@ public interface RepeatabilityClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> immediateSuccess(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> immediateSuccess(RequestOptions requestOptions, Context context); @Post("/special-headers/repeatability/immediateSuccess") @ExpectedResponses({ 204 }) @@ -122,8 +120,7 @@ Mono> immediateSuccess(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response immediateSuccessSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response immediateSuccessSync(RequestOptions requestOptions, Context context); } /** @@ -147,7 +144,6 @@ Response immediateSuccessSync(@HeaderParam("accept") String accept, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> immediateSuccessWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; String repeatabilityRequestId = UUID.randomUUID().toString(); String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); @@ -163,7 +159,7 @@ public Mono> immediateSuccessWithResponseAsync(RequestOptions req .set(HttpHeaderName.fromString("repeatability-first-sent"), repeatabilityFirstSent); } }); - return FluxUtil.withContext(context -> service.immediateSuccess(accept, requestOptionsLocal, context)); + return FluxUtil.withContext(context -> service.immediateSuccess(requestOptionsLocal, context)); } /** @@ -187,7 +183,6 @@ public Mono> immediateSuccessWithResponseAsync(RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Response immediateSuccessWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; String repeatabilityRequestId = UUID.randomUUID().toString(); String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); @@ -203,6 +198,6 @@ public Response immediateSuccessWithResponse(RequestOptions requestOptions .set(HttpHeaderName.fromString("repeatability-first-sent"), repeatabilityFirstSent); } }); - return service.immediateSuccessSync(accept, requestOptionsLocal, Context.NONE); + return service.immediateSuccessSync(requestOptionsLocal, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/specialwords/implementation/ModelPropertiesImpl.java b/typespec-tests/src/main/java/com/specialwords/implementation/ModelPropertiesImpl.java index db9360cc23..5cafb1140f 100644 --- a/typespec-tests/src/main/java/com/specialwords/implementation/ModelPropertiesImpl.java +++ b/typespec-tests/src/main/java/com/specialwords/implementation/ModelPropertiesImpl.java @@ -63,7 +63,7 @@ public interface ModelPropertiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> sameAsModel(@HeaderParam("accept") String accept, + Mono> sameAsModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/model-properties/same-as-model") @@ -72,7 +72,7 @@ Mono> sameAsModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sameAsModelSync(@HeaderParam("accept") String accept, + Response sameAsModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -96,8 +96,8 @@ Response sameAsModelSync(@HeaderParam("accept") String accept, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sameAsModelWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.sameAsModel(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.sameAsModel(contentType, body, requestOptions, context)); } /** @@ -120,7 +120,7 @@ public Mono> sameAsModelWithResponseAsync(BinaryData body, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sameAsModelWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sameAsModelSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sameAsModelSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/specialwords/implementation/ModelsImpl.java b/typespec-tests/src/main/java/com/specialwords/implementation/ModelsImpl.java index d4b6404abf..87d74f2309 100644 --- a/typespec-tests/src/main/java/com/specialwords/implementation/ModelsImpl.java +++ b/typespec-tests/src/main/java/com/specialwords/implementation/ModelsImpl.java @@ -62,7 +62,7 @@ public interface ModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAnd(@HeaderParam("accept") String accept, + Mono> withAnd(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/and") @@ -71,8 +71,8 @@ Mono> withAnd(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAndSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response withAndSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/as") @ExpectedResponses({ 204 }) @@ -80,7 +80,7 @@ Response withAndSync(@HeaderParam("accept") String accept, @BodyParam("app @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAs(@HeaderParam("accept") String accept, + Mono> withAs(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/as") @@ -89,8 +89,8 @@ Mono> withAs(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAsSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response withAsSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/assert") @ExpectedResponses({ 204 }) @@ -98,7 +98,7 @@ Response withAsSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAssert(@HeaderParam("accept") String accept, + Mono> withAssert(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/assert") @@ -107,7 +107,7 @@ Mono> withAssert(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAssertSync(@HeaderParam("accept") String accept, + Response withAssertSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/async") @@ -116,7 +116,7 @@ Response withAssertSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAsync(@HeaderParam("accept") String accept, + Mono> withAsync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/async") @@ -125,7 +125,7 @@ Mono> withAsync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAsyncSync(@HeaderParam("accept") String accept, + Response withAsyncSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/await") @@ -134,7 +134,7 @@ Response withAsyncSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAwait(@HeaderParam("accept") String accept, + Mono> withAwait(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/await") @@ -143,7 +143,7 @@ Mono> withAwait(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAwaitSync(@HeaderParam("accept") String accept, + Response withAwaitSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/break") @@ -152,7 +152,7 @@ Response withAwaitSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withBreak(@HeaderParam("accept") String accept, + Mono> withBreak(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/break") @@ -161,7 +161,7 @@ Mono> withBreak(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withBreakSync(@HeaderParam("accept") String accept, + Response withBreakSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/class") @@ -170,7 +170,7 @@ Response withBreakSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withClass(@HeaderParam("accept") String accept, + Mono> withClass(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/class") @@ -179,7 +179,7 @@ Mono> withClass(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withClassSync(@HeaderParam("accept") String accept, + Response withClassSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/constructor") @@ -188,7 +188,7 @@ Response withClassSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withConstructor(@HeaderParam("accept") String accept, + Mono> withConstructor(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/constructor") @@ -197,7 +197,7 @@ Mono> withConstructor(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withConstructorSync(@HeaderParam("accept") String accept, + Response withConstructorSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/continue") @@ -206,7 +206,7 @@ Response withConstructorSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withContinue(@HeaderParam("accept") String accept, + Mono> withContinue(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/continue") @@ -215,7 +215,7 @@ Mono> withContinue(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withContinueSync(@HeaderParam("accept") String accept, + Response withContinueSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/def") @@ -224,7 +224,7 @@ Response withContinueSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withDef(@HeaderParam("accept") String accept, + Mono> withDef(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/def") @@ -233,8 +233,8 @@ Mono> withDef(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withDefSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response withDefSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/del") @ExpectedResponses({ 204 }) @@ -242,7 +242,7 @@ Response withDefSync(@HeaderParam("accept") String accept, @BodyParam("app @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withDel(@HeaderParam("accept") String accept, + Mono> withDel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/del") @@ -251,8 +251,8 @@ Mono> withDel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withDelSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response withDelSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/elif") @ExpectedResponses({ 204 }) @@ -260,7 +260,7 @@ Response withDelSync(@HeaderParam("accept") String accept, @BodyParam("app @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withElif(@HeaderParam("accept") String accept, + Mono> withElif(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/elif") @@ -269,7 +269,7 @@ Mono> withElif(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withElifSync(@HeaderParam("accept") String accept, + Response withElifSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/else") @@ -278,7 +278,7 @@ Response withElifSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withElse(@HeaderParam("accept") String accept, + Mono> withElse(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/else") @@ -287,7 +287,7 @@ Mono> withElse(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withElseSync(@HeaderParam("accept") String accept, + Response withElseSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/except") @@ -296,7 +296,7 @@ Response withElseSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withExcept(@HeaderParam("accept") String accept, + Mono> withExcept(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/except") @@ -305,7 +305,7 @@ Mono> withExcept(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withExceptSync(@HeaderParam("accept") String accept, + Response withExceptSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/exec") @@ -314,7 +314,7 @@ Response withExceptSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withExec(@HeaderParam("accept") String accept, + Mono> withExec(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/exec") @@ -323,7 +323,7 @@ Mono> withExec(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withExecSync(@HeaderParam("accept") String accept, + Response withExecSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/finally") @@ -332,7 +332,7 @@ Response withExecSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withFinally(@HeaderParam("accept") String accept, + Mono> withFinally(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/finally") @@ -341,7 +341,7 @@ Mono> withFinally(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withFinallySync(@HeaderParam("accept") String accept, + Response withFinallySync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/for") @@ -350,7 +350,7 @@ Response withFinallySync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withFor(@HeaderParam("accept") String accept, + Mono> withFor(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/for") @@ -359,8 +359,8 @@ Mono> withFor(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withForSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response withForSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/from") @ExpectedResponses({ 204 }) @@ -368,7 +368,7 @@ Response withForSync(@HeaderParam("accept") String accept, @BodyParam("app @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withFrom(@HeaderParam("accept") String accept, + Mono> withFrom(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/from") @@ -377,7 +377,7 @@ Mono> withFrom(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withFromSync(@HeaderParam("accept") String accept, + Response withFromSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/global") @@ -386,7 +386,7 @@ Response withFromSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withGlobal(@HeaderParam("accept") String accept, + Mono> withGlobal(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/global") @@ -395,7 +395,7 @@ Mono> withGlobal(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withGlobalSync(@HeaderParam("accept") String accept, + Response withGlobalSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/if") @@ -404,7 +404,7 @@ Response withGlobalSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withIf(@HeaderParam("accept") String accept, + Mono> withIf(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/if") @@ -413,8 +413,8 @@ Mono> withIf(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withIfSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response withIfSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/import") @ExpectedResponses({ 204 }) @@ -422,7 +422,7 @@ Response withIfSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withImport(@HeaderParam("accept") String accept, + Mono> withImport(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/import") @@ -431,7 +431,7 @@ Mono> withImport(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withImportSync(@HeaderParam("accept") String accept, + Response withImportSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/in") @@ -440,7 +440,7 @@ Response withImportSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withIn(@HeaderParam("accept") String accept, + Mono> withIn(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/in") @@ -449,8 +449,8 @@ Mono> withIn(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withInSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response withInSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/is") @ExpectedResponses({ 204 }) @@ -458,7 +458,7 @@ Response withInSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withIs(@HeaderParam("accept") String accept, + Mono> withIs(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/is") @@ -467,8 +467,8 @@ Mono> withIs(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withIsSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response withIsSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/lambda") @ExpectedResponses({ 204 }) @@ -476,7 +476,7 @@ Response withIsSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withLambda(@HeaderParam("accept") String accept, + Mono> withLambda(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/lambda") @@ -485,7 +485,7 @@ Mono> withLambda(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withLambdaSync(@HeaderParam("accept") String accept, + Response withLambdaSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/not") @@ -494,7 +494,7 @@ Response withLambdaSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withNot(@HeaderParam("accept") String accept, + Mono> withNot(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/not") @@ -503,8 +503,8 @@ Mono> withNot(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withNotSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response withNotSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/or") @ExpectedResponses({ 204 }) @@ -512,7 +512,7 @@ Response withNotSync(@HeaderParam("accept") String accept, @BodyParam("app @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withOr(@HeaderParam("accept") String accept, + Mono> withOr(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/or") @@ -521,8 +521,8 @@ Mono> withOr(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withOrSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response withOrSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/pass") @ExpectedResponses({ 204 }) @@ -530,7 +530,7 @@ Response withOrSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withPass(@HeaderParam("accept") String accept, + Mono> withPass(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/pass") @@ -539,7 +539,7 @@ Mono> withPass(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withPassSync(@HeaderParam("accept") String accept, + Response withPassSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/raise") @@ -548,7 +548,7 @@ Response withPassSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withRaise(@HeaderParam("accept") String accept, + Mono> withRaise(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/raise") @@ -557,7 +557,7 @@ Mono> withRaise(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withRaiseSync(@HeaderParam("accept") String accept, + Response withRaiseSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/return") @@ -566,7 +566,7 @@ Response withRaiseSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withReturn(@HeaderParam("accept") String accept, + Mono> withReturn(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/return") @@ -575,7 +575,7 @@ Mono> withReturn(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withReturnSync(@HeaderParam("accept") String accept, + Response withReturnSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/try") @@ -584,7 +584,7 @@ Response withReturnSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withTry(@HeaderParam("accept") String accept, + Mono> withTry(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/try") @@ -593,8 +593,8 @@ Mono> withTry(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withTrySync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response withTrySync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/while") @ExpectedResponses({ 204 }) @@ -602,7 +602,7 @@ Response withTrySync(@HeaderParam("accept") String accept, @BodyParam("app @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withWhile(@HeaderParam("accept") String accept, + Mono> withWhile(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/while") @@ -611,7 +611,7 @@ Mono> withWhile(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withWhileSync(@HeaderParam("accept") String accept, + Response withWhileSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/with") @@ -620,7 +620,7 @@ Response withWhileSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withWith(@HeaderParam("accept") String accept, + Mono> withWith(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/with") @@ -629,7 +629,7 @@ Mono> withWith(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withWithSync(@HeaderParam("accept") String accept, + Response withWithSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/yield") @@ -638,7 +638,7 @@ Response withWithSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withYield(@HeaderParam("accept") String accept, + Mono> withYield(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/yield") @@ -647,7 +647,7 @@ Mono> withYield(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withYieldSync(@HeaderParam("accept") String accept, + Response withYieldSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -671,8 +671,8 @@ Response withYieldSync(@HeaderParam("accept") String accept, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAndWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withAnd(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withAnd(contentType, body, requestOptions, context)); } /** @@ -695,8 +695,8 @@ public Mono> withAndWithResponseAsync(BinaryData body, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAndWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withAndSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withAndSync(contentType, body, requestOptions, Context.NONE); } /** @@ -719,8 +719,8 @@ public Response withAndWithResponse(BinaryData body, RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withAs(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withAs(contentType, body, requestOptions, context)); } /** @@ -743,8 +743,8 @@ public Mono> withAsWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAsWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withAsSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withAsSync(contentType, body, requestOptions, Context.NONE); } /** @@ -767,8 +767,8 @@ public Response withAsWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAssertWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withAssert(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withAssert(contentType, body, requestOptions, context)); } /** @@ -791,8 +791,8 @@ public Mono> withAssertWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAssertWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withAssertSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withAssertSync(contentType, body, requestOptions, Context.NONE); } /** @@ -815,8 +815,8 @@ public Response withAssertWithResponse(BinaryData body, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAsyncWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withAsync(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withAsync(contentType, body, requestOptions, context)); } /** @@ -839,8 +839,8 @@ public Mono> withAsyncWithResponseAsync(BinaryData body, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAsyncWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withAsyncSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withAsyncSync(contentType, body, requestOptions, Context.NONE); } /** @@ -863,8 +863,8 @@ public Response withAsyncWithResponse(BinaryData body, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAwaitWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withAwait(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withAwait(contentType, body, requestOptions, context)); } /** @@ -887,8 +887,8 @@ public Mono> withAwaitWithResponseAsync(BinaryData body, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAwaitWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withAwaitSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withAwaitSync(contentType, body, requestOptions, Context.NONE); } /** @@ -911,8 +911,8 @@ public Response withAwaitWithResponse(BinaryData body, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withBreakWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withBreak(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withBreak(contentType, body, requestOptions, context)); } /** @@ -935,8 +935,8 @@ public Mono> withBreakWithResponseAsync(BinaryData body, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withBreakWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withBreakSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withBreakSync(contentType, body, requestOptions, Context.NONE); } /** @@ -959,8 +959,8 @@ public Response withBreakWithResponse(BinaryData body, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withClassWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withClass(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withClass(contentType, body, requestOptions, context)); } /** @@ -983,8 +983,8 @@ public Mono> withClassWithResponseAsync(BinaryData body, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withClassWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withClassSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withClassSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1007,8 +1007,8 @@ public Response withClassWithResponse(BinaryData body, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withConstructorWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withConstructor(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withConstructor(contentType, body, requestOptions, context)); } /** @@ -1031,8 +1031,8 @@ public Mono> withConstructorWithResponseAsync(BinaryData body, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withConstructorWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withConstructorSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withConstructorSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1055,8 +1055,8 @@ public Response withConstructorWithResponse(BinaryData body, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withContinueWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withContinue(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withContinue(contentType, body, requestOptions, context)); } /** @@ -1079,8 +1079,8 @@ public Mono> withContinueWithResponseAsync(BinaryData body, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withContinueWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withContinueSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withContinueSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1103,8 +1103,8 @@ public Response withContinueWithResponse(BinaryData body, RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withDefWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withDef(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withDef(contentType, body, requestOptions, context)); } /** @@ -1127,8 +1127,8 @@ public Mono> withDefWithResponseAsync(BinaryData body, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withDefWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withDefSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withDefSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1151,8 +1151,8 @@ public Response withDefWithResponse(BinaryData body, RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withDelWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withDel(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withDel(contentType, body, requestOptions, context)); } /** @@ -1175,8 +1175,8 @@ public Mono> withDelWithResponseAsync(BinaryData body, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withDelWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withDelSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withDelSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1199,8 +1199,8 @@ public Response withDelWithResponse(BinaryData body, RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withElifWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withElif(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withElif(contentType, body, requestOptions, context)); } /** @@ -1223,8 +1223,8 @@ public Mono> withElifWithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withElifWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withElifSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withElifSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1247,8 +1247,8 @@ public Response withElifWithResponse(BinaryData body, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withElseWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withElse(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withElse(contentType, body, requestOptions, context)); } /** @@ -1271,8 +1271,8 @@ public Mono> withElseWithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withElseWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withElseSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withElseSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1295,8 +1295,8 @@ public Response withElseWithResponse(BinaryData body, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withExceptWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withExcept(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withExcept(contentType, body, requestOptions, context)); } /** @@ -1319,8 +1319,8 @@ public Mono> withExceptWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withExceptWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withExceptSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withExceptSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1343,8 +1343,8 @@ public Response withExceptWithResponse(BinaryData body, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withExecWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withExec(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withExec(contentType, body, requestOptions, context)); } /** @@ -1367,8 +1367,8 @@ public Mono> withExecWithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withExecWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withExecSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withExecSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1391,8 +1391,8 @@ public Response withExecWithResponse(BinaryData body, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withFinallyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withFinally(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withFinally(contentType, body, requestOptions, context)); } /** @@ -1415,8 +1415,8 @@ public Mono> withFinallyWithResponseAsync(BinaryData body, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withFinallyWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withFinallySync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withFinallySync(contentType, body, requestOptions, Context.NONE); } /** @@ -1439,8 +1439,8 @@ public Response withFinallyWithResponse(BinaryData body, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withForWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withFor(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withFor(contentType, body, requestOptions, context)); } /** @@ -1463,8 +1463,8 @@ public Mono> withForWithResponseAsync(BinaryData body, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withForWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withForSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withForSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1487,8 +1487,8 @@ public Response withForWithResponse(BinaryData body, RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withFromWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withFrom(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withFrom(contentType, body, requestOptions, context)); } /** @@ -1511,8 +1511,8 @@ public Mono> withFromWithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withFromWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withFromSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withFromSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1535,8 +1535,8 @@ public Response withFromWithResponse(BinaryData body, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withGlobalWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withGlobal(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withGlobal(contentType, body, requestOptions, context)); } /** @@ -1559,8 +1559,8 @@ public Mono> withGlobalWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withGlobalWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withGlobalSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withGlobalSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1583,8 +1583,8 @@ public Response withGlobalWithResponse(BinaryData body, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withIfWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withIf(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withIf(contentType, body, requestOptions, context)); } /** @@ -1607,8 +1607,8 @@ public Mono> withIfWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withIfWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withIfSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withIfSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1631,8 +1631,8 @@ public Response withIfWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withImportWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withImport(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withImport(contentType, body, requestOptions, context)); } /** @@ -1655,8 +1655,8 @@ public Mono> withImportWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withImportWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withImportSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withImportSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1679,8 +1679,8 @@ public Response withImportWithResponse(BinaryData body, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withInWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withIn(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withIn(contentType, body, requestOptions, context)); } /** @@ -1703,8 +1703,8 @@ public Mono> withInWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withInWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withInSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withInSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1727,8 +1727,8 @@ public Response withInWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withIsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withIs(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withIs(contentType, body, requestOptions, context)); } /** @@ -1751,8 +1751,8 @@ public Mono> withIsWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withIsWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withIsSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withIsSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1775,8 +1775,8 @@ public Response withIsWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withLambdaWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withLambda(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withLambda(contentType, body, requestOptions, context)); } /** @@ -1799,8 +1799,8 @@ public Mono> withLambdaWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withLambdaWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withLambdaSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withLambdaSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1823,8 +1823,8 @@ public Response withLambdaWithResponse(BinaryData body, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withNotWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withNot(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withNot(contentType, body, requestOptions, context)); } /** @@ -1847,8 +1847,8 @@ public Mono> withNotWithResponseAsync(BinaryData body, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withNotWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withNotSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withNotSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1871,8 +1871,8 @@ public Response withNotWithResponse(BinaryData body, RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withOrWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withOr(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withOr(contentType, body, requestOptions, context)); } /** @@ -1895,8 +1895,8 @@ public Mono> withOrWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withOrWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withOrSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withOrSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1919,8 +1919,8 @@ public Response withOrWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withPassWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withPass(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withPass(contentType, body, requestOptions, context)); } /** @@ -1943,8 +1943,8 @@ public Mono> withPassWithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withPassWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withPassSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withPassSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1967,8 +1967,8 @@ public Response withPassWithResponse(BinaryData body, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withRaiseWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withRaise(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withRaise(contentType, body, requestOptions, context)); } /** @@ -1991,8 +1991,8 @@ public Mono> withRaiseWithResponseAsync(BinaryData body, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withRaiseWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withRaiseSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withRaiseSync(contentType, body, requestOptions, Context.NONE); } /** @@ -2015,8 +2015,8 @@ public Response withRaiseWithResponse(BinaryData body, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withReturnWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withReturn(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withReturn(contentType, body, requestOptions, context)); } /** @@ -2039,8 +2039,8 @@ public Mono> withReturnWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withReturnWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withReturnSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withReturnSync(contentType, body, requestOptions, Context.NONE); } /** @@ -2063,8 +2063,8 @@ public Response withReturnWithResponse(BinaryData body, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withTryWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withTry(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withTry(contentType, body, requestOptions, context)); } /** @@ -2087,8 +2087,8 @@ public Mono> withTryWithResponseAsync(BinaryData body, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withTryWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withTrySync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withTrySync(contentType, body, requestOptions, Context.NONE); } /** @@ -2111,8 +2111,8 @@ public Response withTryWithResponse(BinaryData body, RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withWhileWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withWhile(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withWhile(contentType, body, requestOptions, context)); } /** @@ -2135,8 +2135,8 @@ public Mono> withWhileWithResponseAsync(BinaryData body, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withWhileWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withWhileSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withWhileSync(contentType, body, requestOptions, Context.NONE); } /** @@ -2159,8 +2159,8 @@ public Response withWhileWithResponse(BinaryData body, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withWithWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withWith(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withWith(contentType, body, requestOptions, context)); } /** @@ -2183,8 +2183,8 @@ public Mono> withWithWithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withWithWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withWithSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withWithSync(contentType, body, requestOptions, Context.NONE); } /** @@ -2207,8 +2207,8 @@ public Response withWithWithResponse(BinaryData body, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withYieldWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withYield(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withYield(contentType, body, requestOptions, context)); } /** @@ -2231,7 +2231,7 @@ public Mono> withYieldWithResponseAsync(BinaryData body, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withYieldWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withYieldSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withYieldSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/specialwords/implementation/OperationsImpl.java b/typespec-tests/src/main/java/com/specialwords/implementation/OperationsImpl.java index cbd4595300..56816afd4d 100644 --- a/typespec-tests/src/main/java/com/specialwords/implementation/OperationsImpl.java +++ b/typespec-tests/src/main/java/com/specialwords/implementation/OperationsImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -61,7 +60,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> and(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> and(RequestOptions requestOptions, Context context); @Get("/special-words/operations/and") @ExpectedResponses({ 204 }) @@ -69,7 +68,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response andSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response andSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/as") @ExpectedResponses({ 204 }) @@ -77,7 +76,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> as(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> as(RequestOptions requestOptions, Context context); @Get("/special-words/operations/as") @ExpectedResponses({ 204 }) @@ -85,7 +84,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response asSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response asSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/assert") @ExpectedResponses({ 204 }) @@ -93,8 +92,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> assertMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> assertMethod(RequestOptions requestOptions, Context context); @Get("/special-words/operations/assert") @ExpectedResponses({ 204 }) @@ -102,8 +100,7 @@ Mono> assertMethod(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response assertMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response assertMethodSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/async") @ExpectedResponses({ 204 }) @@ -111,8 +108,7 @@ Response assertMethodSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> async(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> async(RequestOptions requestOptions, Context context); @Get("/special-words/operations/async") @ExpectedResponses({ 204 }) @@ -120,7 +116,7 @@ Mono> async(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response asyncSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response asyncSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/await") @ExpectedResponses({ 204 }) @@ -128,8 +124,7 @@ Mono> async(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> await(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> await(RequestOptions requestOptions, Context context); @Get("/special-words/operations/await") @ExpectedResponses({ 204 }) @@ -137,7 +132,7 @@ Mono> await(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response awaitSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response awaitSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/break") @ExpectedResponses({ 204 }) @@ -145,8 +140,7 @@ Mono> await(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> breakMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> breakMethod(RequestOptions requestOptions, Context context); @Get("/special-words/operations/break") @ExpectedResponses({ 204 }) @@ -154,8 +148,7 @@ Mono> breakMethod(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response breakMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response breakMethodSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/class") @ExpectedResponses({ 204 }) @@ -163,8 +156,7 @@ Response breakMethodSync(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> classMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> classMethod(RequestOptions requestOptions, Context context); @Get("/special-words/operations/class") @ExpectedResponses({ 204 }) @@ -172,8 +164,7 @@ Mono> classMethod(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response classMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response classMethodSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/constructor") @ExpectedResponses({ 204 }) @@ -181,8 +172,7 @@ Response classMethodSync(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> constructor(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> constructor(RequestOptions requestOptions, Context context); @Get("/special-words/operations/constructor") @ExpectedResponses({ 204 }) @@ -190,8 +180,7 @@ Mono> constructor(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response constructorSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response constructorSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/continue") @ExpectedResponses({ 204 }) @@ -199,8 +188,7 @@ Response constructorSync(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> continueMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> continueMethod(RequestOptions requestOptions, Context context); @Get("/special-words/operations/continue") @ExpectedResponses({ 204 }) @@ -208,8 +196,7 @@ Mono> continueMethod(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response continueMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response continueMethodSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/def") @ExpectedResponses({ 204 }) @@ -217,7 +204,7 @@ Response continueMethodSync(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> def(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> def(RequestOptions requestOptions, Context context); @Get("/special-words/operations/def") @ExpectedResponses({ 204 }) @@ -225,7 +212,7 @@ Response continueMethodSync(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response defSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/del") @ExpectedResponses({ 204 }) @@ -233,7 +220,7 @@ Response continueMethodSync(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> del(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> del(RequestOptions requestOptions, Context context); @Get("/special-words/operations/del") @ExpectedResponses({ 204 }) @@ -241,7 +228,7 @@ Response continueMethodSync(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response delSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response delSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/elif") @ExpectedResponses({ 204 }) @@ -249,7 +236,7 @@ Response continueMethodSync(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> elif(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> elif(RequestOptions requestOptions, Context context); @Get("/special-words/operations/elif") @ExpectedResponses({ 204 }) @@ -257,7 +244,7 @@ Response continueMethodSync(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response elifSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response elifSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/else") @ExpectedResponses({ 204 }) @@ -265,8 +252,7 @@ Response continueMethodSync(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> elseMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> elseMethod(RequestOptions requestOptions, Context context); @Get("/special-words/operations/else") @ExpectedResponses({ 204 }) @@ -274,8 +260,7 @@ Mono> elseMethod(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response elseMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response elseMethodSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/except") @ExpectedResponses({ 204 }) @@ -283,8 +268,7 @@ Response elseMethodSync(@HeaderParam("accept") String accept, RequestOptio @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> except(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> except(RequestOptions requestOptions, Context context); @Get("/special-words/operations/except") @ExpectedResponses({ 204 }) @@ -292,7 +276,7 @@ Mono> except(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response exceptSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response exceptSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/exec") @ExpectedResponses({ 204 }) @@ -300,7 +284,7 @@ Mono> except(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> exec(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> exec(RequestOptions requestOptions, Context context); @Get("/special-words/operations/exec") @ExpectedResponses({ 204 }) @@ -308,7 +292,7 @@ Mono> except(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response execSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response execSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/finally") @ExpectedResponses({ 204 }) @@ -316,8 +300,7 @@ Mono> except(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> finallyMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> finallyMethod(RequestOptions requestOptions, Context context); @Get("/special-words/operations/finally") @ExpectedResponses({ 204 }) @@ -325,8 +308,7 @@ Mono> finallyMethod(@HeaderParam("accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response finallyMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response finallyMethodSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/for") @ExpectedResponses({ 204 }) @@ -334,8 +316,7 @@ Response finallyMethodSync(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> forMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> forMethod(RequestOptions requestOptions, Context context); @Get("/special-words/operations/for") @ExpectedResponses({ 204 }) @@ -343,8 +324,7 @@ Mono> forMethod(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response forMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response forMethodSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/from") @ExpectedResponses({ 204 }) @@ -352,7 +332,7 @@ Response forMethodSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> from(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> from(RequestOptions requestOptions, Context context); @Get("/special-words/operations/from") @ExpectedResponses({ 204 }) @@ -360,7 +340,7 @@ Response forMethodSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response fromSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response fromSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/global") @ExpectedResponses({ 204 }) @@ -368,8 +348,7 @@ Response forMethodSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> global(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> global(RequestOptions requestOptions, Context context); @Get("/special-words/operations/global") @ExpectedResponses({ 204 }) @@ -377,7 +356,7 @@ Mono> global(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response globalSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response globalSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/if") @ExpectedResponses({ 204 }) @@ -385,8 +364,7 @@ Mono> global(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> ifMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> ifMethod(RequestOptions requestOptions, Context context); @Get("/special-words/operations/if") @ExpectedResponses({ 204 }) @@ -394,8 +372,7 @@ Mono> ifMethod(@HeaderParam("accept") String accept, RequestOptio @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response ifMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response ifMethodSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/import") @ExpectedResponses({ 204 }) @@ -403,8 +380,7 @@ Response ifMethodSync(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> importMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> importMethod(RequestOptions requestOptions, Context context); @Get("/special-words/operations/import") @ExpectedResponses({ 204 }) @@ -412,8 +388,7 @@ Mono> importMethod(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response importMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response importMethodSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/in") @ExpectedResponses({ 204 }) @@ -421,7 +396,7 @@ Response importMethodSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> in(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> in(RequestOptions requestOptions, Context context); @Get("/special-words/operations/in") @ExpectedResponses({ 204 }) @@ -429,7 +404,7 @@ Response importMethodSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response inSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response inSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/is") @ExpectedResponses({ 204 }) @@ -437,7 +412,7 @@ Response importMethodSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> is(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> is(RequestOptions requestOptions, Context context); @Get("/special-words/operations/is") @ExpectedResponses({ 204 }) @@ -445,7 +420,7 @@ Response importMethodSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response isSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response isSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/lambda") @ExpectedResponses({ 204 }) @@ -453,8 +428,7 @@ Response importMethodSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> lambda(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> lambda(RequestOptions requestOptions, Context context); @Get("/special-words/operations/lambda") @ExpectedResponses({ 204 }) @@ -462,7 +436,7 @@ Mono> lambda(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response lambdaSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response lambdaSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/not") @ExpectedResponses({ 204 }) @@ -470,7 +444,7 @@ Mono> lambda(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> not(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> not(RequestOptions requestOptions, Context context); @Get("/special-words/operations/not") @ExpectedResponses({ 204 }) @@ -478,7 +452,7 @@ Mono> lambda(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response notSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response notSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/or") @ExpectedResponses({ 204 }) @@ -486,7 +460,7 @@ Mono> lambda(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> or(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> or(RequestOptions requestOptions, Context context); @Get("/special-words/operations/or") @ExpectedResponses({ 204 }) @@ -494,7 +468,7 @@ Mono> lambda(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response orSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response orSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/pass") @ExpectedResponses({ 204 }) @@ -502,7 +476,7 @@ Mono> lambda(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> pass(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> pass(RequestOptions requestOptions, Context context); @Get("/special-words/operations/pass") @ExpectedResponses({ 204 }) @@ -510,7 +484,7 @@ Mono> lambda(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response passSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response passSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/raise") @ExpectedResponses({ 204 }) @@ -518,8 +492,7 @@ Mono> lambda(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> raise(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> raise(RequestOptions requestOptions, Context context); @Get("/special-words/operations/raise") @ExpectedResponses({ 204 }) @@ -527,7 +500,7 @@ Mono> raise(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response raiseSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response raiseSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/return") @ExpectedResponses({ 204 }) @@ -535,8 +508,7 @@ Mono> raise(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> returnMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> returnMethod(RequestOptions requestOptions, Context context); @Get("/special-words/operations/return") @ExpectedResponses({ 204 }) @@ -544,8 +516,7 @@ Mono> returnMethod(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response returnMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response returnMethodSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/try") @ExpectedResponses({ 204 }) @@ -553,8 +524,7 @@ Response returnMethodSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> tryMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> tryMethod(RequestOptions requestOptions, Context context); @Get("/special-words/operations/try") @ExpectedResponses({ 204 }) @@ -562,8 +532,7 @@ Mono> tryMethod(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response tryMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response tryMethodSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/while") @ExpectedResponses({ 204 }) @@ -571,8 +540,7 @@ Response tryMethodSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> whileMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> whileMethod(RequestOptions requestOptions, Context context); @Get("/special-words/operations/while") @ExpectedResponses({ 204 }) @@ -580,8 +548,7 @@ Mono> whileMethod(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response whileMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response whileMethodSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/with") @ExpectedResponses({ 204 }) @@ -589,7 +556,7 @@ Response whileMethodSync(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> with(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> with(RequestOptions requestOptions, Context context); @Get("/special-words/operations/with") @ExpectedResponses({ 204 }) @@ -597,7 +564,7 @@ Response whileMethodSync(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response withSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/yield") @ExpectedResponses({ 204 }) @@ -605,8 +572,7 @@ Response whileMethodSync(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> yield(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> yield(RequestOptions requestOptions, Context context); @Get("/special-words/operations/yield") @ExpectedResponses({ 204 }) @@ -614,7 +580,7 @@ Mono> yield(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response yieldSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response yieldSync(RequestOptions requestOptions, Context context); } /** @@ -629,8 +595,7 @@ Mono> yield(@HeaderParam("accept") String accept, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> andWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.and(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.and(requestOptions, context)); } /** @@ -645,8 +610,7 @@ public Mono> andWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response andWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.andSync(accept, requestOptions, Context.NONE); + return service.andSync(requestOptions, Context.NONE); } /** @@ -661,8 +625,7 @@ public Response andWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> asWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.as(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.as(requestOptions, context)); } /** @@ -677,8 +640,7 @@ public Mono> asWithResponseAsync(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response asWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.asSync(accept, requestOptions, Context.NONE); + return service.asSync(requestOptions, Context.NONE); } /** @@ -693,8 +655,7 @@ public Response asWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> assertMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.assertMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.assertMethod(requestOptions, context)); } /** @@ -709,8 +670,7 @@ public Mono> assertMethodWithResponseAsync(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response assertMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.assertMethodSync(accept, requestOptions, Context.NONE); + return service.assertMethodSync(requestOptions, Context.NONE); } /** @@ -725,8 +685,7 @@ public Response assertMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> asyncWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.async(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.async(requestOptions, context)); } /** @@ -741,8 +700,7 @@ public Mono> asyncWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response asyncWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.asyncSync(accept, requestOptions, Context.NONE); + return service.asyncSync(requestOptions, Context.NONE); } /** @@ -757,8 +715,7 @@ public Response asyncWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> awaitWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.await(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.await(requestOptions, context)); } /** @@ -773,8 +730,7 @@ public Mono> awaitWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response awaitWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.awaitSync(accept, requestOptions, Context.NONE); + return service.awaitSync(requestOptions, Context.NONE); } /** @@ -789,8 +745,7 @@ public Response awaitWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> breakMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.breakMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.breakMethod(requestOptions, context)); } /** @@ -805,8 +760,7 @@ public Mono> breakMethodWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response breakMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.breakMethodSync(accept, requestOptions, Context.NONE); + return service.breakMethodSync(requestOptions, Context.NONE); } /** @@ -821,8 +775,7 @@ public Response breakMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> classMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.classMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.classMethod(requestOptions, context)); } /** @@ -837,8 +790,7 @@ public Mono> classMethodWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response classMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.classMethodSync(accept, requestOptions, Context.NONE); + return service.classMethodSync(requestOptions, Context.NONE); } /** @@ -853,8 +805,7 @@ public Response classMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> constructorWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.constructor(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.constructor(requestOptions, context)); } /** @@ -869,8 +820,7 @@ public Mono> constructorWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response constructorWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.constructorSync(accept, requestOptions, Context.NONE); + return service.constructorSync(requestOptions, Context.NONE); } /** @@ -885,8 +835,7 @@ public Response constructorWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> continueMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.continueMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.continueMethod(requestOptions, context)); } /** @@ -901,8 +850,7 @@ public Mono> continueMethodWithResponseAsync(RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response continueMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.continueMethodSync(accept, requestOptions, Context.NONE); + return service.continueMethodSync(requestOptions, Context.NONE); } /** @@ -917,8 +865,7 @@ public Response continueMethodWithResponse(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.def(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.def(requestOptions, context)); } /** @@ -933,8 +880,7 @@ public Mono> defWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.defSync(accept, requestOptions, Context.NONE); + return service.defSync(requestOptions, Context.NONE); } /** @@ -949,8 +895,7 @@ public Response defWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.del(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.del(requestOptions, context)); } /** @@ -965,8 +910,7 @@ public Mono> delWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response delWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.delSync(accept, requestOptions, Context.NONE); + return service.delSync(requestOptions, Context.NONE); } /** @@ -981,8 +925,7 @@ public Response delWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> elifWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.elif(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.elif(requestOptions, context)); } /** @@ -997,8 +940,7 @@ public Mono> elifWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response elifWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.elifSync(accept, requestOptions, Context.NONE); + return service.elifSync(requestOptions, Context.NONE); } /** @@ -1013,8 +955,7 @@ public Response elifWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> elseMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.elseMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.elseMethod(requestOptions, context)); } /** @@ -1029,8 +970,7 @@ public Mono> elseMethodWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response elseMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.elseMethodSync(accept, requestOptions, Context.NONE); + return service.elseMethodSync(requestOptions, Context.NONE); } /** @@ -1045,8 +985,7 @@ public Response elseMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> exceptWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.except(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.except(requestOptions, context)); } /** @@ -1061,8 +1000,7 @@ public Mono> exceptWithResponseAsync(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response exceptWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.exceptSync(accept, requestOptions, Context.NONE); + return service.exceptSync(requestOptions, Context.NONE); } /** @@ -1077,8 +1015,7 @@ public Response exceptWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> execWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.exec(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.exec(requestOptions, context)); } /** @@ -1093,8 +1030,7 @@ public Mono> execWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response execWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.execSync(accept, requestOptions, Context.NONE); + return service.execSync(requestOptions, Context.NONE); } /** @@ -1109,8 +1045,7 @@ public Response execWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> finallyMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.finallyMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.finallyMethod(requestOptions, context)); } /** @@ -1125,8 +1060,7 @@ public Mono> finallyMethodWithResponseAsync(RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response finallyMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.finallyMethodSync(accept, requestOptions, Context.NONE); + return service.finallyMethodSync(requestOptions, Context.NONE); } /** @@ -1141,8 +1075,7 @@ public Response finallyMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> forMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.forMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.forMethod(requestOptions, context)); } /** @@ -1157,8 +1090,7 @@ public Mono> forMethodWithResponseAsync(RequestOptions requestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response forMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.forMethodSync(accept, requestOptions, Context.NONE); + return service.forMethodSync(requestOptions, Context.NONE); } /** @@ -1173,8 +1105,7 @@ public Response forMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.from(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.from(requestOptions, context)); } /** @@ -1189,8 +1120,7 @@ public Mono> fromWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.fromSync(accept, requestOptions, Context.NONE); + return service.fromSync(requestOptions, Context.NONE); } /** @@ -1205,8 +1135,7 @@ public Response fromWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> globalWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.global(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.global(requestOptions, context)); } /** @@ -1221,8 +1150,7 @@ public Mono> globalWithResponseAsync(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response globalWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.globalSync(accept, requestOptions, Context.NONE); + return service.globalSync(requestOptions, Context.NONE); } /** @@ -1237,8 +1165,7 @@ public Response globalWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> ifMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.ifMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.ifMethod(requestOptions, context)); } /** @@ -1253,8 +1180,7 @@ public Mono> ifMethodWithResponseAsync(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response ifMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.ifMethodSync(accept, requestOptions, Context.NONE); + return service.ifMethodSync(requestOptions, Context.NONE); } /** @@ -1269,8 +1195,7 @@ public Response ifMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> importMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.importMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.importMethod(requestOptions, context)); } /** @@ -1285,8 +1210,7 @@ public Mono> importMethodWithResponseAsync(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response importMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.importMethodSync(accept, requestOptions, Context.NONE); + return service.importMethodSync(requestOptions, Context.NONE); } /** @@ -1301,8 +1225,7 @@ public Response importMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> inWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.in(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.in(requestOptions, context)); } /** @@ -1317,8 +1240,7 @@ public Mono> inWithResponseAsync(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response inWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.inSync(accept, requestOptions, Context.NONE); + return service.inSync(requestOptions, Context.NONE); } /** @@ -1333,8 +1255,7 @@ public Response inWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> isWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.is(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.is(requestOptions, context)); } /** @@ -1349,8 +1270,7 @@ public Mono> isWithResponseAsync(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response isWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.isSync(accept, requestOptions, Context.NONE); + return service.isSync(requestOptions, Context.NONE); } /** @@ -1365,8 +1285,7 @@ public Response isWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> lambdaWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.lambda(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.lambda(requestOptions, context)); } /** @@ -1381,8 +1300,7 @@ public Mono> lambdaWithResponseAsync(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response lambdaWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.lambdaSync(accept, requestOptions, Context.NONE); + return service.lambdaSync(requestOptions, Context.NONE); } /** @@ -1397,8 +1315,7 @@ public Response lambdaWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> notWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.not(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.not(requestOptions, context)); } /** @@ -1413,8 +1330,7 @@ public Mono> notWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response notWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.notSync(accept, requestOptions, Context.NONE); + return service.notSync(requestOptions, Context.NONE); } /** @@ -1429,8 +1345,7 @@ public Response notWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> orWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.or(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.or(requestOptions, context)); } /** @@ -1445,8 +1360,7 @@ public Mono> orWithResponseAsync(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response orWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.orSync(accept, requestOptions, Context.NONE); + return service.orSync(requestOptions, Context.NONE); } /** @@ -1461,8 +1375,7 @@ public Response orWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> passWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.pass(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.pass(requestOptions, context)); } /** @@ -1477,8 +1390,7 @@ public Mono> passWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response passWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.passSync(accept, requestOptions, Context.NONE); + return service.passSync(requestOptions, Context.NONE); } /** @@ -1493,8 +1405,7 @@ public Response passWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> raiseWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.raise(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.raise(requestOptions, context)); } /** @@ -1509,8 +1420,7 @@ public Mono> raiseWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response raiseWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.raiseSync(accept, requestOptions, Context.NONE); + return service.raiseSync(requestOptions, Context.NONE); } /** @@ -1525,8 +1435,7 @@ public Response raiseWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> returnMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.returnMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.returnMethod(requestOptions, context)); } /** @@ -1541,8 +1450,7 @@ public Mono> returnMethodWithResponseAsync(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response returnMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.returnMethodSync(accept, requestOptions, Context.NONE); + return service.returnMethodSync(requestOptions, Context.NONE); } /** @@ -1557,8 +1465,7 @@ public Response returnMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> tryMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.tryMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.tryMethod(requestOptions, context)); } /** @@ -1573,8 +1480,7 @@ public Mono> tryMethodWithResponseAsync(RequestOptions requestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response tryMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.tryMethodSync(accept, requestOptions, Context.NONE); + return service.tryMethodSync(requestOptions, Context.NONE); } /** @@ -1589,8 +1495,7 @@ public Response tryMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> whileMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.whileMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.whileMethod(requestOptions, context)); } /** @@ -1605,8 +1510,7 @@ public Mono> whileMethodWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response whileMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.whileMethodSync(accept, requestOptions, Context.NONE); + return service.whileMethodSync(requestOptions, Context.NONE); } /** @@ -1621,8 +1525,7 @@ public Response whileMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.with(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.with(requestOptions, context)); } /** @@ -1637,8 +1540,7 @@ public Mono> withWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withSync(accept, requestOptions, Context.NONE); + return service.withSync(requestOptions, Context.NONE); } /** @@ -1653,8 +1555,7 @@ public Response withWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> yieldWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.yield(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.yield(requestOptions, context)); } /** @@ -1669,7 +1570,6 @@ public Mono> yieldWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response yieldWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.yieldSync(accept, requestOptions, Context.NONE); + return service.yieldSync(requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/specialwords/implementation/ParametersImpl.java b/typespec-tests/src/main/java/com/specialwords/implementation/ParametersImpl.java index 40e40e0a6a..b412b4d91b 100644 --- a/typespec-tests/src/main/java/com/specialwords/implementation/ParametersImpl.java +++ b/typespec-tests/src/main/java/com/specialwords/implementation/ParametersImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -62,8 +61,7 @@ public interface ParametersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAnd(@QueryParam("and") String and, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withAnd(@QueryParam("and") String and, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/and") @ExpectedResponses({ 204 }) @@ -71,8 +69,7 @@ Mono> withAnd(@QueryParam("and") String and, @HeaderParam("accept @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAndSync(@QueryParam("and") String and, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withAndSync(@QueryParam("and") String and, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/as") @ExpectedResponses({ 204 }) @@ -80,8 +77,7 @@ Response withAndSync(@QueryParam("and") String and, @HeaderParam("accept") @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAs(@QueryParam("as") String as, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withAs(@QueryParam("as") String as, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/as") @ExpectedResponses({ 204 }) @@ -89,8 +85,7 @@ Mono> withAs(@QueryParam("as") String as, @HeaderParam("accept") @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAsSync(@QueryParam("as") String as, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withAsSync(@QueryParam("as") String as, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/assert") @ExpectedResponses({ 204 }) @@ -98,8 +93,8 @@ Response withAsSync(@QueryParam("as") String as, @HeaderParam("accept") St @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAssert(@QueryParam("assert") String assertParameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> withAssert(@QueryParam("assert") String assertParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/assert") @ExpectedResponses({ 204 }) @@ -107,8 +102,8 @@ Mono> withAssert(@QueryParam("assert") String assertParameter, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAssertSync(@QueryParam("assert") String assertParameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response withAssertSync(@QueryParam("assert") String assertParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/async") @ExpectedResponses({ 204 }) @@ -116,8 +111,8 @@ Response withAssertSync(@QueryParam("assert") String assertParameter, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAsync(@QueryParam("async") String async, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withAsync(@QueryParam("async") String async, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/async") @ExpectedResponses({ 204 }) @@ -125,8 +120,7 @@ Mono> withAsync(@QueryParam("async") String async, @HeaderParam(" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAsyncSync(@QueryParam("async") String async, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withAsyncSync(@QueryParam("async") String async, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/await") @ExpectedResponses({ 204 }) @@ -134,8 +128,8 @@ Response withAsyncSync(@QueryParam("async") String async, @HeaderParam("ac @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAwait(@QueryParam("await") String await, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withAwait(@QueryParam("await") String await, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/await") @ExpectedResponses({ 204 }) @@ -143,8 +137,7 @@ Mono> withAwait(@QueryParam("await") String await, @HeaderParam(" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAwaitSync(@QueryParam("await") String await, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withAwaitSync(@QueryParam("await") String await, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/break") @ExpectedResponses({ 204 }) @@ -152,8 +145,8 @@ Response withAwaitSync(@QueryParam("await") String await, @HeaderParam("ac @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withBreak(@QueryParam("break") String breakParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withBreak(@QueryParam("break") String breakParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/break") @ExpectedResponses({ 204 }) @@ -161,8 +154,8 @@ Mono> withBreak(@QueryParam("break") String breakParameter, @Head @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withBreakSync(@QueryParam("break") String breakParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withBreakSync(@QueryParam("break") String breakParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/class") @ExpectedResponses({ 204 }) @@ -170,8 +163,8 @@ Response withBreakSync(@QueryParam("break") String breakParameter, @Header @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withClass(@QueryParam("class") String classParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withClass(@QueryParam("class") String classParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/class") @ExpectedResponses({ 204 }) @@ -179,8 +172,8 @@ Mono> withClass(@QueryParam("class") String classParameter, @Head @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withClassSync(@QueryParam("class") String classParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withClassSync(@QueryParam("class") String classParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/constructor") @ExpectedResponses({ 204 }) @@ -189,7 +182,7 @@ Response withClassSync(@QueryParam("class") String classParameter, @Header @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withConstructor(@QueryParam("constructor") String constructor, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/constructor") @ExpectedResponses({ 204 }) @@ -197,8 +190,8 @@ Mono> withConstructor(@QueryParam("constructor") String construct @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withConstructorSync(@QueryParam("constructor") String constructor, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response withConstructorSync(@QueryParam("constructor") String constructor, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/continue") @ExpectedResponses({ 204 }) @@ -207,7 +200,7 @@ Response withConstructorSync(@QueryParam("constructor") String constructor @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withContinue(@QueryParam("continue") String continueParameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/continue") @ExpectedResponses({ 204 }) @@ -215,8 +208,8 @@ Mono> withContinue(@QueryParam("continue") String continueParamet @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withContinueSync(@QueryParam("continue") String continueParameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response withContinueSync(@QueryParam("continue") String continueParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/def") @ExpectedResponses({ 204 }) @@ -224,8 +217,7 @@ Response withContinueSync(@QueryParam("continue") String continueParameter @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withDef(@QueryParam("def") String def, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withDef(@QueryParam("def") String def, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/def") @ExpectedResponses({ 204 }) @@ -233,8 +225,7 @@ Mono> withDef(@QueryParam("def") String def, @HeaderParam("accept @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withDefSync(@QueryParam("def") String def, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withDefSync(@QueryParam("def") String def, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/del") @ExpectedResponses({ 204 }) @@ -242,8 +233,7 @@ Response withDefSync(@QueryParam("def") String def, @HeaderParam("accept") @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withDel(@QueryParam("del") String del, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withDel(@QueryParam("del") String del, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/del") @ExpectedResponses({ 204 }) @@ -251,8 +241,7 @@ Mono> withDel(@QueryParam("del") String del, @HeaderParam("accept @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withDelSync(@QueryParam("del") String del, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withDelSync(@QueryParam("del") String del, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/elif") @ExpectedResponses({ 204 }) @@ -260,8 +249,7 @@ Response withDelSync(@QueryParam("del") String del, @HeaderParam("accept") @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withElif(@QueryParam("elif") String elif, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withElif(@QueryParam("elif") String elif, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/elif") @ExpectedResponses({ 204 }) @@ -269,8 +257,7 @@ Mono> withElif(@QueryParam("elif") String elif, @HeaderParam("acc @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withElifSync(@QueryParam("elif") String elif, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withElifSync(@QueryParam("elif") String elif, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/else") @ExpectedResponses({ 204 }) @@ -278,8 +265,8 @@ Response withElifSync(@QueryParam("elif") String elif, @HeaderParam("accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withElse(@QueryParam("else") String elseParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withElse(@QueryParam("else") String elseParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/else") @ExpectedResponses({ 204 }) @@ -287,8 +274,8 @@ Mono> withElse(@QueryParam("else") String elseParameter, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withElseSync(@QueryParam("else") String elseParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withElseSync(@QueryParam("else") String elseParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/except") @ExpectedResponses({ 204 }) @@ -296,8 +283,8 @@ Response withElseSync(@QueryParam("else") String elseParameter, @HeaderPar @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withExcept(@QueryParam("except") String except, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withExcept(@QueryParam("except") String except, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/except") @ExpectedResponses({ 204 }) @@ -305,8 +292,8 @@ Mono> withExcept(@QueryParam("except") String except, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withExceptSync(@QueryParam("except") String except, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withExceptSync(@QueryParam("except") String except, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/exec") @ExpectedResponses({ 204 }) @@ -314,8 +301,7 @@ Response withExceptSync(@QueryParam("except") String except, @HeaderParam( @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withExec(@QueryParam("exec") String exec, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withExec(@QueryParam("exec") String exec, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/exec") @ExpectedResponses({ 204 }) @@ -323,8 +309,7 @@ Mono> withExec(@QueryParam("exec") String exec, @HeaderParam("acc @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withExecSync(@QueryParam("exec") String exec, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withExecSync(@QueryParam("exec") String exec, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/finally") @ExpectedResponses({ 204 }) @@ -332,8 +317,8 @@ Response withExecSync(@QueryParam("exec") String exec, @HeaderParam("accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withFinally(@QueryParam("finally") String finallyParameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> withFinally(@QueryParam("finally") String finallyParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/finally") @ExpectedResponses({ 204 }) @@ -341,8 +326,8 @@ Mono> withFinally(@QueryParam("finally") String finallyParameter, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withFinallySync(@QueryParam("finally") String finallyParameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response withFinallySync(@QueryParam("finally") String finallyParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/for") @ExpectedResponses({ 204 }) @@ -350,8 +335,8 @@ Response withFinallySync(@QueryParam("finally") String finallyParameter, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withFor(@QueryParam("for") String forParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withFor(@QueryParam("for") String forParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/for") @ExpectedResponses({ 204 }) @@ -359,8 +344,8 @@ Mono> withFor(@QueryParam("for") String forParameter, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withForSync(@QueryParam("for") String forParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withForSync(@QueryParam("for") String forParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/from") @ExpectedResponses({ 204 }) @@ -368,8 +353,7 @@ Response withForSync(@QueryParam("for") String forParameter, @HeaderParam( @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withFrom(@QueryParam("from") String from, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withFrom(@QueryParam("from") String from, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/from") @ExpectedResponses({ 204 }) @@ -377,8 +361,7 @@ Mono> withFrom(@QueryParam("from") String from, @HeaderParam("acc @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withFromSync(@QueryParam("from") String from, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withFromSync(@QueryParam("from") String from, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/global") @ExpectedResponses({ 204 }) @@ -386,8 +369,8 @@ Response withFromSync(@QueryParam("from") String from, @HeaderParam("accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withGlobal(@QueryParam("global") String global, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withGlobal(@QueryParam("global") String global, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/global") @ExpectedResponses({ 204 }) @@ -395,8 +378,8 @@ Mono> withGlobal(@QueryParam("global") String global, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withGlobalSync(@QueryParam("global") String global, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withGlobalSync(@QueryParam("global") String global, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/if") @ExpectedResponses({ 204 }) @@ -404,8 +387,8 @@ Response withGlobalSync(@QueryParam("global") String global, @HeaderParam( @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withIf(@QueryParam("if") String ifParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withIf(@QueryParam("if") String ifParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/if") @ExpectedResponses({ 204 }) @@ -413,8 +396,7 @@ Mono> withIf(@QueryParam("if") String ifParameter, @HeaderParam(" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withIfSync(@QueryParam("if") String ifParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withIfSync(@QueryParam("if") String ifParameter, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/import") @ExpectedResponses({ 204 }) @@ -422,8 +404,8 @@ Response withIfSync(@QueryParam("if") String ifParameter, @HeaderParam("ac @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withImport(@QueryParam("import") String importParameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> withImport(@QueryParam("import") String importParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/import") @ExpectedResponses({ 204 }) @@ -431,8 +413,8 @@ Mono> withImport(@QueryParam("import") String importParameter, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withImportSync(@QueryParam("import") String importParameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response withImportSync(@QueryParam("import") String importParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/in") @ExpectedResponses({ 204 }) @@ -440,8 +422,7 @@ Response withImportSync(@QueryParam("import") String importParameter, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withIn(@QueryParam("in") String in, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withIn(@QueryParam("in") String in, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/in") @ExpectedResponses({ 204 }) @@ -449,8 +430,7 @@ Mono> withIn(@QueryParam("in") String in, @HeaderParam("accept") @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withInSync(@QueryParam("in") String in, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withInSync(@QueryParam("in") String in, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/is") @ExpectedResponses({ 204 }) @@ -458,8 +438,7 @@ Response withInSync(@QueryParam("in") String in, @HeaderParam("accept") St @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withIs(@QueryParam("is") String is, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withIs(@QueryParam("is") String is, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/is") @ExpectedResponses({ 204 }) @@ -467,8 +446,7 @@ Mono> withIs(@QueryParam("is") String is, @HeaderParam("accept") @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withIsSync(@QueryParam("is") String is, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withIsSync(@QueryParam("is") String is, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/lambda") @ExpectedResponses({ 204 }) @@ -476,8 +454,8 @@ Response withIsSync(@QueryParam("is") String is, @HeaderParam("accept") St @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withLambda(@QueryParam("lambda") String lambda, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withLambda(@QueryParam("lambda") String lambda, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/lambda") @ExpectedResponses({ 204 }) @@ -485,8 +463,8 @@ Mono> withLambda(@QueryParam("lambda") String lambda, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withLambdaSync(@QueryParam("lambda") String lambda, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withLambdaSync(@QueryParam("lambda") String lambda, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/not") @ExpectedResponses({ 204 }) @@ -494,8 +472,7 @@ Response withLambdaSync(@QueryParam("lambda") String lambda, @HeaderParam( @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withNot(@QueryParam("not") String not, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withNot(@QueryParam("not") String not, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/not") @ExpectedResponses({ 204 }) @@ -503,8 +480,7 @@ Mono> withNot(@QueryParam("not") String not, @HeaderParam("accept @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withNotSync(@QueryParam("not") String not, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withNotSync(@QueryParam("not") String not, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/or") @ExpectedResponses({ 204 }) @@ -512,8 +488,7 @@ Response withNotSync(@QueryParam("not") String not, @HeaderParam("accept") @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withOr(@QueryParam("or") String or, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withOr(@QueryParam("or") String or, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/or") @ExpectedResponses({ 204 }) @@ -521,8 +496,7 @@ Mono> withOr(@QueryParam("or") String or, @HeaderParam("accept") @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withOrSync(@QueryParam("or") String or, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withOrSync(@QueryParam("or") String or, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/pass") @ExpectedResponses({ 204 }) @@ -530,8 +504,7 @@ Response withOrSync(@QueryParam("or") String or, @HeaderParam("accept") St @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withPass(@QueryParam("pass") String pass, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withPass(@QueryParam("pass") String pass, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/pass") @ExpectedResponses({ 204 }) @@ -539,8 +512,7 @@ Mono> withPass(@QueryParam("pass") String pass, @HeaderParam("acc @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withPassSync(@QueryParam("pass") String pass, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withPassSync(@QueryParam("pass") String pass, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/raise") @ExpectedResponses({ 204 }) @@ -548,8 +520,8 @@ Response withPassSync(@QueryParam("pass") String pass, @HeaderParam("accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withRaise(@QueryParam("raise") String raise, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withRaise(@QueryParam("raise") String raise, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/raise") @ExpectedResponses({ 204 }) @@ -557,8 +529,7 @@ Mono> withRaise(@QueryParam("raise") String raise, @HeaderParam(" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withRaiseSync(@QueryParam("raise") String raise, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withRaiseSync(@QueryParam("raise") String raise, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/return") @ExpectedResponses({ 204 }) @@ -566,8 +537,8 @@ Response withRaiseSync(@QueryParam("raise") String raise, @HeaderParam("ac @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withReturn(@QueryParam("return") String returnParameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> withReturn(@QueryParam("return") String returnParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/return") @ExpectedResponses({ 204 }) @@ -575,8 +546,8 @@ Mono> withReturn(@QueryParam("return") String returnParameter, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withReturnSync(@QueryParam("return") String returnParameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response withReturnSync(@QueryParam("return") String returnParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/try") @ExpectedResponses({ 204 }) @@ -584,8 +555,8 @@ Response withReturnSync(@QueryParam("return") String returnParameter, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withTry(@QueryParam("try") String tryParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withTry(@QueryParam("try") String tryParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/try") @ExpectedResponses({ 204 }) @@ -593,8 +564,8 @@ Mono> withTry(@QueryParam("try") String tryParameter, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withTrySync(@QueryParam("try") String tryParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withTrySync(@QueryParam("try") String tryParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/while") @ExpectedResponses({ 204 }) @@ -602,8 +573,8 @@ Response withTrySync(@QueryParam("try") String tryParameter, @HeaderParam( @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withWhile(@QueryParam("while") String whileParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withWhile(@QueryParam("while") String whileParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/while") @ExpectedResponses({ 204 }) @@ -611,8 +582,8 @@ Mono> withWhile(@QueryParam("while") String whileParameter, @Head @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withWhileSync(@QueryParam("while") String whileParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withWhileSync(@QueryParam("while") String whileParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/with") @ExpectedResponses({ 204 }) @@ -620,8 +591,7 @@ Response withWhileSync(@QueryParam("while") String whileParameter, @Header @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withWith(@QueryParam("with") String with, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withWith(@QueryParam("with") String with, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/with") @ExpectedResponses({ 204 }) @@ -629,8 +599,7 @@ Mono> withWith(@QueryParam("with") String with, @HeaderParam("acc @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withWithSync(@QueryParam("with") String with, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withWithSync(@QueryParam("with") String with, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/yield") @ExpectedResponses({ 204 }) @@ -638,8 +607,8 @@ Response withWithSync(@QueryParam("with") String with, @HeaderParam("accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withYield(@QueryParam("yield") String yield, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withYield(@QueryParam("yield") String yield, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/yield") @ExpectedResponses({ 204 }) @@ -647,8 +616,7 @@ Mono> withYield(@QueryParam("yield") String yield, @HeaderParam(" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withYieldSync(@QueryParam("yield") String yield, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withYieldSync(@QueryParam("yield") String yield, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/cancellationToken") @ExpectedResponses({ 204 }) @@ -657,7 +625,7 @@ Response withYieldSync(@QueryParam("yield") String yield, @HeaderParam("ac @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withCancellationToken(@QueryParam("cancellationToken") String cancellationToken, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/cancellationToken") @ExpectedResponses({ 204 }) @@ -666,7 +634,7 @@ Mono> withCancellationToken(@QueryParam("cancellationToken") Stri @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response withCancellationTokenSync(@QueryParam("cancellationToken") String cancellationToken, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -682,8 +650,7 @@ Response withCancellationTokenSync(@QueryParam("cancellationToken") String */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAndWithResponseAsync(String and, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withAnd(and, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withAnd(and, requestOptions, context)); } /** @@ -699,8 +666,7 @@ public Mono> withAndWithResponseAsync(String and, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAndWithResponse(String and, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withAndSync(and, accept, requestOptions, Context.NONE); + return service.withAndSync(and, requestOptions, Context.NONE); } /** @@ -716,8 +682,7 @@ public Response withAndWithResponse(String and, RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAsWithResponseAsync(String as, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withAs(as, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withAs(as, requestOptions, context)); } /** @@ -733,8 +698,7 @@ public Mono> withAsWithResponseAsync(String as, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAsWithResponse(String as, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withAsSync(as, accept, requestOptions, Context.NONE); + return service.withAsSync(as, requestOptions, Context.NONE); } /** @@ -750,8 +714,7 @@ public Response withAsWithResponse(String as, RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAssertWithResponseAsync(String assertParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withAssert(assertParameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withAssert(assertParameter, requestOptions, context)); } /** @@ -767,8 +730,7 @@ public Mono> withAssertWithResponseAsync(String assertParameter, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAssertWithResponse(String assertParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withAssertSync(assertParameter, accept, requestOptions, Context.NONE); + return service.withAssertSync(assertParameter, requestOptions, Context.NONE); } /** @@ -784,8 +746,7 @@ public Response withAssertWithResponse(String assertParameter, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAsyncWithResponseAsync(String async, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withAsync(async, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withAsync(async, requestOptions, context)); } /** @@ -801,8 +762,7 @@ public Mono> withAsyncWithResponseAsync(String async, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAsyncWithResponse(String async, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withAsyncSync(async, accept, requestOptions, Context.NONE); + return service.withAsyncSync(async, requestOptions, Context.NONE); } /** @@ -818,8 +778,7 @@ public Response withAsyncWithResponse(String async, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAwaitWithResponseAsync(String await, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withAwait(await, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withAwait(await, requestOptions, context)); } /** @@ -835,8 +794,7 @@ public Mono> withAwaitWithResponseAsync(String await, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAwaitWithResponse(String await, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withAwaitSync(await, accept, requestOptions, Context.NONE); + return service.withAwaitSync(await, requestOptions, Context.NONE); } /** @@ -852,8 +810,7 @@ public Response withAwaitWithResponse(String await, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withBreakWithResponseAsync(String breakParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withBreak(breakParameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withBreak(breakParameter, requestOptions, context)); } /** @@ -869,8 +826,7 @@ public Mono> withBreakWithResponseAsync(String breakParameter, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withBreakWithResponse(String breakParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withBreakSync(breakParameter, accept, requestOptions, Context.NONE); + return service.withBreakSync(breakParameter, requestOptions, Context.NONE); } /** @@ -886,8 +842,7 @@ public Response withBreakWithResponse(String breakParameter, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withClassWithResponseAsync(String classParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withClass(classParameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withClass(classParameter, requestOptions, context)); } /** @@ -903,8 +858,7 @@ public Mono> withClassWithResponseAsync(String classParameter, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withClassWithResponse(String classParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withClassSync(classParameter, accept, requestOptions, Context.NONE); + return service.withClassSync(classParameter, requestOptions, Context.NONE); } /** @@ -920,8 +874,7 @@ public Response withClassWithResponse(String classParameter, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withConstructorWithResponseAsync(String constructor, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withConstructor(constructor, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withConstructor(constructor, requestOptions, context)); } /** @@ -937,8 +890,7 @@ public Mono> withConstructorWithResponseAsync(String constructor, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withConstructorWithResponse(String constructor, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withConstructorSync(constructor, accept, requestOptions, Context.NONE); + return service.withConstructorSync(constructor, requestOptions, Context.NONE); } /** @@ -954,9 +906,7 @@ public Response withConstructorWithResponse(String constructor, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withContinueWithResponseAsync(String continueParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.withContinue(continueParameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withContinue(continueParameter, requestOptions, context)); } /** @@ -972,8 +922,7 @@ public Mono> withContinueWithResponseAsync(String continueParamet */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withContinueWithResponse(String continueParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withContinueSync(continueParameter, accept, requestOptions, Context.NONE); + return service.withContinueSync(continueParameter, requestOptions, Context.NONE); } /** @@ -989,8 +938,7 @@ public Response withContinueWithResponse(String continueParameter, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withDefWithResponseAsync(String def, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withDef(def, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withDef(def, requestOptions, context)); } /** @@ -1006,8 +954,7 @@ public Mono> withDefWithResponseAsync(String def, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withDefWithResponse(String def, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withDefSync(def, accept, requestOptions, Context.NONE); + return service.withDefSync(def, requestOptions, Context.NONE); } /** @@ -1023,8 +970,7 @@ public Response withDefWithResponse(String def, RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withDelWithResponseAsync(String del, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withDel(del, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withDel(del, requestOptions, context)); } /** @@ -1040,8 +986,7 @@ public Mono> withDelWithResponseAsync(String del, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withDelWithResponse(String del, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withDelSync(del, accept, requestOptions, Context.NONE); + return service.withDelSync(del, requestOptions, Context.NONE); } /** @@ -1057,8 +1002,7 @@ public Response withDelWithResponse(String del, RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withElifWithResponseAsync(String elif, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withElif(elif, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withElif(elif, requestOptions, context)); } /** @@ -1074,8 +1018,7 @@ public Mono> withElifWithResponseAsync(String elif, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withElifWithResponse(String elif, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withElifSync(elif, accept, requestOptions, Context.NONE); + return service.withElifSync(elif, requestOptions, Context.NONE); } /** @@ -1091,8 +1034,7 @@ public Response withElifWithResponse(String elif, RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withElseWithResponseAsync(String elseParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withElse(elseParameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withElse(elseParameter, requestOptions, context)); } /** @@ -1108,8 +1050,7 @@ public Mono> withElseWithResponseAsync(String elseParameter, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withElseWithResponse(String elseParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withElseSync(elseParameter, accept, requestOptions, Context.NONE); + return service.withElseSync(elseParameter, requestOptions, Context.NONE); } /** @@ -1125,8 +1066,7 @@ public Response withElseWithResponse(String elseParameter, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withExceptWithResponseAsync(String except, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withExcept(except, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withExcept(except, requestOptions, context)); } /** @@ -1142,8 +1082,7 @@ public Mono> withExceptWithResponseAsync(String except, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withExceptWithResponse(String except, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withExceptSync(except, accept, requestOptions, Context.NONE); + return service.withExceptSync(except, requestOptions, Context.NONE); } /** @@ -1159,8 +1098,7 @@ public Response withExceptWithResponse(String except, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withExecWithResponseAsync(String exec, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withExec(exec, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withExec(exec, requestOptions, context)); } /** @@ -1176,8 +1114,7 @@ public Mono> withExecWithResponseAsync(String exec, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withExecWithResponse(String exec, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withExecSync(exec, accept, requestOptions, Context.NONE); + return service.withExecSync(exec, requestOptions, Context.NONE); } /** @@ -1193,8 +1130,7 @@ public Response withExecWithResponse(String exec, RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withFinallyWithResponseAsync(String finallyParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withFinally(finallyParameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withFinally(finallyParameter, requestOptions, context)); } /** @@ -1210,8 +1146,7 @@ public Mono> withFinallyWithResponseAsync(String finallyParameter */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withFinallyWithResponse(String finallyParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withFinallySync(finallyParameter, accept, requestOptions, Context.NONE); + return service.withFinallySync(finallyParameter, requestOptions, Context.NONE); } /** @@ -1227,8 +1162,7 @@ public Response withFinallyWithResponse(String finallyParameter, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withForWithResponseAsync(String forParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withFor(forParameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withFor(forParameter, requestOptions, context)); } /** @@ -1244,8 +1178,7 @@ public Mono> withForWithResponseAsync(String forParameter, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withForWithResponse(String forParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withForSync(forParameter, accept, requestOptions, Context.NONE); + return service.withForSync(forParameter, requestOptions, Context.NONE); } /** @@ -1261,8 +1194,7 @@ public Response withForWithResponse(String forParameter, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withFromWithResponseAsync(String from, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withFrom(from, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withFrom(from, requestOptions, context)); } /** @@ -1278,8 +1210,7 @@ public Mono> withFromWithResponseAsync(String from, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withFromWithResponse(String from, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withFromSync(from, accept, requestOptions, Context.NONE); + return service.withFromSync(from, requestOptions, Context.NONE); } /** @@ -1295,8 +1226,7 @@ public Response withFromWithResponse(String from, RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withGlobalWithResponseAsync(String global, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withGlobal(global, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withGlobal(global, requestOptions, context)); } /** @@ -1312,8 +1242,7 @@ public Mono> withGlobalWithResponseAsync(String global, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withGlobalWithResponse(String global, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withGlobalSync(global, accept, requestOptions, Context.NONE); + return service.withGlobalSync(global, requestOptions, Context.NONE); } /** @@ -1329,8 +1258,7 @@ public Response withGlobalWithResponse(String global, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withIfWithResponseAsync(String ifParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withIf(ifParameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withIf(ifParameter, requestOptions, context)); } /** @@ -1346,8 +1274,7 @@ public Mono> withIfWithResponseAsync(String ifParameter, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withIfWithResponse(String ifParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withIfSync(ifParameter, accept, requestOptions, Context.NONE); + return service.withIfSync(ifParameter, requestOptions, Context.NONE); } /** @@ -1363,8 +1290,7 @@ public Response withIfWithResponse(String ifParameter, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withImportWithResponseAsync(String importParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withImport(importParameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withImport(importParameter, requestOptions, context)); } /** @@ -1380,8 +1306,7 @@ public Mono> withImportWithResponseAsync(String importParameter, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withImportWithResponse(String importParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withImportSync(importParameter, accept, requestOptions, Context.NONE); + return service.withImportSync(importParameter, requestOptions, Context.NONE); } /** @@ -1397,8 +1322,7 @@ public Response withImportWithResponse(String importParameter, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withInWithResponseAsync(String in, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withIn(in, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withIn(in, requestOptions, context)); } /** @@ -1414,8 +1338,7 @@ public Mono> withInWithResponseAsync(String in, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withInWithResponse(String in, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withInSync(in, accept, requestOptions, Context.NONE); + return service.withInSync(in, requestOptions, Context.NONE); } /** @@ -1431,8 +1354,7 @@ public Response withInWithResponse(String in, RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withIsWithResponseAsync(String is, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withIs(is, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withIs(is, requestOptions, context)); } /** @@ -1448,8 +1370,7 @@ public Mono> withIsWithResponseAsync(String is, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withIsWithResponse(String is, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withIsSync(is, accept, requestOptions, Context.NONE); + return service.withIsSync(is, requestOptions, Context.NONE); } /** @@ -1465,8 +1386,7 @@ public Response withIsWithResponse(String is, RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withLambdaWithResponseAsync(String lambda, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withLambda(lambda, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withLambda(lambda, requestOptions, context)); } /** @@ -1482,8 +1402,7 @@ public Mono> withLambdaWithResponseAsync(String lambda, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withLambdaWithResponse(String lambda, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withLambdaSync(lambda, accept, requestOptions, Context.NONE); + return service.withLambdaSync(lambda, requestOptions, Context.NONE); } /** @@ -1499,8 +1418,7 @@ public Response withLambdaWithResponse(String lambda, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withNotWithResponseAsync(String not, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withNot(not, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withNot(not, requestOptions, context)); } /** @@ -1516,8 +1434,7 @@ public Mono> withNotWithResponseAsync(String not, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withNotWithResponse(String not, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withNotSync(not, accept, requestOptions, Context.NONE); + return service.withNotSync(not, requestOptions, Context.NONE); } /** @@ -1533,8 +1450,7 @@ public Response withNotWithResponse(String not, RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withOrWithResponseAsync(String or, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withOr(or, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withOr(or, requestOptions, context)); } /** @@ -1550,8 +1466,7 @@ public Mono> withOrWithResponseAsync(String or, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withOrWithResponse(String or, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withOrSync(or, accept, requestOptions, Context.NONE); + return service.withOrSync(or, requestOptions, Context.NONE); } /** @@ -1567,8 +1482,7 @@ public Response withOrWithResponse(String or, RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withPassWithResponseAsync(String pass, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withPass(pass, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withPass(pass, requestOptions, context)); } /** @@ -1584,8 +1498,7 @@ public Mono> withPassWithResponseAsync(String pass, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withPassWithResponse(String pass, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withPassSync(pass, accept, requestOptions, Context.NONE); + return service.withPassSync(pass, requestOptions, Context.NONE); } /** @@ -1601,8 +1514,7 @@ public Response withPassWithResponse(String pass, RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withRaiseWithResponseAsync(String raise, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withRaise(raise, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withRaise(raise, requestOptions, context)); } /** @@ -1618,8 +1530,7 @@ public Mono> withRaiseWithResponseAsync(String raise, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withRaiseWithResponse(String raise, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withRaiseSync(raise, accept, requestOptions, Context.NONE); + return service.withRaiseSync(raise, requestOptions, Context.NONE); } /** @@ -1635,8 +1546,7 @@ public Response withRaiseWithResponse(String raise, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withReturnWithResponseAsync(String returnParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withReturn(returnParameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withReturn(returnParameter, requestOptions, context)); } /** @@ -1652,8 +1562,7 @@ public Mono> withReturnWithResponseAsync(String returnParameter, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withReturnWithResponse(String returnParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withReturnSync(returnParameter, accept, requestOptions, Context.NONE); + return service.withReturnSync(returnParameter, requestOptions, Context.NONE); } /** @@ -1669,8 +1578,7 @@ public Response withReturnWithResponse(String returnParameter, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withTryWithResponseAsync(String tryParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withTry(tryParameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withTry(tryParameter, requestOptions, context)); } /** @@ -1686,8 +1594,7 @@ public Mono> withTryWithResponseAsync(String tryParameter, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withTryWithResponse(String tryParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withTrySync(tryParameter, accept, requestOptions, Context.NONE); + return service.withTrySync(tryParameter, requestOptions, Context.NONE); } /** @@ -1703,8 +1610,7 @@ public Response withTryWithResponse(String tryParameter, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withWhileWithResponseAsync(String whileParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withWhile(whileParameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withWhile(whileParameter, requestOptions, context)); } /** @@ -1720,8 +1626,7 @@ public Mono> withWhileWithResponseAsync(String whileParameter, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withWhileWithResponse(String whileParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withWhileSync(whileParameter, accept, requestOptions, Context.NONE); + return service.withWhileSync(whileParameter, requestOptions, Context.NONE); } /** @@ -1737,8 +1642,7 @@ public Response withWhileWithResponse(String whileParameter, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withWithWithResponseAsync(String with, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withWith(with, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withWith(with, requestOptions, context)); } /** @@ -1754,8 +1658,7 @@ public Mono> withWithWithResponseAsync(String with, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withWithWithResponse(String with, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withWithSync(with, accept, requestOptions, Context.NONE); + return service.withWithSync(with, requestOptions, Context.NONE); } /** @@ -1771,8 +1674,7 @@ public Response withWithWithResponse(String with, RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withYieldWithResponseAsync(String yield, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withYield(yield, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withYield(yield, requestOptions, context)); } /** @@ -1788,8 +1690,7 @@ public Mono> withYieldWithResponseAsync(String yield, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withYieldWithResponse(String yield, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withYieldSync(yield, accept, requestOptions, Context.NONE); + return service.withYieldSync(yield, requestOptions, Context.NONE); } /** @@ -1806,9 +1707,8 @@ public Response withYieldWithResponse(String yield, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withCancellationTokenWithResponseAsync(String cancellationToken, RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.withCancellationToken(cancellationToken, accept, requestOptions, context)); + .withContext(context -> service.withCancellationToken(cancellationToken, requestOptions, context)); } /** @@ -1824,7 +1724,6 @@ public Mono> withCancellationTokenWithResponseAsync(String cancel */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withCancellationTokenWithResponse(String cancellationToken, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withCancellationTokenSync(cancellationToken, accept, requestOptions, Context.NONE); + return service.withCancellationTokenSync(cancellationToken, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/BooleanValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/BooleanValuesImpl.java index 1fe41e98f7..f5491cda2e 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/BooleanValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/BooleanValuesImpl.java @@ -64,7 +64,7 @@ public interface BooleanValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/boolean") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/boolean") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/boolean") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/DatetimeValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/DatetimeValuesImpl.java index bf57043843..23fc8a8a32 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/DatetimeValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/DatetimeValuesImpl.java @@ -64,7 +64,7 @@ public interface DatetimeValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/datetime") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/datetime") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/datetime") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/DurationValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/DurationValuesImpl.java index 2ad8d29b75..76cacdd710 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/DurationValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/DurationValuesImpl.java @@ -64,7 +64,7 @@ public interface DurationValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/duration") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/duration") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/duration") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/Float32ValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/Float32ValuesImpl.java index 9ff1844849..f76500d8f5 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/Float32ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/Float32ValuesImpl.java @@ -64,7 +64,7 @@ public interface Float32ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/float32") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/float32") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/float32") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/Int32ValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/Int32ValuesImpl.java index 93c087d948..7abdd7ba1f 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/Int32ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/Int32ValuesImpl.java @@ -64,7 +64,7 @@ public interface Int32ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/int32") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/int32") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/int32") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/Int64ValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/Int64ValuesImpl.java index 5001f0f289..1acefeb409 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/Int64ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/Int64ValuesImpl.java @@ -64,7 +64,7 @@ public interface Int64ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/int64") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/int64") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/int64") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/ModelValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/ModelValuesImpl.java index b1e3161b47..62ea7c7061 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/ModelValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/ModelValuesImpl.java @@ -64,7 +64,7 @@ public interface ModelValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/model") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/model") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/model") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -176,8 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -205,7 +205,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/NullableBooleanValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/NullableBooleanValuesImpl.java index 568cdaf7d4..dbd68b10a9 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/NullableBooleanValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/NullableBooleanValuesImpl.java @@ -64,7 +64,7 @@ public interface NullableBooleanValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/nullable-boolean") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/nullable-boolean") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/nullable-boolean") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/NullableFloatValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/NullableFloatValuesImpl.java index 7ec91a5d72..f8b29edffe 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/NullableFloatValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/NullableFloatValuesImpl.java @@ -64,7 +64,7 @@ public interface NullableFloatValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/nullable-float") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/nullable-float") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/nullable-float") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/NullableInt32ValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/NullableInt32ValuesImpl.java index 2ea543029e..0fb9ab3586 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/NullableInt32ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/NullableInt32ValuesImpl.java @@ -64,7 +64,7 @@ public interface NullableInt32ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/nullable-int32") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/nullable-int32") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/nullable-int32") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/NullableModelValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/NullableModelValuesImpl.java index 1a7aa50cb1..76b06b3e8d 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/NullableModelValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/NullableModelValuesImpl.java @@ -64,7 +64,7 @@ public interface NullableModelValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/nullable-model") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/nullable-model") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/nullable-model") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -176,8 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -205,7 +205,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/NullableStringValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/NullableStringValuesImpl.java index 14d3526cf2..46748cc964 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/NullableStringValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/NullableStringValuesImpl.java @@ -64,7 +64,7 @@ public interface NullableStringValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/nullable-string") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/nullable-string") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/nullable-string") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/StringValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/StringValuesImpl.java index ef7552c5d1..e8d96abd38 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/StringValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/StringValuesImpl.java @@ -64,7 +64,7 @@ public interface StringValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/string") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/string") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/string") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/UnknownValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/UnknownValuesImpl.java index b79b8875f7..3fb3a49567 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/UnknownValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/UnknownValuesImpl.java @@ -64,7 +64,7 @@ public interface UnknownValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/unknown") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/unknown") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/unknown") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/BooleanValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/BooleanValuesImpl.java index fef9ecf811..54dcdb8e2d 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/BooleanValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/BooleanValuesImpl.java @@ -64,7 +64,7 @@ public interface BooleanValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/boolean") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/boolean") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/dictionary/boolean") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/DatetimeValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/DatetimeValuesImpl.java index 2e7fddb5c3..ea55d7e8af 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/DatetimeValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/DatetimeValuesImpl.java @@ -64,7 +64,7 @@ public interface DatetimeValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/datetime") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/datetime") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/dictionary/datetime") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/DurationValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/DurationValuesImpl.java index 112a1695e8..bed505de4e 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/DurationValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/DurationValuesImpl.java @@ -64,7 +64,7 @@ public interface DurationValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/duration") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/duration") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/dictionary/duration") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/Float32ValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/Float32ValuesImpl.java index aa131f6908..bdf89ed2f5 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/Float32ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/Float32ValuesImpl.java @@ -64,7 +64,7 @@ public interface Float32ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/float32") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/float32") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/dictionary/float32") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/Int32ValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/Int32ValuesImpl.java index 9abf4cc57e..a4f1e9d61c 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/Int32ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/Int32ValuesImpl.java @@ -64,7 +64,7 @@ public interface Int32ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/int32") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/int32") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/dictionary/int32") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/Int64ValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/Int64ValuesImpl.java index 383b89c568..168df55ef0 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/Int64ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/Int64ValuesImpl.java @@ -64,7 +64,7 @@ public interface Int64ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/int64") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/int64") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/dictionary/int64") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/ModelValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/ModelValuesImpl.java index 0a2c47ac81..be1e1e900c 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/ModelValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/ModelValuesImpl.java @@ -64,7 +64,7 @@ public interface ModelValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/model") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/model") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/dictionary/model") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -176,8 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -205,7 +205,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/NullableFloatValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/NullableFloatValuesImpl.java index c280de87dc..c9de0c5e27 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/NullableFloatValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/NullableFloatValuesImpl.java @@ -64,7 +64,7 @@ public interface NullableFloatValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/nullable-float") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/nullable-float") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/dictionary/nullable-float") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/RecursiveModelValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/RecursiveModelValuesImpl.java index e2cb88c8a2..eb9cf58a84 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/RecursiveModelValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/RecursiveModelValuesImpl.java @@ -64,7 +64,7 @@ public interface RecursiveModelValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/model/recursive") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/model/recursive") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/dictionary/model/recursive") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -176,8 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -205,7 +205,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/StringValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/StringValuesImpl.java index f175afc089..84dcefbc08 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/StringValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/StringValuesImpl.java @@ -64,7 +64,7 @@ public interface StringValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/string") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/string") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/dictionary/string") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/UnknownValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/UnknownValuesImpl.java index db4156cabc..7726abff65 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/UnknownValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/UnknownValuesImpl.java @@ -64,7 +64,7 @@ public interface UnknownValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/unknown") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/unknown") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/dictionary/unknown") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/enums/extensible/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/enums/extensible/implementation/StringOperationsImpl.java index cd5194e3e2..1bd58d59f1 100644 --- a/typespec-tests/src/main/java/com/type/enums/extensible/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/enums/extensible/implementation/StringOperationsImpl.java @@ -64,7 +64,7 @@ public interface StringOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getKnownValue(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getKnownValue(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/enum/extensible/string/known-value") @@ -73,7 +73,7 @@ Mono> getKnownValue(@HeaderParam("accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getKnownValueSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getKnownValueSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/enum/extensible/string/unknown-value") @@ -82,7 +82,7 @@ Response getKnownValueSync(@HeaderParam("accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getUnknownValue(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getUnknownValue(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/enum/extensible/string/unknown-value") @@ -91,7 +91,7 @@ Mono> getUnknownValue(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getUnknownValueSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getUnknownValueSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/enum/extensible/string/known-value") @@ -100,7 +100,7 @@ Response getUnknownValueSync(@HeaderParam("accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putKnownValue(@HeaderParam("accept") String accept, + Mono> putKnownValue(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/enum/extensible/string/known-value") @@ -109,7 +109,7 @@ Mono> putKnownValue(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putKnownValueSync(@HeaderParam("accept") String accept, + Response putKnownValueSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/enum/extensible/string/unknown-value") @@ -118,7 +118,7 @@ Response putKnownValueSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putUnknownValue(@HeaderParam("accept") String accept, + Mono> putUnknownValue(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/enum/extensible/string/unknown-value") @@ -127,7 +127,7 @@ Mono> putUnknownValue(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putUnknownValueSync(@HeaderParam("accept") String accept, + Response putUnknownValueSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -233,8 +233,8 @@ public Response getUnknownValueWithResponse(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putKnownValueWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putKnownValue(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putKnownValue(contentType, body, requestOptions, context)); } /** @@ -255,8 +255,8 @@ public Mono> putKnownValueWithResponseAsync(BinaryData body, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putKnownValueWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putKnownValueSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putKnownValueSync(contentType, body, requestOptions, Context.NONE); } /** @@ -277,8 +277,8 @@ public Response putKnownValueWithResponse(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putUnknownValueWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putUnknownValue(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putUnknownValue(contentType, body, requestOptions, context)); } /** @@ -299,7 +299,7 @@ public Mono> putUnknownValueWithResponseAsync(BinaryData body, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putUnknownValueWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putUnknownValueSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putUnknownValueSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/enums/fixed/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/enums/fixed/implementation/StringOperationsImpl.java index 62604da0a7..e5b90d1241 100644 --- a/typespec-tests/src/main/java/com/type/enums/fixed/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/enums/fixed/implementation/StringOperationsImpl.java @@ -64,7 +64,7 @@ public interface StringOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getKnownValue(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getKnownValue(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/enum/fixed/string/known-value") @@ -73,7 +73,7 @@ Mono> getKnownValue(@HeaderParam("accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getKnownValueSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getKnownValueSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/enum/fixed/string/known-value") @@ -82,7 +82,7 @@ Response getKnownValueSync(@HeaderParam("accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putKnownValue(@HeaderParam("accept") String accept, + Mono> putKnownValue(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/enum/fixed/string/known-value") @@ -91,7 +91,7 @@ Mono> putKnownValue(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putKnownValueSync(@HeaderParam("accept") String accept, + Response putKnownValueSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/enum/fixed/string/unknown-value") @@ -100,7 +100,7 @@ Response putKnownValueSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putUnknownValue(@HeaderParam("accept") String accept, + Mono> putUnknownValue(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/enum/fixed/string/unknown-value") @@ -109,7 +109,7 @@ Mono> putUnknownValue(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putUnknownValueSync(@HeaderParam("accept") String accept, + Response putUnknownValueSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -173,8 +173,8 @@ public Response getKnownValueWithResponse(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putKnownValueWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putKnownValue(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putKnownValue(contentType, body, requestOptions, context)); } /** @@ -195,8 +195,8 @@ public Mono> putKnownValueWithResponseAsync(BinaryData body, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putKnownValueWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putKnownValueSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putKnownValueSync(contentType, body, requestOptions, Context.NONE); } /** @@ -217,8 +217,8 @@ public Response putKnownValueWithResponse(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putUnknownValueWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putUnknownValue(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putUnknownValue(contentType, body, requestOptions, context)); } /** @@ -239,7 +239,7 @@ public Mono> putUnknownValueWithResponseAsync(BinaryData body, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putUnknownValueWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putUnknownValueSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putUnknownValueSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/model/empty/implementation/EmptyClientImpl.java b/typespec-tests/src/main/java/com/type/model/empty/implementation/EmptyClientImpl.java index d71e6ad6dc..38edf448b7 100644 --- a/typespec-tests/src/main/java/com/type/model/empty/implementation/EmptyClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/empty/implementation/EmptyClientImpl.java @@ -111,7 +111,7 @@ public interface EmptyClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putEmpty(@HeaderParam("accept") String accept, + Mono> putEmpty(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/empty/alone") @@ -120,7 +120,7 @@ Mono> putEmpty(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putEmptySync(@HeaderParam("accept") String accept, + Response putEmptySync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/empty/alone") @@ -129,7 +129,7 @@ Response putEmptySync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getEmpty(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getEmpty(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/empty/alone") @@ -138,7 +138,7 @@ Mono> getEmpty(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getEmptySync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getEmptySync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/model/empty/round-trip") @@ -147,8 +147,9 @@ Response getEmptySync(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> postRoundTripEmpty(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> postRoundTripEmpty(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/type/model/empty/round-trip") @ExpectedResponses({ 200 }) @@ -156,8 +157,9 @@ Mono> postRoundTripEmpty(@HeaderParam("accept") String acce @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postRoundTripEmptySync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response postRoundTripEmptySync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -178,8 +180,8 @@ Response postRoundTripEmptySync(@HeaderParam("accept") String accept */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putEmpty(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putEmpty(contentType, input, requestOptions, context)); } /** @@ -200,8 +202,8 @@ public Mono> putEmptyWithResponseAsync(BinaryData input, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putEmptyWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putEmptySync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putEmptySync(contentType, input, requestOptions, Context.NONE); } /** @@ -273,8 +275,10 @@ public Response getEmptyWithResponse(RequestOptions requestOptions) @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postRoundTripEmptyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.postRoundTripEmpty(accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.postRoundTripEmpty(contentType, accept, body, requestOptions, context)); } /** @@ -301,7 +305,8 @@ public Mono> postRoundTripEmptyWithResponseAsync(BinaryData */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postRoundTripEmptyWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.postRoundTripEmptySync(accept, body, requestOptions, Context.NONE); + return service.postRoundTripEmptySync(contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/model/flatten/implementation/FlattenClientImpl.java b/typespec-tests/src/main/java/com/type/model/flatten/implementation/FlattenClientImpl.java index c3eac4fd0f..78c29caa76 100644 --- a/typespec-tests/src/main/java/com/type/model/flatten/implementation/FlattenClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/flatten/implementation/FlattenClientImpl.java @@ -109,8 +109,9 @@ public interface FlattenClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putFlattenModel(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> putFlattenModel(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Put("/type/model/flatten/flattenModel") @ExpectedResponses({ 200 }) @@ -118,8 +119,9 @@ Mono> putFlattenModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putFlattenModelSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response putFlattenModelSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Put("/type/model/flatten/nestedFlattenModel") @ExpectedResponses({ 200 }) @@ -127,8 +129,9 @@ Response putFlattenModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putNestedFlattenModel(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> putNestedFlattenModel(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Put("/type/model/flatten/nestedFlattenModel") @ExpectedResponses({ 200 }) @@ -136,8 +139,9 @@ Mono> putNestedFlattenModel(@HeaderParam("accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putNestedFlattenModelSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response putNestedFlattenModelSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); } /** @@ -178,8 +182,10 @@ Response putNestedFlattenModelSync(@HeaderParam("accept") String acc @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putFlattenModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putFlattenModel(accept, input, requestOptions, context)); + return FluxUtil + .withContext(context -> service.putFlattenModel(contentType, accept, input, requestOptions, context)); } /** @@ -218,8 +224,9 @@ public Mono> putFlattenModelWithResponseAsync(BinaryData in */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putFlattenModelWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.putFlattenModelSync(accept, input, requestOptions, Context.NONE); + return service.putFlattenModelSync(contentType, accept, input, requestOptions, Context.NONE); } /** @@ -266,8 +273,10 @@ public Response putFlattenModelWithResponse(BinaryData input, Reques @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNestedFlattenModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putNestedFlattenModel(accept, input, requestOptions, context)); + return FluxUtil + .withContext(context -> service.putNestedFlattenModel(contentType, accept, input, requestOptions, context)); } /** @@ -312,7 +321,8 @@ public Mono> putNestedFlattenModelWithResponseAsync(BinaryD */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putNestedFlattenModelWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.putNestedFlattenModelSync(accept, input, requestOptions, Context.NONE); + return service.putNestedFlattenModelSync(contentType, accept, input, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorAsyncClient.java b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorAsyncClient.java index f75a57ccab..9220524eb4 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorAsyncClient.java @@ -105,7 +105,8 @@ public Mono> putExtensibleModelWithResponse(BinaryData input, Req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model omitting the discriminator along with {@link Response} on successful completion of {@link Mono}. + * @return test extensible enum type for discriminator along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -130,8 +131,8 @@ public Mono> putExtensibleModelWithResponse(BinaryData input, Req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model containing discriminator value never defined along with {@link Response} on successful completion - * of {@link Mono}. + * @return test extensible enum type for discriminator along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -205,7 +206,8 @@ public Mono> putFixedModelWithResponse(BinaryData input, RequestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model omitting the discriminator along with {@link Response} on successful completion of {@link Mono}. + * @return test fixed enum type for discriminator along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -229,8 +231,8 @@ public Mono> getFixedModelMissingDiscriminatorWithResponse( * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model containing discriminator value never defined along with {@link Response} on successful completion - * of {@link Mono}. + * @return test fixed enum type for discriminator along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -285,7 +287,7 @@ public Mono putExtensibleModel(Dog input) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a model omitting the discriminator on successful completion of {@link Mono}. + * @return test extensible enum type for discriminator on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -304,7 +306,7 @@ public Mono getExtensibleModelMissingDiscriminator() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a model containing discriminator value never defined on successful completion of {@link Mono}. + * @return test extensible enum type for discriminator on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -362,7 +364,7 @@ public Mono putFixedModel(Snake input) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a model omitting the discriminator on successful completion of {@link Mono}. + * @return test fixed enum type for discriminator on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -381,7 +383,7 @@ public Mono getFixedModelMissingDiscriminator() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a model containing discriminator value never defined on successful completion of {@link Mono}. + * @return test fixed enum type for discriminator on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorClient.java b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorClient.java index 5ab61e86e0..3ab5802713 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorClient.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorClient.java @@ -102,7 +102,7 @@ public Response putExtensibleModelWithResponse(BinaryData input, RequestOp * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model omitting the discriminator along with {@link Response}. + * @return test extensible enum type for discriminator along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -126,7 +126,7 @@ public Response getExtensibleModelMissingDiscriminatorWithResponse(R * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model containing discriminator value never defined along with {@link Response}. + * @return test extensible enum type for discriminator along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -199,7 +199,7 @@ public Response putFixedModelWithResponse(BinaryData input, RequestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model omitting the discriminator along with {@link Response}. + * @return test fixed enum type for discriminator along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -223,7 +223,7 @@ public Response getFixedModelMissingDiscriminatorWithResponse(Reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model containing discriminator value never defined along with {@link Response}. + * @return test fixed enum type for discriminator along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -276,7 +276,7 @@ public void putExtensibleModel(Dog input) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a model omitting the discriminator. + * @return test extensible enum type for discriminator. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -294,7 +294,7 @@ public Dog getExtensibleModelMissingDiscriminator() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a model containing discriminator value never defined. + * @return test extensible enum type for discriminator. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -349,7 +349,7 @@ public void putFixedModel(Snake input) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a model omitting the discriminator. + * @return test fixed enum type for discriminator. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -367,7 +367,7 @@ public Snake getFixedModelMissingDiscriminator() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a model containing discriminator value never defined. + * @return test fixed enum type for discriminator. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/implementation/EnumDiscriminatorClientImpl.java b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/implementation/EnumDiscriminatorClientImpl.java index fd4879ceef..a7209ae879 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/implementation/EnumDiscriminatorClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/implementation/EnumDiscriminatorClientImpl.java @@ -112,7 +112,7 @@ public interface EnumDiscriminatorClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getExtensibleModel(@HeaderParam("accept") String accept, + Mono> getExtensibleModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/extensible-enum") @@ -121,7 +121,7 @@ Mono> getExtensibleModel(@HeaderParam("accept") String acce @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getExtensibleModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getExtensibleModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-discriminator/extensible-enum") @@ -130,7 +130,7 @@ Response getExtensibleModelSync(@HeaderParam("accept") String accept @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putExtensibleModel(@HeaderParam("accept") String accept, + Mono> putExtensibleModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-discriminator/extensible-enum") @@ -139,7 +139,7 @@ Mono> putExtensibleModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putExtensibleModelSync(@HeaderParam("accept") String accept, + Response putExtensibleModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/extensible-enum/missingdiscriminator") @@ -148,7 +148,7 @@ Response putExtensibleModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getExtensibleModelMissingDiscriminator(@HeaderParam("accept") String accept, + Mono> getExtensibleModelMissingDiscriminator(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/extensible-enum/missingdiscriminator") @@ -157,7 +157,7 @@ Mono> getExtensibleModelMissingDiscriminator(@HeaderParam(" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getExtensibleModelMissingDiscriminatorSync(@HeaderParam("accept") String accept, + Response getExtensibleModelMissingDiscriminatorSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/extensible-enum/wrongdiscriminator") @@ -166,7 +166,7 @@ Response getExtensibleModelMissingDiscriminatorSync(@HeaderParam("ac @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getExtensibleModelWrongDiscriminator(@HeaderParam("accept") String accept, + Mono> getExtensibleModelWrongDiscriminator(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/extensible-enum/wrongdiscriminator") @@ -175,7 +175,7 @@ Mono> getExtensibleModelWrongDiscriminator(@HeaderParam("ac @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getExtensibleModelWrongDiscriminatorSync(@HeaderParam("accept") String accept, + Response getExtensibleModelWrongDiscriminatorSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/fixed-enum") @@ -184,7 +184,7 @@ Response getExtensibleModelWrongDiscriminatorSync(@HeaderParam("acce @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getFixedModel(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getFixedModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/fixed-enum") @@ -193,7 +193,7 @@ Mono> getFixedModel(@HeaderParam("accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getFixedModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getFixedModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-discriminator/fixed-enum") @@ -202,7 +202,7 @@ Response getFixedModelSync(@HeaderParam("accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putFixedModel(@HeaderParam("accept") String accept, + Mono> putFixedModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-discriminator/fixed-enum") @@ -211,7 +211,7 @@ Mono> putFixedModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putFixedModelSync(@HeaderParam("accept") String accept, + Response putFixedModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/fixed-enum/missingdiscriminator") @@ -220,7 +220,7 @@ Response putFixedModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getFixedModelMissingDiscriminator(@HeaderParam("accept") String accept, + Mono> getFixedModelMissingDiscriminator(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/fixed-enum/missingdiscriminator") @@ -229,7 +229,7 @@ Mono> getFixedModelMissingDiscriminator(@HeaderParam("accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getFixedModelMissingDiscriminatorSync(@HeaderParam("accept") String accept, + Response getFixedModelMissingDiscriminatorSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/fixed-enum/wrongdiscriminator") @@ -238,7 +238,7 @@ Response getFixedModelMissingDiscriminatorSync(@HeaderParam("accept" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getFixedModelWrongDiscriminator(@HeaderParam("accept") String accept, + Mono> getFixedModelWrongDiscriminator(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/fixed-enum/wrongdiscriminator") @@ -247,7 +247,7 @@ Mono> getFixedModelWrongDiscriminator(@HeaderParam("accept" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getFixedModelWrongDiscriminatorSync(@HeaderParam("accept") String accept, + Response getFixedModelWrongDiscriminatorSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -321,8 +321,8 @@ public Response getExtensibleModelWithResponse(RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putExtensibleModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putExtensibleModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putExtensibleModel(contentType, input, requestOptions, context)); } /** @@ -346,8 +346,8 @@ public Mono> putExtensibleModelWithResponseAsync(BinaryData input */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putExtensibleModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putExtensibleModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putExtensibleModelSync(contentType, input, requestOptions, Context.NONE); } /** @@ -366,7 +366,8 @@ public Response putExtensibleModelWithResponse(BinaryData input, RequestOp * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model omitting the discriminator along with {@link Response} on successful completion of {@link Mono}. + * @return test extensible enum type for discriminator along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> @@ -392,7 +393,7 @@ public Response putExtensibleModelWithResponse(BinaryData input, RequestOp * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model omitting the discriminator along with {@link Response}. + * @return test extensible enum type for discriminator along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getExtensibleModelMissingDiscriminatorWithResponse(RequestOptions requestOptions) { @@ -416,8 +417,8 @@ public Response getExtensibleModelMissingDiscriminatorWithResponse(R * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model containing discriminator value never defined along with {@link Response} on successful completion - * of {@link Mono}. + * @return test extensible enum type for discriminator along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> @@ -443,7 +444,7 @@ public Response getExtensibleModelMissingDiscriminatorWithResponse(R * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model containing discriminator value never defined along with {@link Response}. + * @return test extensible enum type for discriminator along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getExtensibleModelWrongDiscriminatorWithResponse(RequestOptions requestOptions) { @@ -521,8 +522,8 @@ public Response getFixedModelWithResponse(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putFixedModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putFixedModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putFixedModel(contentType, input, requestOptions, context)); } /** @@ -546,8 +547,8 @@ public Mono> putFixedModelWithResponseAsync(BinaryData input, Req */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putFixedModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putFixedModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putFixedModelSync(contentType, input, requestOptions, Context.NONE); } /** @@ -566,7 +567,8 @@ public Response putFixedModelWithResponse(BinaryData input, RequestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model omitting the discriminator along with {@link Response} on successful completion of {@link Mono}. + * @return test fixed enum type for discriminator along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> @@ -592,7 +594,7 @@ public Response putFixedModelWithResponse(BinaryData input, RequestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model omitting the discriminator along with {@link Response}. + * @return test fixed enum type for discriminator along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getFixedModelMissingDiscriminatorWithResponse(RequestOptions requestOptions) { @@ -616,8 +618,8 @@ public Response getFixedModelMissingDiscriminatorWithResponse(Reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model containing discriminator value never defined along with {@link Response} on successful completion - * of {@link Mono}. + * @return test fixed enum type for discriminator along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getFixedModelWrongDiscriminatorWithResponseAsync(RequestOptions requestOptions) { @@ -642,7 +644,7 @@ public Mono> getFixedModelWrongDiscriminatorWithResponseAsy * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model containing discriminator value never defined along with {@link Response}. + * @return test fixed enum type for discriminator along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getFixedModelWrongDiscriminatorWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/enumnesteddiscriminator/implementation/EnumNestedDiscriminatorClientImpl.java b/typespec-tests/src/main/java/com/type/model/inheritance/enumnesteddiscriminator/implementation/EnumNestedDiscriminatorClientImpl.java index 92fe6ffd6d..eec907b6e9 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/enumnesteddiscriminator/implementation/EnumNestedDiscriminatorClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/enumnesteddiscriminator/implementation/EnumNestedDiscriminatorClientImpl.java @@ -112,7 +112,7 @@ public interface EnumNestedDiscriminatorClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getModel(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/model") @@ -121,7 +121,7 @@ Mono> getModel(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-nested-discriminator/model") @@ -130,7 +130,7 @@ Response getModelSync(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putModel(@HeaderParam("accept") String accept, + Mono> putModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-nested-discriminator/model") @@ -139,7 +139,7 @@ Mono> putModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putModelSync(@HeaderParam("accept") String accept, + Response putModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/recursivemodel") @@ -148,7 +148,7 @@ Response putModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getRecursiveModel(@HeaderParam("accept") String accept, + Mono> getRecursiveModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/recursivemodel") @@ -157,7 +157,7 @@ Mono> getRecursiveModel(@HeaderParam("accept") String accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getRecursiveModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getRecursiveModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-nested-discriminator/recursivemodel") @@ -166,7 +166,7 @@ Response getRecursiveModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putRecursiveModel(@HeaderParam("accept") String accept, + Mono> putRecursiveModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-nested-discriminator/recursivemodel") @@ -175,7 +175,7 @@ Mono> putRecursiveModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putRecursiveModelSync(@HeaderParam("accept") String accept, + Response putRecursiveModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/missingdiscriminator") @@ -184,7 +184,7 @@ Response putRecursiveModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getMissingDiscriminator(@HeaderParam("accept") String accept, + Mono> getMissingDiscriminator(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/missingdiscriminator") @@ -193,7 +193,7 @@ Mono> getMissingDiscriminator(@HeaderParam("accept") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getMissingDiscriminatorSync(@HeaderParam("accept") String accept, + Response getMissingDiscriminatorSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/wrongdiscriminator") @@ -202,7 +202,7 @@ Response getMissingDiscriminatorSync(@HeaderParam("accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getWrongDiscriminator(@HeaderParam("accept") String accept, + Mono> getWrongDiscriminator(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/wrongdiscriminator") @@ -211,7 +211,7 @@ Mono> getWrongDiscriminator(@HeaderParam("accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getWrongDiscriminatorSync(@HeaderParam("accept") String accept, + Response getWrongDiscriminatorSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -286,8 +286,8 @@ public Response getModelWithResponse(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putModel(contentType, input, requestOptions, context)); } /** @@ -311,8 +311,8 @@ public Mono> putModelWithResponseAsync(BinaryData input, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putModelSync(contentType, input, requestOptions, Context.NONE); } /** @@ -386,8 +386,8 @@ public Response getRecursiveModelWithResponse(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putRecursiveModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putRecursiveModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putRecursiveModel(contentType, input, requestOptions, context)); } /** @@ -411,8 +411,8 @@ public Mono> putRecursiveModelWithResponseAsync(BinaryData input, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putRecursiveModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putRecursiveModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putRecursiveModelSync(contentType, input, requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/nesteddiscriminator/implementation/NestedDiscriminatorClientImpl.java b/typespec-tests/src/main/java/com/type/model/inheritance/nesteddiscriminator/implementation/NestedDiscriminatorClientImpl.java index 0872049d53..b6b85a870f 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/nesteddiscriminator/implementation/NestedDiscriminatorClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/nesteddiscriminator/implementation/NestedDiscriminatorClientImpl.java @@ -112,7 +112,7 @@ public interface NestedDiscriminatorClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getModel(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/model") @@ -121,7 +121,7 @@ Mono> getModel(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/nested-discriminator/model") @@ -130,7 +130,7 @@ Response getModelSync(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putModel(@HeaderParam("accept") String accept, + Mono> putModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/nested-discriminator/model") @@ -139,7 +139,7 @@ Mono> putModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putModelSync(@HeaderParam("accept") String accept, + Response putModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/recursivemodel") @@ -148,7 +148,7 @@ Response putModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getRecursiveModel(@HeaderParam("accept") String accept, + Mono> getRecursiveModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/recursivemodel") @@ -157,7 +157,7 @@ Mono> getRecursiveModel(@HeaderParam("accept") String accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getRecursiveModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getRecursiveModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/nested-discriminator/recursivemodel") @@ -166,7 +166,7 @@ Response getRecursiveModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putRecursiveModel(@HeaderParam("accept") String accept, + Mono> putRecursiveModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/nested-discriminator/recursivemodel") @@ -175,7 +175,7 @@ Mono> putRecursiveModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putRecursiveModelSync(@HeaderParam("accept") String accept, + Response putRecursiveModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/missingdiscriminator") @@ -184,7 +184,7 @@ Response putRecursiveModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getMissingDiscriminator(@HeaderParam("accept") String accept, + Mono> getMissingDiscriminator(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/missingdiscriminator") @@ -193,7 +193,7 @@ Mono> getMissingDiscriminator(@HeaderParam("accept") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getMissingDiscriminatorSync(@HeaderParam("accept") String accept, + Response getMissingDiscriminatorSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/wrongdiscriminator") @@ -202,7 +202,7 @@ Response getMissingDiscriminatorSync(@HeaderParam("accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getWrongDiscriminator(@HeaderParam("accept") String accept, + Mono> getWrongDiscriminator(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/wrongdiscriminator") @@ -211,7 +211,7 @@ Mono> getWrongDiscriminator(@HeaderParam("accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getWrongDiscriminatorSync(@HeaderParam("accept") String accept, + Response getWrongDiscriminatorSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -286,8 +286,8 @@ public Response getModelWithResponse(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putModel(contentType, input, requestOptions, context)); } /** @@ -311,8 +311,8 @@ public Mono> putModelWithResponseAsync(BinaryData input, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putModelSync(contentType, input, requestOptions, Context.NONE); } /** @@ -386,8 +386,8 @@ public Response getRecursiveModelWithResponse(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putRecursiveModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putRecursiveModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putRecursiveModel(contentType, input, requestOptions, context)); } /** @@ -411,8 +411,8 @@ public Mono> putRecursiveModelWithResponseAsync(BinaryData input, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putRecursiveModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putRecursiveModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putRecursiveModelSync(contentType, input, requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/notdiscriminated/implementation/NotDiscriminatedClientImpl.java b/typespec-tests/src/main/java/com/type/model/inheritance/notdiscriminated/implementation/NotDiscriminatedClientImpl.java index 95a7d97592..e1917b4818 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/notdiscriminated/implementation/NotDiscriminatedClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/notdiscriminated/implementation/NotDiscriminatedClientImpl.java @@ -113,7 +113,7 @@ public interface NotDiscriminatedClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> postValid(@HeaderParam("accept") String accept, + Mono> postValid(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Post("/type/model/inheritance/not-discriminated/valid") @@ -122,7 +122,7 @@ Mono> postValid(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postValidSync(@HeaderParam("accept") String accept, + Response postValidSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/not-discriminated/valid") @@ -131,7 +131,7 @@ Response postValidSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getValid(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getValid(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/not-discriminated/valid") @@ -140,7 +140,7 @@ Mono> getValid(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getValidSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getValidSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/not-discriminated/valid") @@ -149,8 +149,9 @@ Response getValidSync(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putValid(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> putValid(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/not-discriminated/valid") @ExpectedResponses({ 200 }) @@ -158,8 +159,9 @@ Mono> putValid(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putValidSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response putValidSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); } /** @@ -184,8 +186,8 @@ Response putValidSync(@HeaderParam("accept") String accept, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postValidWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.postValid(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.postValid(contentType, input, requestOptions, context)); } /** @@ -210,8 +212,8 @@ public Mono> postValidWithResponseAsync(BinaryData input, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postValidWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.postValidSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.postValidSync(contentType, input, requestOptions, Context.NONE); } /** @@ -298,8 +300,9 @@ public Response getValidWithResponse(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(accept, input, requestOptions, context)); + return FluxUtil.withContext(context -> service.putValid(contentType, accept, input, requestOptions, context)); } /** @@ -334,7 +337,8 @@ public Mono> putValidWithResponseAsync(BinaryData input, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putValidWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.putValidSync(accept, input, requestOptions, Context.NONE); + return service.putValidSync(contentType, accept, input, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/recursive/implementation/RecursiveClientImpl.java b/typespec-tests/src/main/java/com/type/model/inheritance/recursive/implementation/RecursiveClientImpl.java index 977d2a16db..c322a2eabe 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/recursive/implementation/RecursiveClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/recursive/implementation/RecursiveClientImpl.java @@ -111,8 +111,8 @@ public interface RecursiveClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/recursive") @ExpectedResponses({ 204 }) @@ -120,8 +120,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/recursive") @ExpectedResponses({ 200 }) @@ -129,7 +129,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/recursive") @@ -138,7 +138,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -165,8 +165,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, input, requestOptions, context)); } /** @@ -192,8 +192,8 @@ public Mono> putWithResponseAsync(BinaryData input, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, input, requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/singlediscriminator/implementation/SingleDiscriminatorClientImpl.java b/typespec-tests/src/main/java/com/type/model/inheritance/singlediscriminator/implementation/SingleDiscriminatorClientImpl.java index d3b10c2328..fa7e8515da 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/singlediscriminator/implementation/SingleDiscriminatorClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/singlediscriminator/implementation/SingleDiscriminatorClientImpl.java @@ -112,7 +112,7 @@ public interface SingleDiscriminatorClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getModel(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/model") @@ -121,7 +121,7 @@ Mono> getModel(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/single-discriminator/model") @@ -130,7 +130,7 @@ Response getModelSync(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putModel(@HeaderParam("accept") String accept, + Mono> putModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/single-discriminator/model") @@ -139,7 +139,7 @@ Mono> putModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putModelSync(@HeaderParam("accept") String accept, + Response putModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/recursivemodel") @@ -148,7 +148,7 @@ Response putModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getRecursiveModel(@HeaderParam("accept") String accept, + Mono> getRecursiveModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/recursivemodel") @@ -157,7 +157,7 @@ Mono> getRecursiveModel(@HeaderParam("accept") String accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getRecursiveModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getRecursiveModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/single-discriminator/recursivemodel") @@ -166,7 +166,7 @@ Response getRecursiveModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putRecursiveModel(@HeaderParam("accept") String accept, + Mono> putRecursiveModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/single-discriminator/recursivemodel") @@ -175,7 +175,7 @@ Mono> putRecursiveModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putRecursiveModelSync(@HeaderParam("accept") String accept, + Response putRecursiveModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/missingdiscriminator") @@ -184,7 +184,7 @@ Response putRecursiveModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getMissingDiscriminator(@HeaderParam("accept") String accept, + Mono> getMissingDiscriminator(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/missingdiscriminator") @@ -193,7 +193,7 @@ Mono> getMissingDiscriminator(@HeaderParam("accept") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getMissingDiscriminatorSync(@HeaderParam("accept") String accept, + Response getMissingDiscriminatorSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/wrongdiscriminator") @@ -202,7 +202,7 @@ Response getMissingDiscriminatorSync(@HeaderParam("accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getWrongDiscriminator(@HeaderParam("accept") String accept, + Mono> getWrongDiscriminator(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/wrongdiscriminator") @@ -211,7 +211,7 @@ Mono> getWrongDiscriminator(@HeaderParam("accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getWrongDiscriminatorSync(@HeaderParam("accept") String accept, + Response getWrongDiscriminatorSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/legacy-model") @@ -220,7 +220,7 @@ Response getWrongDiscriminatorSync(@HeaderParam("accept") String acc @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getLegacyModel(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getLegacyModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/legacy-model") @@ -229,7 +229,7 @@ Mono> getLegacyModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getLegacyModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getLegacyModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -304,8 +304,8 @@ public Response getModelWithResponse(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putModel(contentType, input, requestOptions, context)); } /** @@ -329,8 +329,8 @@ public Mono> putModelWithResponseAsync(BinaryData input, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putModelSync(contentType, input, requestOptions, Context.NONE); } /** @@ -404,8 +404,8 @@ public Response getRecursiveModelWithResponse(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putRecursiveModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putRecursiveModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putRecursiveModel(contentType, input, requestOptions, context)); } /** @@ -429,8 +429,8 @@ public Mono> putRecursiveModelWithResponseAsync(BinaryData input, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putRecursiveModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putRecursiveModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putRecursiveModelSync(contentType, input, requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/type/model/usage/implementation/UsageClientImpl.java b/typespec-tests/src/main/java/com/type/model/usage/implementation/UsageClientImpl.java index 033a927fc0..49ac156331 100644 --- a/typespec-tests/src/main/java/com/type/model/usage/implementation/UsageClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/usage/implementation/UsageClientImpl.java @@ -110,7 +110,7 @@ public interface UsageClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> input(@HeaderParam("accept") String accept, + Mono> input(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Post("/type/model/usage/input") @@ -119,8 +119,8 @@ Mono> input(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response inputSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, - RequestOptions requestOptions, Context context); + Response inputSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/usage/output") @ExpectedResponses({ 200 }) @@ -128,7 +128,7 @@ Response inputSync(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> output(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> output(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/usage/output") @@ -137,7 +137,7 @@ Mono> output(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response outputSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response outputSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/model/usage/input-output") @@ -146,8 +146,9 @@ Response outputSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> inputAndOutput(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> inputAndOutput(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/type/model/usage/input-output") @ExpectedResponses({ 200 }) @@ -155,8 +156,9 @@ Mono> inputAndOutput(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response inputAndOutputSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response inputAndOutputSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -179,8 +181,8 @@ Response inputAndOutputSync(@HeaderParam("accept") String accept, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> inputWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.input(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.input(contentType, input, requestOptions, context)); } /** @@ -203,8 +205,8 @@ public Mono> inputWithResponseAsync(BinaryData input, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response inputWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.inputSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.inputSync(contentType, input, requestOptions, Context.NONE); } /** @@ -283,8 +285,10 @@ public Response outputWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> inputAndOutputWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.inputAndOutput(accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.inputAndOutput(contentType, accept, body, requestOptions, context)); } /** @@ -315,7 +319,8 @@ public Mono> inputAndOutputWithResponseAsync(BinaryData bod */ @ServiceMethod(returns = ReturnType.SINGLE) public Response inputAndOutputWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.inputAndOutputSync(accept, body, requestOptions, Context.NONE); + return service.inputAndOutputSync(contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/model/visibility/implementation/VisibilityClientImpl.java b/typespec-tests/src/main/java/com/type/model/visibility/implementation/VisibilityClientImpl.java index 9c7fb72e81..f611891806 100644 --- a/typespec-tests/src/main/java/com/type/model/visibility/implementation/VisibilityClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/visibility/implementation/VisibilityClientImpl.java @@ -115,8 +115,9 @@ public interface VisibilityClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getModel(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> getModel(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Get("/type/model/visibility") @ExpectedResponses({ 200 }) @@ -124,8 +125,9 @@ Mono> getModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getModelSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response getModelSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Head("/type/model/visibility") @ExpectedResponses({ 200 }) @@ -133,7 +135,7 @@ Response getModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> headModel(@HeaderParam("accept") String accept, + Mono> headModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Head("/type/model/visibility") @@ -142,7 +144,7 @@ Mono> headModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response headModelSync(@HeaderParam("accept") String accept, + Response headModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/visibility") @@ -151,7 +153,7 @@ Response headModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putModel(@HeaderParam("accept") String accept, + Mono> putModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/visibility") @@ -160,7 +162,7 @@ Mono> putModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putModelSync(@HeaderParam("accept") String accept, + Response putModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Patch("/type/model/visibility") @@ -169,7 +171,7 @@ Response putModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> patchModel(@HeaderParam("accept") String accept, + Mono> patchModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Patch("/type/model/visibility") @@ -178,7 +180,7 @@ Mono> patchModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response patchModelSync(@HeaderParam("accept") String accept, + Response patchModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Post("/type/model/visibility") @@ -187,7 +189,7 @@ Response patchModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> postModel(@HeaderParam("accept") String accept, + Mono> postModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Post("/type/model/visibility") @@ -196,7 +198,7 @@ Mono> postModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postModelSync(@HeaderParam("accept") String accept, + Response postModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Delete("/type/model/visibility") @@ -205,7 +207,7 @@ Response postModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteModel(@HeaderParam("accept") String accept, + Mono> deleteModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Delete("/type/model/visibility") @@ -214,7 +216,7 @@ Mono> deleteModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteModelSync(@HeaderParam("accept") String accept, + Response deleteModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); } @@ -263,8 +265,9 @@ Response deleteModelSync(@HeaderParam("accept") String accept, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getModel(accept, input, requestOptions, context)); + return FluxUtil.withContext(context -> service.getModel(contentType, accept, input, requestOptions, context)); } /** @@ -311,8 +314,9 @@ public Mono> getModelWithResponseAsync(BinaryData input, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getModelWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.getModelSync(accept, input, requestOptions, Context.NONE); + return service.getModelSync(contentType, accept, input, requestOptions, Context.NONE); } /** @@ -343,8 +347,8 @@ public Response getModelWithResponse(BinaryData input, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> headModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.headModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.headModel(contentType, input, requestOptions, context)); } /** @@ -375,8 +379,8 @@ public Mono> headModelWithResponseAsync(BinaryData input, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response headModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.headModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.headModelSync(contentType, input, requestOptions, Context.NONE); } /** @@ -407,8 +411,8 @@ public Response headModelWithResponse(BinaryData input, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putModel(contentType, input, requestOptions, context)); } /** @@ -439,8 +443,8 @@ public Mono> putModelWithResponseAsync(BinaryData input, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putModelSync(contentType, input, requestOptions, Context.NONE); } /** @@ -471,8 +475,8 @@ public Response putModelWithResponse(BinaryData input, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patchModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.patchModel(contentType, input, requestOptions, context)); } /** @@ -503,8 +507,8 @@ public Mono> patchModelWithResponseAsync(BinaryData input, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response patchModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.patchModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.patchModelSync(contentType, input, requestOptions, Context.NONE); } /** @@ -535,8 +539,8 @@ public Response patchModelWithResponse(BinaryData input, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.postModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.postModel(contentType, input, requestOptions, context)); } /** @@ -567,8 +571,8 @@ public Mono> postModelWithResponseAsync(BinaryData input, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.postModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.postModelSync(contentType, input, requestOptions, Context.NONE); } /** @@ -599,8 +603,8 @@ public Response postModelWithResponse(BinaryData input, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.deleteModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.deleteModel(contentType, input, requestOptions, context)); } /** @@ -631,7 +635,7 @@ public Mono> deleteModelWithResponseAsync(BinaryData input, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.deleteModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.deleteModelSync(contentType, input, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatAsyncClient.java index 0a77172f15..6bb710ebf5 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatAsyncClient.java @@ -57,7 +57,8 @@ public final class ExtendsDifferentSpreadFloatAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from a model that spread Record<float32> with the different known property type + * along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +102,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model extends from a model that spread Record<float32> with the different known property type + * on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatClient.java index a18b3d3fc5..bc2422ccb7 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatClient.java @@ -55,7 +55,8 @@ public final class ExtendsDifferentSpreadFloatClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from a model that spread Record<float32> with the different known property type + * along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model extends from a model that spread Record<float32> with the different known property type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayAsyncClient.java index 8e539dc46c..f002e61953 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayAsyncClient.java @@ -63,7 +63,8 @@ public final class ExtendsDifferentSpreadModelArrayAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from a model that spread Record<ModelForRecord[]> with the different known + * property type along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -113,7 +114,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model extends from a model that spread Record<ModelForRecord[]> with the different known + * property type on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayClient.java index c9341fbd75..19967ec10b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayClient.java @@ -61,7 +61,8 @@ public final class ExtendsDifferentSpreadModelArrayClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from a model that spread Record<ModelForRecord[]> with the different known + * property type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -111,7 +112,8 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model extends from a model that spread Record<ModelForRecord[]> with the different known + * property type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelAsyncClient.java index edeaef6e63..7bd1089729 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelAsyncClient.java @@ -59,7 +59,8 @@ public final class ExtendsDifferentSpreadModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from a model that spread Record<ModelForRecord> with the different known property + * type along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -105,7 +106,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model extends from a model that spread Record<ModelForRecord> with the different known property + * type on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelClient.java index 3ef771373b..a4de285a70 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelClient.java @@ -57,7 +57,8 @@ public final class ExtendsDifferentSpreadModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from a model that spread Record<ModelForRecord> with the different known property + * type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -103,7 +104,8 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model extends from a model that spread Record<ModelForRecord> with the different known property + * type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringAsyncClient.java index 79c7ee9f46..714c54aed9 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringAsyncClient.java @@ -57,7 +57,8 @@ public final class ExtendsDifferentSpreadStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from a model that spread Record<string> with the different known property type + * along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +102,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model extends from a model that spread Record<string> with the different known property type on + * successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringClient.java index c110a4e66e..956a1b7d23 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringClient.java @@ -55,7 +55,8 @@ public final class ExtendsDifferentSpreadStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from a model that spread Record<string> with the different known property type + * along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model extends from a model that spread Record<string> with the different known property type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatAsyncClient.java index 165efe0962..f730ea2bb2 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatAsyncClient.java @@ -56,7 +56,8 @@ public final class ExtendsFloatAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from Record<float32> type along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model extends from Record<float32> type on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatClient.java index 2344a7bcc7..13a6671339 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatClient.java @@ -54,7 +54,7 @@ public final class ExtendsFloatClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from Record<float32> type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model extends from Record<float32> type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayAsyncClient.java index aee6c3bdfc..9261fc56a2 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayAsyncClient.java @@ -62,7 +62,8 @@ public final class ExtendsModelArrayAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from Record<ModelForRecord[]> type along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -111,7 +112,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model extends from Record<ModelForRecord[]> type on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayClient.java index 112640784b..9fd0bb8f8c 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayClient.java @@ -60,7 +60,7 @@ public final class ExtendsModelArrayClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from Record<ModelForRecord[]> type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -109,7 +109,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model extends from Record<ModelForRecord[]> type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelAsyncClient.java index 3e2c8a262b..93a7496c97 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelAsyncClient.java @@ -58,7 +58,8 @@ public final class ExtendsModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from Record<ModelForRecord> type along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -103,7 +104,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model extends from Record<ModelForRecord> type on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelClient.java index 350b125c5b..929d4454c8 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelClient.java @@ -56,7 +56,7 @@ public final class ExtendsModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from Record<ModelForRecord> type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +101,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model extends from Record<ModelForRecord> type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringAsyncClient.java index 631556ec37..cd7eab90a1 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringAsyncClient.java @@ -56,7 +56,8 @@ public final class ExtendsStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from Record<string> type along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model extends from Record<string> type on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringClient.java index 18ef0b0b98..5b64a375ac 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringClient.java @@ -54,7 +54,7 @@ public final class ExtendsStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from Record<string> type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model extends from Record<string> type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownAsyncClient.java index a3971293d0..17fedcb062 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownAsyncClient.java @@ -56,7 +56,8 @@ public final class ExtendsUnknownAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from Record<unknown> type along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model extends from Record<unknown> type on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownClient.java index d1223a9711..7470e09e3c 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownClient.java @@ -54,7 +54,7 @@ public final class ExtendsUnknownClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from Record<unknown> type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model extends from Record<unknown> type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedAsyncClient.java index 47555089a1..62eba489a9 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedAsyncClient.java @@ -58,7 +58,8 @@ public final class ExtendsUnknownDerivedAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from a type that extends from Record<unknown> along with {@link Response} on + * successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -103,7 +104,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model extends from a type that extends from Record<unknown> on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedClient.java index a711f89a99..d8a5cc01c5 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedClient.java @@ -56,7 +56,7 @@ public final class ExtendsUnknownDerivedClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from a type that extends from Record<unknown> along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +101,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model extends from a type that extends from Record<unknown>. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedAsyncClient.java index 2996ebdb51..226d004e8b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedAsyncClient.java @@ -57,7 +57,8 @@ public final class ExtendsUnknownDiscriminatedAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from Record<unknown> with a discriminator along with {@link Response} on + * successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +102,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model extends from Record<unknown> with a discriminator on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedClient.java index 8c65533253..25288a4269 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedClient.java @@ -55,7 +55,7 @@ public final class ExtendsUnknownDiscriminatedClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from Record<unknown> with a discriminator along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +99,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model extends from Record<unknown> with a discriminator. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatAsyncClient.java index f0b5bec866..e092c6732f 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatAsyncClient.java @@ -56,7 +56,8 @@ public final class IsFloatAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model is from Record<float32> type along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model is from Record<float32> type on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatClient.java index 59f59264a0..62521ba1db 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatClient.java @@ -54,7 +54,7 @@ public final class IsFloatClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model is from Record<float32> type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model is from Record<float32> type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayAsyncClient.java index dc5b7a138c..0f41954adf 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayAsyncClient.java @@ -62,7 +62,8 @@ public final class IsModelArrayAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model is from Record<ModelForRecord[]> type along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -111,7 +112,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model is from Record<ModelForRecord[]> type on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayClient.java index ed99323bec..247008401b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayClient.java @@ -60,7 +60,7 @@ public final class IsModelArrayClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model is from Record<ModelForRecord[]> type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -109,7 +109,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model is from Record<ModelForRecord[]> type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelAsyncClient.java index 245ff40887..25e851b3ff 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelAsyncClient.java @@ -58,7 +58,8 @@ public final class IsModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model is from Record<ModelForRecord> type along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -103,7 +104,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model is from Record<ModelForRecord> type on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelClient.java index cb9bb36ef3..c38f983cc6 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelClient.java @@ -56,7 +56,7 @@ public final class IsModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model is from Record<ModelForRecord> type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +101,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model is from Record<ModelForRecord> type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringAsyncClient.java index 4388e9f9a7..90ba3dc461 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringAsyncClient.java @@ -56,7 +56,8 @@ public final class IsStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model is from Record<string> type along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model is from Record<string> type on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringClient.java index 54f77899d5..5cc8e95486 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringClient.java @@ -54,7 +54,7 @@ public final class IsStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model is from Record<string> type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model is from Record<string> type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownAsyncClient.java index 56fb6113f7..71a28db9ec 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownAsyncClient.java @@ -56,7 +56,8 @@ public final class IsUnknownAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model is from Record<unknown> type along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model is from Record<unknown> type on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownClient.java index e5fde6da37..0990ca7125 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownClient.java @@ -54,7 +54,7 @@ public final class IsUnknownClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model is from Record<unknown> type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model is from Record<unknown> type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedAsyncClient.java index 6527d2fd23..3b65a75c16 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedAsyncClient.java @@ -58,7 +58,8 @@ public final class IsUnknownDerivedAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from a type that is Record<unknown> type along with {@link Response} on + * successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -103,7 +104,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model extends from a type that is Record<unknown> type on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedClient.java index ff945769c1..3fd6631f2e 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedClient.java @@ -56,7 +56,7 @@ public final class IsUnknownDerivedClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from a type that is Record<unknown> type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +101,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model extends from a type that is Record<unknown> type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedAsyncClient.java index 33cd143e8a..926dac37f4 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedAsyncClient.java @@ -57,7 +57,8 @@ public final class IsUnknownDiscriminatedAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model is Record<unknown> with a discriminator along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +102,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model is Record<unknown> with a discriminator on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedClient.java index 8d336689cc..6830a100e9 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedClient.java @@ -55,7 +55,7 @@ public final class IsUnknownDiscriminatedClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model is Record<unknown> with a discriminator along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +99,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model is Record<unknown> with a discriminator. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadAsyncClient.java index 4a7f13d101..c922f38890 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadAsyncClient.java @@ -56,7 +56,8 @@ public final class MultipleSpreadAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<string> and Record<float32> along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<string> and Record<float32> on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadClient.java index 695adb7ab4..0537e3ddcf 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadClient.java @@ -54,7 +54,7 @@ public final class MultipleSpreadClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<string> and Record<float32> along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<string> and Record<float32>. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatAsyncClient.java index 52c264e60c..fb314eb760 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatAsyncClient.java @@ -56,7 +56,8 @@ public final class SpreadDifferentFloatAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<float32> with the different known property type along with {@link Response} + * on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<float32> with the different known property type on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatClient.java index cf800c43fe..f88fff8d92 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatClient.java @@ -54,7 +54,8 @@ public final class SpreadDifferentFloatClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<float32> with the different known property type along with + * {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +98,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<float32> with the different known property type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayAsyncClient.java index 90fbf5a45e..e286ae7d94 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayAsyncClient.java @@ -60,7 +60,8 @@ public final class SpreadDifferentModelArrayAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<ModelForRecord[]> with the different known property type along with + * {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -107,7 +108,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<ModelForRecord[]> with the different known property type on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayClient.java index 75c931ef47..cfd2094235 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayClient.java @@ -58,7 +58,8 @@ public final class SpreadDifferentModelArrayClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<ModelForRecord[]> with the different known property type along with + * {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -105,7 +106,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<ModelForRecord[]> with the different known property type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelAsyncClient.java index dd78d0eafa..d587b7f673 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelAsyncClient.java @@ -58,7 +58,8 @@ public final class SpreadDifferentModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<ModelForRecord> with the different known property type along with + * {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -103,7 +104,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<ModelForRecord> with the different known property type on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelClient.java index 2de9b57e67..3c8399d490 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelClient.java @@ -56,7 +56,8 @@ public final class SpreadDifferentModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<ModelForRecord> with the different known property type along with + * {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +102,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<ModelForRecord> with the different known property type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringAsyncClient.java index 9a5b404239..be6d3a5fe5 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringAsyncClient.java @@ -56,7 +56,8 @@ public final class SpreadDifferentStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<string> with the different known property type along with {@link Response} + * on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<string> with the different known property type on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringClient.java index c052f4d6b2..19d4ba0b53 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringClient.java @@ -54,7 +54,7 @@ public final class SpreadDifferentStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<string> with the different known property type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<string> with the different known property type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatAsyncClient.java index 4491b1cea4..aea11ced99 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatAsyncClient.java @@ -56,7 +56,8 @@ public final class SpreadFloatAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<float32> with the same known property type along with {@link Response} on + * successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<float32> with the same known property type on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatClient.java index 844165116e..d47074a53f 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatClient.java @@ -54,7 +54,7 @@ public final class SpreadFloatClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<float32> with the same known property type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<float32> with the same known property type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayAsyncClient.java index bfb87faa8f..21c8cb7745 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayAsyncClient.java @@ -62,7 +62,7 @@ public final class SpreadModelArrayAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -111,7 +111,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the response body on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayClient.java index d869e8b9df..5dd8466491 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayClient.java @@ -60,7 +60,7 @@ public final class SpreadModelArrayClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the response body along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -109,7 +109,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the response. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelAsyncClient.java index c1250d5eec..8ce7cdb6c7 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelAsyncClient.java @@ -58,7 +58,8 @@ public final class SpreadModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<ModelForRecord> with the same known property type along with + * {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -103,7 +104,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<ModelForRecord> with the same known property type on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelClient.java index ed489d4347..4c46cfe548 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelClient.java @@ -56,7 +56,8 @@ public final class SpreadModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<ModelForRecord> with the same known property type along with + * {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +102,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<ModelForRecord> with the same known property type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionAsyncClient.java index 7baae2dcb8..4a8f20819b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionAsyncClient.java @@ -56,7 +56,8 @@ public final class SpreadRecordDiscriminatedUnionAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<WidgetData> along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<WidgetData> on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionClient.java index 641f7c8498..6e397cd71a 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionClient.java @@ -54,7 +54,7 @@ public final class SpreadRecordDiscriminatedUnionClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<WidgetData> along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<WidgetData>. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2AsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2AsyncClient.java index 25d072990b..1b655db476 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2AsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2AsyncClient.java @@ -56,7 +56,8 @@ public final class SpreadRecordNonDiscriminatedUnion2AsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<WidgetData2 | WidgetData1> along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<WidgetData2 | WidgetData1> on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2Client.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2Client.java index 25af9e4463..a6a9f04145 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2Client.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2Client.java @@ -54,7 +54,7 @@ public final class SpreadRecordNonDiscriminatedUnion2Client { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<WidgetData2 | WidgetData1> along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<WidgetData2 | WidgetData1>. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3AsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3AsyncClient.java index 067ee6ee43..1dbabff923 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3AsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3AsyncClient.java @@ -56,7 +56,8 @@ public final class SpreadRecordNonDiscriminatedUnion3AsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<WidgetData2[] | WidgetData1> along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<WidgetData2[] | WidgetData1> on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3Client.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3Client.java index d14844fa24..6fac9d6a5b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3Client.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3Client.java @@ -54,7 +54,7 @@ public final class SpreadRecordNonDiscriminatedUnion3Client { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<WidgetData2[] | WidgetData1> along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<WidgetData2[] | WidgetData1>. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionAsyncClient.java index 637b3d680f..77cc859c3c 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionAsyncClient.java @@ -56,7 +56,8 @@ public final class SpreadRecordNonDiscriminatedUnionAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<WidgetData0 | WidgetData1> along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<WidgetData0 | WidgetData1> on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionClient.java index 96fda8ee04..c8012b543b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionClient.java @@ -54,7 +54,7 @@ public final class SpreadRecordNonDiscriminatedUnionClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<WidgetData0 | WidgetData1> along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<WidgetData0 | WidgetData1>. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionAsyncClient.java index f59998aac8..70a66e9ed6 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionAsyncClient.java @@ -56,7 +56,8 @@ public final class SpreadRecordUnionAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<string | float32> along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<string | float32> on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionClient.java index c8eaa17b0a..5a995d9fa3 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionClient.java @@ -54,7 +54,7 @@ public final class SpreadRecordUnionClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<string | float32> along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<string | float32>. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringAsyncClient.java index 51c27dd0e2..5336b072b3 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringAsyncClient.java @@ -56,7 +56,8 @@ public final class SpreadStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<string> with the same known property type along with {@link Response} on + * successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<string> with the same known property type on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringClient.java index ccd1774615..cfa9d95e6a 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringClient.java @@ -54,7 +54,7 @@ public final class SpreadStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<string> with the same known property type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<string> with the same known property type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadFloatsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadFloatsImpl.java index 6fa9cb37c8..946a56caa5 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadFloatsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadFloatsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsDifferentSpreadFloatsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsDifferentSpreadFloat") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadFloat") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadFloat") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -114,7 +114,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from a model that spread Record<float32> with the different known property type + * along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -141,7 +142,8 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from a model that spread Record<float32> with the different known property type + * along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -173,8 +175,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -201,7 +203,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelArraysImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelArraysImpl.java index e8609caff6..2224e88ced 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelArraysImpl.java @@ -64,7 +64,7 @@ public interface ExtendsDifferentSpreadModelArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsDifferentSpreadModelArray") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadModelArray") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadModelArray") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -120,7 +120,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from a model that spread Record<ModelForRecord[]> with the different known + * property type along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -153,7 +154,8 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from a model that spread Record<ModelForRecord[]> with the different known + * property type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -191,8 +193,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -225,7 +227,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelsImpl.java index 303776b348..7df490a68a 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsDifferentSpreadModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsDifferentSpreadModel") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadModel") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadModel") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -116,7 +116,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from a model that spread Record<ModelForRecord> with the different known property + * type along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -145,7 +146,8 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from a model that spread Record<ModelForRecord> with the different known property + * type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -179,8 +181,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -209,7 +211,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadStringsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadStringsImpl.java index 29f8e4e6af..a4e516d9f8 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadStringsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsDifferentSpreadStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsDifferentSpreadString") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadString") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadString") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -114,7 +114,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from a model that spread Record<string> with the different known property type + * along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -141,7 +142,8 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from a model that spread Record<string> with the different known property type + * along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -173,8 +175,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -201,7 +203,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsFloatsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsFloatsImpl.java index 61cc2601f4..8dce92e7f6 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsFloatsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsFloatsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsFloatsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsRecordFloat") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordFloat") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordFloat") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from Record<float32> type along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from Record<float32> type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelArraysImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelArraysImpl.java index d4037271c3..2afe79bda0 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelArraysImpl.java @@ -64,7 +64,7 @@ public interface ExtendsModelArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsRecordModelArray") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordModelArray") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordModelArray") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -119,7 +119,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from Record<ModelForRecord[]> type along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -151,7 +152,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from Record<ModelForRecord[]> type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -188,8 +189,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -221,7 +222,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelsImpl.java index 954e26e129..1c63df2d2f 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsRecordModel") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordModel") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordModel") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -115,7 +115,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from Record<ModelForRecord> type along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -143,7 +144,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from Record<ModelForRecord> type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -176,8 +177,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -205,7 +206,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsStringsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsStringsImpl.java index 3d3cbbade3..e91ac0bf9f 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsStringsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsRecordString") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordString") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordString") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from Record<string> type along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from Record<string> type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDerivedsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDerivedsImpl.java index d4a55cf5ad..ad3970029c 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDerivedsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDerivedsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsUnknownDerivedsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsRecordUnknownDerived") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordUnknownDerived") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordUnknownDerived") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -115,7 +115,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from a type that extends from Record<unknown> along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -143,7 +144,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from a type that extends from Record<unknown> along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -176,8 +177,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -205,7 +206,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDiscriminatedsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDiscriminatedsImpl.java index 96798c5a1a..287ba0ef13 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDiscriminatedsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDiscriminatedsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsUnknownDiscriminatedsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsUnknownDiscriminated") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsUnknownDiscriminated") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsUnknownDiscriminated") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -114,7 +114,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from Record<unknown> with a discriminator along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -141,7 +142,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from Record<unknown> with a discriminator along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -173,8 +174,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -201,7 +202,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownsImpl.java index c58713b6fc..3399b10f12 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsUnknownsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsRecordUnknown") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordUnknown") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordUnknown") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from Record<unknown> type along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from Record<unknown> type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsFloatsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsFloatsImpl.java index e276967a22..a9c9d63f2d 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsFloatsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsFloatsImpl.java @@ -63,7 +63,7 @@ public interface IsFloatsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isRecordFloat") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordFloat") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordFloat") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -112,7 +112,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model is from Record<float32> type along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -138,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model is from Record<float32> type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -169,8 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -196,7 +197,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelArraysImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelArraysImpl.java index 7125390719..98824cb300 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelArraysImpl.java @@ -64,7 +64,7 @@ public interface IsModelArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isRecordModelArray") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordModelArray") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordModelArray") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -119,7 +119,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model is from Record<ModelForRecord[]> type along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -151,7 +152,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model is from Record<ModelForRecord[]> type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -188,8 +189,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -221,7 +222,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelsImpl.java index 774c6d7a12..f2ca76a184 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelsImpl.java @@ -63,7 +63,7 @@ public interface IsModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isRecordModel") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordModel") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordModel") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -114,7 +114,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model is from Record<ModelForRecord> type along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -142,7 +143,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model is from Record<ModelForRecord> type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -175,8 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -204,7 +205,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsStringsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsStringsImpl.java index fb3f27c469..c47ae7c73d 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsStringsImpl.java @@ -64,7 +64,7 @@ public interface IsStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isRecordstring") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordstring") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordstring") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model is from Record<string> type along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model is from Record<string> type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDerivedsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDerivedsImpl.java index bc84462e01..e25c66368b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDerivedsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDerivedsImpl.java @@ -64,7 +64,7 @@ public interface IsUnknownDerivedsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isRecordUnknownDerived") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordUnknownDerived") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordUnknownDerived") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -115,7 +115,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from a type that is Record<unknown> type along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -143,7 +144,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from a type that is Record<unknown> type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -176,8 +177,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -205,7 +206,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDiscriminatedsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDiscriminatedsImpl.java index 22e4b82f69..03c85f799c 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDiscriminatedsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDiscriminatedsImpl.java @@ -64,7 +64,7 @@ public interface IsUnknownDiscriminatedsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isUnknownDiscriminated") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isUnknownDiscriminated") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isUnknownDiscriminated") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -114,7 +114,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model is Record<unknown> with a discriminator along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -141,7 +142,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model is Record<unknown> with a discriminator along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -173,8 +174,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -201,7 +202,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownsImpl.java index 785aa71b46..01f14ff39c 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownsImpl.java @@ -64,7 +64,7 @@ public interface IsUnknownsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isRecordUnknown") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordUnknown") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordUnknown") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model is from Record<unknown> type along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model is from Record<unknown> type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/MultipleSpreadsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/MultipleSpreadsImpl.java index dbbfe181bc..2d18a071fb 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/MultipleSpreadsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/MultipleSpreadsImpl.java @@ -64,7 +64,7 @@ public interface MultipleSpreadsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/multipleSpreadRecord") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/multipleSpreadRecord") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/multipleSpreadRecord") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<string> and Record<float32> along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<string> and Record<float32> along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentFloatsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentFloatsImpl.java index 656068de0d..bc2e7bdc53 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentFloatsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentFloatsImpl.java @@ -64,7 +64,7 @@ public interface SpreadDifferentFloatsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadDifferentRecordFloat") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordFloat") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordFloat") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<float32> with the different known property type along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,8 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<float32> with the different known property type along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +172,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +199,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelArraysImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelArraysImpl.java index 49fc1bc88b..fd3e7daac7 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelArraysImpl.java @@ -64,7 +64,7 @@ public interface SpreadDifferentModelArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadDifferentRecordModelArray") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordModelArray") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordModelArray") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -117,7 +117,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<ModelForRecord[]> with the different known property type along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -147,7 +148,8 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<ModelForRecord[]> with the different known property type along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -182,8 +184,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -213,7 +215,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelsImpl.java index 26370c64d6..28515b154d 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelsImpl.java @@ -64,7 +64,7 @@ public interface SpreadDifferentModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadDifferentRecordModel") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordModel") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordModel") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -115,7 +115,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<ModelForRecord> with the different known property type along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -143,7 +144,8 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<ModelForRecord> with the different known property type along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -176,8 +178,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -205,7 +207,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentStringsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentStringsImpl.java index 99142402ab..5666b47ca9 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentStringsImpl.java @@ -64,7 +64,7 @@ public interface SpreadDifferentStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadDifferentRecordString") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordString") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordString") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<string> with the different known property type along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<string> with the different known property type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadFloatsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadFloatsImpl.java index 6aabfef3d0..01300615b0 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadFloatsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadFloatsImpl.java @@ -64,7 +64,7 @@ public interface SpreadFloatsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordFloat") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordFloat") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordFloat") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<float32> with the same known property type along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<float32> with the same known property type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelArraysImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelArraysImpl.java index 90f5c8d51f..2fe8d8ed8a 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelArraysImpl.java @@ -64,7 +64,7 @@ public interface SpreadModelArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordModelArray") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordModelArray") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordModelArray") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -119,7 +119,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -151,7 +151,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -188,8 +188,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -221,7 +221,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelsImpl.java index 6697295534..16f2061cba 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelsImpl.java @@ -64,7 +64,7 @@ public interface SpreadModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordModel") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordModel") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordModel") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -115,7 +115,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<ModelForRecord> with the same known property type along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -143,7 +144,8 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<ModelForRecord> with the same known property type along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -176,8 +178,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -205,7 +207,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordDiscriminatedUnionsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordDiscriminatedUnionsImpl.java index eb6455fc95..95322abccc 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordDiscriminatedUnionsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordDiscriminatedUnionsImpl.java @@ -64,7 +64,7 @@ public interface SpreadRecordDiscriminatedUnionsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordDiscriminatedUnion") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordDiscriminatedUnion") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordDiscriminatedUnion") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<WidgetData> along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<WidgetData> along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion2sImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion2sImpl.java index f4b04508f0..eaa2c35421 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion2sImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion2sImpl.java @@ -64,7 +64,7 @@ public interface SpreadRecordNonDiscriminatedUnion2sService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion2") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion2") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion2") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<WidgetData2 | WidgetData1> along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<WidgetData2 | WidgetData1> along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion3sImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion3sImpl.java index 84d395ac98..80628db295 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion3sImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion3sImpl.java @@ -64,7 +64,7 @@ public interface SpreadRecordNonDiscriminatedUnion3sService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion3") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion3") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion3") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<WidgetData2[] | WidgetData1> along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<WidgetData2[] | WidgetData1> along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnionsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnionsImpl.java index c01713dd82..36ac49fea4 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnionsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnionsImpl.java @@ -64,7 +64,7 @@ public interface SpreadRecordNonDiscriminatedUnionsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<WidgetData0 | WidgetData1> along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<WidgetData0 | WidgetData1> along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordUnionsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordUnionsImpl.java index 0ec58862d2..2992f99561 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordUnionsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordUnionsImpl.java @@ -64,7 +64,7 @@ public interface SpreadRecordUnionsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordUnion") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordUnion") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordUnion") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<string | float32> along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<string | float32> along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadStringsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadStringsImpl.java index 71c0892436..434a600f5e 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadStringsImpl.java @@ -64,7 +64,7 @@ public interface SpreadStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordString") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordString") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordString") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<string> with the same known property type along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<string> with the same known property type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/BytesAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/BytesAsyncClient.java index dc15c34de7..f64a4f3790 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/BytesAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/BytesAsyncClient.java @@ -55,8 +55,8 @@ public final class BytesAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return template type for testing models with nullable property along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -80,8 +80,8 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return template type for testing models with nullable property along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -147,7 +147,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return template type for testing models with nullable property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -166,7 +166,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return template type for testing models with nullable property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/BytesClient.java b/typespec-tests/src/main/java/com/type/property/nullable/BytesClient.java index d8ae75cd3b..b49fb83f3a 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/BytesClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/BytesClient.java @@ -53,7 +53,7 @@ public final class BytesClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return template type for testing models with nullable property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return template type for testing models with nullable property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -143,7 +143,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return template type for testing models with nullable property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public BytesProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return template type for testing models with nullable property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteAsyncClient.java index 85e397e71a..33c181cee0 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteAsyncClient.java @@ -57,8 +57,8 @@ public final class CollectionsByteAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with collection bytes properties along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -84,7 +84,7 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with collection bytes properties along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -155,7 +155,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with collection bytes properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -174,7 +174,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with collection bytes properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteClient.java b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteClient.java index 058ede5f10..f1f918e423 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteClient.java @@ -55,7 +55,7 @@ public final class CollectionsByteClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with collection bytes properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -81,7 +81,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with collection bytes properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -151,7 +151,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with collection bytes properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -169,7 +169,7 @@ public CollectionsByteProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with collection bytes properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelAsyncClient.java index a0aca8862f..9f5b5bceaa 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelAsyncClient.java @@ -59,8 +59,8 @@ public final class CollectionsModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with collection models properties along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -88,7 +88,7 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with collection models properties along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -163,7 +163,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with collection models properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -182,7 +182,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with collection models properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelClient.java b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelClient.java index ce1d4f5cc9..75aa3bbe2e 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelClient.java @@ -57,7 +57,7 @@ public final class CollectionsModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with collection models properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -85,7 +85,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with collection models properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -159,7 +159,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with collection models properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -177,7 +177,7 @@ public CollectionsModelProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with collection models properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringAsyncClient.java index a7a9cfdb5f..327312e43b 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringAsyncClient.java @@ -57,8 +57,8 @@ public final class CollectionsStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with collection string properties along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -84,7 +84,7 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with collection string properties along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -155,7 +155,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with collection string properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -174,7 +174,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with collection string properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringClient.java b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringClient.java index 3329a9e430..9344eb47fd 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringClient.java @@ -55,7 +55,7 @@ public final class CollectionsStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with collection string properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -81,7 +81,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with collection string properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -151,7 +151,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with collection string properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -169,7 +169,7 @@ public CollectionsStringProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with collection string properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationAsyncClient.java index ef61ca233d..2c4fe80d38 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationAsyncClient.java @@ -55,8 +55,7 @@ public final class DatetimeOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -80,8 +79,7 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -147,7 +145,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with a datetime property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -166,7 +164,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with a datetime property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationClient.java b/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationClient.java index dfeb42ff6e..fe7be8ddbb 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationClient.java @@ -53,7 +53,7 @@ public final class DatetimeOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with a datetime property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with a datetime property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -143,7 +143,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with a datetime property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public DatetimeProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with a datetime property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationAsyncClient.java index 3766704382..45db0da472 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationAsyncClient.java @@ -55,8 +55,7 @@ public final class DurationOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -80,8 +79,7 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -147,7 +145,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with a duration property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -166,7 +164,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with a duration property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationClient.java b/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationClient.java index e3a7cd47fb..2ba1cc33b0 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationClient.java @@ -53,7 +53,7 @@ public final class DurationOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with a duration property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with a duration property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -143,7 +143,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with a duration property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public DurationProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with a duration property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/StringOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/StringOperationAsyncClient.java index 64cc982cfb..11befcbcb2 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/StringOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/StringOperationAsyncClient.java @@ -55,8 +55,8 @@ public final class StringOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return template type for testing models with nullable property along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -80,8 +80,8 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return template type for testing models with nullable property along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -147,7 +147,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return template type for testing models with nullable property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -166,7 +166,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return template type for testing models with nullable property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/StringOperationClient.java b/typespec-tests/src/main/java/com/type/property/nullable/StringOperationClient.java index 3ec28d6f8a..cde6151b68 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/StringOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/StringOperationClient.java @@ -53,7 +53,7 @@ public final class StringOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return template type for testing models with nullable property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return template type for testing models with nullable property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -143,7 +143,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return template type for testing models with nullable property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public StringProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return template type for testing models with nullable property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/BytesImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/BytesImpl.java index 3f437a5bda..aa8586ce95 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/BytesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/BytesImpl.java @@ -63,7 +63,7 @@ public interface BytesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/bytes/non-null") @@ -72,7 +72,7 @@ Mono> getNonNull(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/bytes/null") @@ -81,7 +81,7 @@ Response getNonNullSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/bytes/null") @@ -90,7 +90,7 @@ Mono> getNull(@HeaderParam("accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/bytes/non-null") @@ -100,8 +100,7 @@ Response getNullSync(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/bytes/non-null") @ExpectedResponses({ 204 }) @@ -110,8 +109,7 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/bytes/null") @ExpectedResponses({ 204 }) @@ -120,8 +118,7 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/bytes/null") @ExpectedResponses({ 204 }) @@ -130,8 +127,7 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -150,8 +146,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return template type for testing models with nullable property along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -175,7 +171,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return template type for testing models with nullable property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -199,8 +195,8 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return template type for testing models with nullable property along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync(RequestOptions requestOptions) { @@ -224,7 +220,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return template type for testing models with nullable property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { @@ -254,9 +250,7 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.patchNonNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); } /** @@ -281,8 +275,7 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNonNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); } /** @@ -307,8 +300,7 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); } /** @@ -333,7 +325,6 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNullSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsBytesImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsBytesImpl.java index 22e07f33ff..cf1dff1bd6 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsBytesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsBytesImpl.java @@ -64,7 +64,7 @@ public interface CollectionsBytesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/bytes/non-null") @@ -73,7 +73,7 @@ Mono> getNonNull(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/bytes/null") @@ -82,7 +82,7 @@ Response getNonNullSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/bytes/null") @@ -91,7 +91,7 @@ Mono> getNull(@HeaderParam("accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/bytes/non-null") @@ -101,8 +101,7 @@ Response getNullSync(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/bytes/non-null") @ExpectedResponses({ 204 }) @@ -111,8 +110,7 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/bytes/null") @ExpectedResponses({ 204 }) @@ -121,8 +119,7 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/bytes/null") @ExpectedResponses({ 204 }) @@ -131,8 +128,7 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -153,8 +149,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with collection bytes properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -180,7 +176,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with collection bytes properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -206,7 +202,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with collection bytes properties along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -233,7 +229,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with collection bytes properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { @@ -265,9 +261,7 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.patchNonNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); } /** @@ -294,8 +288,7 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNonNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); } /** @@ -322,8 +315,7 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); } /** @@ -350,7 +342,6 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNullSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsModelsImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsModelsImpl.java index 1e72392d36..02b4152448 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsModelsImpl.java @@ -64,7 +64,7 @@ public interface CollectionsModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/model/non-null") @@ -73,7 +73,7 @@ Mono> getNonNull(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/model/null") @@ -82,7 +82,7 @@ Response getNonNullSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/model/null") @@ -91,7 +91,7 @@ Mono> getNull(@HeaderParam("accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/model/non-null") @@ -101,8 +101,7 @@ Response getNullSync(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/model/non-null") @ExpectedResponses({ 204 }) @@ -111,8 +110,7 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/model/null") @ExpectedResponses({ 204 }) @@ -121,8 +119,7 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/model/null") @ExpectedResponses({ 204 }) @@ -131,8 +128,7 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -155,8 +151,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with collection models properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -184,7 +180,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with collection models properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -212,7 +208,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with collection models properties along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -241,7 +237,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with collection models properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { @@ -275,9 +271,7 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.patchNonNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); } /** @@ -306,8 +300,7 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNonNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); } /** @@ -336,8 +329,7 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); } /** @@ -366,7 +358,6 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNullSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsStringsImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsStringsImpl.java index ed96a21925..fcc1ad2fb4 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsStringsImpl.java @@ -64,7 +64,7 @@ public interface CollectionsStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/string/non-null") @@ -73,7 +73,7 @@ Mono> getNonNull(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/string/null") @@ -82,7 +82,7 @@ Response getNonNullSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/string/null") @@ -91,7 +91,7 @@ Mono> getNull(@HeaderParam("accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/string/non-null") @@ -101,8 +101,7 @@ Response getNullSync(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/string/non-null") @ExpectedResponses({ 204 }) @@ -111,8 +110,7 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/string/null") @ExpectedResponses({ 204 }) @@ -121,8 +119,7 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/string/null") @ExpectedResponses({ 204 }) @@ -131,8 +128,7 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -153,8 +149,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with collection string properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -180,7 +176,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with collection string properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -206,7 +202,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with collection string properties along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -233,7 +229,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with collection string properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { @@ -265,9 +261,7 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.patchNonNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); } /** @@ -294,8 +288,7 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNonNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); } /** @@ -322,8 +315,7 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); } /** @@ -350,7 +342,6 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNullSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/DatetimeOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/DatetimeOperationsImpl.java index 0b112670da..dd878296a1 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/DatetimeOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/DatetimeOperationsImpl.java @@ -64,7 +64,7 @@ public interface DatetimeOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/datetime/non-null") @@ -73,7 +73,7 @@ Mono> getNonNull(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/datetime/null") @@ -82,7 +82,7 @@ Response getNonNullSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/datetime/null") @@ -91,7 +91,7 @@ Mono> getNull(@HeaderParam("accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/datetime/non-null") @@ -101,8 +101,7 @@ Response getNullSync(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/datetime/non-null") @ExpectedResponses({ 204 }) @@ -111,8 +110,7 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/datetime/null") @ExpectedResponses({ 204 }) @@ -121,8 +119,7 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/datetime/null") @ExpectedResponses({ 204 }) @@ -131,8 +128,7 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -151,8 +147,7 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -176,7 +171,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with a datetime property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -200,8 +195,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync(RequestOptions requestOptions) { @@ -225,7 +219,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with a datetime property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { @@ -255,9 +249,7 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.patchNonNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); } /** @@ -282,8 +274,7 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNonNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); } /** @@ -308,8 +299,7 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); } /** @@ -334,7 +324,6 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNullSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/DurationOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/DurationOperationsImpl.java index 7c427c03ea..e75328f6e6 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/DurationOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/DurationOperationsImpl.java @@ -64,7 +64,7 @@ public interface DurationOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/duration/non-null") @@ -73,7 +73,7 @@ Mono> getNonNull(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/duration/null") @@ -82,7 +82,7 @@ Response getNonNullSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/duration/null") @@ -91,7 +91,7 @@ Mono> getNull(@HeaderParam("accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/duration/non-null") @@ -101,8 +101,7 @@ Response getNullSync(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/duration/non-null") @ExpectedResponses({ 204 }) @@ -111,8 +110,7 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/duration/null") @ExpectedResponses({ 204 }) @@ -121,8 +119,7 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/duration/null") @ExpectedResponses({ 204 }) @@ -131,8 +128,7 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -151,8 +147,7 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -176,7 +171,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with a duration property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -200,8 +195,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync(RequestOptions requestOptions) { @@ -225,7 +219,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with a duration property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { @@ -255,9 +249,7 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.patchNonNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); } /** @@ -282,8 +274,7 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNonNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); } /** @@ -308,8 +299,7 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); } /** @@ -334,7 +324,6 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNullSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/StringOperationsImpl.java index 34b813d183..ec8367b3db 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/StringOperationsImpl.java @@ -64,7 +64,7 @@ public interface StringOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/string/non-null") @@ -73,7 +73,7 @@ Mono> getNonNull(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/string/null") @@ -82,7 +82,7 @@ Response getNonNullSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/string/null") @@ -91,7 +91,7 @@ Mono> getNull(@HeaderParam("accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/string/non-null") @@ -101,8 +101,7 @@ Response getNullSync(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/string/non-null") @ExpectedResponses({ 204 }) @@ -111,8 +110,7 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/string/null") @ExpectedResponses({ 204 }) @@ -121,8 +119,7 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/string/null") @ExpectedResponses({ 204 }) @@ -131,8 +128,7 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -151,8 +147,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return template type for testing models with nullable property along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -176,7 +172,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return template type for testing models with nullable property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -200,8 +196,8 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return template type for testing models with nullable property along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync(RequestOptions requestOptions) { @@ -225,7 +221,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return template type for testing models with nullable property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { @@ -255,9 +251,7 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.patchNonNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); } /** @@ -282,8 +276,7 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNonNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); } /** @@ -308,8 +301,7 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); } /** @@ -334,7 +326,6 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNullSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralAsyncClient.java index 1b744de174..8534963817 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralAsyncClient.java @@ -53,8 +53,7 @@ public final class BooleanLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with boolean literal property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,8 +76,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with boolean literal property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +140,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with boolean literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +159,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with boolean literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralClient.java index aedbc41fb2..74914b4234 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralClient.java @@ -51,7 +51,7 @@ public final class BooleanLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with boolean literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with boolean literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with boolean literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public BooleanLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with boolean literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/BytesAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/BytesAsyncClient.java index ff4076bdd3..77463eb8d0 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/BytesAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/BytesAsyncClient.java @@ -53,8 +53,8 @@ public final class BytesAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return template type for testing models with optional property along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,8 +77,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return template type for testing models with optional property along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return template type for testing models with optional property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return template type for testing models with optional property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/BytesClient.java b/typespec-tests/src/main/java/com/type/property/optional/BytesClient.java index e9a0400de8..3f1d304a49 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/BytesClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/BytesClient.java @@ -51,7 +51,7 @@ public final class BytesClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return template type for testing models with optional property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return template type for testing models with optional property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return template type for testing models with optional property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public BytesProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return template type for testing models with optional property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteAsyncClient.java index 82c01f6a28..9e103e5ff0 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteAsyncClient.java @@ -55,8 +55,8 @@ public final class CollectionsByteAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with collection bytes properties along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -81,7 +81,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with collection bytes properties along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -150,7 +150,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with collection bytes properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -169,7 +169,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with collection bytes properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteClient.java b/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteClient.java index 082eef861c..4014a913d2 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteClient.java @@ -53,7 +53,7 @@ public final class CollectionsByteClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with collection bytes properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -78,7 +78,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with collection bytes properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -146,7 +146,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with collection bytes properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -164,7 +164,7 @@ public CollectionsByteProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with collection bytes properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelAsyncClient.java index baf2f7a094..3d18da19c9 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelAsyncClient.java @@ -57,8 +57,8 @@ public final class CollectionsModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with collection models properties along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -85,7 +85,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with collection models properties along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -158,7 +158,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with collection models properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -177,7 +177,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with collection models properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelClient.java b/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelClient.java index 4a2f838215..e87c26318c 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelClient.java @@ -55,7 +55,7 @@ public final class CollectionsModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with collection models properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -82,7 +82,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with collection models properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -154,7 +154,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with collection models properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -172,7 +172,7 @@ public CollectionsModelProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with collection models properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationAsyncClient.java index 76b0916466..5f9bf2a733 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationAsyncClient.java @@ -53,8 +53,7 @@ public final class DatetimeOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,8 +76,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +140,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with a datetime property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +159,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with a datetime property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationClient.java b/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationClient.java index 7707ac2dd6..885825653d 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationClient.java @@ -51,7 +51,7 @@ public final class DatetimeOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with a datetime property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with a datetime property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with a datetime property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public DatetimeProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with a datetime property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/DurationOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/DurationOperationAsyncClient.java index 2e0543ca46..f4fd693b7e 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/DurationOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/DurationOperationAsyncClient.java @@ -53,8 +53,7 @@ public final class DurationOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,8 +76,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +140,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with a duration property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +159,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with a duration property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/DurationOperationClient.java b/typespec-tests/src/main/java/com/type/property/optional/DurationOperationClient.java index 276c91e42c..efd15214f2 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/DurationOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/DurationOperationClient.java @@ -51,7 +51,7 @@ public final class DurationOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with a duration property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with a duration property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with a duration property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public DurationProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with a duration property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralAsyncClient.java index a2a5e7e831..61d6a2a257 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralAsyncClient.java @@ -53,8 +53,7 @@ public final class FloatLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with float literal property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,8 +76,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with float literal property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +140,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with float literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +159,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with float literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralClient.java index 55497ed2ce..4233398ad7 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralClient.java @@ -51,7 +51,7 @@ public final class FloatLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with float literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with float literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with float literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public FloatLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with float literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/IntLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/IntLiteralAsyncClient.java index 9054c2ff21..3873765e2f 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/IntLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/IntLiteralAsyncClient.java @@ -53,8 +53,7 @@ public final class IntLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with int literal property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,8 +76,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with int literal property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +140,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with int literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +159,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with int literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/IntLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/IntLiteralClient.java index 9df5a7c453..cb552f3f0d 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/IntLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/IntLiteralClient.java @@ -51,7 +51,7 @@ public final class IntLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with int literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with int literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with int literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public IntLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with int literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalAsyncClient.java index 9f9d8c40f4..5fee690f7d 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalAsyncClient.java @@ -54,8 +54,8 @@ public final class RequiredAndOptionalAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with required and optional properties along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -79,8 +79,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return only the required properties along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with required and optional properties along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -146,7 +146,7 @@ public Mono> putRequiredOnlyWithResponse(BinaryData body, Request * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with required and optional properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -165,7 +165,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return only the required properties on successful completion of {@link Mono}. + * @return model with required and optional properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalClient.java b/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalClient.java index f617bed9c6..50a64367b6 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalClient.java @@ -52,7 +52,7 @@ public final class RequiredAndOptionalClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with required and optional properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -76,7 +76,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return only the required properties along with {@link Response}. + * @return model with required and optional properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +142,7 @@ public Response putRequiredOnlyWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with required and optional properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -160,7 +160,7 @@ public RequiredAndOptionalProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return only the required properties. + * @return model with required and optional properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/StringLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/StringLiteralAsyncClient.java index 8738ca2114..2c08498887 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/StringLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/StringLiteralAsyncClient.java @@ -53,8 +53,7 @@ public final class StringLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with string literal property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,8 +76,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with string literal property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +140,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with string literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +159,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with string literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/StringLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/StringLiteralClient.java index 9d9edb2a08..20eed2ab15 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/StringLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/StringLiteralClient.java @@ -51,7 +51,7 @@ public final class StringLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with string literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with string literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with string literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public StringLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with string literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/StringOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/StringOperationAsyncClient.java index ccb6ab14d8..83834191d0 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/StringOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/StringOperationAsyncClient.java @@ -53,8 +53,8 @@ public final class StringOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return template type for testing models with optional property along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,8 +77,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return template type for testing models with optional property along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return template type for testing models with optional property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return template type for testing models with optional property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/StringOperationClient.java b/typespec-tests/src/main/java/com/type/property/optional/StringOperationClient.java index f5a89b6b7c..a7bdf1b616 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/StringOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/StringOperationClient.java @@ -51,7 +51,7 @@ public final class StringOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return template type for testing models with optional property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return template type for testing models with optional property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return template type for testing models with optional property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public StringProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return template type for testing models with optional property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralAsyncClient.java index c1a677f4f3..62f49dcf5b 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralAsyncClient.java @@ -53,8 +53,8 @@ public final class UnionFloatLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with union of float literal property along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with union of float literal property along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -142,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with union of float literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with union of float literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralClient.java index d73101ed7b..20952bd2d5 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralClient.java @@ -51,7 +51,7 @@ public final class UnionFloatLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with union of float literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with union of float literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with union of float literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public UnionFloatLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with union of float literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralAsyncClient.java index 0d026ff1c4..f64106a9af 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralAsyncClient.java @@ -53,8 +53,8 @@ public final class UnionIntLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with union of int literal property along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with union of int literal property along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -142,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with union of int literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with union of int literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralClient.java index 0e32a129ab..41c429f898 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralClient.java @@ -51,7 +51,7 @@ public final class UnionIntLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with union of int literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with union of int literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with union of int literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public UnionIntLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with union of int literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralAsyncClient.java index 34e9fd00fa..743b330b69 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralAsyncClient.java @@ -53,8 +53,8 @@ public final class UnionStringLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with union of string literal property along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with union of string literal property along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -142,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with union of string literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with union of string literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralClient.java index c2965da697..21f0905b88 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralClient.java @@ -51,7 +51,7 @@ public final class UnionStringLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with union of string literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with union of string literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with union of string literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public UnionStringLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with union of string literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/BooleanLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/BooleanLiteralsImpl.java index e72269c7a3..143140fb62 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/BooleanLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/BooleanLiteralsImpl.java @@ -64,7 +64,7 @@ public interface BooleanLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/boolean/literal/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/boolean/literal/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/boolean/literal/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/boolean/literal/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/boolean/literal/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/boolean/literal/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/boolean/literal/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,7 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with boolean literal property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +169,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with boolean literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,8 +192,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with boolean literal property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -217,7 +215,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with boolean literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +243,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -269,8 +267,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -293,8 +291,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -317,7 +315,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/BytesImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/BytesImpl.java index 7cfd63358e..313b3ebeca 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/BytesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/BytesImpl.java @@ -63,7 +63,7 @@ public interface BytesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/bytes/all") @@ -72,7 +72,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/bytes/default") @@ -81,7 +81,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/bytes/default") @@ -90,7 +90,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/bytes/all") @@ -99,7 +99,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/bytes/all") @@ -108,8 +108,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/bytes/default") @ExpectedResponses({ 204 }) @@ -117,7 +117,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/bytes/default") @@ -126,7 +126,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -145,8 +145,8 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return template type for testing models with optional property along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -169,7 +169,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return template type for testing models with optional property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -192,8 +192,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return template type for testing models with optional property along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -216,7 +216,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return template type for testing models with optional property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -244,8 +244,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -268,8 +268,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -292,8 +292,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -316,7 +316,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsBytesImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsBytesImpl.java index 2e9533b065..f91daebff6 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsBytesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsBytesImpl.java @@ -64,7 +64,7 @@ public interface CollectionsBytesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/collections/bytes/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/collections/bytes/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/collections/bytes/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/bytes/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/bytes/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/bytes/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/bytes/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -148,8 +148,8 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with collection bytes properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -174,7 +174,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with collection bytes properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -199,7 +199,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with collection bytes properties along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -225,7 +225,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with collection bytes properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -255,8 +255,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -281,8 +281,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -307,8 +307,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -333,7 +333,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsModelsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsModelsImpl.java index d85f5175ea..5ed7dfb397 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsModelsImpl.java @@ -64,7 +64,7 @@ public interface CollectionsModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/collections/model/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/collections/model/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/collections/model/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/model/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/model/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/model/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/model/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -150,8 +150,8 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with collection models properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -178,7 +178,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with collection models properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -205,7 +205,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with collection models properties along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -233,7 +233,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with collection models properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -265,8 +265,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -293,8 +293,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -321,8 +321,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -349,7 +349,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/DatetimeOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/DatetimeOperationsImpl.java index 320cafafdf..17e8959364 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/DatetimeOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/DatetimeOperationsImpl.java @@ -64,7 +64,7 @@ public interface DatetimeOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/datetime/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/datetime/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/datetime/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/datetime/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/datetime/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/datetime/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/datetime/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,7 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +169,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with a datetime property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,8 +192,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -217,7 +215,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with a datetime property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +243,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -269,8 +267,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -293,8 +291,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -317,7 +315,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/DurationOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/DurationOperationsImpl.java index 226ab461ae..8442600b73 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/DurationOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/DurationOperationsImpl.java @@ -64,7 +64,7 @@ public interface DurationOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/duration/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/duration/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/duration/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/duration/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/duration/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/duration/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/duration/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,7 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +169,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with a duration property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,8 +192,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -217,7 +215,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with a duration property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +243,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -269,8 +267,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -293,8 +291,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -317,7 +315,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/FloatLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/FloatLiteralsImpl.java index 0a8453db4e..cf21e52173 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/FloatLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/FloatLiteralsImpl.java @@ -64,7 +64,7 @@ public interface FloatLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/float/literal/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/float/literal/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/float/literal/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/float/literal/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/float/literal/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/float/literal/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/float/literal/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,7 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with float literal property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +169,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with float literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,8 +192,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with float literal property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -217,7 +215,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with float literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +243,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -269,8 +267,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -293,8 +291,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -317,7 +315,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/IntLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/IntLiteralsImpl.java index 8597087a7e..806ab7b2db 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/IntLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/IntLiteralsImpl.java @@ -64,7 +64,7 @@ public interface IntLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/int/literal/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/int/literal/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/int/literal/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/int/literal/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/int/literal/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/int/literal/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/int/literal/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,7 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with int literal property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +169,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with int literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,8 +192,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with int literal property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -217,7 +215,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with int literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +243,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -269,8 +267,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -293,8 +291,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -317,7 +315,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/RequiredAndOptionalsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/RequiredAndOptionalsImpl.java index 4e41231942..f52f9ee63f 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/RequiredAndOptionalsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/RequiredAndOptionalsImpl.java @@ -64,7 +64,7 @@ public interface RequiredAndOptionalsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/requiredAndOptional/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/requiredAndOptional/requiredOnly") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getRequiredOnly(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getRequiredOnly(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/requiredAndOptional/requiredOnly") @@ -91,7 +91,7 @@ Mono> getRequiredOnly(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getRequiredOnlySync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getRequiredOnlySync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/requiredAndOptional/all") @@ -100,7 +100,7 @@ Response getRequiredOnlySync(@HeaderParam("accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/requiredAndOptional/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/requiredAndOptional/requiredOnly") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putRequiredOnly(@HeaderParam("accept") String accept, + Mono> putRequiredOnly(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/requiredAndOptional/requiredOnly") @@ -127,7 +127,7 @@ Mono> putRequiredOnly(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putRequiredOnlySync(@HeaderParam("accept") String accept, + Response putRequiredOnlySync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -147,8 +147,8 @@ Response putRequiredOnlySync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with required and optional properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -172,7 +172,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with required and optional properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -196,8 +196,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return only the required properties along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with required and optional properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getRequiredOnlyWithResponseAsync(RequestOptions requestOptions) { @@ -221,7 +221,7 @@ public Mono> getRequiredOnlyWithResponseAsync(RequestOption * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return only the required properties along with {@link Response}. + * @return model with required and optional properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getRequiredOnlyWithResponse(RequestOptions requestOptions) { @@ -250,8 +250,8 @@ public Response getRequiredOnlyWithResponse(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -275,8 +275,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -300,8 +300,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putRequiredOnlyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putRequiredOnly(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putRequiredOnly(contentType, body, requestOptions, context)); } /** @@ -325,7 +325,7 @@ public Mono> putRequiredOnlyWithResponseAsync(BinaryData body, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putRequiredOnlyWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putRequiredOnlySync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putRequiredOnlySync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/StringLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/StringLiteralsImpl.java index 7dbf99b700..ec3e600a90 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/StringLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/StringLiteralsImpl.java @@ -64,7 +64,7 @@ public interface StringLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/string/literal/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/string/literal/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/string/literal/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/literal/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/literal/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/literal/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/literal/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,7 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with string literal property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +169,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with string literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,8 +192,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with string literal property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -217,7 +215,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with string literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +243,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -269,8 +267,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -293,8 +291,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -317,7 +315,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/StringOperationsImpl.java index 77f6591e40..7bacd8c514 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/StringOperationsImpl.java @@ -64,7 +64,7 @@ public interface StringOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/string/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/string/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/string/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,8 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return template type for testing models with optional property along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return template type for testing models with optional property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,8 +193,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return template type for testing models with optional property along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -217,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return template type for testing models with optional property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +245,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -269,8 +269,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -293,8 +293,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -317,7 +317,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionFloatLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionFloatLiteralsImpl.java index 4decf810ac..f379ffee75 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionFloatLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionFloatLiteralsImpl.java @@ -64,7 +64,7 @@ public interface UnionFloatLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/float/literal/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/float/literal/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/float/literal/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/float/literal/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/float/literal/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/float/literal/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/float/literal/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,8 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with union of float literal property along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with union of float literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,7 +193,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with union of float literal property along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -217,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with union of float literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +245,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -269,8 +269,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -293,8 +293,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -317,7 +317,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionIntLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionIntLiteralsImpl.java index 791550d174..1c00e0d2de 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionIntLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionIntLiteralsImpl.java @@ -64,7 +64,7 @@ public interface UnionIntLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/int/literal/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/int/literal/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/int/literal/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/int/literal/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/int/literal/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/int/literal/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/int/literal/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,8 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with union of int literal property along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with union of int literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,7 +193,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with union of int literal property along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -217,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with union of int literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +245,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -269,8 +269,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -293,8 +293,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -317,7 +317,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionStringLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionStringLiteralsImpl.java index 08636166f8..720046c77e 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionStringLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionStringLiteralsImpl.java @@ -64,7 +64,7 @@ public interface UnionStringLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/string/literal/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/string/literal/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/string/literal/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/string/literal/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/string/literal/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/string/literal/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/string/literal/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,8 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with union of string literal property along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with union of string literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,7 +193,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with union of string literal property along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -217,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with union of string literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +245,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -269,8 +269,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -293,8 +293,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -317,7 +317,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralAsyncClient.java index b6af04d1cb..7ea1a5c8a1 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralAsyncClient.java @@ -53,7 +53,8 @@ public final class BooleanLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a boolean literal property along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +94,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a boolean literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralClient.java index 6b0a528a29..b53578427c 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralClient.java @@ -51,7 +51,7 @@ public final class BooleanLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a boolean literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a boolean literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationAsyncClient.java index ab3775f865..54561c7fd1 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationAsyncClient.java @@ -53,7 +53,7 @@ public final class BooleanOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a boolean property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a boolean property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationClient.java index d4e7f5dd02..ecc3bc534a 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationClient.java @@ -51,7 +51,7 @@ public final class BooleanOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a boolean property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a boolean property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/BytesAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/BytesAsyncClient.java index dd79a17a7b..86659fd345 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/BytesAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/BytesAsyncClient.java @@ -53,7 +53,7 @@ public final class BytesAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a bytes property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a bytes property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/BytesClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/BytesClient.java index d3615f65a8..7cab3afc83 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/BytesClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/BytesClient.java @@ -51,7 +51,7 @@ public final class BytesClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a bytes property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a bytes property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntAsyncClient.java index 2828e55a22..3dec4784d4 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntAsyncClient.java @@ -55,7 +55,8 @@ public final class CollectionsIntAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with collection int properties along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +98,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with collection int properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntClient.java index 0d3b0442ec..1bed50f153 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntClient.java @@ -53,7 +53,7 @@ public final class CollectionsIntClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with collection int properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -95,7 +95,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with collection int properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelAsyncClient.java index b193658be3..a7da97ea3a 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelAsyncClient.java @@ -57,7 +57,8 @@ public final class CollectionsModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with collection model properties along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +102,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with collection model properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelClient.java index 5ba3a996dc..a986c997f8 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelClient.java @@ -55,7 +55,7 @@ public final class CollectionsModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with collection model properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +99,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with collection model properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringAsyncClient.java index c4d33d5d27..a9d54433db 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringAsyncClient.java @@ -55,7 +55,8 @@ public final class CollectionsStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with collection string properties along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +98,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with collection string properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringClient.java index 18405b33ee..4a487152c9 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringClient.java @@ -53,7 +53,7 @@ public final class CollectionsStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with collection string properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -95,7 +95,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with collection string properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationAsyncClient.java index 421c87f118..1f8bfa429b 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationAsyncClient.java @@ -53,7 +53,7 @@ public final class DatetimeOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a datetime property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationClient.java index 4c2c29ea5e..277b42911d 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationClient.java @@ -51,7 +51,7 @@ public final class DatetimeOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a datetime property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a datetime property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128AsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128AsyncClient.java index bbb25640c2..94daa62ddb 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128AsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128AsyncClient.java @@ -53,7 +53,7 @@ public final class Decimal128AsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a decimal128 property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a decimal128 property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128Client.java b/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128Client.java index 6b2e7e0b79..0ac47c1ded 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128Client.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128Client.java @@ -51,7 +51,7 @@ public final class Decimal128Client { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a decimal128 property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a decimal128 property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalAsyncClient.java index 10495283a2..f253962734 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalAsyncClient.java @@ -53,7 +53,7 @@ public final class DecimalAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a decimal property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a decimal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalClient.java index f3f2223231..e4aa41eeb3 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalClient.java @@ -51,7 +51,7 @@ public final class DecimalClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a decimal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a decimal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringAsyncClient.java index b776f2e001..5a6e624202 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringAsyncClient.java @@ -55,7 +55,8 @@ public final class DictionaryStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with dictionary string properties along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +98,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with dictionary string properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringClient.java index 0b7e9ca739..7f2e2591bf 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringClient.java @@ -53,7 +53,7 @@ public final class DictionaryStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with dictionary string properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -95,7 +95,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with dictionary string properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationAsyncClient.java index bf23710596..24c091cfe9 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationAsyncClient.java @@ -53,7 +53,7 @@ public final class DurationOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a duration property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationClient.java index f8452ab301..e8fa93f4a6 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationClient.java @@ -51,7 +51,7 @@ public final class DurationOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a duration property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a duration property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/EnumAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/EnumAsyncClient.java index 6c8d1e4a54..46fc873bd9 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/EnumAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/EnumAsyncClient.java @@ -53,7 +53,7 @@ public final class EnumAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with enum properties along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with enum properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/EnumClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/EnumClient.java index a80ef76bef..a78d401355 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/EnumClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/EnumClient.java @@ -51,7 +51,7 @@ public final class EnumClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with enum properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with enum properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumAsyncClient.java index f7dec5b955..ba6d0b4e22 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumAsyncClient.java @@ -53,7 +53,8 @@ public final class ExtensibleEnumAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with extensible enum properties along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +94,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with extensible enum properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumClient.java index d5085c2041..01f24dea69 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumClient.java @@ -51,7 +51,7 @@ public final class ExtensibleEnumClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with extensible enum properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with extensible enum properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralAsyncClient.java index 8079183e5b..a12cb1ed4d 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralAsyncClient.java @@ -53,7 +53,7 @@ public final class FloatLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a float literal property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a float literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralClient.java index 2ff74c5840..e907cf285d 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralClient.java @@ -51,7 +51,7 @@ public final class FloatLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a float literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a float literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationAsyncClient.java index a2ce50e823..41b46e42ac 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationAsyncClient.java @@ -53,7 +53,7 @@ public final class FloatOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a float property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a float property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationClient.java index fb2acae468..09e4aae6e0 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationClient.java @@ -51,7 +51,7 @@ public final class FloatOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a float property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a float property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/IntAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/IntAsyncClient.java index 58bfa7d20b..4c2a143444 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/IntAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/IntAsyncClient.java @@ -53,7 +53,7 @@ public final class IntAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a int property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a int property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/IntClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/IntClient.java index 5af2cc2da9..7f48765be2 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/IntClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/IntClient.java @@ -51,7 +51,7 @@ public final class IntClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a int property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a int property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralAsyncClient.java index 5e47bc9325..b1f73f525a 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralAsyncClient.java @@ -53,7 +53,7 @@ public final class IntLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a int literal property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a int literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralClient.java index 60d67a57bf..5b62bfb073 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralClient.java @@ -51,7 +51,7 @@ public final class IntLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a int literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a int literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/ModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/ModelAsyncClient.java index c75310c16e..1f3d71a101 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/ModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/ModelAsyncClient.java @@ -55,7 +55,7 @@ public final class ModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with model properties along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with model properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/ModelClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/ModelClient.java index 9e9cba4588..33482c584f 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/ModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/ModelClient.java @@ -53,7 +53,7 @@ public final class ModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with model properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -95,7 +95,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with model properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/NeverAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/NeverAsyncClient.java index a2dfced927..f2d32f8de0 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/NeverAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/NeverAsyncClient.java @@ -51,7 +51,7 @@ public final class NeverAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a property never along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -89,7 +89,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a property never on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/NeverClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/NeverClient.java index 27bb34204f..f10cb31915 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/NeverClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/NeverClient.java @@ -49,7 +49,7 @@ public final class NeverClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a property never along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -87,7 +87,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a property never. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralAsyncClient.java index 89e6d85cc4..c1c31f6ace 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralAsyncClient.java @@ -53,7 +53,8 @@ public final class StringLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a string literal property along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +94,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a string literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralClient.java index 6e7d29ce62..b8a866bf31 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralClient.java @@ -51,7 +51,7 @@ public final class StringLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a string literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a string literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationAsyncClient.java index f1208deeb2..7bfda94e60 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationAsyncClient.java @@ -53,7 +53,7 @@ public final class StringOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a string property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a string property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationClient.java index a11dfddc54..973bd04706 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationClient.java @@ -51,7 +51,7 @@ public final class StringOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a string property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a string property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueAsyncClient.java index 52d1903389..d1d37dc0e3 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueAsyncClient.java @@ -53,7 +53,8 @@ public final class UnionEnumValueAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return template type for testing models with specific properties along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +94,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return template type for testing models with specific properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueClient.java index a1503da5fc..4359412b99 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueClient.java @@ -51,7 +51,7 @@ public final class UnionEnumValueClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return template type for testing models with specific properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return template type for testing models with specific properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralAsyncClient.java index 160e23a08e..fafbea83e6 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralAsyncClient.java @@ -53,7 +53,8 @@ public final class UnionFloatLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a union of float literal as property along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +94,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a union of float literal as property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralClient.java index 5ce4c1c405..bf3e7c9f76 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralClient.java @@ -51,7 +51,7 @@ public final class UnionFloatLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a union of float literal as property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a union of float literal as property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralAsyncClient.java index 4855784b53..44058432f4 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralAsyncClient.java @@ -53,7 +53,8 @@ public final class UnionIntLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a union of int literal as property along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +94,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a union of int literal as property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralClient.java index d570a5aa5e..bcd8faac8d 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralClient.java @@ -51,7 +51,7 @@ public final class UnionIntLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a union of int literal as property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a union of int literal as property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralAsyncClient.java index e64dcb9244..d2536e8fd3 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralAsyncClient.java @@ -53,7 +53,8 @@ public final class UnionStringLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a union of string literal as property along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +94,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a union of string literal as property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralClient.java index 933d39b0bd..f866ff1935 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralClient.java @@ -51,7 +51,7 @@ public final class UnionStringLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a union of string literal as property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a union of string literal as property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayAsyncClient.java index 770b3d5ee5..81777dc7a3 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayAsyncClient.java @@ -53,7 +53,8 @@ public final class UnknownArrayAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a property unknown, and the data is an array along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +94,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a property unknown, and the data is an array on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayClient.java index a085998120..ffea6edef3 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayClient.java @@ -51,7 +51,7 @@ public final class UnknownArrayClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a property unknown, and the data is an array along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a property unknown, and the data is an array. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictAsyncClient.java index 9460b676df..33aa735c73 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictAsyncClient.java @@ -53,7 +53,8 @@ public final class UnknownDictAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a property unknown, and the data is a dictionnary along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +94,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a property unknown, and the data is a dictionnary on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictClient.java index 754d29a11e..9bd638e063 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictClient.java @@ -51,7 +51,7 @@ public final class UnknownDictClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a property unknown, and the data is a dictionnary along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a property unknown, and the data is a dictionnary. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntAsyncClient.java index 6dab5dae36..9188e43b98 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntAsyncClient.java @@ -53,7 +53,8 @@ public final class UnknownIntAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a property unknown, and the data is a int32 along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +94,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a property unknown, and the data is a int32 on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntClient.java index 1e8e38cbd0..fbfec46200 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntClient.java @@ -51,7 +51,7 @@ public final class UnknownIntClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a property unknown, and the data is a int32 along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a property unknown, and the data is a int32. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringAsyncClient.java index e8a87af736..bde5f700b1 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringAsyncClient.java @@ -53,7 +53,8 @@ public final class UnknownStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a property unknown, and the data is a string along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +94,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a property unknown, and the data is a string on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringClient.java index f4f9faf52f..9e3cdf893d 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringClient.java @@ -51,7 +51,7 @@ public final class UnknownStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a property unknown, and the data is a string along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a property unknown, and the data is a string. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanLiteralsImpl.java index f044a6712f..cee9d8137b 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanLiteralsImpl.java @@ -64,7 +64,7 @@ public interface BooleanLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/boolean/literal") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/boolean/literal") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/boolean/literal") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a boolean literal property along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +134,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a boolean literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +162,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +186,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanOperationsImpl.java index 7bc544aa60..0ce856b063 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanOperationsImpl.java @@ -64,7 +64,7 @@ public interface BooleanOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/boolean") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/boolean") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/boolean") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a boolean property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a boolean property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BytesImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BytesImpl.java index 97617c9762..b353b6ca1f 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BytesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BytesImpl.java @@ -63,7 +63,7 @@ public interface BytesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/bytes") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/bytes") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/bytes") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -109,7 +109,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a bytes property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -132,7 +132,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a bytes property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -160,8 +160,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -184,7 +184,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsIntsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsIntsImpl.java index 8b66c952ac..71d5e18e86 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsIntsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsIntsImpl.java @@ -64,7 +64,7 @@ public interface CollectionsIntsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/collections/int") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/collections/int") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/collections/int") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -112,7 +112,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with collection int properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -137,7 +138,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with collection int properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -167,8 +168,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -193,7 +194,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsModelsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsModelsImpl.java index a37cc3bed6..be7b84a2e9 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsModelsImpl.java @@ -64,7 +64,7 @@ public interface CollectionsModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/collections/model") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/collections/model") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/collections/model") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -114,7 +114,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with collection model properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -141,7 +142,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with collection model properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -173,8 +174,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -201,7 +202,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsStringsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsStringsImpl.java index a762c83dd6..64e85967d3 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsStringsImpl.java @@ -64,7 +64,7 @@ public interface CollectionsStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/collections/string") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/collections/string") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/collections/string") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -112,7 +112,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with collection string properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -137,7 +138,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with collection string properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -167,8 +168,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -193,7 +194,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DatetimeOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DatetimeOperationsImpl.java index d8e9cd6481..79029e9a84 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DatetimeOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DatetimeOperationsImpl.java @@ -64,7 +64,7 @@ public interface DatetimeOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/datetime") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/datetime") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/datetime") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a datetime property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/Decimal128sImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/Decimal128sImpl.java index 2e5bb88c9d..05e75e74bd 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/Decimal128sImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/Decimal128sImpl.java @@ -64,7 +64,7 @@ public interface Decimal128sService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/decimal128") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/decimal128") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/decimal128") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a decimal128 property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a decimal128 property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DecimalsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DecimalsImpl.java index ed97eb861f..f285e90d4c 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DecimalsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DecimalsImpl.java @@ -63,7 +63,7 @@ public interface DecimalsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/decimal") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/decimal") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/decimal") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -109,7 +109,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a decimal property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -132,7 +132,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a decimal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -160,8 +160,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -184,7 +184,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DictionaryStringsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DictionaryStringsImpl.java index ba0e9667f8..7e3d7a3d41 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DictionaryStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DictionaryStringsImpl.java @@ -64,7 +64,7 @@ public interface DictionaryStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/dictionary/string") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/dictionary/string") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/dictionary/string") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -112,7 +112,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with dictionary string properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -137,7 +138,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with dictionary string properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -167,8 +168,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -193,7 +194,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DurationOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DurationOperationsImpl.java index 1103d13826..ab3c63609b 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DurationOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DurationOperationsImpl.java @@ -64,7 +64,7 @@ public interface DurationOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/duration") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/duration") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/duration") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a duration property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/EnumsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/EnumsImpl.java index d46ce8bb8c..9ba8a4c9aa 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/EnumsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/EnumsImpl.java @@ -63,7 +63,7 @@ public interface EnumsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/enum") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/enum") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/enum") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -109,7 +109,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with enum properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -132,7 +132,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with enum properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -160,8 +160,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -184,7 +184,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ExtensibleEnumsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ExtensibleEnumsImpl.java index 9c571604fa..6551f029e0 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ExtensibleEnumsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ExtensibleEnumsImpl.java @@ -64,7 +64,7 @@ public interface ExtensibleEnumsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/extensible-enum") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/extensible-enum") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/extensible-enum") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with extensible enum properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +134,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with extensible enum properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +162,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +186,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatLiteralsImpl.java index f7774bca94..f436f4672c 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatLiteralsImpl.java @@ -64,7 +64,7 @@ public interface FloatLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/float/literal") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/float/literal") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/float/literal") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a float literal property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a float literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatOperationsImpl.java index d0706e6297..696c4d14e2 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatOperationsImpl.java @@ -64,7 +64,7 @@ public interface FloatOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/float") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/float") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/float") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a float property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a float property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntLiteralsImpl.java index 0b47e87d0f..ce4f6e5349 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntLiteralsImpl.java @@ -64,7 +64,7 @@ public interface IntLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/int/literal") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/int/literal") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/int/literal") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a int literal property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a int literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntsImpl.java index b74d365f10..ae53179952 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntsImpl.java @@ -63,7 +63,7 @@ public interface IntsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/int") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/int") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/int") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -109,7 +109,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a int property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -132,7 +132,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a int property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -160,8 +160,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -184,7 +184,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ModelsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ModelsImpl.java index 475388e54f..fcfd26085f 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ModelsImpl.java @@ -63,7 +63,7 @@ public interface ModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/model") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/model") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/model") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -111,7 +111,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with model properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -136,7 +136,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with model properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -166,8 +166,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -192,7 +192,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/NeversImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/NeversImpl.java index 0ee5812b2a..8a65c8dfaf 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/NeversImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/NeversImpl.java @@ -63,7 +63,7 @@ public interface NeversService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/never") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/never") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/never") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -107,7 +107,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a property never along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -128,7 +128,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a property never along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -154,8 +154,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -176,7 +176,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringLiteralsImpl.java index 925cfbc34b..601e00a543 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringLiteralsImpl.java @@ -64,7 +64,7 @@ public interface StringLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/string/literal") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/string/literal") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/string/literal") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a string literal property along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +134,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a string literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +162,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +186,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringOperationsImpl.java index 0a14991592..8d4b4f8d66 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringOperationsImpl.java @@ -64,7 +64,7 @@ public interface StringOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/string") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/string") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/string") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a string property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a string property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionEnumValuesImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionEnumValuesImpl.java index d134e37823..a9f141ae34 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionEnumValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionEnumValuesImpl.java @@ -64,7 +64,7 @@ public interface UnionEnumValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/union-enum-value") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union-enum-value") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union-enum-value") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return template type for testing models with specific properties along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +134,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return template type for testing models with specific properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +162,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +186,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionFloatLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionFloatLiteralsImpl.java index 2ef0c1534b..6c300f3fa4 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionFloatLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionFloatLiteralsImpl.java @@ -64,7 +64,7 @@ public interface UnionFloatLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/union/float/literal") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union/float/literal") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union/float/literal") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a union of float literal as property along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +134,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a union of float literal as property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +162,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +186,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionIntLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionIntLiteralsImpl.java index d624ac99a0..177386cc3d 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionIntLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionIntLiteralsImpl.java @@ -64,7 +64,7 @@ public interface UnionIntLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/union/int/literal") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union/int/literal") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union/int/literal") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a union of int literal as property along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +134,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a union of int literal as property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +162,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +186,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionStringLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionStringLiteralsImpl.java index e30da4628a..3e64d4b24a 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionStringLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionStringLiteralsImpl.java @@ -64,7 +64,7 @@ public interface UnionStringLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/union/string/literal") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union/string/literal") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union/string/literal") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a union of string literal as property along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +134,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a union of string literal as property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +162,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +186,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownArraysImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownArraysImpl.java index 62b57490e1..878b12995e 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownArraysImpl.java @@ -64,7 +64,7 @@ public interface UnknownArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/unknown/array") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/array") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/array") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a property unknown, and the data is an array along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +134,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a property unknown, and the data is an array along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +162,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +186,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownDictsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownDictsImpl.java index c13ddac04c..d4a64ff56b 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownDictsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownDictsImpl.java @@ -64,7 +64,7 @@ public interface UnknownDictsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/unknown/dict") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/dict") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/dict") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a property unknown, and the data is a dictionnary along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +134,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a property unknown, and the data is a dictionnary along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +162,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +186,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownIntsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownIntsImpl.java index 18af3c5879..26ae4cdf1d 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownIntsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownIntsImpl.java @@ -64,7 +64,7 @@ public interface UnknownIntsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/unknown/int") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/int") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/int") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a property unknown, and the data is a int32 along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +134,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a property unknown, and the data is a int32 along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +162,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +186,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownStringsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownStringsImpl.java index cc8277e2f2..4e3dc3355c 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownStringsImpl.java @@ -64,7 +64,7 @@ public interface UnknownStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/unknown/string") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/string") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/string") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a property unknown, and the data is a string along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +134,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a property unknown, and the data is a string along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +162,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +186,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/BooleanOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/scalar/BooleanOperationAsyncClient.java index d5d00b8319..a972f827b1 100644 --- a/typespec-tests/src/main/java/com/type/scalar/BooleanOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/scalar/BooleanOperationAsyncClient.java @@ -50,7 +50,8 @@ public final class BooleanOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return boolean value along with {@link Response} on successful completion of {@link Mono}. + * @return boolean with `true` and `false` values along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -88,7 +89,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return boolean value on successful completion of {@link Mono}. + * @return boolean with `true` and `false` values on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/scalar/BooleanOperationClient.java b/typespec-tests/src/main/java/com/type/scalar/BooleanOperationClient.java index b3765fc21e..58777e320d 100644 --- a/typespec-tests/src/main/java/com/type/scalar/BooleanOperationClient.java +++ b/typespec-tests/src/main/java/com/type/scalar/BooleanOperationClient.java @@ -48,7 +48,7 @@ public final class BooleanOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return boolean value along with {@link Response}. + * @return boolean with `true` and `false` values along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -86,7 +86,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return boolean value. + * @return boolean with `true` and `false` values. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/scalar/StringOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/scalar/StringOperationAsyncClient.java index a08bd9dfcd..b0bcf6b3c5 100644 --- a/typespec-tests/src/main/java/com/type/scalar/StringOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/scalar/StringOperationAsyncClient.java @@ -50,7 +50,7 @@ public final class StringOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return string value along with {@link Response} on successful completion of {@link Mono}. + * @return a sequence of textual characters along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -88,7 +88,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string value on successful completion of {@link Mono}. + * @return a sequence of textual characters on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/scalar/StringOperationClient.java b/typespec-tests/src/main/java/com/type/scalar/StringOperationClient.java index f3b4f77150..a79d03671f 100644 --- a/typespec-tests/src/main/java/com/type/scalar/StringOperationClient.java +++ b/typespec-tests/src/main/java/com/type/scalar/StringOperationClient.java @@ -48,7 +48,7 @@ public final class StringOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return string value along with {@link Response}. + * @return a sequence of textual characters along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -86,7 +86,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string value. + * @return a sequence of textual characters. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/scalar/UnknownAsyncClient.java b/typespec-tests/src/main/java/com/type/scalar/UnknownAsyncClient.java index 1a0c97e690..4628e26fd2 100644 --- a/typespec-tests/src/main/java/com/type/scalar/UnknownAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/scalar/UnknownAsyncClient.java @@ -50,7 +50,7 @@ public final class UnknownAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return unknown value along with {@link Response} on successful completion of {@link Mono}. + * @return anything along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -88,7 +88,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return unknown value on successful completion of {@link Mono}. + * @return anything on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/scalar/UnknownClient.java b/typespec-tests/src/main/java/com/type/scalar/UnknownClient.java index 6a09092ec3..1df551ca87 100644 --- a/typespec-tests/src/main/java/com/type/scalar/UnknownClient.java +++ b/typespec-tests/src/main/java/com/type/scalar/UnknownClient.java @@ -48,7 +48,7 @@ public final class UnknownClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return unknown value along with {@link Response}. + * @return anything along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -86,7 +86,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return unknown value. + * @return anything. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/BooleanOperationsImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/BooleanOperationsImpl.java index 85a5e4540d..0b93ca47a7 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/BooleanOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/BooleanOperationsImpl.java @@ -64,7 +64,7 @@ public interface BooleanOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/boolean") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/scalar/boolean") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/scalar/boolean") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -108,7 +108,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return boolean value along with {@link Response} on successful completion of {@link Mono}. + * @return boolean with `true` and `false` values along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -129,7 +130,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return boolean value along with {@link Response}. + * @return boolean with `true` and `false` values along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -155,8 +156,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -177,7 +178,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128TypesImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128TypesImpl.java index 7888d3acb3..ead3edeadf 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128TypesImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128TypesImpl.java @@ -66,7 +66,7 @@ public interface Decimal128TypesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> responseBody(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> responseBody(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal128/response_body") @@ -75,7 +75,7 @@ Mono> responseBody(@HeaderParam("accept") String accept, Re @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response responseBodySync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response responseBodySync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/scalar/decimal128/resquest_body") @@ -84,7 +84,7 @@ Response responseBodySync(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> requestBody(@HeaderParam("accept") String accept, + Mono> requestBody(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/scalar/decimal128/resquest_body") @@ -93,7 +93,7 @@ Mono> requestBody(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requestBodySync(@HeaderParam("accept") String accept, + Response requestBodySync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal128/request_parameter") @@ -102,8 +102,8 @@ Response requestBodySync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> requestParameter(@QueryParam("value") BigDecimal value, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> requestParameter(@QueryParam("value") BigDecimal value, RequestOptions requestOptions, + Context context); @Get("/type/scalar/decimal128/request_parameter") @ExpectedResponses({ 204 }) @@ -111,8 +111,8 @@ Mono> requestParameter(@QueryParam("value") BigDecimal value, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requestParameterSync(@QueryParam("value") BigDecimal value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response requestParameterSync(@QueryParam("value") BigDecimal value, RequestOptions requestOptions, + Context context); } /** @@ -175,8 +175,8 @@ public Response responseBodyWithResponse(RequestOptions requestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> requestBodyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.requestBody(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.requestBody(contentType, body, requestOptions, context)); } /** @@ -197,8 +197,8 @@ public Mono> requestBodyWithResponseAsync(BinaryData body, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response requestBodyWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.requestBodySync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.requestBodySync(contentType, body, requestOptions, Context.NONE); } /** @@ -214,8 +214,7 @@ public Response requestBodyWithResponse(BinaryData body, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> requestParameterWithResponseAsync(BigDecimal value, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.requestParameter(value, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.requestParameter(value, requestOptions, context)); } /** @@ -231,7 +230,6 @@ public Mono> requestParameterWithResponseAsync(BigDecimal value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response requestParameterWithResponse(BigDecimal value, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.requestParameterSync(value, accept, requestOptions, Context.NONE); + return service.requestParameterSync(value, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128VerifiesImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128VerifiesImpl.java index 9ab59d8665..873e28ba4e 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128VerifiesImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128VerifiesImpl.java @@ -64,7 +64,7 @@ public interface Decimal128VerifiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> prepareVerify(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> prepareVerify(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal128/prepare_verify") @@ -73,7 +73,7 @@ Mono> prepareVerify(@HeaderParam("accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response prepareVerifySync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response prepareVerifySync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/scalar/decimal128/verify") @@ -82,7 +82,7 @@ Response prepareVerifySync(@HeaderParam("accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> verify(@HeaderParam("accept") String accept, + Mono> verify(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/type/scalar/decimal128/verify") @@ -91,8 +91,8 @@ Mono> verify(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response verifySync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response verifySync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -159,8 +159,8 @@ public Response prepareVerifyWithResponse(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> verifyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.verify(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.verify(contentType, body, requestOptions, context)); } /** @@ -181,7 +181,7 @@ public Mono> verifyWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response verifyWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.verifySync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.verifySync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalTypesImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalTypesImpl.java index e44f5908ad..5773f7981d 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalTypesImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalTypesImpl.java @@ -66,7 +66,7 @@ public interface DecimalTypesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> responseBody(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> responseBody(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal/response_body") @@ -75,7 +75,7 @@ Mono> responseBody(@HeaderParam("accept") String accept, Re @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response responseBodySync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response responseBodySync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/scalar/decimal/resquest_body") @@ -84,7 +84,7 @@ Response responseBodySync(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> requestBody(@HeaderParam("accept") String accept, + Mono> requestBody(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/scalar/decimal/resquest_body") @@ -93,7 +93,7 @@ Mono> requestBody(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requestBodySync(@HeaderParam("accept") String accept, + Response requestBodySync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal/request_parameter") @@ -102,8 +102,8 @@ Response requestBodySync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> requestParameter(@QueryParam("value") BigDecimal value, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> requestParameter(@QueryParam("value") BigDecimal value, RequestOptions requestOptions, + Context context); @Get("/type/scalar/decimal/request_parameter") @ExpectedResponses({ 204 }) @@ -111,8 +111,8 @@ Mono> requestParameter(@QueryParam("value") BigDecimal value, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requestParameterSync(@QueryParam("value") BigDecimal value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response requestParameterSync(@QueryParam("value") BigDecimal value, RequestOptions requestOptions, + Context context); } /** @@ -176,8 +176,8 @@ public Response responseBodyWithResponse(RequestOptions requestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> requestBodyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.requestBody(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.requestBody(contentType, body, requestOptions, context)); } /** @@ -198,8 +198,8 @@ public Mono> requestBodyWithResponseAsync(BinaryData body, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response requestBodyWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.requestBodySync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.requestBodySync(contentType, body, requestOptions, Context.NONE); } /** @@ -215,8 +215,7 @@ public Response requestBodyWithResponse(BinaryData body, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> requestParameterWithResponseAsync(BigDecimal value, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.requestParameter(value, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.requestParameter(value, requestOptions, context)); } /** @@ -232,7 +231,6 @@ public Mono> requestParameterWithResponseAsync(BigDecimal value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response requestParameterWithResponse(BigDecimal value, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.requestParameterSync(value, accept, requestOptions, Context.NONE); + return service.requestParameterSync(value, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalVerifiesImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalVerifiesImpl.java index 4917636063..c1981b7463 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalVerifiesImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalVerifiesImpl.java @@ -64,7 +64,7 @@ public interface DecimalVerifiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> prepareVerify(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> prepareVerify(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal/prepare_verify") @@ -73,7 +73,7 @@ Mono> prepareVerify(@HeaderParam("accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response prepareVerifySync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response prepareVerifySync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/scalar/decimal/verify") @@ -82,7 +82,7 @@ Response prepareVerifySync(@HeaderParam("accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> verify(@HeaderParam("accept") String accept, + Mono> verify(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/type/scalar/decimal/verify") @@ -91,8 +91,8 @@ Mono> verify(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response verifySync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response verifySync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -159,8 +159,8 @@ public Response prepareVerifyWithResponse(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> verifyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.verify(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.verify(contentType, body, requestOptions, context)); } /** @@ -181,7 +181,7 @@ public Mono> verifyWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response verifyWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.verifySync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.verifySync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/StringOperationsImpl.java index 577df014e4..08ecfcdc44 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/StringOperationsImpl.java @@ -64,7 +64,7 @@ public interface StringOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/string") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/scalar/string") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/scalar/string") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -108,7 +108,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return string value along with {@link Response} on successful completion of {@link Mono}. + * @return a sequence of textual characters along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -129,7 +129,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return string value along with {@link Response}. + * @return a sequence of textual characters along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -155,8 +155,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -177,7 +177,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/UnknownsImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/UnknownsImpl.java index fdd5fea491..a58950e0b2 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/UnknownsImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/UnknownsImpl.java @@ -63,7 +63,7 @@ public interface UnknownsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/unknown") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/scalar/unknown") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/scalar/unknown") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -107,7 +107,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return unknown value along with {@link Response} on successful completion of {@link Mono}. + * @return anything along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -128,7 +128,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return unknown value along with {@link Response}. + * @return anything along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -154,8 +154,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -176,7 +176,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/EnumsOnliesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/EnumsOnliesImpl.java index 1e77334931..b212091519 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/EnumsOnliesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/EnumsOnliesImpl.java @@ -64,7 +64,7 @@ public interface EnumsOnliesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/enums-only") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/enums-only") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("accept") String accept, + Mono> send(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest3, RequestOptions requestOptions, Context context); @Post("/type/union/enums-only") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("accept") String accept, + Response sendSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest3, RequestOptions requestOptions, Context context); } @@ -170,8 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest3, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.send(accept, sendRequest3, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.send(contentType, sendRequest3, requestOptions, context)); } /** @@ -197,7 +197,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest3, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest3, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendSync(accept, sendRequest3, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sendSync(contentType, sendRequest3, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/FloatsOnliesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/FloatsOnliesImpl.java index 0d38239585..a59bb71ea2 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/FloatsOnliesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/FloatsOnliesImpl.java @@ -64,7 +64,7 @@ public interface FloatsOnliesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/floats-only") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/floats-only") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("accept") String accept, + Mono> send(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest5, RequestOptions requestOptions, Context context); @Post("/type/union/floats-only") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("accept") String accept, + Response sendSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest5, RequestOptions requestOptions, Context context); } @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest5, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.send(accept, sendRequest5, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.send(contentType, sendRequest5, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest5, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest5, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendSync(accept, sendRequest5, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sendSync(contentType, sendRequest5, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/IntsOnliesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/IntsOnliesImpl.java index a83f054fc6..99d90d9646 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/IntsOnliesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/IntsOnliesImpl.java @@ -64,7 +64,7 @@ public interface IntsOnliesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/ints-only") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/ints-only") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("accept") String accept, + Mono> send(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest6, RequestOptions requestOptions, Context context); @Post("/type/union/ints-only") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("accept") String accept, + Response sendSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest6, RequestOptions requestOptions, Context context); } @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest6, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.send(accept, sendRequest6, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.send(contentType, sendRequest6, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest6, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest6, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendSync(accept, sendRequest6, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sendSync(contentType, sendRequest6, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/MixedLiteralsImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/MixedLiteralsImpl.java index 0009929c23..24bff76dff 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/MixedLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/MixedLiteralsImpl.java @@ -64,7 +64,7 @@ public interface MixedLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/mixed-literals") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/mixed-literals") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("accept") String accept, + Mono> send(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest1, RequestOptions requestOptions, Context context); @Post("/type/union/mixed-literals") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("accept") String accept, + Response sendSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest1, RequestOptions requestOptions, Context context); } @@ -176,8 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest1, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.send(accept, sendRequest1, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.send(contentType, sendRequest1, requestOptions, context)); } /** @@ -205,7 +205,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest1, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest1, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendSync(accept, sendRequest1, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sendSync(contentType, sendRequest1, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/MixedTypesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/MixedTypesImpl.java index cfa98f8b9f..aafe11c1b4 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/MixedTypesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/MixedTypesImpl.java @@ -64,7 +64,7 @@ public interface MixedTypesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/mixed-types") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/mixed-types") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("accept") String accept, + Mono> send(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest, RequestOptions requestOptions, Context context); @Post("/type/union/mixed-types") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("accept") String accept, + Response sendSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest, RequestOptions requestOptions, Context context); } @@ -185,8 +185,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.send(accept, sendRequest, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.send(contentType, sendRequest, requestOptions, context)); } /** @@ -217,7 +217,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendSync(accept, sendRequest, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sendSync(contentType, sendRequest, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/ModelsOnliesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/ModelsOnliesImpl.java index b4e16f01c6..769705e92e 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/ModelsOnliesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/ModelsOnliesImpl.java @@ -64,7 +64,7 @@ public interface ModelsOnliesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/models-only") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/models-only") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("accept") String accept, + Mono> send(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest4, RequestOptions requestOptions, Context context); @Post("/type/union/models-only") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("accept") String accept, + Response sendSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest4, RequestOptions requestOptions, Context context); } @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest4, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.send(accept, sendRequest4, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.send(contentType, sendRequest4, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest4, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest4, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendSync(accept, sendRequest4, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sendSync(contentType, sendRequest4, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/StringAndArraysImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/StringAndArraysImpl.java index 82db1f931b..72ad57f6c0 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/StringAndArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/StringAndArraysImpl.java @@ -64,7 +64,7 @@ public interface StringAndArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/string-and-array") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/string-and-array") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("accept") String accept, + Mono> send(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest2, RequestOptions requestOptions, Context context); @Post("/type/union/string-and-array") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("accept") String accept, + Response sendSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest2, RequestOptions requestOptions, Context context); } @@ -170,8 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest2, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.send(accept, sendRequest2, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.send(contentType, sendRequest2, requestOptions, context)); } /** @@ -197,7 +197,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest2, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest2, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendSync(accept, sendRequest2, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sendSync(contentType, sendRequest2, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/StringExtensibleNamedsImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/StringExtensibleNamedsImpl.java index 8066f73f79..b52c1fd016 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/StringExtensibleNamedsImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/StringExtensibleNamedsImpl.java @@ -64,7 +64,7 @@ public interface StringExtensibleNamedsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/string-extensible-named") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/string-extensible-named") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("accept") String accept, + Mono> send(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest7, RequestOptions requestOptions, Context context); @Post("/type/union/string-extensible-named") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("accept") String accept, + Response sendSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest7, RequestOptions requestOptions, Context context); } @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest7, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.send(accept, sendRequest7, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.send(contentType, sendRequest7, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest7, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest7, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendSync(accept, sendRequest7, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sendSync(contentType, sendRequest7, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/StringExtensiblesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/StringExtensiblesImpl.java index ed83e7409a..91d254d8b4 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/StringExtensiblesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/StringExtensiblesImpl.java @@ -64,7 +64,7 @@ public interface StringExtensiblesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/string-extensible") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/string-extensible") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("accept") String accept, + Mono> send(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest8, RequestOptions requestOptions, Context context); @Post("/type/union/string-extensible") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("accept") String accept, + Response sendSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest8, RequestOptions requestOptions, Context context); } @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest8, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.send(accept, sendRequest8, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.send(contentType, sendRequest8, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest8, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest8, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendSync(accept, sendRequest8, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sendSync(contentType, sendRequest8, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/StringsOnliesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/StringsOnliesImpl.java index 58d503544e..a1f5912b78 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/StringsOnliesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/StringsOnliesImpl.java @@ -64,7 +64,7 @@ public interface StringsOnliesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/strings-only") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/strings-only") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("accept") String accept, + Mono> send(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest9, RequestOptions requestOptions, Context context); @Post("/type/union/strings-only") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("accept") String accept, + Response sendSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest9, RequestOptions requestOptions, Context context); } @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest9, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.send(accept, sendRequest9, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.send(contentType, sendRequest9, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest9, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest9, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendSync(accept, sendRequest9, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sendSync(contentType, sendRequest9, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/versioning/added/implementation/AddedClientImpl.java b/typespec-tests/src/main/java/com/versioning/added/implementation/AddedClientImpl.java index ea3c2305cd..76f0d27904 100644 --- a/typespec-tests/src/main/java/com/versioning/added/implementation/AddedClientImpl.java +++ b/typespec-tests/src/main/java/com/versioning/added/implementation/AddedClientImpl.java @@ -184,8 +184,9 @@ public interface AddedClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> v1(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("header-v2") String headerV2, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("header-v2") String headerV2, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/v1") @ExpectedResponses({ 200 }) @@ -194,8 +195,9 @@ Mono> v1(@HostParam("endpoint") String endpoint, @HostParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response v1Sync(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("header-v2") String headerV2, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("header-v2") String headerV2, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/v2") @ExpectedResponses({ 200 }) @@ -204,8 +206,8 @@ Response v1Sync(@HostParam("endpoint") String endpoint, @HostParam(" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> v2(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/v2") @ExpectedResponses({ 200 }) @@ -214,8 +216,8 @@ Mono> v2(@HostParam("endpoint") String endpoint, @HostParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response v2Sync(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -252,9 +254,10 @@ Response v2Sync(@HostParam("endpoint") String endpoint, @HostParam(" @ServiceMethod(returns = ReturnType.SINGLE) public Mono> v1WithResponseAsync(String headerV2, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.v1(this.getEndpoint(), this.getVersion(), headerV2, accept, body, - requestOptions, context)); + return FluxUtil.withContext(context -> service.v1(this.getEndpoint(), this.getVersion(), headerV2, contentType, + accept, body, requestOptions, context)); } /** @@ -290,9 +293,10 @@ public Mono> v1WithResponseAsync(String headerV2, BinaryDat */ @ServiceMethod(returns = ReturnType.SINGLE) public Response v1WithResponse(String headerV2, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.v1Sync(this.getEndpoint(), this.getVersion(), headerV2, accept, body, requestOptions, - Context.NONE); + return service.v1Sync(this.getEndpoint(), this.getVersion(), headerV2, contentType, accept, body, + requestOptions, Context.NONE); } /** @@ -327,9 +331,10 @@ public Response v1WithResponse(String headerV2, BinaryData body, Req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> v2WithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.v2(this.getEndpoint(), this.getVersion(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.v2(this.getEndpoint(), this.getVersion(), contentType, accept, + body, requestOptions, context)); } /** @@ -364,7 +369,9 @@ public Mono> v2WithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response v2WithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.v2Sync(this.getEndpoint(), this.getVersion(), accept, body, requestOptions, Context.NONE); + return service.v2Sync(this.getEndpoint(), this.getVersion(), contentType, accept, body, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/versioning/added/implementation/InterfaceV2sImpl.java b/typespec-tests/src/main/java/com/versioning/added/implementation/InterfaceV2sImpl.java index 31d6ad0d3c..a032c93597 100644 --- a/typespec-tests/src/main/java/com/versioning/added/implementation/InterfaceV2sImpl.java +++ b/typespec-tests/src/main/java/com/versioning/added/implementation/InterfaceV2sImpl.java @@ -75,8 +75,9 @@ public interface InterfaceV2sService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> v2InInterface(@HostParam("endpoint") String endpoint, - @HostParam("version") String version, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HostParam("version") String version, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/interface-v2/v2") @ExpectedResponses({ 200 }) @@ -85,8 +86,9 @@ Mono> v2InInterface(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response v2InInterfaceSync(@HostParam("endpoint") String endpoint, - @HostParam("version") String version, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HostParam("version") String version, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -121,9 +123,10 @@ Response v2InInterfaceSync(@HostParam("endpoint") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> v2InInterfaceWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.v2InInterface(this.client.getEndpoint(), - this.client.getVersion(), accept, body, requestOptions, context)); + this.client.getVersion(), contentType, accept, body, requestOptions, context)); } /** @@ -158,8 +161,9 @@ public Mono> v2InInterfaceWithResponseAsync(BinaryData body */ @ServiceMethod(returns = ReturnType.SINGLE) public Response v2InInterfaceWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.v2InInterfaceSync(this.client.getEndpoint(), this.client.getVersion(), accept, body, + return service.v2InInterfaceSync(this.client.getEndpoint(), this.client.getVersion(), contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/versioning/madeoptional/implementation/MadeOptionalClientImpl.java b/typespec-tests/src/main/java/com/versioning/madeoptional/implementation/MadeOptionalClientImpl.java index 11b87890d5..fc57f6064f 100644 --- a/typespec-tests/src/main/java/com/versioning/madeoptional/implementation/MadeOptionalClientImpl.java +++ b/typespec-tests/src/main/java/com/versioning/madeoptional/implementation/MadeOptionalClientImpl.java @@ -171,8 +171,8 @@ public interface MadeOptionalClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> test(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/test") @ExpectedResponses({ 200 }) @@ -181,8 +181,8 @@ Mono> test(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response testSync(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -222,9 +222,10 @@ Response testSync(@HostParam("endpoint") String endpoint, @HostParam */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> testWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.test(this.getEndpoint(), this.getVersion(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.test(this.getEndpoint(), this.getVersion(), contentType, accept, + body, requestOptions, context)); } /** @@ -264,7 +265,9 @@ public Mono> testWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response testWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.testSync(this.getEndpoint(), this.getVersion(), accept, body, requestOptions, Context.NONE); + return service.testSync(this.getEndpoint(), this.getVersion(), contentType, accept, body, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/versioning/removed/implementation/RemovedClientImpl.java b/typespec-tests/src/main/java/com/versioning/removed/implementation/RemovedClientImpl.java index 75be98281d..74936454ac 100644 --- a/typespec-tests/src/main/java/com/versioning/removed/implementation/RemovedClientImpl.java +++ b/typespec-tests/src/main/java/com/versioning/removed/implementation/RemovedClientImpl.java @@ -169,8 +169,8 @@ public interface RemovedClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> v2(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/v2") @ExpectedResponses({ 200 }) @@ -179,8 +179,8 @@ Mono> v2(@HostParam("endpoint") String endpoint, @HostParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response v2Sync(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -215,9 +215,10 @@ Response v2Sync(@HostParam("endpoint") String endpoint, @HostParam(" */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> v2WithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.v2(this.getEndpoint(), this.getVersion(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.v2(this.getEndpoint(), this.getVersion(), contentType, accept, + body, requestOptions, context)); } /** @@ -252,7 +253,9 @@ public Mono> v2WithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response v2WithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.v2Sync(this.getEndpoint(), this.getVersion(), accept, body, requestOptions, Context.NONE); + return service.v2Sync(this.getEndpoint(), this.getVersion(), contentType, accept, body, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/versioning/renamedfrom/implementation/NewInterfacesImpl.java b/typespec-tests/src/main/java/com/versioning/renamedfrom/implementation/NewInterfacesImpl.java index 3efaf2c5a5..4f6dd02c68 100644 --- a/typespec-tests/src/main/java/com/versioning/renamedfrom/implementation/NewInterfacesImpl.java +++ b/typespec-tests/src/main/java/com/versioning/renamedfrom/implementation/NewInterfacesImpl.java @@ -75,8 +75,9 @@ public interface NewInterfacesService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> newOpInNewInterface(@HostParam("endpoint") String endpoint, - @HostParam("version") String version, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HostParam("version") String version, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/interface/test") @ExpectedResponses({ 200 }) @@ -85,8 +86,9 @@ Mono> newOpInNewInterface(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response newOpInNewInterfaceSync(@HostParam("endpoint") String endpoint, - @HostParam("version") String version, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HostParam("version") String version, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -122,9 +124,10 @@ Response newOpInNewInterfaceSync(@HostParam("endpoint") String endpo @ServiceMethod(returns = ReturnType.SINGLE) public Mono> newOpInNewInterfaceWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.newOpInNewInterface(this.client.getEndpoint(), - this.client.getVersion(), accept, body, requestOptions, context)); + this.client.getVersion(), contentType, accept, body, requestOptions, context)); } /** @@ -159,8 +162,9 @@ public Mono> newOpInNewInterfaceWithResponseAsync(BinaryDat */ @ServiceMethod(returns = ReturnType.SINGLE) public Response newOpInNewInterfaceWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.newOpInNewInterfaceSync(this.client.getEndpoint(), this.client.getVersion(), accept, body, - requestOptions, Context.NONE); + return service.newOpInNewInterfaceSync(this.client.getEndpoint(), this.client.getVersion(), contentType, accept, + body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/versioning/renamedfrom/implementation/RenamedFromClientImpl.java b/typespec-tests/src/main/java/com/versioning/renamedfrom/implementation/RenamedFromClientImpl.java index 8cb793c44a..4b3e777ef4 100644 --- a/typespec-tests/src/main/java/com/versioning/renamedfrom/implementation/RenamedFromClientImpl.java +++ b/typespec-tests/src/main/java/com/versioning/renamedfrom/implementation/RenamedFromClientImpl.java @@ -186,8 +186,9 @@ public interface RenamedFromClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> newOp(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @QueryParam("newQuery") String newQuery, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("newQuery") String newQuery, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/test") @ExpectedResponses({ 200 }) @@ -196,8 +197,9 @@ Mono> newOp(@HostParam("endpoint") String endpoint, @HostPa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response newOpSync(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @QueryParam("newQuery") String newQuery, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("newQuery") String newQuery, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -234,9 +236,10 @@ Response newOpSync(@HostParam("endpoint") String endpoint, @HostPara @ServiceMethod(returns = ReturnType.SINGLE) public Mono> newOpWithResponseAsync(String newQuery, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.newOp(this.getEndpoint(), this.getVersion(), newQuery, accept, - body, requestOptions, context)); + return FluxUtil.withContext(context -> service.newOp(this.getEndpoint(), this.getVersion(), newQuery, + contentType, accept, body, requestOptions, context)); } /** @@ -272,8 +275,9 @@ public Mono> newOpWithResponseAsync(String newQuery, Binary */ @ServiceMethod(returns = ReturnType.SINGLE) public Response newOpWithResponse(String newQuery, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.newOpSync(this.getEndpoint(), this.getVersion(), newQuery, accept, body, requestOptions, - Context.NONE); + return service.newOpSync(this.getEndpoint(), this.getVersion(), newQuery, contentType, accept, body, + requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/versioning/returntypechangedfrom/implementation/ReturnTypeChangedFromClientImpl.java b/typespec-tests/src/main/java/com/versioning/returntypechangedfrom/implementation/ReturnTypeChangedFromClientImpl.java index 58e80a8662..ac32c99f2e 100644 --- a/typespec-tests/src/main/java/com/versioning/returntypechangedfrom/implementation/ReturnTypeChangedFromClientImpl.java +++ b/typespec-tests/src/main/java/com/versioning/returntypechangedfrom/implementation/ReturnTypeChangedFromClientImpl.java @@ -172,8 +172,8 @@ public interface ReturnTypeChangedFromClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> test(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/test") @ExpectedResponses({ 200 }) @@ -182,8 +182,8 @@ Mono> test(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response testSync(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -210,9 +210,10 @@ Response testSync(@HostParam("endpoint") String endpoint, @HostParam */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> testWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.test(this.getEndpoint(), this.getVersion(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.test(this.getEndpoint(), this.getVersion(), contentType, accept, + body, requestOptions, context)); } /** @@ -239,7 +240,9 @@ public Mono> testWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response testWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.testSync(this.getEndpoint(), this.getVersion(), accept, body, requestOptions, Context.NONE); + return service.testSync(this.getEndpoint(), this.getVersion(), contentType, accept, body, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/versioning/typechangedfrom/implementation/TypeChangedFromClientImpl.java b/typespec-tests/src/main/java/com/versioning/typechangedfrom/implementation/TypeChangedFromClientImpl.java index b11f99fc16..76874be3a0 100644 --- a/typespec-tests/src/main/java/com/versioning/typechangedfrom/implementation/TypeChangedFromClientImpl.java +++ b/typespec-tests/src/main/java/com/versioning/typechangedfrom/implementation/TypeChangedFromClientImpl.java @@ -172,8 +172,9 @@ public interface TypeChangedFromClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> test(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @QueryParam("param") String param, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("param") String param, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/test") @ExpectedResponses({ 200 }) @@ -182,8 +183,9 @@ Mono> test(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response testSync(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @QueryParam("param") String param, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("param") String param, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -218,9 +220,10 @@ Response testSync(@HostParam("endpoint") String endpoint, @HostParam @ServiceMethod(returns = ReturnType.SINGLE) public Mono> testWithResponseAsync(String param, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.test(this.getEndpoint(), this.getVersion(), param, accept, body, - requestOptions, context)); + return FluxUtil.withContext(context -> service.test(this.getEndpoint(), this.getVersion(), param, contentType, + accept, body, requestOptions, context)); } /** @@ -254,8 +257,9 @@ public Mono> testWithResponseAsync(String param, BinaryData */ @ServiceMethod(returns = ReturnType.SINGLE) public Response testWithResponse(String param, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.testSync(this.getEndpoint(), this.getVersion(), param, accept, body, requestOptions, + return service.testSync(this.getEndpoint(), this.getVersion(), param, contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/resources/cadl-optional.properties b/typespec-tests/src/main/resources/cadl-optional.properties deleted file mode 100644 index ca812989b4..0000000000 --- a/typespec-tests/src/main/resources/cadl-optional.properties +++ /dev/null @@ -1,2 +0,0 @@ -name=${project.artifactId} -version=${project.version} diff --git a/typespec-tests/src/samples/java/com/cadl/builtin/generated/BuiltinOpRead.java b/typespec-tests/src/samples/java/com/cadl/builtin/generated/BuiltinOpRead.java deleted file mode 100644 index b6e217eb16..0000000000 --- a/typespec-tests/src/samples/java/com/cadl/builtin/generated/BuiltinOpRead.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.cadl.builtin.generated; - -import com.azure.core.util.Configuration; -import com.cadl.builtin.BuiltinClient; -import com.cadl.builtin.BuiltinClientBuilder; -import com.cadl.builtin.models.Builtin; - -public class BuiltinOpRead { - public static void main(String[] args) { - BuiltinClient builtinClient - = new BuiltinClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")).buildClient(); - // BEGIN:com.cadl.builtin.generated.builtinopread.builtinopread - Builtin response = builtinClient.read(null, null, null, "myFilter", null, null); - // END:com.cadl.builtin.generated.builtinopread.builtinopread - } -} diff --git a/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSend.java b/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSend.java deleted file mode 100644 index 599899249b..0000000000 --- a/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSend.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.cadl.flatten.generated; - -import com.azure.core.util.Configuration; -import com.cadl.flatten.FlattenClient; -import com.cadl.flatten.FlattenClientBuilder; -import com.cadl.flatten.models.User; - -public class FlattenOpSend { - public static void main(String[] args) { - FlattenClient flattenClient - = new FlattenClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")).buildClient(); - // BEGIN:com.cadl.flatten.generated.send.flattenopsend - flattenClient.send("myRequiredId", "myRequiredInput", new User("myOptionalUser")); - // END:com.cadl.flatten.generated.send.flattenopsend - } -} diff --git a/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSendLong.java b/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSendLong.java deleted file mode 100644 index 4a373d51f4..0000000000 --- a/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSendLong.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.cadl.flatten.generated; - -import com.azure.core.util.Configuration; -import com.cadl.flatten.FlattenClient; -import com.cadl.flatten.FlattenClientBuilder; -import com.cadl.flatten.models.SendLongOptions; -import com.cadl.flatten.models.TodoItemStatus; -import com.cadl.flatten.models.User; - -public class FlattenOpSendLong { - public static void main(String[] args) { - FlattenClient flattenClient - = new FlattenClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")).buildClient(); - // BEGIN:com.cadl.flatten.generated.sendlong.flattenopsendlong - flattenClient - .sendLong(new SendLongOptions("myRequiredId", "myRequiredInput", 11, "title", TodoItemStatus.NOT_STARTED) - .setFilter("name=myName") - .setUser(new User("myOptionalUser")) - .setDataIntOptional(12) - .setDataLong(13L) - .setDataFloat(14.0D) - .setDescription("description")); - // END:com.cadl.flatten.generated.sendlong.flattenopsendlong - } -} diff --git a/typespec-tests/src/samples/java/com/cadl/longrunning/generated/LongRunningCreateJob.java b/typespec-tests/src/samples/java/com/cadl/longrunning/generated/LongRunningCreateJob.java deleted file mode 100644 index 541ca15df3..0000000000 --- a/typespec-tests/src/samples/java/com/cadl/longrunning/generated/LongRunningCreateJob.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.cadl.longrunning.generated; - -import com.azure.core.util.Configuration; -import com.azure.core.util.polling.SyncPoller; -import com.cadl.longrunning.LongRunningClient; -import com.cadl.longrunning.LongRunningClientBuilder; -import com.cadl.longrunning.models.JobData; -import com.cadl.longrunning.models.JobResult; -import com.cadl.longrunning.models.JobResultResult; -import java.util.HashMap; -import java.util.Map; - -public class LongRunningCreateJob { - public static void main(String[] args) { - LongRunningClient longRunningClient - = new LongRunningClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.cadl.longrunning.generated.createjob.longrunningcreatejob - SyncPoller response = longRunningClient - .beginCreateJob(new JobData(mapOf("max", 15.0D, "min", 14.0D, "average", 14.3D)).setConfiguration("{}")); - // END:com.cadl.longrunning.generated.createjob.longrunningcreatejob - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/typespec-tests/src/samples/java/com/cadl/model/generated/ModelOpPutNested.java b/typespec-tests/src/samples/java/com/cadl/model/generated/ModelOpPutNested.java deleted file mode 100644 index 6cef025157..0000000000 --- a/typespec-tests/src/samples/java/com/cadl/model/generated/ModelOpPutNested.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.cadl.model.generated; - -import com.azure.core.util.Configuration; -import com.cadl.model.ModelClient; -import com.cadl.model.ModelClientBuilder; -import com.cadl.model.models.NestedModel; - -public class ModelOpPutNested { - public static void main(String[] args) { - ModelClient modelClient - = new ModelClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")).buildClient(); - // BEGIN:com.cadl.model.generated.modelopputnested.modelopputnested - NestedModel response = modelClient.putNested(null); - // END:com.cadl.model.generated.modelopputnested.modelopputnested - } -} diff --git a/typespec-tests/src/samples/java/com/cadl/multicontenttypes/generated/SingleContentTypeUploadImageForSingleContentType.java b/typespec-tests/src/samples/java/com/cadl/multicontenttypes/generated/SingleContentTypeUploadImageForSingleContentType.java deleted file mode 100644 index 60913555b6..0000000000 --- a/typespec-tests/src/samples/java/com/cadl/multicontenttypes/generated/SingleContentTypeUploadImageForSingleContentType.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.cadl.multicontenttypes.generated; - -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.cadl.multicontenttypes.MultiContentTypesClientBuilder; -import com.cadl.multicontenttypes.SingleContentTypeClient; -import java.nio.charset.StandardCharsets; - -public class SingleContentTypeUploadImageForSingleContentType { - public static void main(String[] args) { - SingleContentTypeClient singleContentTypeClient - = new MultiContentTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildSingleContentTypeClient(); - // BEGIN:com.cadl.multicontenttypes.generated.singlecontenttypeuploadimageforsinglecontenttype.singlecontenttypeuploadimageforsinglecontenttype - singleContentTypeClient.uploadImageForSingleContentType( - BinaryData.fromBytes("\"D:\\Program Files\"".getBytes(StandardCharsets.UTF_8))); - // END:com.cadl.multicontenttypes.generated.singlecontenttypeuploadimageforsinglecontenttype.singlecontenttypeuploadimageforsinglecontenttype - } -} diff --git a/typespec-tests/src/samples/java/com/cadl/response/generated/ResponseOpExists.java b/typespec-tests/src/samples/java/com/cadl/response/generated/ResponseOpExists.java deleted file mode 100644 index 1be44c77ca..0000000000 --- a/typespec-tests/src/samples/java/com/cadl/response/generated/ResponseOpExists.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.cadl.response.generated; - -import com.azure.core.util.Configuration; -import com.cadl.response.ResponseClient; -import com.cadl.response.ResponseClientBuilder; - -public class ResponseOpExists { - public static void main(String[] args) { - ResponseClient responseClient - = new ResponseClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.cadl.response.generated.exists.responseopexists - boolean response = responseClient.exists(); - // END:com.cadl.response.generated.exists.responseopexists - } -} diff --git a/typespec-tests/src/samples/java/com/cadl/response/generated/ResponseOpListStrings.java b/typespec-tests/src/samples/java/com/cadl/response/generated/ResponseOpListStrings.java deleted file mode 100644 index cf41d8eecb..0000000000 --- a/typespec-tests/src/samples/java/com/cadl/response/generated/ResponseOpListStrings.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.cadl.response.generated; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Configuration; -import com.cadl.response.ResponseClient; -import com.cadl.response.ResponseClientBuilder; - -public class ResponseOpListStrings { - public static void main(String[] args) { - ResponseClient responseClient - = new ResponseClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.cadl.response.generated.liststrings.responseopliststrings - PagedIterable response = responseClient.listStrings(); - // END:com.cadl.response.generated.liststrings.responseopliststrings - } -} diff --git a/typespec-tests/src/samples/java/com/cadl/specialchars/generated/BuiltinOpRead.java b/typespec-tests/src/samples/java/com/cadl/specialchars/generated/BuiltinOpRead.java deleted file mode 100644 index 30d198db4b..0000000000 --- a/typespec-tests/src/samples/java/com/cadl/specialchars/generated/BuiltinOpRead.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.cadl.specialchars.generated; - -import com.azure.core.util.Configuration; -import com.cadl.specialchars.SpecialCharsClient; -import com.cadl.specialchars.SpecialCharsClientBuilder; -import com.cadl.specialchars.models.Resource; - -public class BuiltinOpRead { - public static void main(String[] args) { - SpecialCharsClient specialCharsClient - = new SpecialCharsClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.cadl.specialchars.generated.builtinopread.builtinopread - Resource response = specialCharsClient.read(null); - // END:com.cadl.specialchars.generated.builtinopread.builtinopread - } -} diff --git a/typespec-tests/src/samples/java/com/cadl/specialheaders/generated/EtagHeadersListWithEtag.java b/typespec-tests/src/samples/java/com/cadl/specialheaders/generated/EtagHeadersListWithEtag.java deleted file mode 100644 index 08a3112636..0000000000 --- a/typespec-tests/src/samples/java/com/cadl/specialheaders/generated/EtagHeadersListWithEtag.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.cadl.specialheaders.generated; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Configuration; -import com.cadl.specialheaders.EtagHeadersClient; -import com.cadl.specialheaders.SpecialHeadersClientBuilder; -import com.cadl.specialheaders.models.Resource; - -public class EtagHeadersListWithEtag { - public static void main(String[] args) { - EtagHeadersClient etagHeadersClient - = new SpecialHeadersClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildEtagHeadersClient(); - // BEGIN:com.cadl.specialheaders.generated.etagheaderslistwithetag.etagheaderslistwithetag - PagedIterable response = etagHeadersClient.listWithEtag(); - // END:com.cadl.specialheaders.generated.etagheaderslistwithetag.etagheaderslistwithetag - } -} diff --git a/typespec-tests/src/samples/java/com/cadl/specialheaders/generated/EtagHeadersPutWithRequestHeaders.java b/typespec-tests/src/samples/java/com/cadl/specialheaders/generated/EtagHeadersPutWithRequestHeaders.java deleted file mode 100644 index 472b5bc41a..0000000000 --- a/typespec-tests/src/samples/java/com/cadl/specialheaders/generated/EtagHeadersPutWithRequestHeaders.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.cadl.specialheaders.generated; - -import com.azure.core.http.RequestConditions; -import com.azure.core.util.Configuration; -import com.cadl.specialheaders.EtagHeadersClient; -import com.cadl.specialheaders.SpecialHeadersClientBuilder; -import com.cadl.specialheaders.models.Resource; - -public class EtagHeadersPutWithRequestHeaders { - public static void main(String[] args) { - EtagHeadersClient etagHeadersClient - = new SpecialHeadersClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildEtagHeadersClient(); - // BEGIN:com.cadl.specialheaders.generated.etagheadersputwithrequestheaders.etagheadersputwithrequestheaders - Resource response = etagHeadersClient.putWithRequestHeaders("name", - new Resource().setDescription("This is sample for Etag headers").setType("myType"), - new RequestConditions().setIfMatch("\"64e005\"")); - // END:com.cadl.specialheaders.generated.etagheadersputwithrequestheaders.etagheadersputwithrequestheaders - } -} diff --git a/typespec-tests/src/samples/java/com/cadl/versioning/generated/VersioningOpList.java b/typespec-tests/src/samples/java/com/cadl/versioning/generated/VersioningOpList.java deleted file mode 100644 index 9bd3bcb148..0000000000 --- a/typespec-tests/src/samples/java/com/cadl/versioning/generated/VersioningOpList.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.cadl.versioning.generated; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Configuration; -import com.cadl.versioning.VersioningClient; -import com.cadl.versioning.VersioningClientBuilder; -import com.cadl.versioning.models.Resource; -import java.util.Arrays; - -public class VersioningOpList { - public static void main(String[] args) { - VersioningClient versioningClient - = new VersioningClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.cadl.versioning.generated.versioningoplist.versioningoplist - PagedIterable response = versioningClient.list(Arrays.asList("name=name"), null); - // END:com.cadl.versioning.generated.versioningoplist.versioningoplist - } -} diff --git a/typespec-tests/src/test/java/com/cadl/server/generated/HttpbinClientTestBase.java b/typespec-tests/src/test/java/com/cadl/server/generated/HttpbinClientTestBase.java index 133ae7c4f3..ff715afeaf 100644 --- a/typespec-tests/src/test/java/com/cadl/server/generated/HttpbinClientTestBase.java +++ b/typespec-tests/src/test/java/com/cadl/server/generated/HttpbinClientTestBase.java @@ -29,6 +29,7 @@ protected void beforeTest() { HttpbinClientBuilder httpbinClientbuilder = new HttpbinClientBuilder().domain(Configuration.getGlobalConfiguration().get("DOMAIN", "domain")) .tld(Configuration.getGlobalConfiguration().get("TLD", "tld")) + .relativePath(Configuration.getGlobalConfiguration().get("RELATIVEPATH", "relativepath")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -40,6 +41,7 @@ protected void beforeTest() { ContosoClientBuilder contosoClientbuilder = new ContosoClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .apiVersion(Configuration.getGlobalConfiguration().get("APIVERSION", "apiversion")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/client/structure/service/generated/ServiceClientClientTestBase.java b/typespec-tests/src/test/java/com/client/structure/service/generated/ServiceClientClientTestBase.java index bd22590dab..ee84ef8e23 100644 --- a/typespec-tests/src/test/java/com/client/structure/service/generated/ServiceClientClientTestBase.java +++ b/typespec-tests/src/test/java/com/client/structure/service/generated/ServiceClientClientTestBase.java @@ -15,9 +15,8 @@ import com.azure.core.test.TestProxyTestBase; import com.azure.core.util.Configuration; import com.client.structure.service.BarClient; -import com.client.structure.service.BazFooClient; +import com.client.structure.service.BazClient; import com.client.structure.service.FooClient; -import com.client.structure.service.QuxBarClient; import com.client.structure.service.QuxClient; import com.client.structure.service.ServiceClientClient; import com.client.structure.service.ServiceClientClientBuilder; @@ -25,11 +24,13 @@ class ServiceClientClientTestBase extends TestProxyTestBase { protected ServiceClientClient serviceClientClient; - protected BazFooClient bazFooClient; + protected BazClient bazClient; + + protected FooClient fooClient; protected QuxClient quxClient; - protected QuxBarClient quxBarClient; + protected BarClient barClient; protected FooClient fooClient; @@ -49,17 +50,29 @@ protected void beforeTest() { } serviceClientClient = serviceClientClientbuilder.buildClient(); - ServiceClientClientBuilder bazFooClientbuilder = new ServiceClientClientBuilder() + ServiceClientClientBuilder bazClientbuilder = new ServiceClientClientBuilder() .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) .client(Configuration.getGlobalConfiguration().get("CLIENT", "client")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { - bazFooClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + bazClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { - bazFooClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + bazClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); } - bazFooClient = bazFooClientbuilder.buildBazFooClient(); + bazClient = bazClientbuilder.buildBazClient(); + + ServiceClientClientBuilder fooClientbuilder = new ServiceClientClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .client(Configuration.getGlobalConfiguration().get("CLIENT", "client")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + fooClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + fooClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + fooClient = fooClientbuilder.buildFooClient(); ServiceClientClientBuilder quxClientbuilder = new ServiceClientClientBuilder() .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) @@ -73,17 +86,17 @@ protected void beforeTest() { } quxClient = quxClientbuilder.buildQuxClient(); - ServiceClientClientBuilder quxBarClientbuilder = new ServiceClientClientBuilder() + ServiceClientClientBuilder barClientbuilder = new ServiceClientClientBuilder() .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) .client(Configuration.getGlobalConfiguration().get("CLIENT", "client")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { - quxBarClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + barClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { - quxBarClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + barClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); } - quxBarClient = quxBarClientbuilder.buildQuxBarClient(); + barClient = barClientbuilder.buildBarClient(); ServiceClientClientBuilder fooClientbuilder = new ServiceClientClientBuilder() .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) diff --git a/typespec-tests/src/test/java/com/resiliency/servicedriven/generated/ResiliencyServiceDrivenClientTestBase.java b/typespec-tests/src/test/java/com/resiliency/servicedriven/generated/ResiliencyServiceDrivenClientTestBase.java index b42cd18d88..085cfca3e4 100644 --- a/typespec-tests/src/test/java/com/resiliency/servicedriven/generated/ResiliencyServiceDrivenClientTestBase.java +++ b/typespec-tests/src/test/java/com/resiliency/servicedriven/generated/ResiliencyServiceDrivenClientTestBase.java @@ -27,6 +27,7 @@ protected void beforeTest() { .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) .serviceDeploymentVersion( Configuration.getGlobalConfiguration().get("SERVICEDEPLOYMENTVERSION", "servicedeploymentversion")) + .apiVersion(Configuration.getGlobalConfiguration().get("APIVERSION", "apiversion")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/resiliency/servicedriven/v1/generated/ResiliencyServiceDrivenClientTestBase.java b/typespec-tests/src/test/java/com/resiliency/servicedriven/v1/generated/ResiliencyServiceDrivenClientTestBase.java index eec959eb94..c4d1be8a6a 100644 --- a/typespec-tests/src/test/java/com/resiliency/servicedriven/v1/generated/ResiliencyServiceDrivenClientTestBase.java +++ b/typespec-tests/src/test/java/com/resiliency/servicedriven/v1/generated/ResiliencyServiceDrivenClientTestBase.java @@ -27,6 +27,7 @@ protected void beforeTest() { .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) .serviceDeploymentVersion( Configuration.getGlobalConfiguration().get("SERVICEDEPLOYMENTVERSION", "servicedeploymentversion")) + .apiVersion(Configuration.getGlobalConfiguration().get("APIVERSION", "apiversion")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/server/path/multiple/generated/MultipleClientTestBase.java b/typespec-tests/src/test/java/com/server/path/multiple/generated/MultipleClientTestBase.java index a1e5597656..09b7923b1f 100644 --- a/typespec-tests/src/test/java/com/server/path/multiple/generated/MultipleClientTestBase.java +++ b/typespec-tests/src/test/java/com/server/path/multiple/generated/MultipleClientTestBase.java @@ -24,6 +24,7 @@ class MultipleClientTestBase extends TestProxyTestBase { protected void beforeTest() { MultipleClientBuilder multipleClientbuilder = new MultipleClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .apiVersion(Configuration.getGlobalConfiguration().get("APIVERSION", "apiversion")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { From b443345340fdcdb2c8db0a6fc4d8b9fe779dad46 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Thu, 27 Jun 2024 17:26:48 +0800 Subject: [PATCH 06/90] process exception --- typespec-extension/src/code-model-builder.ts | 47 +++++++++++++++----- 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index ee462941b9..bd55c4dc30 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -281,7 +281,7 @@ export class CodeModelBuilder { this.options["group-etag-headers"] = false; } - const clients = this.processClients(); + // const clients = this.processClients(); this.processClientsFromSdkType(); @@ -1053,11 +1053,13 @@ export class CodeModelBuilder { // this.processResponseFromSdkType(codeModelOperation, sdkMethod.operation.responses, lroMetadata.longRunning); for (const [code, response] of sdkMethod.operation.responses) { - this.processResponseFromSdkType(codeModelOperation, code, response, lroMetadata.longRunning); + this.processResponseFromSdkType(codeModelOperation, code, response, lroMetadata.longRunning, false); } - - // sdkMethod.operation.__raw.responses.map((it) => this.processResponse(codeModelOperation, it, lroMetadata.longRunning)); + // exception + for (const [code, response] of sdkMethod.operation.exceptions) { + this.processResponseFromSdkType(codeModelOperation, code, response, lroMetadata.longRunning, true); + } // check for paged @@ -2596,7 +2598,7 @@ export class CodeModelBuilder { } } - private processResponseFromSdkType(op: CodeModelOperation, statusCode: number | HttpStatusCodeRange, sdkResponse: SdkHttpResponse, longRunning: boolean) { + private processResponseFromSdkType(op: CodeModelOperation, statusCode: number | HttpStatusCodeRange | "*", sdkResponse: SdkHttpResponse, longRunning: boolean, isErrorResponse: boolean) { // TODO: what to do if more than 1 response? // It happens when the response type is Union, on one status code. // let response: Response; @@ -2633,7 +2635,7 @@ export class CodeModelBuilder { response = new BinaryResponse({ protocol: { http: { - statusCodes: statusCode, + statusCodes: this.getStatusCodes(statusCode), headers: headers, mediaTypes: sdkResponse.contentTypes, knownMediaType: KnownMediaType.Binary, @@ -2642,7 +2644,7 @@ export class CodeModelBuilder { language: { default: { name: op.language.default.name + "Response", - description: sdkResponse.description ?? bodyType.details, + description: this.getResponseDescription(sdkResponse.__raw), }, }, }); @@ -2659,7 +2661,7 @@ export class CodeModelBuilder { response = new SchemaResponse(schema, { protocol: { http: { - statusCodes: statusCode, + statusCodes: this.getStatusCodes(statusCode), headers: headers, mediaTypes: sdkResponse.contentTypes, }, @@ -2667,7 +2669,7 @@ export class CodeModelBuilder { language: { default: { name: op.language.default.name + "Response", - description: bodyType.description ?? bodyType.details, + description: this.getResponseDescription(sdkResponse.__raw), }, }, }); @@ -2676,19 +2678,38 @@ export class CodeModelBuilder { response = new Response({ protocol: { http: { - statusCodes: statusCode, + statusCodes: this.getStatusCodes(statusCode), headers: headers, }, }, language: { default: { name: op.language.default.name + "Response", - description: this.getResponseDescription(resp), + description: this.getResponseDescription(sdkResponse.__raw), }, }, }); } - + + if (isErrorResponse) { + op.addException(response); + + if (response instanceof SchemaResponse) { + this.trackSchemaUsage(response.schema, { usage: [SchemaContext.Exception] }); + } + } else { + op.addResponse(response); + + if (response instanceof SchemaResponse) { + this.trackSchemaUsage(response.schema, { usage: [SchemaContext.Output] }); + + if (trackConvenienceApi) { + this.trackSchemaUsage(response.schema, { + usage: [op.internalApi ? SchemaContext.Internal : SchemaContext.Public], + }); + } + } + } } private getStatusCodes(statusCodes: HttpStatusCodesEntry): string[] { @@ -3079,9 +3100,11 @@ export class CodeModelBuilder { keyType: { kind: "string", encode: "string", + decorators: [], }, description: type.description, valueType: type.additionalProperties, + decorators: [], }; const parentSchema = this.processSchemaFromSdkType(sdkDictType, "Record"); objectSchema.parents = objectSchema.parents ?? new Relations(); From 2434e679488a6a5c27f9dd93e2e7a1e036a31b5e Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Fri, 28 Jun 2024 14:45:30 +0800 Subject: [PATCH 07/90] rename local var --- typespec-extension/src/code-model-builder.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index bd55c4dc30..0b5e87ac55 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -688,10 +688,10 @@ export class CodeModelBuilder { const operationGroups: SdkClientType[] = []; for (const method of client.methods) { if (method.kind === "clientaccessor") { - const client = method.response; - operationGroups.push(client); + const subClient = method.response; + operationGroups.push(subClient); if (includeNestedOperationGroups) { - for (const operationGroup of this.listSubClientsUnderClient(client, includeNestedOperationGroups)) { + for (const operationGroup of this.listSubClientsUnderClient(subClient, includeNestedOperationGroups)) { operationGroups.push(operationGroup); } } From 7a53e1cf94271c3cd9e670345d73bff7284b3d04 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Fri, 28 Jun 2024 15:34:50 +0800 Subject: [PATCH 08/90] add samples --- .../cadl/builtin/generated/BuiltinOpRead.java | 20 ++++++++++ .../cadl/flatten/generated/FlattenOpSend.java | 19 +++++++++ .../generated/LongRunningCreateJob.java | 39 +++++++++++++++++++ .../model/generated/ModelOpPutNested.java | 20 ++++++++++ ...ntTypeUploadImageForSingleContentType.java | 23 +++++++++++ .../response/generated/ResponseOpExists.java | 20 ++++++++++ .../generated/ResponseOpListStrings.java | 21 ++++++++++ .../specialchars/generated/BuiltinOpRead.java | 21 ++++++++++ .../generated/EtagHeadersListWithEtag.java | 22 +++++++++++ .../EtagHeadersPutWithRequestHeaders.java | 24 ++++++++++++ .../generated/VersioningOpList.java | 23 +++++++++++ 11 files changed, 252 insertions(+) create mode 100644 typespec-tests/src/samples/java/com/cadl/builtin/generated/BuiltinOpRead.java create mode 100644 typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSend.java create mode 100644 typespec-tests/src/samples/java/com/cadl/longrunning/generated/LongRunningCreateJob.java create mode 100644 typespec-tests/src/samples/java/com/cadl/model/generated/ModelOpPutNested.java create mode 100644 typespec-tests/src/samples/java/com/cadl/multicontenttypes/generated/SingleContentTypeUploadImageForSingleContentType.java create mode 100644 typespec-tests/src/samples/java/com/cadl/response/generated/ResponseOpExists.java create mode 100644 typespec-tests/src/samples/java/com/cadl/response/generated/ResponseOpListStrings.java create mode 100644 typespec-tests/src/samples/java/com/cadl/specialchars/generated/BuiltinOpRead.java create mode 100644 typespec-tests/src/samples/java/com/cadl/specialheaders/generated/EtagHeadersListWithEtag.java create mode 100644 typespec-tests/src/samples/java/com/cadl/specialheaders/generated/EtagHeadersPutWithRequestHeaders.java create mode 100644 typespec-tests/src/samples/java/com/cadl/versioning/generated/VersioningOpList.java diff --git a/typespec-tests/src/samples/java/com/cadl/builtin/generated/BuiltinOpRead.java b/typespec-tests/src/samples/java/com/cadl/builtin/generated/BuiltinOpRead.java new file mode 100644 index 0000000000..b6e217eb16 --- /dev/null +++ b/typespec-tests/src/samples/java/com/cadl/builtin/generated/BuiltinOpRead.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.cadl.builtin.generated; + +import com.azure.core.util.Configuration; +import com.cadl.builtin.BuiltinClient; +import com.cadl.builtin.BuiltinClientBuilder; +import com.cadl.builtin.models.Builtin; + +public class BuiltinOpRead { + public static void main(String[] args) { + BuiltinClient builtinClient + = new BuiltinClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")).buildClient(); + // BEGIN:com.cadl.builtin.generated.builtinopread.builtinopread + Builtin response = builtinClient.read(null, null, null, "myFilter", null, null); + // END:com.cadl.builtin.generated.builtinopread.builtinopread + } +} diff --git a/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSend.java b/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSend.java new file mode 100644 index 0000000000..19756261ce --- /dev/null +++ b/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSend.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.cadl.flatten.generated; + +import com.azure.core.util.Configuration; +import com.cadl.flatten.FlattenClient; +import com.cadl.flatten.FlattenClientBuilder; + +public class FlattenOpSend { + public static void main(String[] args) { + FlattenClient flattenClient + = new FlattenClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")).buildClient(); + // BEGIN:com.cadl.flatten.generated.send.flattenopsend + flattenClient.send("myRequiredId", null, null); + // END:com.cadl.flatten.generated.send.flattenopsend + } +} diff --git a/typespec-tests/src/samples/java/com/cadl/longrunning/generated/LongRunningCreateJob.java b/typespec-tests/src/samples/java/com/cadl/longrunning/generated/LongRunningCreateJob.java new file mode 100644 index 0000000000..541ca15df3 --- /dev/null +++ b/typespec-tests/src/samples/java/com/cadl/longrunning/generated/LongRunningCreateJob.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.cadl.longrunning.generated; + +import com.azure.core.util.Configuration; +import com.azure.core.util.polling.SyncPoller; +import com.cadl.longrunning.LongRunningClient; +import com.cadl.longrunning.LongRunningClientBuilder; +import com.cadl.longrunning.models.JobData; +import com.cadl.longrunning.models.JobResult; +import com.cadl.longrunning.models.JobResultResult; +import java.util.HashMap; +import java.util.Map; + +public class LongRunningCreateJob { + public static void main(String[] args) { + LongRunningClient longRunningClient + = new LongRunningClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.cadl.longrunning.generated.createjob.longrunningcreatejob + SyncPoller response = longRunningClient + .beginCreateJob(new JobData(mapOf("max", 15.0D, "min", 14.0D, "average", 14.3D)).setConfiguration("{}")); + // END:com.cadl.longrunning.generated.createjob.longrunningcreatejob + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/typespec-tests/src/samples/java/com/cadl/model/generated/ModelOpPutNested.java b/typespec-tests/src/samples/java/com/cadl/model/generated/ModelOpPutNested.java new file mode 100644 index 0000000000..6cef025157 --- /dev/null +++ b/typespec-tests/src/samples/java/com/cadl/model/generated/ModelOpPutNested.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.cadl.model.generated; + +import com.azure.core.util.Configuration; +import com.cadl.model.ModelClient; +import com.cadl.model.ModelClientBuilder; +import com.cadl.model.models.NestedModel; + +public class ModelOpPutNested { + public static void main(String[] args) { + ModelClient modelClient + = new ModelClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")).buildClient(); + // BEGIN:com.cadl.model.generated.modelopputnested.modelopputnested + NestedModel response = modelClient.putNested(null); + // END:com.cadl.model.generated.modelopputnested.modelopputnested + } +} diff --git a/typespec-tests/src/samples/java/com/cadl/multicontenttypes/generated/SingleContentTypeUploadImageForSingleContentType.java b/typespec-tests/src/samples/java/com/cadl/multicontenttypes/generated/SingleContentTypeUploadImageForSingleContentType.java new file mode 100644 index 0000000000..60913555b6 --- /dev/null +++ b/typespec-tests/src/samples/java/com/cadl/multicontenttypes/generated/SingleContentTypeUploadImageForSingleContentType.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.cadl.multicontenttypes.generated; + +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.cadl.multicontenttypes.MultiContentTypesClientBuilder; +import com.cadl.multicontenttypes.SingleContentTypeClient; +import java.nio.charset.StandardCharsets; + +public class SingleContentTypeUploadImageForSingleContentType { + public static void main(String[] args) { + SingleContentTypeClient singleContentTypeClient + = new MultiContentTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildSingleContentTypeClient(); + // BEGIN:com.cadl.multicontenttypes.generated.singlecontenttypeuploadimageforsinglecontenttype.singlecontenttypeuploadimageforsinglecontenttype + singleContentTypeClient.uploadImageForSingleContentType( + BinaryData.fromBytes("\"D:\\Program Files\"".getBytes(StandardCharsets.UTF_8))); + // END:com.cadl.multicontenttypes.generated.singlecontenttypeuploadimageforsinglecontenttype.singlecontenttypeuploadimageforsinglecontenttype + } +} diff --git a/typespec-tests/src/samples/java/com/cadl/response/generated/ResponseOpExists.java b/typespec-tests/src/samples/java/com/cadl/response/generated/ResponseOpExists.java new file mode 100644 index 0000000000..1be44c77ca --- /dev/null +++ b/typespec-tests/src/samples/java/com/cadl/response/generated/ResponseOpExists.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.cadl.response.generated; + +import com.azure.core.util.Configuration; +import com.cadl.response.ResponseClient; +import com.cadl.response.ResponseClientBuilder; + +public class ResponseOpExists { + public static void main(String[] args) { + ResponseClient responseClient + = new ResponseClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.cadl.response.generated.exists.responseopexists + boolean response = responseClient.exists(); + // END:com.cadl.response.generated.exists.responseopexists + } +} diff --git a/typespec-tests/src/samples/java/com/cadl/response/generated/ResponseOpListStrings.java b/typespec-tests/src/samples/java/com/cadl/response/generated/ResponseOpListStrings.java new file mode 100644 index 0000000000..cf41d8eecb --- /dev/null +++ b/typespec-tests/src/samples/java/com/cadl/response/generated/ResponseOpListStrings.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.cadl.response.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Configuration; +import com.cadl.response.ResponseClient; +import com.cadl.response.ResponseClientBuilder; + +public class ResponseOpListStrings { + public static void main(String[] args) { + ResponseClient responseClient + = new ResponseClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.cadl.response.generated.liststrings.responseopliststrings + PagedIterable response = responseClient.listStrings(); + // END:com.cadl.response.generated.liststrings.responseopliststrings + } +} diff --git a/typespec-tests/src/samples/java/com/cadl/specialchars/generated/BuiltinOpRead.java b/typespec-tests/src/samples/java/com/cadl/specialchars/generated/BuiltinOpRead.java new file mode 100644 index 0000000000..30d198db4b --- /dev/null +++ b/typespec-tests/src/samples/java/com/cadl/specialchars/generated/BuiltinOpRead.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.cadl.specialchars.generated; + +import com.azure.core.util.Configuration; +import com.cadl.specialchars.SpecialCharsClient; +import com.cadl.specialchars.SpecialCharsClientBuilder; +import com.cadl.specialchars.models.Resource; + +public class BuiltinOpRead { + public static void main(String[] args) { + SpecialCharsClient specialCharsClient + = new SpecialCharsClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.cadl.specialchars.generated.builtinopread.builtinopread + Resource response = specialCharsClient.read(null); + // END:com.cadl.specialchars.generated.builtinopread.builtinopread + } +} diff --git a/typespec-tests/src/samples/java/com/cadl/specialheaders/generated/EtagHeadersListWithEtag.java b/typespec-tests/src/samples/java/com/cadl/specialheaders/generated/EtagHeadersListWithEtag.java new file mode 100644 index 0000000000..08a3112636 --- /dev/null +++ b/typespec-tests/src/samples/java/com/cadl/specialheaders/generated/EtagHeadersListWithEtag.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.cadl.specialheaders.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Configuration; +import com.cadl.specialheaders.EtagHeadersClient; +import com.cadl.specialheaders.SpecialHeadersClientBuilder; +import com.cadl.specialheaders.models.Resource; + +public class EtagHeadersListWithEtag { + public static void main(String[] args) { + EtagHeadersClient etagHeadersClient + = new SpecialHeadersClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildEtagHeadersClient(); + // BEGIN:com.cadl.specialheaders.generated.etagheaderslistwithetag.etagheaderslistwithetag + PagedIterable response = etagHeadersClient.listWithEtag(); + // END:com.cadl.specialheaders.generated.etagheaderslistwithetag.etagheaderslistwithetag + } +} diff --git a/typespec-tests/src/samples/java/com/cadl/specialheaders/generated/EtagHeadersPutWithRequestHeaders.java b/typespec-tests/src/samples/java/com/cadl/specialheaders/generated/EtagHeadersPutWithRequestHeaders.java new file mode 100644 index 0000000000..472b5bc41a --- /dev/null +++ b/typespec-tests/src/samples/java/com/cadl/specialheaders/generated/EtagHeadersPutWithRequestHeaders.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.cadl.specialheaders.generated; + +import com.azure.core.http.RequestConditions; +import com.azure.core.util.Configuration; +import com.cadl.specialheaders.EtagHeadersClient; +import com.cadl.specialheaders.SpecialHeadersClientBuilder; +import com.cadl.specialheaders.models.Resource; + +public class EtagHeadersPutWithRequestHeaders { + public static void main(String[] args) { + EtagHeadersClient etagHeadersClient + = new SpecialHeadersClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildEtagHeadersClient(); + // BEGIN:com.cadl.specialheaders.generated.etagheadersputwithrequestheaders.etagheadersputwithrequestheaders + Resource response = etagHeadersClient.putWithRequestHeaders("name", + new Resource().setDescription("This is sample for Etag headers").setType("myType"), + new RequestConditions().setIfMatch("\"64e005\"")); + // END:com.cadl.specialheaders.generated.etagheadersputwithrequestheaders.etagheadersputwithrequestheaders + } +} diff --git a/typespec-tests/src/samples/java/com/cadl/versioning/generated/VersioningOpList.java b/typespec-tests/src/samples/java/com/cadl/versioning/generated/VersioningOpList.java new file mode 100644 index 0000000000..9bd3bcb148 --- /dev/null +++ b/typespec-tests/src/samples/java/com/cadl/versioning/generated/VersioningOpList.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.cadl.versioning.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Configuration; +import com.cadl.versioning.VersioningClient; +import com.cadl.versioning.VersioningClientBuilder; +import com.cadl.versioning.models.Resource; +import java.util.Arrays; + +public class VersioningOpList { + public static void main(String[] args) { + VersioningClient versioningClient + = new VersioningClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.cadl.versioning.generated.versioningoplist.versioningoplist + PagedIterable response = versioningClient.list(Arrays.asList("name=name"), null); + // END:com.cadl.versioning.generated.versioningoplist.versioningoplist + } +} From 339352ca44e8ff22003ea491738e3262ef9c31f3 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Fri, 28 Jun 2024 15:45:45 +0800 Subject: [PATCH 09/90] add loading examples logic --- typespec-extension/src/code-model-builder.ts | 26 ++++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 0b5e87ac55..4f21986105 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -623,6 +623,7 @@ export class CodeModelBuilder { ); // preprocess operation groups and operations + // operations without operation group const serviceMethodsWithoutSubClient = this.listServiceMethodsUnderClient(client, false); let codeModelGroup = new OperationGroup(""); for (const serviceMethod of serviceMethodsWithoutSubClient) { @@ -634,11 +635,21 @@ export class CodeModelBuilder { codeModelClient.operationGroups.push(codeModelGroup); } + // operations under operation groups const subClients = this.listSubClientsUnderClient(client, true); for (const subClient of subClients) { const serviceMethods = this.listServiceMethodsUnderClient(subClient, true); // operation group with no operation is skipped if (serviceMethods.length > 0) { + // const groupPath = subClient..groupPath.split("."); + // let operationGroupName: string; + // if (groupPath.length > 1) { + // // groupPath should be in format of "OpenAIClient.Chat.Completions" + // operationGroupName = groupPath.slice(1).join(""); + // } else { + // // protection + // operationGroupName = operationGroup.type.name; + // } codeModelGroup = new OperationGroup(subClient.name); for (const serviceMethod of serviceMethods) { if (!this.needToSkipProcessingOperation(serviceMethod.__raw, clientContext)) { @@ -936,14 +947,19 @@ export class CodeModelBuilder { const operationId = groupName ? `${groupName}_${operationName}` : `${operationName}`; const operationGroup = this.codeModel.getOperationGroup(groupName); + let operationExample = undefined; + if (sdkMethod.__raw) { + operationExample = this.getOperationExample(sdkMethod.__raw); + } + const codeModelOperation = new CodeModelOperation(operationName, sdkMethod.details ?? "", { operationId: operationId, summary: sdkMethod.description, - // extensions: { - // "x-ms-examples": operationExample - // ? { [operationExample.title ?? operationExample.operationId ?? operation.name]: operationExample } - // : undefined, - // }, + extensions: { + "x-ms-examples": operationExample + ? { [operationExample.title ?? operationExample.operationId ?? sdkMethod.name]: operationExample } + : undefined, + }, }); codeModelOperation.crossLanguageDefinitionId = sdkMethod.crossLanguageDefintionId; From ddbca42bd5c32157760299576bb9837e837a19d4 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 1 Jul 2024 11:04:14 +0800 Subject: [PATCH 10/90] Revert "regen" This reverts commit 07a773fbfd7183031fbf8941876f6b5e3f12666d. # Conflicts: # typespec-tests/src/main/java/com/cadl/internal/InternalAsyncClient.java # typespec-tests/src/main/java/com/cadl/internal/InternalClient.java # typespec-tests/src/main/java/com/cadl/internal/implementation/InternalOpsImpl.java # typespec-tests/src/main/java/com/cadl/literalservice/implementation/LiteralOpsImpl.java # typespec-tests/src/main/java/com/cadl/longrunning/implementation/LongRunningClientImpl.java # typespec-tests/src/main/java/com/cadl/naming/NamingAsyncClient.java # typespec-tests/src/main/java/com/cadl/naming/NamingClient.java # typespec-tests/src/main/java/com/cadl/naming/implementation/NamingOpsImpl.java # typespec-tests/src/main/java/com/cadl/optional/OptionalAsyncClient.java # typespec-tests/src/main/java/com/cadl/optional/OptionalClient.java # typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalOpsImpl.java # typespec-tests/src/main/java/com/cadl/wiretype/implementation/WireTypeOpsImpl.java # typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSend.java --- .../InternalOperationsImpl.java | 12 +- .../implementation/PublicOperationsImpl.java | 8 +- .../RelativeModelInOperationsImpl.java | 8 +- .../SharedModelInOperationsImpl.java | 8 +- .../implementation/ModelInOperationsImpl.java | 33 +- .../basic/implementation/BasicClientImpl.java | 101 +-- .../TwoModelsAsPageItemsImpl.java | 28 +- .../azure/core/lro/rpc/RpcAsyncClient.java | 4 +- .../_specs_/azure/core/lro/rpc/RpcClient.java | 4 +- .../lro/rpc/implementation/RpcClientImpl.java | 30 +- .../core/lro/rpc/models/OperationState.java | 75 -- ...nerationResponseGenerationResultError.java | 152 ---- .../implementation/StandardClientImpl.java | 24 +- .../lro/standard/models/OperationState.java | 75 -- .../standard/models/OperationStatusError.java | 129 ---- ...eOperationStatusUserExportedUserError.java | 150 ---- .../azure/core/scalar/ScalarAsyncClient.java | 6 +- .../azure/core/scalar/ScalarClient.java | 4 +- .../AzureLocationScalarsImpl.java | 67 +- .../azure/core/traits/TraitsAsyncClient.java | 11 +- .../azure/core/traits/TraitsClient.java | 10 +- .../implementation/TraitsClientImpl.java | 30 +- .../implementation/ApiKeyClientImpl.java | 15 +- .../implementation/CustomClientImpl.java | 15 +- .../implementation/OAuth2ClientImpl.java | 15 +- .../union/implementation/UnionClientImpl.java | 25 +- .../models/resources/ResourcesManager.java | 1 + .../fluent/NestedProxyResourcesClient.java | 4 +- .../resources/fluent/ResourcesClient.java | 7 + .../TopLevelTrackedResourcesClient.java | 5 +- .../NestedProxyResourcesClientImpl.java | 159 +++-- .../ResourcesClientBuilder.java | 18 +- .../implementation/ResourcesClientImpl.java | 18 +- .../TopLevelTrackedResourcesClientImpl.java | 197 ++++-- .../models/NestedProxyResources.java | 8 +- .../models/TopLevelTrackedResources.java | 11 +- .../XmsClientRequestIdAsyncClient.java | 5 +- .../XmsClientRequestIdClient.java | 2 +- .../XmsClientRequestIdClientImpl.java | 16 +- .../ArmResourceProviderManager.java | 1 + .../fluent/ArmResourceProviderClient.java | 7 + ...hildExtensionResourceInterfacesClient.java | 4 +- .../ChildResourcesInterfacesClient.java | 4 +- .../TopLevelArmResourceInterfacesClient.java | 5 +- .../ArmResourceProviderClientBuilder.java | 18 +- .../ArmResourceProviderClientImpl.java | 18 +- ...ExtensionResourceInterfacesClientImpl.java | 153 ++-- .../ChildResourcesInterfacesClientImpl.java | 191 +++-- ...mTemplateResourceInterfacesClientImpl.java | 64 +- .../implementation/OperationsClientImpl.java | 39 +- ...pLevelArmResourceInterfacesClientImpl.java | 219 ++++-- .../ChildExtensionResourceInterfaces.java | 8 +- .../models/ChildResourcesInterfaces.java | 8 +- .../models/TopLevelArmResourceInterfaces.java | 11 +- .../ArmStreamStyleSerializationManager.java | 1 + .../ArmStreamStyleSerializationClient.java | 7 + ...StreamStyleSerializationClientBuilder.java | 18 +- ...ArmStreamStyleSerializationClientImpl.java | 18 +- .../implementation/FishesClientImpl.java | 37 +- .../TopLevelArmResourcesClientImpl.java | 31 +- .../implementation/BuiltinClientImpl.java | 10 +- .../implementation/BuiltinOpsImpl.java | 24 +- .../implementation/EnumServiceClientImpl.java | 70 +- .../implementation/ErrorModelClientImpl.java | 10 +- .../implementation/ErrorOpsImpl.java | 4 +- .../com/cadl/flatten/FlattenAsyncClient.java | 109 ++- .../java/com/cadl/flatten/FlattenClient.java | 107 ++- .../implementation/FlattenClientImpl.java | 165 ++--- .../implementation/InternalClientImpl.java | 10 +- .../models/ResponseInternal.java | 2 +- .../models/ResponseInternalInner.java | 2 +- .../LiteralServiceClientImpl.java | 10 +- .../longrunning/LongRunningAsyncClient.java | 19 +- .../cadl/longrunning/LongRunningClient.java | 18 +- .../models/LroOperationStatusError.java | 177 ----- .../model/implementation/ModelClientImpl.java | 10 +- .../model/implementation/ModelOpsImpl.java | 48 +- .../MultiContentTypesClientImpl.java | 27 +- .../MultipleContentTypesOnRequestsImpl.java | 58 +- .../SingleContentTypesImpl.java | 20 +- .../implementation/MultipartClientImpl.java | 24 +- .../implementation/FirstClientImpl.java | 14 +- .../NoApiVersionClientImpl.java | 25 +- .../implementation/SecondClientImpl.java | 14 +- .../implementation/NamingClientImpl.java | 10 +- .../cadl/optional/OptionalClientBuilder.java | 287 ++++++++ .../implementation/OptionalClientImpl.java | 107 +++ .../optional/implementation/package-info.java | 10 + .../models/AllPropertiesOptional.java | 462 ++++++++++++ .../cadl/optional/models/ImmutableModel.java | 105 +++ .../com/cadl/optional/models/Optional.java | 665 ++++++++++++++++++ .../cadl/optional/models/package-info.java | 10 + .../java/com/cadl/optional/package-info.java | 10 + .../PartialUpdateClientImpl.java | 14 +- .../patch/implementation/PatchClientImpl.java | 10 +- .../patch/implementation/PatchesImpl.java | 12 +- .../ProtocolAndConvenienceOpsImpl.java | 98 ++- .../ProtocolAndConvenientClientImpl.java | 10 +- .../implementation/ResponseClientImpl.java | 97 ++- .../com/cadl/server/ContosoClientBuilder.java | 21 +- .../com/cadl/server/HttpbinClientBuilder.java | 1 - .../implementation/ContosoClientImpl.java | 45 +- .../implementation/HttpbinClientImpl.java | 15 +- .../implementation/BuiltinOpsImpl.java | 15 +- .../SpecialCharsClientImpl.java | 10 +- .../implementation/EtagHeadersImpl.java | 32 +- .../EtagHeadersOptionalBodiesImpl.java | 18 +- .../RepeatabilityHeadersImpl.java | 31 +- .../SkipSpecialHeadersImpl.java | 4 +- .../SpecialHeadersClientImpl.java | 10 +- .../java/com/cadl/union/UnionAsyncClient.java | 31 +- .../main/java/com/cadl/union/UnionClient.java | 30 +- .../union/implementation/UnionClientImpl.java | 9 +- .../implementation/UnionFlattenOpsImpl.java | 70 +- .../com/cadl/union/models/OperationState.java | 75 -- ...ationStatusOperationStatusResultError.java | 150 ---- .../implementation/VersioningClientImpl.java | 10 +- .../implementation/VersioningOpsImpl.java | 31 +- .../versioning/models/OperationState.java | 75 -- ...onStatusResourceExportedResourceError.java | 151 ---- .../implementation/VisibilityClientImpl.java | 56 +- .../implementation/VisibilityReadsImpl.java | 4 +- .../implementation/VisibilityWritesImpl.java | 14 +- .../implementation/WireTypeClientImpl.java | 10 +- .../naming/implementation/ModelsImpl.java | 24 +- .../implementation/NamingClientImpl.java | 88 ++- .../naming/implementation/UnionEnumsImpl.java | 24 +- .../structure/service/BarAsyncClient.java | 48 +- .../client/structure/service/BarClient.java | 47 +- ...syncClient.java => BazFooAsyncClient.java} | 10 +- .../{BazClient.java => BazFooClient.java} | 10 +- .../structure/service/FooAsyncClient.java | 48 +- .../client/structure/service/FooClient.java | 47 +- .../structure/service/QuxAsyncClient.java | 34 - .../structure/service/QuxBarAsyncClient.java | 72 ++ .../structure/service/QuxBarClient.java | 69 ++ .../client/structure/service/QuxClient.java | 33 - .../service/ServiceClientClientBuilder.java | 70 +- .../service/implementation/BarsImpl.java | 82 ++- .../implementation/BarsOperationsImpl.java | 155 ---- .../{BazesImpl.java => BazFoosImpl.java} | 30 +- .../implementation/ClientAClientImpl.java | 35 +- .../implementation/ClientBClientImpl.java | 37 +- .../service/implementation/FoosImpl.java | 82 ++- .../implementation/FoosOperationsImpl.java | 155 ---- .../service/implementation/Group1sImpl.java | 40 +- .../service/implementation/Group2sImpl.java | 40 +- .../service/implementation/GroupsImpl.java | 37 +- .../service/implementation/QuxBarsImpl.java | 110 +++ .../service/implementation/QuxesImpl.java | 63 +- .../RenamedOperationClientImpl.java | 35 +- .../ServiceClientClientImpl.java | 90 ++- .../bytes/implementation/HeadersImpl.java | 54 +- .../bytes/implementation/PropertiesImpl.java | 66 +- .../bytes/implementation/QueriesImpl.java | 55 +- .../implementation/RequestBodiesImpl.java | 72 +- .../implementation/ResponseBodiesImpl.java | 20 +- .../datetime/implementation/HeadersImpl.java | 71 +- .../implementation/PropertiesImpl.java | 83 +-- .../datetime/implementation/QueriesImpl.java | 72 +- .../implementation/ResponseHeadersImpl.java | 49 +- .../duration/implementation/HeadersImpl.java | 88 ++- .../implementation/PropertiesImpl.java | 101 +-- .../duration/implementation/QueriesImpl.java | 85 ++- .../implementation/ExplicitBodiesImpl.java | 14 +- .../implementation/ImplicitBodiesImpl.java | 12 +- .../BodyOptionalityClientImpl.java | 25 +- .../implementation/OptionalExplicitsImpl.java | 28 +- .../implementation/HeadersImpl.java | 12 +- .../implementation/QueriesImpl.java | 59 +- .../parameters/spread/AliasAsyncClient.java | 32 +- .../com/parameters/spread/AliasClient.java | 35 +- .../parameters/spread/ModelAsyncClient.java | 8 +- .../com/parameters/spread/ModelClient.java | 8 +- .../spread/implementation/AliasImpl.java | 75 +- .../spread/implementation/ModelsImpl.java | 70 +- .../JsonMergePatchClientImpl.java | 33 +- .../implementation/StringBodiesImpl.java | 40 +- .../multipart/MultiPartAsyncClient.java | 22 +- .../payload/multipart/MultiPartClient.java | 22 +- .../implementation/FormDatasImpl.java | 143 ++-- .../implementation/PageableClientImpl.java | 12 +- .../ResiliencyServiceDrivenClientBuilder.java | 21 +- .../ResiliencyServiceDrivenClientImpl.java | 94 ++- .../ResiliencyServiceDrivenClientBuilder.java | 23 +- .../ResiliencyServiceDrivenClientImpl.java | 82 +-- .../json/implementation/PropertiesImpl.java | 17 +- .../implementation/NotDefinedClientImpl.java | 25 +- .../path/multiple/MultipleClientBuilder.java | 21 +- .../implementation/MultipleClientImpl.java | 59 +- .../implementation/SingleClientImpl.java | 14 +- .../NotVersionedClientImpl.java | 40 +- .../implementation/VersionedClientImpl.java | 54 +- .../ConditionalRequestClientImpl.java | 25 +- .../RepeatabilityClientImpl.java | 13 +- .../implementation/ModelPropertiesImpl.java | 12 +- .../implementation/ModelsImpl.java | 418 +++++------ .../implementation/OperationsImpl.java | 364 ++++++---- .../implementation/ParametersImpl.java | 439 +++++++----- .../implementation/BooleanValuesImpl.java | 20 +- .../implementation/DatetimeValuesImpl.java | 20 +- .../implementation/DurationValuesImpl.java | 20 +- .../implementation/Float32ValuesImpl.java | 20 +- .../array/implementation/Int32ValuesImpl.java | 20 +- .../array/implementation/Int64ValuesImpl.java | 20 +- .../array/implementation/ModelValuesImpl.java | 20 +- .../NullableBooleanValuesImpl.java | 20 +- .../NullableFloatValuesImpl.java | 20 +- .../NullableInt32ValuesImpl.java | 20 +- .../NullableModelValuesImpl.java | 20 +- .../NullableStringValuesImpl.java | 20 +- .../implementation/StringValuesImpl.java | 20 +- .../implementation/UnknownValuesImpl.java | 20 +- .../implementation/BooleanValuesImpl.java | 20 +- .../implementation/DatetimeValuesImpl.java | 20 +- .../implementation/DurationValuesImpl.java | 20 +- .../implementation/Float32ValuesImpl.java | 20 +- .../implementation/Int32ValuesImpl.java | 20 +- .../implementation/Int64ValuesImpl.java | 20 +- .../implementation/ModelValuesImpl.java | 20 +- .../NullableFloatValuesImpl.java | 20 +- .../RecursiveModelValuesImpl.java | 20 +- .../implementation/StringValuesImpl.java | 20 +- .../implementation/UnknownValuesImpl.java | 20 +- .../implementation/StringOperationsImpl.java | 32 +- .../implementation/StringOperationsImpl.java | 28 +- .../empty/implementation/EmptyClientImpl.java | 33 +- .../implementation/FlattenClientImpl.java | 34 +- .../EnumDiscriminatorAsyncClient.java | 22 +- .../EnumDiscriminatorClient.java | 16 +- .../EnumDiscriminatorClientImpl.java | 70 +- .../EnumNestedDiscriminatorClientImpl.java | 40 +- .../NestedDiscriminatorClientImpl.java | 40 +- .../NotDiscriminatedClientImpl.java | 32 +- .../implementation/RecursiveClientImpl.java | 20 +- .../SingleDiscriminatorClientImpl.java | 44 +- .../usage/implementation/UsageClientImpl.java | 35 +- .../implementation/VisibilityClientImpl.java | 76 +- ...xtendsDifferentSpreadFloatAsyncClient.java | 6 +- .../ExtendsDifferentSpreadFloatClient.java | 5 +- ...sDifferentSpreadModelArrayAsyncClient.java | 6 +- ...xtendsDifferentSpreadModelArrayClient.java | 6 +- ...xtendsDifferentSpreadModelAsyncClient.java | 6 +- .../ExtendsDifferentSpreadModelClient.java | 6 +- ...tendsDifferentSpreadStringAsyncClient.java | 6 +- .../ExtendsDifferentSpreadStringClient.java | 5 +- .../ExtendsFloatAsyncClient.java | 5 +- .../ExtendsFloatClient.java | 4 +- .../ExtendsModelArrayAsyncClient.java | 5 +- .../ExtendsModelArrayClient.java | 4 +- .../ExtendsModelAsyncClient.java | 5 +- .../ExtendsModelClient.java | 4 +- .../ExtendsStringAsyncClient.java | 5 +- .../ExtendsStringClient.java | 4 +- .../ExtendsUnknownAsyncClient.java | 5 +- .../ExtendsUnknownClient.java | 4 +- .../ExtendsUnknownDerivedAsyncClient.java | 6 +- .../ExtendsUnknownDerivedClient.java | 4 +- ...xtendsUnknownDiscriminatedAsyncClient.java | 6 +- .../ExtendsUnknownDiscriminatedClient.java | 4 +- .../IsFloatAsyncClient.java | 5 +- .../additionalproperties/IsFloatClient.java | 4 +- .../IsModelArrayAsyncClient.java | 5 +- .../IsModelArrayClient.java | 4 +- .../IsModelAsyncClient.java | 5 +- .../additionalproperties/IsModelClient.java | 4 +- .../IsStringAsyncClient.java | 5 +- .../additionalproperties/IsStringClient.java | 4 +- .../IsUnknownAsyncClient.java | 5 +- .../additionalproperties/IsUnknownClient.java | 4 +- .../IsUnknownDerivedAsyncClient.java | 6 +- .../IsUnknownDerivedClient.java | 4 +- .../IsUnknownDiscriminatedAsyncClient.java | 5 +- .../IsUnknownDiscriminatedClient.java | 4 +- .../MultipleSpreadAsyncClient.java | 5 +- .../MultipleSpreadClient.java | 4 +- .../SpreadDifferentFloatAsyncClient.java | 6 +- .../SpreadDifferentFloatClient.java | 5 +- .../SpreadDifferentModelArrayAsyncClient.java | 6 +- .../SpreadDifferentModelArrayClient.java | 5 +- .../SpreadDifferentModelAsyncClient.java | 6 +- .../SpreadDifferentModelClient.java | 5 +- .../SpreadDifferentStringAsyncClient.java | 6 +- .../SpreadDifferentStringClient.java | 4 +- .../SpreadFloatAsyncClient.java | 6 +- .../SpreadFloatClient.java | 4 +- .../SpreadModelArrayAsyncClient.java | 4 +- .../SpreadModelArrayClient.java | 4 +- .../SpreadModelAsyncClient.java | 6 +- .../SpreadModelClient.java | 5 +- ...adRecordDiscriminatedUnionAsyncClient.java | 5 +- .../SpreadRecordDiscriminatedUnionClient.java | 4 +- ...cordNonDiscriminatedUnion2AsyncClient.java | 5 +- ...eadRecordNonDiscriminatedUnion2Client.java | 4 +- ...cordNonDiscriminatedUnion3AsyncClient.java | 5 +- ...eadRecordNonDiscriminatedUnion3Client.java | 4 +- ...ecordNonDiscriminatedUnionAsyncClient.java | 5 +- ...readRecordNonDiscriminatedUnionClient.java | 4 +- .../SpreadRecordUnionAsyncClient.java | 5 +- .../SpreadRecordUnionClient.java | 4 +- .../SpreadStringAsyncClient.java | 6 +- .../SpreadStringClient.java | 4 +- .../ExtendsDifferentSpreadFloatsImpl.java | 26 +- ...ExtendsDifferentSpreadModelArraysImpl.java | 26 +- .../ExtendsDifferentSpreadModelsImpl.java | 26 +- .../ExtendsDifferentSpreadStringsImpl.java | 26 +- .../implementation/ExtendsFloatsImpl.java | 25 +- .../ExtendsModelArraysImpl.java | 25 +- .../implementation/ExtendsModelsImpl.java | 25 +- .../implementation/ExtendsStringsImpl.java | 25 +- .../ExtendsUnknownDerivedsImpl.java | 25 +- .../ExtendsUnknownDiscriminatedsImpl.java | 25 +- .../implementation/ExtendsUnknownsImpl.java | 25 +- .../implementation/IsFloatsImpl.java | 25 +- .../implementation/IsModelArraysImpl.java | 25 +- .../implementation/IsModelsImpl.java | 25 +- .../implementation/IsStringsImpl.java | 25 +- .../implementation/IsUnknownDerivedsImpl.java | 25 +- .../IsUnknownDiscriminatedsImpl.java | 25 +- .../implementation/IsUnknownsImpl.java | 25 +- .../implementation/MultipleSpreadsImpl.java | 25 +- .../SpreadDifferentFloatsImpl.java | 26 +- .../SpreadDifferentModelArraysImpl.java | 26 +- .../SpreadDifferentModelsImpl.java | 26 +- .../SpreadDifferentStringsImpl.java | 25 +- .../implementation/SpreadFloatsImpl.java | 25 +- .../implementation/SpreadModelArraysImpl.java | 24 +- .../implementation/SpreadModelsImpl.java | 26 +- .../SpreadRecordDiscriminatedUnionsImpl.java | 25 +- ...readRecordNonDiscriminatedUnion2sImpl.java | 25 +- ...readRecordNonDiscriminatedUnion3sImpl.java | 25 +- ...preadRecordNonDiscriminatedUnionsImpl.java | 25 +- .../SpreadRecordUnionsImpl.java | 25 +- .../implementation/SpreadStringsImpl.java | 25 +- .../property/nullable/BytesAsyncClient.java | 12 +- .../type/property/nullable/BytesClient.java | 8 +- .../nullable/CollectionsByteAsyncClient.java | 10 +- .../nullable/CollectionsByteClient.java | 8 +- .../nullable/CollectionsModelAsyncClient.java | 10 +- .../nullable/CollectionsModelClient.java | 8 +- .../CollectionsStringAsyncClient.java | 10 +- .../nullable/CollectionsStringClient.java | 8 +- .../DatetimeOperationAsyncClient.java | 10 +- .../nullable/DatetimeOperationClient.java | 8 +- .../DurationOperationAsyncClient.java | 10 +- .../nullable/DurationOperationClient.java | 8 +- .../nullable/StringOperationAsyncClient.java | 12 +- .../nullable/StringOperationClient.java | 8 +- .../nullable/implementation/BytesImpl.java | 45 +- .../implementation/CollectionsBytesImpl.java | 43 +- .../implementation/CollectionsModelsImpl.java | 43 +- .../CollectionsStringsImpl.java | 43 +- .../DatetimeOperationsImpl.java | 43 +- .../DurationOperationsImpl.java | 43 +- .../implementation/StringOperationsImpl.java | 45 +- .../optional/BooleanLiteralAsyncClient.java | 10 +- .../optional/BooleanLiteralClient.java | 8 +- .../property/optional/BytesAsyncClient.java | 12 +- .../type/property/optional/BytesClient.java | 8 +- .../optional/CollectionsByteAsyncClient.java | 10 +- .../optional/CollectionsByteClient.java | 8 +- .../optional/CollectionsModelAsyncClient.java | 10 +- .../optional/CollectionsModelClient.java | 8 +- .../DatetimeOperationAsyncClient.java | 10 +- .../optional/DatetimeOperationClient.java | 8 +- .../DurationOperationAsyncClient.java | 10 +- .../optional/DurationOperationClient.java | 8 +- .../optional/FloatLiteralAsyncClient.java | 10 +- .../property/optional/FloatLiteralClient.java | 8 +- .../optional/IntLiteralAsyncClient.java | 10 +- .../property/optional/IntLiteralClient.java | 8 +- .../RequiredAndOptionalAsyncClient.java | 12 +- .../optional/RequiredAndOptionalClient.java | 8 +- .../optional/StringLiteralAsyncClient.java | 10 +- .../optional/StringLiteralClient.java | 8 +- .../optional/StringOperationAsyncClient.java | 12 +- .../optional/StringOperationClient.java | 8 +- .../UnionFloatLiteralAsyncClient.java | 10 +- .../optional/UnionFloatLiteralClient.java | 8 +- .../optional/UnionIntLiteralAsyncClient.java | 10 +- .../optional/UnionIntLiteralClient.java | 8 +- .../UnionStringLiteralAsyncClient.java | 10 +- .../optional/UnionStringLiteralClient.java | 8 +- .../implementation/BooleanLiteralsImpl.java | 44 +- .../optional/implementation/BytesImpl.java | 46 +- .../implementation/CollectionsBytesImpl.java | 44 +- .../implementation/CollectionsModelsImpl.java | 44 +- .../DatetimeOperationsImpl.java | 44 +- .../DurationOperationsImpl.java | 44 +- .../implementation/FloatLiteralsImpl.java | 44 +- .../implementation/IntLiteralsImpl.java | 44 +- .../RequiredAndOptionalsImpl.java | 46 +- .../implementation/StringLiteralsImpl.java | 44 +- .../implementation/StringOperationsImpl.java | 46 +- .../UnionFloatLiteralsImpl.java | 44 +- .../implementation/UnionIntLiteralsImpl.java | 44 +- .../UnionStringLiteralsImpl.java | 44 +- .../valuetypes/BooleanLiteralAsyncClient.java | 5 +- .../valuetypes/BooleanLiteralClient.java | 4 +- .../BooleanOperationAsyncClient.java | 4 +- .../valuetypes/BooleanOperationClient.java | 4 +- .../property/valuetypes/BytesAsyncClient.java | 4 +- .../type/property/valuetypes/BytesClient.java | 4 +- .../valuetypes/CollectionsIntAsyncClient.java | 5 +- .../valuetypes/CollectionsIntClient.java | 4 +- .../CollectionsModelAsyncClient.java | 5 +- .../valuetypes/CollectionsModelClient.java | 4 +- .../CollectionsStringAsyncClient.java | 5 +- .../valuetypes/CollectionsStringClient.java | 4 +- .../DatetimeOperationAsyncClient.java | 4 +- .../valuetypes/DatetimeOperationClient.java | 4 +- .../valuetypes/Decimal128AsyncClient.java | 4 +- .../property/valuetypes/Decimal128Client.java | 4 +- .../valuetypes/DecimalAsyncClient.java | 4 +- .../property/valuetypes/DecimalClient.java | 4 +- .../DictionaryStringAsyncClient.java | 5 +- .../valuetypes/DictionaryStringClient.java | 4 +- .../DurationOperationAsyncClient.java | 4 +- .../valuetypes/DurationOperationClient.java | 4 +- .../property/valuetypes/EnumAsyncClient.java | 4 +- .../type/property/valuetypes/EnumClient.java | 4 +- .../valuetypes/ExtensibleEnumAsyncClient.java | 5 +- .../valuetypes/ExtensibleEnumClient.java | 4 +- .../valuetypes/FloatLiteralAsyncClient.java | 4 +- .../valuetypes/FloatLiteralClient.java | 4 +- .../valuetypes/FloatOperationAsyncClient.java | 4 +- .../valuetypes/FloatOperationClient.java | 4 +- .../property/valuetypes/IntAsyncClient.java | 4 +- .../type/property/valuetypes/IntClient.java | 4 +- .../valuetypes/IntLiteralAsyncClient.java | 4 +- .../property/valuetypes/IntLiteralClient.java | 4 +- .../property/valuetypes/ModelAsyncClient.java | 4 +- .../type/property/valuetypes/ModelClient.java | 4 +- .../property/valuetypes/NeverAsyncClient.java | 4 +- .../type/property/valuetypes/NeverClient.java | 4 +- .../valuetypes/StringLiteralAsyncClient.java | 5 +- .../valuetypes/StringLiteralClient.java | 4 +- .../StringOperationAsyncClient.java | 4 +- .../valuetypes/StringOperationClient.java | 4 +- .../valuetypes/UnionEnumValueAsyncClient.java | 5 +- .../valuetypes/UnionEnumValueClient.java | 4 +- .../UnionFloatLiteralAsyncClient.java | 5 +- .../valuetypes/UnionFloatLiteralClient.java | 4 +- .../UnionIntLiteralAsyncClient.java | 5 +- .../valuetypes/UnionIntLiteralClient.java | 4 +- .../UnionStringLiteralAsyncClient.java | 5 +- .../valuetypes/UnionStringLiteralClient.java | 4 +- .../valuetypes/UnknownArrayAsyncClient.java | 5 +- .../valuetypes/UnknownArrayClient.java | 4 +- .../valuetypes/UnknownDictAsyncClient.java | 5 +- .../valuetypes/UnknownDictClient.java | 4 +- .../valuetypes/UnknownIntAsyncClient.java | 5 +- .../property/valuetypes/UnknownIntClient.java | 4 +- .../valuetypes/UnknownStringAsyncClient.java | 5 +- .../valuetypes/UnknownStringClient.java | 4 +- .../implementation/BooleanLiteralsImpl.java | 25 +- .../implementation/BooleanOperationsImpl.java | 24 +- .../valuetypes/implementation/BytesImpl.java | 24 +- .../implementation/CollectionsIntsImpl.java | 25 +- .../implementation/CollectionsModelsImpl.java | 25 +- .../CollectionsStringsImpl.java | 25 +- .../DatetimeOperationsImpl.java | 24 +- .../implementation/Decimal128sImpl.java | 24 +- .../implementation/DecimalsImpl.java | 24 +- .../implementation/DictionaryStringsImpl.java | 25 +- .../DurationOperationsImpl.java | 24 +- .../valuetypes/implementation/EnumsImpl.java | 24 +- .../implementation/ExtensibleEnumsImpl.java | 25 +- .../implementation/FloatLiteralsImpl.java | 24 +- .../implementation/FloatOperationsImpl.java | 24 +- .../implementation/IntLiteralsImpl.java | 24 +- .../valuetypes/implementation/IntsImpl.java | 24 +- .../valuetypes/implementation/ModelsImpl.java | 24 +- .../valuetypes/implementation/NeversImpl.java | 24 +- .../implementation/StringLiteralsImpl.java | 25 +- .../implementation/StringOperationsImpl.java | 24 +- .../implementation/UnionEnumValuesImpl.java | 25 +- .../UnionFloatLiteralsImpl.java | 25 +- .../implementation/UnionIntLiteralsImpl.java | 25 +- .../UnionStringLiteralsImpl.java | 25 +- .../implementation/UnknownArraysImpl.java | 25 +- .../implementation/UnknownDictsImpl.java | 25 +- .../implementation/UnknownIntsImpl.java | 25 +- .../implementation/UnknownStringsImpl.java | 25 +- .../scalar/BooleanOperationAsyncClient.java | 5 +- .../type/scalar/BooleanOperationClient.java | 4 +- .../scalar/StringOperationAsyncClient.java | 4 +- .../type/scalar/StringOperationClient.java | 4 +- .../com/type/scalar/UnknownAsyncClient.java | 4 +- .../java/com/type/scalar/UnknownClient.java | 4 +- .../implementation/BooleanOperationsImpl.java | 25 +- .../implementation/Decimal128TypesImpl.java | 30 +- .../Decimal128VerifiesImpl.java | 18 +- .../implementation/DecimalTypesImpl.java | 30 +- .../implementation/DecimalVerifiesImpl.java | 18 +- .../implementation/StringOperationsImpl.java | 24 +- .../scalar/implementation/UnknownsImpl.java | 24 +- .../union/implementation/EnumsOnliesImpl.java | 16 +- .../implementation/FloatsOnliesImpl.java | 16 +- .../union/implementation/IntsOnliesImpl.java | 16 +- .../implementation/MixedLiteralsImpl.java | 16 +- .../union/implementation/MixedTypesImpl.java | 16 +- .../implementation/ModelsOnliesImpl.java | 16 +- .../implementation/StringAndArraysImpl.java | 16 +- .../StringExtensibleNamedsImpl.java | 16 +- .../implementation/StringExtensiblesImpl.java | 16 +- .../implementation/StringsOnliesImpl.java | 16 +- .../added/implementation/AddedClientImpl.java | 37 +- .../implementation/InterfaceV2sImpl.java | 16 +- .../MadeOptionalClientImpl.java | 17 +- .../implementation/RemovedClientImpl.java | 17 +- .../implementation/NewInterfacesImpl.java | 18 +- .../implementation/RenamedFromClientImpl.java | 20 +- .../ReturnTypeChangedFromClientImpl.java | 17 +- .../TypeChangedFromClientImpl.java | 18 +- .../main/resources/cadl-optional.properties | 2 + .../cadl/flatten/generated/FlattenOpSend.java | 8 + .../flatten/generated/FlattenOpSendLong.java | 29 + .../generated/HttpbinClientTestBase.java | 2 - .../ServiceClientClientTestBase.java | 37 +- ...ResiliencyServiceDrivenClientTestBase.java | 1 - ...ResiliencyServiceDrivenClientTestBase.java | 1 - .../generated/MultipleClientTestBase.java | 1 - 523 files changed, 8496 insertions(+), 7468 deletions(-) delete mode 100644 typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/models/OperationState.java delete mode 100644 typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/models/ResourceOperationStatusGenerationResponseGenerationResultError.java delete mode 100644 typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/models/OperationState.java delete mode 100644 typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/models/OperationStatusError.java delete mode 100644 typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/models/ResourceOperationStatusUserExportedUserError.java rename typespec-tests/src/main/java/com/cadl/internal/{ => implementation}/models/ResponseInternal.java (98%) rename typespec-tests/src/main/java/com/cadl/internal/{ => implementation}/models/ResponseInternalInner.java (98%) delete mode 100644 typespec-tests/src/main/java/com/cadl/longrunning/models/LroOperationStatusError.java create mode 100644 typespec-tests/src/main/java/com/cadl/optional/OptionalClientBuilder.java create mode 100644 typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalClientImpl.java create mode 100644 typespec-tests/src/main/java/com/cadl/optional/implementation/package-info.java create mode 100644 typespec-tests/src/main/java/com/cadl/optional/models/AllPropertiesOptional.java create mode 100644 typespec-tests/src/main/java/com/cadl/optional/models/ImmutableModel.java create mode 100644 typespec-tests/src/main/java/com/cadl/optional/models/Optional.java create mode 100644 typespec-tests/src/main/java/com/cadl/optional/models/package-info.java create mode 100644 typespec-tests/src/main/java/com/cadl/optional/package-info.java delete mode 100644 typespec-tests/src/main/java/com/cadl/union/models/OperationState.java delete mode 100644 typespec-tests/src/main/java/com/cadl/union/models/ResourceOperationStatusOperationStatusResultError.java delete mode 100644 typespec-tests/src/main/java/com/cadl/versioning/models/OperationState.java delete mode 100644 typespec-tests/src/main/java/com/cadl/versioning/models/ResourceOperationStatusResourceExportedResourceError.java rename typespec-tests/src/main/java/com/client/structure/service/{BazAsyncClient.java => BazFooAsyncClient.java} (91%) rename typespec-tests/src/main/java/com/client/structure/service/{BazClient.java => BazFooClient.java} (91%) create mode 100644 typespec-tests/src/main/java/com/client/structure/service/QuxBarAsyncClient.java create mode 100644 typespec-tests/src/main/java/com/client/structure/service/QuxBarClient.java delete mode 100644 typespec-tests/src/main/java/com/client/structure/service/implementation/BarsOperationsImpl.java rename typespec-tests/src/main/java/com/client/structure/service/implementation/{BazesImpl.java => BazFoosImpl.java} (81%) delete mode 100644 typespec-tests/src/main/java/com/client/structure/service/implementation/FoosOperationsImpl.java create mode 100644 typespec-tests/src/main/java/com/client/structure/service/implementation/QuxBarsImpl.java create mode 100644 typespec-tests/src/main/resources/cadl-optional.properties create mode 100644 typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSendLong.java diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/InternalOperationsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/InternalOperationsImpl.java index f0b3990416..1f546b3b79 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/InternalOperationsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/InternalOperationsImpl.java @@ -64,7 +64,7 @@ public interface InternalOperationsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> noDecoratorInInternal(@QueryParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/internalOperation/noDecoratorInInternal") @ExpectedResponses({ 200 }) @@ -73,7 +73,7 @@ Mono> noDecoratorInInternal(@QueryParam("name") String name @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response noDecoratorInInternalSync(@QueryParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/internalOperation/internalDecoratorInInternal") @ExpectedResponses({ 200 }) @@ -82,7 +82,7 @@ Response noDecoratorInInternalSync(@QueryParam("name") String name, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> internalDecoratorInInternal(@QueryParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/internalOperation/internalDecoratorInInternal") @ExpectedResponses({ 200 }) @@ -91,7 +91,7 @@ Mono> internalDecoratorInInternal(@QueryParam("name") Strin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response internalDecoratorInInternalSync(@QueryParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/internalOperation/publicDecoratorInInternal") @ExpectedResponses({ 200 }) @@ -100,7 +100,7 @@ Response internalDecoratorInInternalSync(@QueryParam("name") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> publicDecoratorInInternal(@QueryParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/internalOperation/publicDecoratorInInternal") @ExpectedResponses({ 200 }) @@ -109,7 +109,7 @@ Mono> publicDecoratorInInternal(@QueryParam("name") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response publicDecoratorInInternalSync(@QueryParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } /** diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/PublicOperationsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/PublicOperationsImpl.java index d50ff927b4..3c5b2aec41 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/PublicOperationsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/PublicOperationsImpl.java @@ -64,7 +64,7 @@ public interface PublicOperationsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> noDecoratorInPublic(@QueryParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/publicOperation/noDecoratorInPublic") @ExpectedResponses({ 200 }) @@ -73,7 +73,7 @@ Mono> noDecoratorInPublic(@QueryParam("name") String name, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response noDecoratorInPublicSync(@QueryParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/publicOperation/publicDecoratorInPublic") @ExpectedResponses({ 200 }) @@ -82,7 +82,7 @@ Response noDecoratorInPublicSync(@QueryParam("name") String name, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> publicDecoratorInPublic(@QueryParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/publicOperation/publicDecoratorInPublic") @ExpectedResponses({ 200 }) @@ -91,7 +91,7 @@ Mono> publicDecoratorInPublic(@QueryParam("name") String na @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response publicDecoratorInPublicSync(@QueryParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } /** diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/RelativeModelInOperationsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/RelativeModelInOperationsImpl.java index a475dde8cc..ecd6b80784 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/RelativeModelInOperationsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/RelativeModelInOperationsImpl.java @@ -63,7 +63,7 @@ public interface RelativeModelInOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> operation(@QueryParam("name") String name, @HeaderParam("Accept") String accept, + Mono> operation(@QueryParam("name") String name, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/relativeModelInOperation/operation") @@ -72,7 +72,7 @@ Mono> operation(@QueryParam("name") String name, @HeaderPar @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response operationSync(@QueryParam("name") String name, @HeaderParam("Accept") String accept, + Response operationSync(@QueryParam("name") String name, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/relativeModelInOperation/discriminator") @@ -81,7 +81,7 @@ Response operationSync(@QueryParam("name") String name, @HeaderParam @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> discriminator(@QueryParam("kind") String kind, @HeaderParam("Accept") String accept, + Mono> discriminator(@QueryParam("kind") String kind, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/relativeModelInOperation/discriminator") @@ -90,7 +90,7 @@ Mono> discriminator(@QueryParam("kind") String kind, @Heade @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response discriminatorSync(@QueryParam("kind") String kind, @HeaderParam("Accept") String accept, + Response discriminatorSync(@QueryParam("kind") String kind, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/SharedModelInOperationsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/SharedModelInOperationsImpl.java index ba5e9df97d..cd3684b45b 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/SharedModelInOperationsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/SharedModelInOperationsImpl.java @@ -63,7 +63,7 @@ public interface SharedModelInOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> publicMethod(@QueryParam("name") String name, @HeaderParam("Accept") String accept, + Mono> publicMethod(@QueryParam("name") String name, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/sharedModelInOperation/public") @@ -72,7 +72,7 @@ Mono> publicMethod(@QueryParam("name") String name, @Header @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response publicMethodSync(@QueryParam("name") String name, @HeaderParam("Accept") String accept, + Response publicMethodSync(@QueryParam("name") String name, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/sharedModelInOperation/internal") @@ -81,7 +81,7 @@ Response publicMethodSync(@QueryParam("name") String name, @HeaderPa @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> internal(@QueryParam("name") String name, @HeaderParam("Accept") String accept, + Mono> internal(@QueryParam("name") String name, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/sharedModelInOperation/internal") @@ -90,7 +90,7 @@ Mono> internal(@QueryParam("name") String name, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response internalSync(@QueryParam("name") String name, @HeaderParam("Accept") String accept, + Response internalSync(@QueryParam("name") String name, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/implementation/ModelInOperationsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/implementation/ModelInOperationsImpl.java index 45f193c3c1..fd5a97122f 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/implementation/ModelInOperationsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/implementation/ModelInOperationsImpl.java @@ -65,7 +65,7 @@ public interface ModelInOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> inputToInputOutput(@HeaderParam("Content-Type") String contentType, + Mono> inputToInputOutput(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/azure/client-generator-core/usage/inputToInputOutput") @@ -74,7 +74,7 @@ Mono> inputToInputOutput(@HeaderParam("Content-Type") String cont @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response inputToInputOutputSync(@HeaderParam("Content-Type") String contentType, + Response inputToInputOutputSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/usage/outputToInputOutput") @@ -83,7 +83,7 @@ Response inputToInputOutputSync(@HeaderParam("Content-Type") String conten @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> outputToInputOutput(@HeaderParam("Accept") String accept, + Mono> outputToInputOutput(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/usage/outputToInputOutput") @@ -92,7 +92,7 @@ Mono> outputToInputOutput(@HeaderParam("Accept") String acc @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response outputToInputOutputSync(@HeaderParam("Accept") String accept, + Response outputToInputOutputSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/azure/client-generator-core/usage/modelInReadOnlyProperty") @@ -101,9 +101,8 @@ Response outputToInputOutputSync(@HeaderParam("Accept") String accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> modelInReadOnlyProperty(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> modelInReadOnlyProperty(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/azure/client-generator-core/usage/modelInReadOnlyProperty") @ExpectedResponses({ 200 }) @@ -111,9 +110,8 @@ Mono> modelInReadOnlyProperty(@HeaderParam("Content-Type") @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response modelInReadOnlyPropertySync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response modelInReadOnlyPropertySync(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -141,8 +139,8 @@ Response modelInReadOnlyPropertySync(@HeaderParam("Content-Type") St */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> inputToInputOutputWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.inputToInputOutput(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.inputToInputOutput(accept, body, requestOptions, context)); } /** @@ -170,8 +168,8 @@ public Mono> inputToInputOutputWithResponseAsync(BinaryData body, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response inputToInputOutputWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.inputToInputOutputSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.inputToInputOutputSync(accept, body, requestOptions, Context.NONE); } /** @@ -276,10 +274,8 @@ public Response outputToInputOutputWithResponse(RequestOptions reque @ServiceMethod(returns = ReturnType.SINGLE) public Mono> modelInReadOnlyPropertyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.modelInReadOnlyProperty(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.modelInReadOnlyProperty(accept, body, requestOptions, context)); } /** @@ -327,8 +323,7 @@ public Mono> modelInReadOnlyPropertyWithResponseAsync(Binar */ @ServiceMethod(returns = ReturnType.SINGLE) public Response modelInReadOnlyPropertyWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.modelInReadOnlyPropertySync(contentType, accept, body, requestOptions, Context.NONE); + return service.modelInReadOnlyPropertySync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java index 93765b3642..01fdba4193 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java @@ -160,7 +160,7 @@ public interface BasicClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrUpdate(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -171,7 +171,7 @@ Mono> createOrUpdate(@QueryParam("api-version") String apiV @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrUpdateSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -182,9 +182,8 @@ Response createOrUpdateSync(@QueryParam("api-version") String apiVer @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrReplace(@QueryParam("api-version") String apiVersion, - @PathParam("id") int id, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + @PathParam("id") int id, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Put("/azure/core/basic/users/{id}") @ExpectedResponses({ 200, 201 }) @@ -193,8 +192,8 @@ Mono> createOrReplace(@QueryParam("api-version") String api @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrReplaceSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, + RequestOptions requestOptions, Context context); @Get("/azure/core/basic/users/{id}") @ExpectedResponses({ 200 }) @@ -203,7 +202,7 @@ Response createOrReplaceSync(@QueryParam("api-version") String apiVe @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> get(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/users/{id}") @ExpectedResponses({ 200 }) @@ -212,7 +211,7 @@ Mono> get(@QueryParam("api-version") String apiVersion, @Pa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/users") @ExpectedResponses({ 200 }) @@ -221,7 +220,7 @@ Response getSync(@QueryParam("api-version") String apiVersion, @Path @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> list(@QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/users") @ExpectedResponses({ 200 }) @@ -230,7 +229,7 @@ Mono> list(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/page") @ExpectedResponses({ 200 }) @@ -239,7 +238,7 @@ Response listSync(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithPage(@QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/page") @ExpectedResponses({ 200 }) @@ -248,7 +247,7 @@ Mono> listWithPage(@QueryParam("api-version") String apiVer @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithPageSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/parameters") @ExpectedResponses({ 200 }) @@ -257,8 +256,8 @@ Response listWithPageSync(@QueryParam("api-version") String apiVersi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithParameters(@QueryParam("api-version") String apiVersion, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData bodyInput, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData bodyInput, + RequestOptions requestOptions, Context context); @Get("/azure/core/basic/parameters") @ExpectedResponses({ 200 }) @@ -267,8 +266,8 @@ Mono> listWithParameters(@QueryParam("api-version") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithParametersSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData bodyInput, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData bodyInput, + RequestOptions requestOptions, Context context); @Get("/azure/core/basic/custom-page") @ExpectedResponses({ 200 }) @@ -277,7 +276,7 @@ Response listWithParametersSync(@QueryParam("api-version") String ap @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithCustomPageModel(@QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/custom-page") @ExpectedResponses({ 200 }) @@ -286,7 +285,7 @@ Mono> listWithCustomPageModel(@QueryParam("api-version") St @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithCustomPageModelSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Delete("/azure/core/basic/users/{id}") @ExpectedResponses({ 204 }) @@ -295,7 +294,7 @@ Response listWithCustomPageModelSync(@QueryParam("api-version") Stri @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> delete(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Delete("/azure/core/basic/users/{id}") @ExpectedResponses({ 204 }) @@ -304,7 +303,7 @@ Mono> delete(@QueryParam("api-version") String apiVersion, @PathP @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/azure/core/basic/users/{id}:export") @ExpectedResponses({ 200 }) @@ -313,7 +312,7 @@ Response deleteSync(@QueryParam("api-version") String apiVersion, @PathPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> export(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @QueryParam("format") String format, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + @QueryParam("format") String format, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/azure/core/basic/users/{id}:export") @@ -323,7 +322,7 @@ Mono> export(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response exportSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @QueryParam("format") String format, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + @QueryParam("format") String format, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -333,7 +332,7 @@ Response exportSync(@QueryParam("api-version") String apiVersion, @P @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -342,7 +341,7 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = tru @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -351,7 +350,7 @@ Response listNextSync(@PathParam(value = "nextLink", encoded = true) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithPageNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -360,7 +359,7 @@ Mono> listWithPageNext(@PathParam(value = "nextLink", encod @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithPageNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -369,8 +368,7 @@ Response listWithPageNextSync(@PathParam(value = "nextLink", encoded @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithParametersNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -380,8 +378,7 @@ Mono> listWithParametersNext( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithParametersNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -390,7 +387,7 @@ Response listWithParametersNextSync(@PathParam(value = "nextLink", e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithCustomPageModelNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -400,7 +397,7 @@ Mono> listWithCustomPageModelNext( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithCustomPageModelNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } @@ -565,10 +562,9 @@ public Response createOrUpdateWithResponse(int id, BinaryData resour @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createOrReplaceWithResponseAsync(int id, BinaryData resource, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.createOrReplace(this.getServiceVersion().getVersion(), id, - contentType, accept, resource, requestOptions, context)); + accept, resource, requestOptions, context)); } /** @@ -621,10 +617,9 @@ public Mono> createOrReplaceWithResponseAsync(int id, Binar @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrReplaceWithResponse(int id, BinaryData resource, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrReplaceSync(this.getServiceVersion().getVersion(), id, contentType, accept, resource, - requestOptions, Context.NONE); + return service.createOrReplaceSync(this.getServiceVersion().getVersion(), id, accept, resource, requestOptions, + Context.NONE); } /** @@ -1138,11 +1133,10 @@ public PagedIterable listWithPage(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithParametersSinglePageAsync(BinaryData bodyInput, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listWithParameters(this.getServiceVersion().getVersion(), contentType, - accept, bodyInput, requestOptions, context)) + .withContext(context -> service.listWithParameters(this.getServiceVersion().getVersion(), accept, bodyInput, + requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -1245,10 +1239,9 @@ public PagedFlux listWithParametersAsync(BinaryData bodyInput, Reque @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listWithParametersSinglePage(BinaryData bodyInput, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - Response res = service.listWithParametersSync(this.getServiceVersion().getVersion(), contentType, - accept, bodyInput, requestOptions, Context.NONE); + Response res = service.listWithParametersSync(this.getServiceVersion().getVersion(), accept, + bodyInput, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } @@ -1634,8 +1627,6 @@ private PagedResponse listNextSinglePage(String nextLink, RequestOpt } /** - * List with Azure.Core.Page<>. - * * Get the next page of items. *

Response Body Schema

* @@ -1672,8 +1663,6 @@ private Mono> listWithPageNextSinglePageAsync(String n } /** - * List with Azure.Core.Page<>. - * * Get the next page of items. *

Response Body Schema

* @@ -1709,8 +1698,6 @@ private PagedResponse listWithPageNextSinglePage(String nextLink, Re } /** - * List with extensible enum parameter Azure.Core.Page<>. - * * Get the next page of items. *

Response Body Schema

* @@ -1740,18 +1727,14 @@ private PagedResponse listWithPageNextSinglePage(String nextLink, Re @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithParametersNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listWithParametersNext(nextLink, contentType, accept, requestOptions, context)) + .withContext(context -> service.listWithParametersNext(nextLink, accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** - * List with extensible enum parameter Azure.Core.Page<>. - * * Get the next page of items. *

Response Body Schema

* @@ -1780,17 +1763,13 @@ private Mono> listWithParametersNextSinglePageAsync(St */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listWithParametersNextSinglePage(String nextLink, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - Response res - = service.listWithParametersNextSync(nextLink, contentType, accept, requestOptions, Context.NONE); + Response res = service.listWithParametersNextSync(nextLink, accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } /** - * List with custom page model. - * * Get the next page of items. *

Response Body Schema

* @@ -1828,8 +1807,6 @@ private Mono> listWithCustomPageModelNextSinglePageAsy } /** - * List with custom page model. - * * Get the next page of items. *

Response Body Schema

* diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/TwoModelsAsPageItemsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/TwoModelsAsPageItemsImpl.java index 677f55c324..cb380a6b93 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/TwoModelsAsPageItemsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/TwoModelsAsPageItemsImpl.java @@ -82,7 +82,7 @@ public interface TwoModelsAsPageItemsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listFirstItem(@QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/first-item") @ExpectedResponses({ 200 }) @@ -91,7 +91,7 @@ Mono> listFirstItem(@QueryParam("api-version") String apiVe @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listFirstItemSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/second-item") @ExpectedResponses({ 200 }) @@ -100,7 +100,7 @@ Response listFirstItemSync(@QueryParam("api-version") String apiVers @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listSecondItem(@QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/second-item") @ExpectedResponses({ 200 }) @@ -109,7 +109,7 @@ Mono> listSecondItem(@QueryParam("api-version") String apiV @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listSecondItemSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -118,7 +118,7 @@ Response listSecondItemSync(@QueryParam("api-version") String apiVer @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listFirstItemNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -127,7 +127,7 @@ Mono> listFirstItemNext(@PathParam(value = "nextLink", enco @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listFirstItemNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -136,7 +136,7 @@ Response listFirstItemNextSync(@PathParam(value = "nextLink", encode @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listSecondItemNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -145,7 +145,7 @@ Mono> listSecondItemNext(@PathParam(value = "nextLink", enc @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listSecondItemNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -369,9 +369,6 @@ public PagedIterable listSecondItem(RequestOptions requestOptions) { } /** - * Two operations with two different page item types should be successfully generated. Should generate model for - * FirstItem. - * * Get the next page of items. *

Response Body Schema

* @@ -400,9 +397,6 @@ private Mono> listFirstItemNextSinglePageAsync(String } /** - * Two operations with two different page item types should be successfully generated. Should generate model for - * FirstItem. - * * Get the next page of items. *

Response Body Schema

* @@ -429,9 +423,6 @@ private PagedResponse listFirstItemNextSinglePage(String nextLink, R } /** - * Two operations with two different page item types should be successfully generated. Should generate model for - * SecondItem. - * * Get the next page of items. *

Response Body Schema

* @@ -460,9 +451,6 @@ private Mono> listSecondItemNextSinglePageAsync(String } /** - * Two operations with two different page item types should be successfully generated. Should generate model for - * SecondItem. - * * Get the next page of items. *

Response Body Schema

* diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/RpcAsyncClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/RpcAsyncClient.java index 263f922bde..ad68e21ebd 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/RpcAsyncClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/RpcAsyncClient.java @@ -68,7 +68,7 @@ public final class RpcAsyncClient { * } * } * - * @param generationOptions The generationOptions parameter. + * @param generationOptions Options for the generation. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -86,7 +86,7 @@ public PollerFlux beginLongRunningRpc(BinaryData generat /** * Generate data. * - * @param generationOptions The generationOptions parameter. + * @param generationOptions Options for the generation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/RpcClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/RpcClient.java index dbfdc2cfa2..01f413c02c 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/RpcClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/RpcClient.java @@ -68,7 +68,7 @@ public final class RpcClient { * } * } * - * @param generationOptions The generationOptions parameter. + * @param generationOptions Options for the generation. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -86,7 +86,7 @@ public SyncPoller beginLongRunningRpc(BinaryData generat /** * Generate data. * - * @param generationOptions The generationOptions parameter. + * @param generationOptions Options for the generation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/implementation/RpcClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/implementation/RpcClientImpl.java index 3365c116da..36653b9616 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/implementation/RpcClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/implementation/RpcClientImpl.java @@ -139,9 +139,8 @@ public interface RpcClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> longRunningRpc(@QueryParam("api-version") String apiVersion, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData generationOptions, RequestOptions requestOptions, - Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData generationOptions, + RequestOptions requestOptions, Context context); @Post("/azure/core/lro/rpc/generations:submit") @ExpectedResponses({ 202 }) @@ -150,9 +149,8 @@ Mono> longRunningRpc(@QueryParam("api-version") String apiV @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response longRunningRpcSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData generationOptions, RequestOptions requestOptions, - Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData generationOptions, + RequestOptions requestOptions, Context context); } /** @@ -185,7 +183,7 @@ Response longRunningRpcSync(@QueryParam("api-version") String apiVer * } * } * - * @param generationOptions The generationOptions parameter. + * @param generationOptions Options for the generation. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -197,10 +195,9 @@ Response longRunningRpcSync(@QueryParam("api-version") String apiVer @ServiceMethod(returns = ReturnType.SINGLE) private Mono> longRunningRpcWithResponseAsync(BinaryData generationOptions, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.longRunningRpc(this.getServiceVersion().getVersion(), - contentType, accept, generationOptions, requestOptions, context)); + return FluxUtil.withContext(context -> service.longRunningRpc(this.getServiceVersion().getVersion(), accept, + generationOptions, requestOptions, context)); } /** @@ -233,7 +230,7 @@ private Mono> longRunningRpcWithResponseAsync(BinaryData ge * } * } * - * @param generationOptions The generationOptions parameter. + * @param generationOptions Options for the generation. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -244,9 +241,8 @@ private Mono> longRunningRpcWithResponseAsync(BinaryData ge @ServiceMethod(returns = ReturnType.SINGLE) private Response longRunningRpcWithResponse(BinaryData generationOptions, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.longRunningRpcSync(this.getServiceVersion().getVersion(), contentType, accept, generationOptions, + return service.longRunningRpcSync(this.getServiceVersion().getVersion(), accept, generationOptions, requestOptions, Context.NONE); } @@ -280,7 +276,7 @@ private Response longRunningRpcWithResponse(BinaryData generationOpt * } * } * - * @param generationOptions The generationOptions parameter. + * @param generationOptions Options for the generation. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -334,7 +330,7 @@ public PollerFlux beginLongRunningRpcAsync(BinaryData ge * } * } * - * @param generationOptions The generationOptions parameter. + * @param generationOptions Options for the generation. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -388,7 +384,7 @@ public SyncPoller beginLongRunningRpc(BinaryData generat * } * } * - * @param generationOptions The generationOptions parameter. + * @param generationOptions Options for the generation. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -443,7 +439,7 @@ public SyncPoller beginLongRunningRpc(BinaryData generat * } * } * - * @param generationOptions The generationOptions parameter. + * @param generationOptions Options for the generation. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/models/OperationState.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/models/OperationState.java deleted file mode 100644 index 69593dba1f..0000000000 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/models/OperationState.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com._specs_.azure.core.lro.rpc.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Enum describing allowed operation states. - */ -public final class OperationState extends ExpandableStringEnum { - /** - * The operation has not started. - */ - @Generated - public static final OperationState NOT_STARTED = fromString("NotStarted"); - - /** - * The operation is in progress. - */ - @Generated - public static final OperationState RUNNING = fromString("Running"); - - /** - * The operation has completed successfully. - */ - @Generated - public static final OperationState SUCCEEDED = fromString("Succeeded"); - - /** - * The operation has failed. - */ - @Generated - public static final OperationState FAILED = fromString("Failed"); - - /** - * The operation has been canceled by the user. - */ - @Generated - public static final OperationState CANCELED = fromString("Canceled"); - - /** - * Creates a new instance of OperationState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public OperationState() { - } - - /** - * Creates or finds a OperationState from its string representation. - * - * @param name a name to look for. - * @return the corresponding OperationState. - */ - @Generated - public static OperationState fromString(String name) { - return fromString(name, OperationState.class); - } - - /** - * Gets known OperationState values. - * - * @return known OperationState values. - */ - @Generated - public static Collection values() { - return values(OperationState.class); - } -} diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/models/ResourceOperationStatusGenerationResponseGenerationResultError.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/models/ResourceOperationStatusGenerationResponseGenerationResultError.java deleted file mode 100644 index 17f485cf69..0000000000 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/models/ResourceOperationStatusGenerationResponseGenerationResultError.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com._specs_.azure.core.lro.rpc.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.core.models.ResponseError; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Provides status details for long running operations. - */ -@Immutable -public final class ResourceOperationStatusGenerationResponseGenerationResultError - implements JsonSerializable { - /* - * The unique ID of the operation. - */ - @Generated - private String id; - - /* - * The status of the operation - */ - @Generated - private final OperationState status; - - /* - * Error object that describes the error when status is "Failed". - */ - @Generated - private ResponseError error; - - /* - * The result of the operation. - */ - @Generated - private GenerationResult result; - - /** - * Creates an instance of ResourceOperationStatusGenerationResponseGenerationResultError class. - * - * @param status the status value to set. - */ - @Generated - private ResourceOperationStatusGenerationResponseGenerationResultError(OperationState status) { - this.status = status; - } - - /** - * Get the id property: The unique ID of the operation. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Get the status property: The status of the operation. - * - * @return the status value. - */ - @Generated - public OperationState getStatus() { - return this.status; - } - - /** - * Get the error property: Error object that describes the error when status is "Failed". - * - * @return the error value. - */ - @Generated - public ResponseError getError() { - return this.error; - } - - /** - * Get the result property: The result of the operation. - * - * @return the result value. - */ - @Generated - public GenerationResult getResult() { - return this.result; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeJsonField("error", this.error); - jsonWriter.writeJsonField("result", this.result); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceOperationStatusGenerationResponseGenerationResultError from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceOperationStatusGenerationResponseGenerationResultError if the JsonReader was - * pointing to an instance of it, or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the - * ResourceOperationStatusGenerationResponseGenerationResultError. - */ - @Generated - public static ResourceOperationStatusGenerationResponseGenerationResultError fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - String id = null; - OperationState status = null; - ResponseError error = null; - GenerationResult result = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("status".equals(fieldName)) { - status = OperationState.fromString(reader.getString()); - } else if ("error".equals(fieldName)) { - error = ResponseError.fromJson(reader); - } else if ("result".equals(fieldName)) { - result = GenerationResult.fromJson(reader); - } else { - reader.skipChildren(); - } - } - ResourceOperationStatusGenerationResponseGenerationResultError deserializedResourceOperationStatusGenerationResponseGenerationResultError - = new ResourceOperationStatusGenerationResponseGenerationResultError(status); - deserializedResourceOperationStatusGenerationResponseGenerationResultError.id = id; - deserializedResourceOperationStatusGenerationResponseGenerationResultError.error = error; - deserializedResourceOperationStatusGenerationResponseGenerationResultError.result = result; - - return deserializedResourceOperationStatusGenerationResponseGenerationResultError; - }); - } -} diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/implementation/StandardClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/implementation/StandardClientImpl.java index 2e2ff4667f..f66dfb0fe8 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/implementation/StandardClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/implementation/StandardClientImpl.java @@ -143,9 +143,8 @@ public interface StandardClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrReplace(@QueryParam("api-version") String apiVersion, - @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + @PathParam("name") String name, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Put("/azure/core/lro/standard/users/{name}") @ExpectedResponses({ 200, 201 }) @@ -154,9 +153,8 @@ Mono> createOrReplace(@QueryParam("api-version") String api @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrReplaceSync(@QueryParam("api-version") String apiVersion, - @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + @PathParam("name") String name, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Delete("/azure/core/lro/standard/users/{name}") @ExpectedResponses({ 202 }) @@ -165,7 +163,7 @@ Response createOrReplaceSync(@QueryParam("api-version") String apiVe @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> delete(@QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Delete("/azure/core/lro/standard/users/{name}") @ExpectedResponses({ 202 }) @@ -174,7 +172,7 @@ Mono> delete(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteSync(@QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/azure/core/lro/standard/users/{name}:export") @ExpectedResponses({ 202 }) @@ -183,7 +181,7 @@ Response deleteSync(@QueryParam("api-version") String apiVersion, @P @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> export(@QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @QueryParam("format") String format, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + @QueryParam("format") String format, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/azure/core/lro/standard/users/{name}:export") @@ -193,7 +191,7 @@ Mono> export(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response exportSync(@QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @QueryParam("format") String format, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + @QueryParam("format") String format, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } @@ -231,10 +229,9 @@ Response exportSync(@QueryParam("api-version") String apiVersion, @P @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrReplaceWithResponseAsync(String name, BinaryData resource, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.createOrReplace(this.getServiceVersion().getVersion(), name, - contentType, accept, resource, requestOptions, context)); + accept, resource, requestOptions, context)); } /** @@ -271,9 +268,8 @@ private Mono> createOrReplaceWithResponseAsync(String name, @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrReplaceWithResponse(String name, BinaryData resource, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrReplaceSync(this.getServiceVersion().getVersion(), name, contentType, accept, resource, + return service.createOrReplaceSync(this.getServiceVersion().getVersion(), name, accept, resource, requestOptions, Context.NONE); } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/models/OperationState.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/models/OperationState.java deleted file mode 100644 index 070ef6faa2..0000000000 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/models/OperationState.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com._specs_.azure.core.lro.standard.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Enum describing allowed operation states. - */ -public final class OperationState extends ExpandableStringEnum { - /** - * The operation has not started. - */ - @Generated - public static final OperationState NOT_STARTED = fromString("NotStarted"); - - /** - * The operation is in progress. - */ - @Generated - public static final OperationState RUNNING = fromString("Running"); - - /** - * The operation has completed successfully. - */ - @Generated - public static final OperationState SUCCEEDED = fromString("Succeeded"); - - /** - * The operation has failed. - */ - @Generated - public static final OperationState FAILED = fromString("Failed"); - - /** - * The operation has been canceled by the user. - */ - @Generated - public static final OperationState CANCELED = fromString("Canceled"); - - /** - * Creates a new instance of OperationState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public OperationState() { - } - - /** - * Creates or finds a OperationState from its string representation. - * - * @param name a name to look for. - * @return the corresponding OperationState. - */ - @Generated - public static OperationState fromString(String name) { - return fromString(name, OperationState.class); - } - - /** - * Gets known OperationState values. - * - * @return known OperationState values. - */ - @Generated - public static Collection values() { - return values(OperationState.class); - } -} diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/models/OperationStatusError.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/models/OperationStatusError.java deleted file mode 100644 index 6683d6e3ab..0000000000 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/models/OperationStatusError.java +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com._specs_.azure.core.lro.standard.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.core.models.ResponseError; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Provides status details for long running operations. - */ -@Immutable -public final class OperationStatusError implements JsonSerializable { - /* - * The unique ID of the operation. - */ - @Generated - private final String id; - - /* - * The status of the operation - */ - @Generated - private final OperationState status; - - /* - * Error object that describes the error when status is "Failed". - */ - @Generated - private ResponseError error; - - /** - * Creates an instance of OperationStatusError class. - * - * @param id the id value to set. - * @param status the status value to set. - */ - @Generated - private OperationStatusError(String id, OperationState status) { - this.id = id; - this.status = status; - } - - /** - * Get the id property: The unique ID of the operation. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Get the status property: The status of the operation. - * - * @return the status value. - */ - @Generated - public OperationState getStatus() { - return this.status; - } - - /** - * Get the error property: Error object that describes the error when status is "Failed". - * - * @return the error value. - */ - @Generated - public ResponseError getError() { - return this.error; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeJsonField("error", this.error); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationStatusError from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationStatusError if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the OperationStatusError. - */ - @Generated - public static OperationStatusError fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String id = null; - OperationState status = null; - ResponseError error = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("status".equals(fieldName)) { - status = OperationState.fromString(reader.getString()); - } else if ("error".equals(fieldName)) { - error = ResponseError.fromJson(reader); - } else { - reader.skipChildren(); - } - } - OperationStatusError deserializedOperationStatusError = new OperationStatusError(id, status); - deserializedOperationStatusError.error = error; - - return deserializedOperationStatusError; - }); - } -} diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/models/ResourceOperationStatusUserExportedUserError.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/models/ResourceOperationStatusUserExportedUserError.java deleted file mode 100644 index f93bd09a87..0000000000 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/models/ResourceOperationStatusUserExportedUserError.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com._specs_.azure.core.lro.standard.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.core.models.ResponseError; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Provides status details for long running operations. - */ -@Immutable -public final class ResourceOperationStatusUserExportedUserError - implements JsonSerializable { - /* - * The unique ID of the operation. - */ - @Generated - private String id; - - /* - * The status of the operation - */ - @Generated - private final OperationState status; - - /* - * Error object that describes the error when status is "Failed". - */ - @Generated - private ResponseError error; - - /* - * The result of the operation. - */ - @Generated - private ExportedUser result; - - /** - * Creates an instance of ResourceOperationStatusUserExportedUserError class. - * - * @param status the status value to set. - */ - @Generated - private ResourceOperationStatusUserExportedUserError(OperationState status) { - this.status = status; - } - - /** - * Get the id property: The unique ID of the operation. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Get the status property: The status of the operation. - * - * @return the status value. - */ - @Generated - public OperationState getStatus() { - return this.status; - } - - /** - * Get the error property: Error object that describes the error when status is "Failed". - * - * @return the error value. - */ - @Generated - public ResponseError getError() { - return this.error; - } - - /** - * Get the result property: The result of the operation. - * - * @return the result value. - */ - @Generated - public ExportedUser getResult() { - return this.result; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeJsonField("error", this.error); - jsonWriter.writeJsonField("result", this.result); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceOperationStatusUserExportedUserError from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceOperationStatusUserExportedUserError if the JsonReader was pointing to an instance - * of it, or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ResourceOperationStatusUserExportedUserError. - */ - @Generated - public static ResourceOperationStatusUserExportedUserError fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String id = null; - OperationState status = null; - ResponseError error = null; - ExportedUser result = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("status".equals(fieldName)) { - status = OperationState.fromString(reader.getString()); - } else if ("error".equals(fieldName)) { - error = ResponseError.fromJson(reader); - } else if ("result".equals(fieldName)) { - result = ExportedUser.fromJson(reader); - } else { - reader.skipChildren(); - } - } - ResourceOperationStatusUserExportedUserError deserializedResourceOperationStatusUserExportedUserError - = new ResourceOperationStatusUserExportedUserError(status); - deserializedResourceOperationStatusUserExportedUserError.id = id; - deserializedResourceOperationStatusUserExportedUserError.error = error; - deserializedResourceOperationStatusUserExportedUserError.result = result; - - return deserializedResourceOperationStatusUserExportedUserError; - }); - } -} diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarAsyncClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarAsyncClient.java index 01d5fd9490..a7cb562f8e 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarAsyncClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarAsyncClient.java @@ -51,8 +51,7 @@ public final class ScalarAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents an Azure geography region where supported resource providers live along with {@link Response} - * on successful completion of {@link Mono}. + * @return azureLocation value along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,8 +155,7 @@ public Mono> queryWithResponse(String region, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an Azure geography region where supported resource providers live on successful completion of - * {@link Mono}. + * @return azureLocation value on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarClient.java index 5361d1c5eb..593f5fd1ea 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarClient.java @@ -49,7 +49,7 @@ public final class ScalarClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents an Azure geography region where supported resource providers live along with {@link Response}. + * @return azureLocation value along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -153,7 +153,7 @@ public Response queryWithResponse(String region, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an Azure geography region where supported resource providers live. + * @return azureLocation value. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/implementation/AzureLocationScalarsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/implementation/AzureLocationScalarsImpl.java index d53a790ae7..8ff921c07c 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/implementation/AzureLocationScalarsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/implementation/AzureLocationScalarsImpl.java @@ -76,7 +76,7 @@ public interface AzureLocationScalarsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/scalar/azureLocation") @@ -85,7 +85,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/azure/core/scalar/azureLocation") @@ -94,8 +94,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/azure/core/scalar/azureLocation") @ExpectedResponses({ 204 }) @@ -103,8 +103,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/azure/core/scalar/azureLocation") @ExpectedResponses({ 200 }) @@ -112,9 +112,8 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> post(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> post(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/azure/core/scalar/azureLocation") @ExpectedResponses({ 200 }) @@ -122,9 +121,8 @@ Mono> post(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response postSync(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/azure/core/scalar/azureLocation/header") @ExpectedResponses({ 204 }) @@ -132,8 +130,8 @@ Response postSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> headerMethod(@HeaderParam("region") String region, RequestOptions requestOptions, - Context context); + Mono> headerMethod(@HeaderParam("region") String region, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Post("/azure/core/scalar/azureLocation/header") @ExpectedResponses({ 204 }) @@ -141,8 +139,8 @@ Mono> headerMethod(@HeaderParam("region") String region, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response headerMethodSync(@HeaderParam("region") String region, RequestOptions requestOptions, - Context context); + Response headerMethodSync(@HeaderParam("region") String region, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Post("/azure/core/scalar/azureLocation/query") @ExpectedResponses({ 204 }) @@ -150,7 +148,8 @@ Response headerMethodSync(@HeaderParam("region") String region, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> query(@QueryParam("region") String region, RequestOptions requestOptions, Context context); + Mono> query(@QueryParam("region") String region, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Post("/azure/core/scalar/azureLocation/query") @ExpectedResponses({ 204 }) @@ -158,7 +157,8 @@ Response headerMethodSync(@HeaderParam("region") String region, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response querySync(@QueryParam("region") String region, RequestOptions requestOptions, Context context); + Response querySync(@QueryParam("region") String region, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); } /** @@ -174,8 +174,7 @@ Response headerMethodSync(@HeaderParam("region") String region, RequestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents an Azure geography region where supported resource providers live along with {@link Response} - * on successful completion of {@link Mono}. + * @return azureLocation value along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -196,7 +195,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents an Azure geography region where supported resource providers live along with {@link Response}. + * @return azureLocation value along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -222,8 +221,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -244,8 +243,8 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } /** @@ -276,9 +275,8 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.post(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.post(accept, body, requestOptions, context)); } /** @@ -309,9 +307,8 @@ public Mono> postWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.postSync(contentType, accept, body, requestOptions, Context.NONE); + return service.postSync(accept, body, requestOptions, Context.NONE); } /** @@ -327,7 +324,8 @@ public Response postWithResponse(BinaryData body, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> headerMethodWithResponseAsync(String region, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.headerMethod(region, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.headerMethod(region, accept, requestOptions, context)); } /** @@ -343,7 +341,8 @@ public Mono> headerMethodWithResponseAsync(String region, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response headerMethodWithResponse(String region, RequestOptions requestOptions) { - return service.headerMethodSync(region, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.headerMethodSync(region, accept, requestOptions, Context.NONE); } /** @@ -359,7 +358,8 @@ public Response headerMethodWithResponse(String region, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> queryWithResponseAsync(String region, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.query(region, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.query(region, accept, requestOptions, context)); } /** @@ -375,6 +375,7 @@ public Mono> queryWithResponseAsync(String region, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response queryWithResponse(String region, RequestOptions requestOptions) { - return service.querySync(region, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.querySync(region, accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsAsyncClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsAsyncClient.java index 60ce7a0d25..7a4b5afccb 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsAsyncClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsAsyncClient.java @@ -76,7 +76,8 @@ public final class TraitsAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sample Model along with {@link Response} on successful completion of {@link Mono}. + * @return a resource, sending and receiving headers along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -112,7 +113,7 @@ public Mono> smokeTestWithResponse(int id, String foo, Requ * } * * @param id The user's id. - * @param userActionParam The userActionParam parameter. + * @param userActionParam User action param. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -139,7 +140,7 @@ public Mono> repeatableActionWithResponse(int id, BinaryDat * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sample Model on successful completion of {@link Mono}. + * @return a resource, sending and receiving headers on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -179,7 +180,7 @@ public Mono smokeTest(int id, String foo, RequestConditions requestConditi * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sample Model on successful completion of {@link Mono}. + * @return a resource, sending and receiving headers on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -194,7 +195,7 @@ public Mono smokeTest(int id, String foo) { * Test for repeatable requests. * * @param id The user's id. - * @param userActionParam The userActionParam parameter. + * @param userActionParam User action param. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsClient.java index f01d7a7737..51fb3aa5a8 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsClient.java @@ -74,7 +74,7 @@ public final class TraitsClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sample Model along with {@link Response}. + * @return a resource, sending and receiving headers along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -110,7 +110,7 @@ public Response smokeTestWithResponse(int id, String foo, RequestOpt * } * * @param id The user's id. - * @param userActionParam The userActionParam parameter. + * @param userActionParam User action param. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -137,7 +137,7 @@ public Response repeatableActionWithResponse(int id, BinaryData user * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sample Model. + * @return a resource, sending and receiving headers. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -176,7 +176,7 @@ public User smokeTest(int id, String foo, RequestConditions requestConditions) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sample Model. + * @return a resource, sending and receiving headers. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -190,7 +190,7 @@ public User smokeTest(int id, String foo) { * Test for repeatable requests. * * @param id The user's id. - * @param userActionParam The userActionParam parameter. + * @param userActionParam User action param. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/implementation/TraitsClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/implementation/TraitsClientImpl.java index 2f88b83d8f..cda8bf00bc 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/implementation/TraitsClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/implementation/TraitsClientImpl.java @@ -138,7 +138,7 @@ public interface TraitsClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> smokeTest(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("foo") String foo, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + @HeaderParam("foo") String foo, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/traits/user/{id}") @@ -148,7 +148,7 @@ Mono> smokeTest(@QueryParam("api-version") String apiVersio @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response smokeTestSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("foo") String foo, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + @HeaderParam("foo") String foo, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/azure/core/traits/user/{id}:repeatableAction") @@ -158,9 +158,8 @@ Response smokeTestSync(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> repeatableAction(@QueryParam("api-version") String apiVersion, - @PathParam("id") int id, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData userActionParam, - RequestOptions requestOptions, Context context); + @PathParam("id") int id, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData userActionParam, RequestOptions requestOptions, Context context); @Post("/azure/core/traits/user/{id}:repeatableAction") @ExpectedResponses({ 200 }) @@ -169,8 +168,8 @@ Mono> repeatableAction(@QueryParam("api-version") String ap @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response repeatableActionSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData userActionParam, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData userActionParam, + RequestOptions requestOptions, Context context); } /** @@ -205,7 +204,8 @@ Response repeatableActionSync(@QueryParam("api-version") String apiV * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sample Model along with {@link Response} on successful completion of {@link Mono}. + * @return a resource, sending and receiving headers along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> smokeTestWithResponseAsync(int id, String foo, RequestOptions requestOptions) { @@ -246,7 +246,7 @@ public Mono> smokeTestWithResponseAsync(int id, String foo, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sample Model along with {@link Response}. + * @return a resource, sending and receiving headers along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response smokeTestWithResponse(int id, String foo, RequestOptions requestOptions) { @@ -283,7 +283,7 @@ public Response smokeTestWithResponse(int id, String foo, RequestOpt * } * * @param id The user's id. - * @param userActionParam The userActionParam parameter. + * @param userActionParam User action param. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -294,7 +294,6 @@ public Response smokeTestWithResponse(int id, String foo, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> repeatableActionWithResponseAsync(int id, BinaryData userActionParam, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; String repeatabilityRequestId = CoreUtils.randomUuid().toString(); @@ -312,7 +311,7 @@ public Mono> repeatableActionWithResponseAsync(int id, Bina } }); return FluxUtil.withContext(context -> service.repeatableAction(this.getServiceVersion().getVersion(), id, - contentType, accept, userActionParam, requestOptionsLocal, context)); + accept, userActionParam, requestOptionsLocal, context)); } /** @@ -343,7 +342,7 @@ public Mono> repeatableActionWithResponseAsync(int id, Bina * } * * @param id The user's id. - * @param userActionParam The userActionParam parameter. + * @param userActionParam User action param. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -354,7 +353,6 @@ public Mono> repeatableActionWithResponseAsync(int id, Bina @ServiceMethod(returns = ReturnType.SINGLE) public Response repeatableActionWithResponse(int id, BinaryData userActionParam, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; String repeatabilityRequestId = CoreUtils.randomUuid().toString(); @@ -371,7 +369,7 @@ public Response repeatableActionWithResponse(int id, BinaryData user .set(HttpHeaderName.fromString("repeatability-first-sent"), repeatabilityFirstSent); } }); - return service.repeatableActionSync(this.getServiceVersion().getVersion(), id, contentType, accept, - userActionParam, requestOptionsLocal, Context.NONE); + return service.repeatableActionSync(this.getServiceVersion().getVersion(), id, accept, userActionParam, + requestOptionsLocal, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/authentication/apikey/implementation/ApiKeyClientImpl.java b/typespec-tests/src/main/java/com/authentication/apikey/implementation/ApiKeyClientImpl.java index 12cfe4eaf4..e0b97150e8 100644 --- a/typespec-tests/src/main/java/com/authentication/apikey/implementation/ApiKeyClientImpl.java +++ b/typespec-tests/src/main/java/com/authentication/apikey/implementation/ApiKeyClientImpl.java @@ -107,7 +107,8 @@ public interface ApiKeyClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> valid(RequestOptions requestOptions, Context context); + Mono> valid(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/authentication/api-key/valid") @ExpectedResponses({ 204 }) @@ -115,7 +116,7 @@ public interface ApiKeyClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response validSync(RequestOptions requestOptions, Context context); + Response validSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/authentication/api-key/invalid") @ExpectedResponses({ 204 }) @@ -123,7 +124,7 @@ public interface ApiKeyClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> invalid(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> invalid(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/authentication/api-key/invalid") @@ -132,7 +133,7 @@ Mono> invalid(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response invalidSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response invalidSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } @@ -148,7 +149,8 @@ Response invalidSync(@HeaderParam("Accept") String accept, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> validWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.valid(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.valid(accept, requestOptions, context)); } /** @@ -163,7 +165,8 @@ public Mono> validWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validWithResponse(RequestOptions requestOptions) { - return service.validSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.validSync(accept, requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/authentication/http/custom/implementation/CustomClientImpl.java b/typespec-tests/src/main/java/com/authentication/http/custom/implementation/CustomClientImpl.java index b6657d5c58..a1249585f5 100644 --- a/typespec-tests/src/main/java/com/authentication/http/custom/implementation/CustomClientImpl.java +++ b/typespec-tests/src/main/java/com/authentication/http/custom/implementation/CustomClientImpl.java @@ -107,7 +107,8 @@ public interface CustomClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> valid(RequestOptions requestOptions, Context context); + Mono> valid(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/authentication/http/custom/valid") @ExpectedResponses({ 204 }) @@ -115,7 +116,7 @@ public interface CustomClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response validSync(RequestOptions requestOptions, Context context); + Response validSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/authentication/http/custom/invalid") @ExpectedResponses({ 204 }) @@ -123,7 +124,7 @@ public interface CustomClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> invalid(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> invalid(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/authentication/http/custom/invalid") @@ -132,7 +133,7 @@ Mono> invalid(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response invalidSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response invalidSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } @@ -148,7 +149,8 @@ Response invalidSync(@HeaderParam("Accept") String accept, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> validWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.valid(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.valid(accept, requestOptions, context)); } /** @@ -163,7 +165,8 @@ public Mono> validWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validWithResponse(RequestOptions requestOptions) { - return service.validSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.validSync(accept, requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/authentication/oauth2/implementation/OAuth2ClientImpl.java b/typespec-tests/src/main/java/com/authentication/oauth2/implementation/OAuth2ClientImpl.java index 3cc7d5a24f..6b58a78ce2 100644 --- a/typespec-tests/src/main/java/com/authentication/oauth2/implementation/OAuth2ClientImpl.java +++ b/typespec-tests/src/main/java/com/authentication/oauth2/implementation/OAuth2ClientImpl.java @@ -107,7 +107,8 @@ public interface OAuth2ClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> valid(RequestOptions requestOptions, Context context); + Mono> valid(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/authentication/oauth2/valid") @ExpectedResponses({ 204 }) @@ -115,7 +116,7 @@ public interface OAuth2ClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response validSync(RequestOptions requestOptions, Context context); + Response validSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/authentication/oauth2/invalid") @ExpectedResponses({ 204 }) @@ -123,7 +124,7 @@ public interface OAuth2ClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> invalid(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> invalid(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/authentication/oauth2/invalid") @@ -132,7 +133,7 @@ Mono> invalid(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response invalidSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response invalidSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } @@ -148,7 +149,8 @@ Response invalidSync(@HeaderParam("Accept") String accept, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> validWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.valid(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.valid(accept, requestOptions, context)); } /** @@ -163,7 +165,8 @@ public Mono> validWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validWithResponse(RequestOptions requestOptions) { - return service.validSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.validSync(accept, requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/authentication/union/implementation/UnionClientImpl.java b/typespec-tests/src/main/java/com/authentication/union/implementation/UnionClientImpl.java index 4c601b975a..e0b863d25e 100644 --- a/typespec-tests/src/main/java/com/authentication/union/implementation/UnionClientImpl.java +++ b/typespec-tests/src/main/java/com/authentication/union/implementation/UnionClientImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -106,7 +107,8 @@ public interface UnionClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> validKey(RequestOptions requestOptions, Context context); + Mono> validKey(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/authentication/union/validkey") @ExpectedResponses({ 204 }) @@ -114,7 +116,8 @@ public interface UnionClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response validKeySync(RequestOptions requestOptions, Context context); + Response validKeySync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/authentication/union/validtoken") @ExpectedResponses({ 204 }) @@ -122,7 +125,8 @@ public interface UnionClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> validToken(RequestOptions requestOptions, Context context); + Mono> validToken(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/authentication/union/validtoken") @ExpectedResponses({ 204 }) @@ -130,7 +134,8 @@ public interface UnionClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response validTokenSync(RequestOptions requestOptions, Context context); + Response validTokenSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); } /** @@ -145,7 +150,8 @@ public interface UnionClientService { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> validKeyWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.validKey(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.validKey(accept, requestOptions, context)); } /** @@ -160,7 +166,8 @@ public Mono> validKeyWithResponseAsync(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validKeyWithResponse(RequestOptions requestOptions) { - return service.validKeySync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.validKeySync(accept, requestOptions, Context.NONE); } /** @@ -175,7 +182,8 @@ public Response validKeyWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> validTokenWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.validToken(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.validToken(accept, requestOptions, context)); } /** @@ -190,6 +198,7 @@ public Mono> validTokenWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validTokenWithResponse(RequestOptions requestOptions) { - return service.validTokenSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.validTokenSync(accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/azure/arm/models/resources/ResourcesManager.java b/typespec-tests/src/main/java/com/azure/arm/models/resources/ResourcesManager.java index b793a9e08e..b747cb7d2d 100644 --- a/typespec-tests/src/main/java/com/azure/arm/models/resources/ResourcesManager.java +++ b/typespec-tests/src/main/java/com/azure/arm/models/resources/ResourcesManager.java @@ -51,6 +51,7 @@ private ResourcesManager(HttpPipeline httpPipeline, AzureProfile profile, Durati Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); this.clientObject = new ResourcesClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) .buildClient(); diff --git a/typespec-tests/src/main/java/com/azure/arm/models/resources/fluent/NestedProxyResourcesClient.java b/typespec-tests/src/main/java/com/azure/arm/models/resources/fluent/NestedProxyResourcesClient.java index b8b564abc2..f34a4b4a5b 100644 --- a/typespec-tests/src/main/java/com/azure/arm/models/resources/fluent/NestedProxyResourcesClient.java +++ b/typespec-tests/src/main/java/com/azure/arm/models/resources/fluent/NestedProxyResourcesClient.java @@ -28,7 +28,7 @@ public interface NestedProxyResourcesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested child of Top Level Tracked Resource along with {@link Response}. + * @return a NestedProxyResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String resourceGroupName, String topLevelTrackedResourceName, @@ -43,7 +43,7 @@ Response getWithResponse(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested child of Top Level Tracked Resource. + * @return a NestedProxyResource. */ @ServiceMethod(returns = ReturnType.SINGLE) NestedProxyResourceInner get(String resourceGroupName, String topLevelTrackedResourceName, diff --git a/typespec-tests/src/main/java/com/azure/arm/models/resources/fluent/ResourcesClient.java b/typespec-tests/src/main/java/com/azure/arm/models/resources/fluent/ResourcesClient.java index 283224ed77..25a58a11d2 100644 --- a/typespec-tests/src/main/java/com/azure/arm/models/resources/fluent/ResourcesClient.java +++ b/typespec-tests/src/main/java/com/azure/arm/models/resources/fluent/ResourcesClient.java @@ -11,6 +11,13 @@ * The interface for ResourcesClient class. */ public interface ResourcesClient { + /** + * Gets Server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + /** * Gets Version parameter. * diff --git a/typespec-tests/src/main/java/com/azure/arm/models/resources/fluent/TopLevelTrackedResourcesClient.java b/typespec-tests/src/main/java/com/azure/arm/models/resources/fluent/TopLevelTrackedResourcesClient.java index 144a839621..6fa93fd7e8 100644 --- a/typespec-tests/src/main/java/com/azure/arm/models/resources/fluent/TopLevelTrackedResourcesClient.java +++ b/typespec-tests/src/main/java/com/azure/arm/models/resources/fluent/TopLevelTrackedResourcesClient.java @@ -27,8 +27,7 @@ public interface TopLevelTrackedResourcesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. + * @return a TopLevelTrackedResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse(String resourceGroupName, @@ -42,7 +41,7 @@ Response getByResourceGroupWithResponse(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + * @return a TopLevelTrackedResource. */ @ServiceMethod(returns = ReturnType.SINGLE) TopLevelTrackedResourceInner getByResourceGroup(String resourceGroupName, String topLevelTrackedResourceName); diff --git a/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/NestedProxyResourcesClientImpl.java b/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/NestedProxyResourcesClientImpl.java index f5ba1da066..b7d7c561ec 100644 --- a/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/NestedProxyResourcesClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/NestedProxyResourcesClientImpl.java @@ -15,6 +15,7 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; @@ -68,51 +69,51 @@ public final class NestedProxyResourcesClientImpl implements NestedProxyResource * The interface defining all the services for ResourcesClientNestedProxyResources to be used by the proxy service * to perform REST calls. */ - @Host("https://management.azure.com") + @Host("{endpoint}") @ServiceInterface(name = "ResourcesClientNeste") public interface NestedProxyResourcesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.Arm.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}/nestedProxyResources/{nextedProxyResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("Accept") String accept, + @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.Arm.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}/nestedProxyResources/{nextedProxyResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrReplace(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrReplace(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @PathParam("nextedProxyResourceName") String nextedProxyResourceName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("accept") String accept, @BodyParam("application/json") NestedProxyResourceInner resource, Context context); + @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.Arm.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}/nestedProxyResources/{nextedProxyResourceName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @PathParam("nextedProxyResourceName") String nextedProxyResourceName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("accept") String accept, @BodyParam("application/json") NestedProxyResourceUpdate properties, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.Arm.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}/nestedProxyResources/{nextedProxyResourceName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("Accept") String accept, + @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -120,18 +121,19 @@ Mono>> delete(@QueryParam("api-version") String apiVer @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTopLevelTrackedResource( - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTopLevelTrackedResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("accept") String accept, Context context); } /** @@ -143,12 +145,15 @@ Mono> listByTopLevelTrackedResourceNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested child of Top Level Tracked Resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return a NestedProxyResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -167,8 +172,9 @@ private Mono> getWithResponseAsync(String res } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, + nextedProxyResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -182,12 +188,15 @@ private Mono> getWithResponseAsync(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested child of Top Level Tracked Resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return a NestedProxyResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -206,8 +215,8 @@ private Mono> getWithResponseAsync(String res } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelTrackedResourceName, nextedProxyResourceName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, accept, context); } /** @@ -219,7 +228,7 @@ private Mono> getWithResponseAsync(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested child of Top Level Tracked Resource on successful completion of {@link Mono}. + * @return a NestedProxyResource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String topLevelTrackedResourceName, @@ -238,7 +247,7 @@ private Mono getAsync(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested child of Top Level Tracked Resource along with {@link Response}. + * @return a NestedProxyResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, @@ -256,7 +265,7 @@ public Response getWithResponse(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested child of Top Level Tracked Resource. + * @return a NestedProxyResource. */ @ServiceMethod(returns = ReturnType.SINGLE) public NestedProxyResourceInner get(String resourceGroupName, String topLevelTrackedResourceName, @@ -281,6 +290,10 @@ public NestedProxyResourceInner get(String resourceGroupName, String topLevelTra @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, NestedProxyResourceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -302,12 +315,11 @@ private Mono>> createOrReplaceWithResponseAsync(String } else { resource.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrReplace(this.client.getApiVersion(), + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, - nextedProxyResourceName, contentType, accept, resource, context)) + nextedProxyResourceName, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -329,6 +341,10 @@ private Mono>> createOrReplaceWithResponseAsync(String private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, NestedProxyResourceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -350,11 +366,11 @@ private Mono>> createOrReplaceWithResponseAsync(String } else { resource.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrReplace(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelTrackedResourceName, nextedProxyResourceName, contentType, accept, resource, context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, + accept, resource, context); } /** @@ -544,6 +560,10 @@ public NestedProxyResourceInner createOrReplace(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, NestedProxyResourceUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -565,12 +585,11 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, contentType, accept, - properties, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, + nextedProxyResourceName, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -592,6 +611,10 @@ private Mono>> updateWithResponseAsync(String resource private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, NestedProxyResourceUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -613,11 +636,10 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelTrackedResourceName, nextedProxyResourceName, contentType, accept, properties, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, accept, properties, context); } /** @@ -803,6 +825,10 @@ public NestedProxyResourceInner update(String resourceGroupName, String topLevel @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -821,8 +847,9 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, + nextedProxyResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -841,6 +868,10 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -859,8 +890,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelTrackedResourceName, nextedProxyResourceName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, accept, context); } /** @@ -1025,6 +1056,10 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelTrackedResourceSinglePageAsync(String resourceGroupName, String topLevelTrackedResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1039,8 +1074,9 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByTopLevelTrackedResource(this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context)) + .withContext( + context -> service.listByTopLevelTrackedResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1061,6 +1097,10 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelTrackedResourceSinglePageAsync( String resourceGroupName, String topLevelTrackedResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1076,8 +1116,8 @@ private Mono> listByTopLevelTrackedResou final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByTopLevelTrackedResource(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, accept, context) + .listByTopLevelTrackedResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1154,8 +1194,6 @@ public PagedIterable listByTopLevelTrackedResource(Str } /** - * List NestedProxyResource resources by TopLevelTrackedResource - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1171,16 +1209,19 @@ public PagedIterable listByTopLevelTrackedResource(Str if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listByTopLevelTrackedResourceNext(nextLink, accept, context)) + return FluxUtil.withContext( + context -> service.listByTopLevelTrackedResourceNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List NestedProxyResource resources by TopLevelTrackedResource - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1197,9 +1238,13 @@ public PagedIterable listByTopLevelTrackedResource(Str if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByTopLevelTrackedResourceNext(nextLink, accept, context) + return service.listByTopLevelTrackedResourceNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/ResourcesClientBuilder.java b/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/ResourcesClientBuilder.java index bd4f3456b3..8bd32a76e3 100644 --- a/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/ResourcesClientBuilder.java +++ b/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/ResourcesClientBuilder.java @@ -19,6 +19,22 @@ */ @ServiceClientBuilder(serviceClients = { ResourcesClientImpl.class }) public final class ResourcesClientBuilder { + /* + * Server parameter + */ + private String endpoint; + + /** + * Sets Server parameter. + * + * @param endpoint the endpoint value. + * @return the ResourcesClientBuilder. + */ + public ResourcesClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The ID of the target subscription. The value must be an UUID. */ @@ -115,7 +131,7 @@ public ResourcesClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); ResourcesClientImpl client = new ResourcesClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.subscriptionId); + localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId); return client; } } diff --git a/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/ResourcesClientImpl.java b/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/ResourcesClientImpl.java index b48ac40819..9db76dc8dd 100644 --- a/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/ResourcesClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/ResourcesClientImpl.java @@ -40,6 +40,20 @@ */ @ServiceClient(builder = ResourcesClientBuilder.class) public final class ResourcesClientImpl implements ResourcesClient { + /** + * Server parameter. + */ + private final String endpoint; + + /** + * Gets Server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * Version parameter. */ @@ -145,13 +159,15 @@ public NestedProxyResourcesClient getNestedProxyResources() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. + * @param endpoint Server parameter. * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ ResourcesClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, - AzureEnvironment environment, String subscriptionId) { + AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; + this.endpoint = endpoint; this.subscriptionId = subscriptionId; this.apiVersion = "2023-12-01-preview"; this.topLevelTrackedResources = new TopLevelTrackedResourcesClientImpl(this); diff --git a/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java b/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java index a5aa94a528..d3efca83d1 100644 --- a/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/arm/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java @@ -15,6 +15,7 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; @@ -68,80 +69,83 @@ public final class TopLevelTrackedResourcesClientImpl implements TopLevelTracked * The interface defining all the services for ResourcesClientTopLevelTrackedResources to be used by the proxy * service to perform REST calls. */ - @Host("https://management.azure.com") + @Host("{endpoint}") @ServiceInterface(name = "ResourcesClientTopLe") public interface TopLevelTrackedResourcesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.Arm.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.Arm.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrReplace(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrReplace(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") TopLevelTrackedResourceInner resource, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") TopLevelTrackedResourceInner resource, + Context context); + @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.Arm.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @HeaderParam("accept") String accept, @BodyParam("application/json") TopLevelTrackedResourceUpdate properties, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.Arm.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.Arm.Models.Resources/topLevelTrackedResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Azure.Arm.Models.Resources/topLevelTrackedResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("accept") String accept, Context context); } /** @@ -152,12 +156,15 @@ Mono> listBySubscriptionNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response} on successful completion of {@link Mono}. + * @return a TopLevelTrackedResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -172,7 +179,7 @@ private Mono> getByResourceGroupWithRespo } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getApiVersion(), + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -186,12 +193,15 @@ private Mono> getByResourceGroupWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response} on successful completion of {@link Mono}. + * @return a TopLevelTrackedResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -206,8 +216,8 @@ private Mono> getByResourceGroupWithRespo } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, accept, context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context); } /** @@ -218,8 +228,7 @@ private Mono> getByResourceGroupWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type on - * successful completion of {@link Mono}. + * @return a TopLevelTrackedResource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, @@ -237,8 +246,7 @@ private Mono getByResourceGroupAsync(String resour * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. + * @return a TopLevelTrackedResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, @@ -254,7 +262,7 @@ public Response getByResourceGroupWithResponse(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + * @return a TopLevelTrackedResource. */ @ServiceMethod(returns = ReturnType.SINGLE) public TopLevelTrackedResourceInner getByResourceGroup(String resourceGroupName, @@ -277,6 +285,10 @@ public TopLevelTrackedResourceInner getByResourceGroup(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, TopLevelTrackedResourceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -294,12 +306,11 @@ private Mono>> createOrReplaceWithResponseAsync(String } else { resource.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.createOrReplace(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, contentType, accept, resource, context)) + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, resource, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -319,6 +330,10 @@ private Mono>> createOrReplaceWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, TopLevelTrackedResourceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -336,11 +351,10 @@ private Mono>> createOrReplaceWithResponseAsync(String } else { resource.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrReplace(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelTrackedResourceName, contentType, accept, resource, context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, resource, context); } /** @@ -519,6 +533,10 @@ public TopLevelTrackedResourceInner createOrReplace(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, TopLevelTrackedResourceUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -536,11 +554,11 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, contentType, accept, properties, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, properties, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -560,6 +578,10 @@ private Mono>> updateWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, TopLevelTrackedResourceUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -577,11 +599,10 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelTrackedResourceName, contentType, accept, properties, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, accept, properties, context); } /** @@ -757,6 +778,10 @@ public TopLevelTrackedResourceInner update(String resourceGroupName, String topL @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -771,8 +796,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -790,6 +815,10 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -804,8 +833,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelTrackedResourceName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, accept, context); } /** @@ -955,6 +984,10 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -965,7 +998,7 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getApiVersion(), + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -986,6 +1019,10 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -997,8 +1034,8 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - accept, context) + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1076,14 +1113,18 @@ public PagedIterable listByResourceGroup(String re */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.list(this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1101,13 +1142,19 @@ private Mono> listSinglePageAsync() */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1169,8 +1216,6 @@ public PagedIterable list(Context context) { } /** - * List TopLevelTrackedResource resources by resource group - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1185,16 +1230,20 @@ private Mono> listByResourceGroupNex if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listByResourceGroupNext(nextLink, accept, context)) + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List TopLevelTrackedResource resources by resource group - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1211,16 +1260,18 @@ private Mono> listByResourceGroupNex if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, accept, context) + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** - * List TopLevelTrackedResource resources by subscription ID - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1235,16 +1286,20 @@ private Mono> listBySubscriptionNext if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listBySubscriptionNext(nextLink, accept, context)) + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List TopLevelTrackedResource resources by subscription ID - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1261,9 +1316,13 @@ private Mono> listBySubscriptionNext if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, accept, context) + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/azure/arm/models/resources/models/NestedProxyResources.java b/typespec-tests/src/main/java/com/azure/arm/models/resources/models/NestedProxyResources.java index a05edc8401..f587acc750 100644 --- a/typespec-tests/src/main/java/com/azure/arm/models/resources/models/NestedProxyResources.java +++ b/typespec-tests/src/main/java/com/azure/arm/models/resources/models/NestedProxyResources.java @@ -22,7 +22,7 @@ public interface NestedProxyResources { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested child of Top Level Tracked Resource along with {@link Response}. + * @return a NestedProxyResource along with {@link Response}. */ Response getWithResponse(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, Context context); @@ -36,7 +36,7 @@ Response getWithResponse(String resourceGroupName, String t * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested child of Top Level Tracked Resource. + * @return a NestedProxyResource. */ NestedProxyResource get(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName); @@ -101,7 +101,7 @@ PagedIterable listByTopLevelTrackedResource(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested child of Top Level Tracked Resource along with {@link Response}. + * @return a NestedProxyResource along with {@link Response}. */ NestedProxyResource getById(String id); @@ -113,7 +113,7 @@ PagedIterable listByTopLevelTrackedResource(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested child of Top Level Tracked Resource along with {@link Response}. + * @return a NestedProxyResource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/typespec-tests/src/main/java/com/azure/arm/models/resources/models/TopLevelTrackedResources.java b/typespec-tests/src/main/java/com/azure/arm/models/resources/models/TopLevelTrackedResources.java index 5a01a4189a..f672db60b2 100644 --- a/typespec-tests/src/main/java/com/azure/arm/models/resources/models/TopLevelTrackedResources.java +++ b/typespec-tests/src/main/java/com/azure/arm/models/resources/models/TopLevelTrackedResources.java @@ -21,8 +21,7 @@ public interface TopLevelTrackedResources { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. + * @return a TopLevelTrackedResource along with {@link Response}. */ Response getByResourceGroupWithResponse(String resourceGroupName, String topLevelTrackedResourceName, Context context); @@ -35,7 +34,7 @@ Response getByResourceGroupWithResponse(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + * @return a TopLevelTrackedResource. */ TopLevelTrackedResource getByResourceGroup(String resourceGroupName, String topLevelTrackedResourceName); @@ -116,8 +115,7 @@ Response getByResourceGroupWithResponse(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. + * @return a TopLevelTrackedResource along with {@link Response}. */ TopLevelTrackedResource getById(String id); @@ -129,8 +127,7 @@ Response getByResourceGroupWithResponse(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. + * @return a TopLevelTrackedResource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdAsyncClient.java b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdAsyncClient.java index 3c6de2a5b3..e67c748929 100644 --- a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdAsyncClient.java +++ b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdAsyncClient.java @@ -44,7 +44,8 @@ public final class XmsClientRequestIdAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return operation with azure `x-ms-client-request-id` header along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -60,7 +61,7 @@ public Mono> getWithResponse(RequestOptions requestOptions) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return operation with azure `x-ms-client-request-id` header on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClient.java b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClient.java index fdb5f059c3..b5db477c0b 100644 --- a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClient.java +++ b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClient.java @@ -42,7 +42,7 @@ public final class XmsClientRequestIdClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. + * @return operation with azure `x-ms-client-request-id` header along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/implementation/XmsClientRequestIdClientImpl.java b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/implementation/XmsClientRequestIdClientImpl.java index 011ed0df41..bb1d550f97 100644 --- a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/implementation/XmsClientRequestIdClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/implementation/XmsClientRequestIdClientImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -108,7 +109,7 @@ public interface XmsClientRequestIdClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(RequestOptions requestOptions, Context context); + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/special-headers/x-ms-client-request-id") @ExpectedResponses({ 204 }) @@ -116,7 +117,7 @@ public interface XmsClientRequestIdClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(RequestOptions requestOptions, Context context); + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -127,11 +128,13 @@ public interface XmsClientRequestIdClientService { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return operation with azure `x-ms-client-request-id` header along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.get(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); } /** @@ -142,10 +145,11 @@ public Mono> getWithResponseAsync(RequestOptions requestOptions) * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. + * @return operation with azure `x-ms-client-request-id` header along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { - return service.getSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.getSync(accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/ArmResourceProviderManager.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/ArmResourceProviderManager.java index 6fbd69c3a4..f8f5fc8810 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/ArmResourceProviderManager.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/ArmResourceProviderManager.java @@ -63,6 +63,7 @@ private ArmResourceProviderManager(HttpPipeline httpPipeline, AzureProfile profi Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); this.clientObject = new ArmResourceProviderClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) .buildClient(); diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ArmResourceProviderClient.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ArmResourceProviderClient.java index d3263fbdfe..3bd6f9112f 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ArmResourceProviderClient.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ArmResourceProviderClient.java @@ -11,6 +11,13 @@ * The interface for ArmResourceProviderClient class. */ public interface ArmResourceProviderClient { + /** + * Gets Server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + /** * Gets Version parameter. * diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildExtensionResourceInterfacesClient.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildExtensionResourceInterfacesClient.java index 9c15298ed8..c4d676e38e 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildExtensionResourceInterfacesClient.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildExtensionResourceInterfacesClient.java @@ -27,7 +27,7 @@ public interface ChildExtensionResourceInterfacesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extensionResource of Top Level Arm Resource along with {@link Response}. + * @return a ChildExtensionResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String resourceUri, String topLevelArmResourceName, @@ -42,7 +42,7 @@ Response getWithResponse(String resourceUri, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extensionResource of Top Level Arm Resource. + * @return a ChildExtensionResource. */ @ServiceMethod(returns = ReturnType.SINGLE) ChildExtensionResourceInner get(String resourceUri, String topLevelArmResourceName, diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildResourcesInterfacesClient.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildResourcesInterfacesClient.java index 7b0b515c17..c06553db4f 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildResourcesInterfacesClient.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildResourcesInterfacesClient.java @@ -28,7 +28,7 @@ public interface ChildResourcesInterfacesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subresource of Top Level Arm Resource along with {@link Response}. + * @return a ChildResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String resourceGroupName, String topLevelArmResourceName, @@ -43,7 +43,7 @@ Response getWithResponse(String resourceGroupName, String to * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subresource of Top Level Arm Resource. + * @return a ChildResource. */ @ServiceMethod(returns = ReturnType.SINGLE) ChildResourceInner get(String resourceGroupName, String topLevelArmResourceName, String childResourceName); diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java index ddc0e6c51a..96977bf126 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java @@ -28,8 +28,7 @@ public interface TopLevelArmResourceInterfacesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. + * @return a TopLevelArmResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse(String resourceGroupName, @@ -43,7 +42,7 @@ Response getByResourceGroupWithResponse(String resourc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + * @return a TopLevelArmResource. */ @ServiceMethod(returns = ReturnType.SINGLE) TopLevelArmResourceInner getByResourceGroup(String resourceGroupName, String topLevelArmResourceName); diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientBuilder.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientBuilder.java index f014b39355..2b36c77e05 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientBuilder.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientBuilder.java @@ -19,6 +19,22 @@ */ @ServiceClientBuilder(serviceClients = { ArmResourceProviderClientImpl.class }) public final class ArmResourceProviderClientBuilder { + /* + * Server parameter + */ + private String endpoint; + + /** + * Sets Server parameter. + * + * @param endpoint the endpoint value. + * @return the ArmResourceProviderClientBuilder. + */ + public ArmResourceProviderClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The ID of the target subscription. The value must be an UUID. */ @@ -115,7 +131,7 @@ public ArmResourceProviderClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); ArmResourceProviderClientImpl client = new ArmResourceProviderClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.subscriptionId); + localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId); return client; } } diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientImpl.java index aa9d985f39..4e9ca21142 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientImpl.java @@ -43,6 +43,20 @@ */ @ServiceClient(builder = ArmResourceProviderClientBuilder.class) public final class ArmResourceProviderClientImpl implements ArmResourceProviderClient { + /** + * Server parameter. + */ + private final String endpoint; + + /** + * Gets Server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * Version parameter. */ @@ -190,13 +204,15 @@ public ChildExtensionResourceInterfacesClient getChildExtensionResourceInterface * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. + * @param endpoint Server parameter. * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ ArmResourceProviderClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId) { + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; + this.endpoint = endpoint; this.subscriptionId = subscriptionId; this.apiVersion = "2023-11-01"; this.childResourcesInterfaces = new ChildResourcesInterfacesClientImpl(this); diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildExtensionResourceInterfacesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildExtensionResourceInterfacesClientImpl.java index a20d4c9cb7..b5767faa1e 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildExtensionResourceInterfacesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildExtensionResourceInterfacesClientImpl.java @@ -11,6 +11,7 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; @@ -67,56 +68,58 @@ public final class ChildExtensionResourceInterfacesClientImpl implements ChildEx * The interface defining all the services for ArmResourceProviderClientChildExtensionResourceInterfaces to be used * by the proxy service to perform REST calls. */ - @Host("https://management.azure.com") + @Host("{endpoint}") @ServiceInterface(name = "ArmResourceProviderC") public interface ChildExtensionResourceInterfacesService { @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childExtensionResources/{childExtensionResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@QueryParam("api-version") String apiVersion, - @PathParam("resourceUri") String resourceUri, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @PathParam("childExtensionResourceName") String childExtensionResourceName, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/{resourceUri}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childExtensionResources/{childExtensionResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@QueryParam("api-version") String apiVersion, - @PathParam("resourceUri") String resourceUri, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @PathParam("childExtensionResourceName") String childExtensionResourceName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ChildExtensionResourceInner resource, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") ChildExtensionResourceInner resource, + Context context); + @Headers({ "Content-Type: application/json" }) @Patch("/{resourceUri}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childExtensionResources/{childExtensionResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@QueryParam("api-version") String apiVersion, - @PathParam("resourceUri") String resourceUri, + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @PathParam("childExtensionResourceName") String childExtensionResourceName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") Object properties, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") Object properties, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/{resourceUri}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childExtensionResources/{childExtensionResourceName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@QueryParam("api-version") String apiVersion, - @PathParam("resourceUri") String resourceUri, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @PathParam("childExtensionResourceName") String childExtensionResourceName, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childExtensionResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTopLevelArmResource( - @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Accept") String accept, + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("resourceUri") String resourceUri, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -124,8 +127,8 @@ Mono> listByTopLevelArmResource( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTopLevelArmResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("accept") String accept, Context context); } /** @@ -137,12 +140,15 @@ Mono> listByTopLevelArmResourceNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extensionResource of Top Level Arm Resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return a ChildExtensionResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -156,8 +162,8 @@ private Mono> getWithResponseAsync(String } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, - childExtensionResourceName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + topLevelArmResourceName, childExtensionResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -171,12 +177,15 @@ private Mono> getWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extensionResource of Top Level Arm Resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return a ChildExtensionResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -190,7 +199,7 @@ private Mono> getWithResponseAsync(String } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, topLevelArmResourceName, childExtensionResourceName, accept, context); } @@ -203,7 +212,7 @@ private Mono> getWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extensionResource of Top Level Arm Resource on successful completion of {@link Mono}. + * @return a ChildExtensionResource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceUri, String topLevelArmResourceName, @@ -222,7 +231,7 @@ private Mono getAsync(String resourceUri, String to * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extensionResource of Top Level Arm Resource along with {@link Response}. + * @return a ChildExtensionResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceUri, String topLevelArmResourceName, @@ -239,7 +248,7 @@ public Response getWithResponse(String resourceUri, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extensionResource of Top Level Arm Resource. + * @return a ChildExtensionResource. */ @ServiceMethod(returns = ReturnType.SINGLE) public ChildExtensionResourceInner get(String resourceUri, String topLevelArmResourceName, @@ -264,6 +273,10 @@ public ChildExtensionResourceInner get(String resourceUri, String topLevelArmRes @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, ChildExtensionResourceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -280,11 +293,10 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getApiVersion(), resourceUri, - topLevelArmResourceName, childExtensionResourceName, contentType, accept, resource, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + resourceUri, topLevelArmResourceName, childExtensionResourceName, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -306,6 +318,10 @@ private Mono>> createOrUpdateWithResponseAsync(String private Mono>> createOrUpdateWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, ChildExtensionResourceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -322,11 +338,10 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, - childExtensionResourceName, contentType, accept, resource, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + topLevelArmResourceName, childExtensionResourceName, accept, resource, context); } /** @@ -514,6 +529,10 @@ public ChildExtensionResourceInner createOrUpdate(String resourceUri, String top @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, Object properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -528,11 +547,10 @@ private Mono> updateWithResponseAsync(Stri if (properties == null) { return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); } - final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, - childExtensionResourceName, contentType, accept, properties, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + topLevelArmResourceName, childExtensionResourceName, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -553,6 +571,10 @@ private Mono> updateWithResponseAsync(Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, Object properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -567,11 +589,10 @@ private Mono> updateWithResponseAsync(Stri if (properties == null) { return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); } - final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, - childExtensionResourceName, contentType, accept, properties, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + topLevelArmResourceName, childExtensionResourceName, accept, properties, context); } /** @@ -646,6 +667,10 @@ public ChildExtensionResourceInner update(String resourceUri, String topLevelArm @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -659,8 +684,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, - childExtensionResourceName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + topLevelArmResourceName, childExtensionResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -679,6 +704,10 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -692,8 +721,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, - childExtensionResourceName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + topLevelArmResourceName, childExtensionResourceName, accept, context); } /** @@ -857,6 +886,10 @@ public void delete(String resourceUri, String topLevelArmResourceName, String ch @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelArmResourceSinglePageAsync(String resourceUri, String topLevelArmResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -866,8 +899,8 @@ public void delete(String resourceUri, String topLevelArmResourceName, String ch } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByTopLevelArmResource(this.client.getApiVersion(), resourceUri, - topLevelArmResourceName, accept, context)) + .withContext(context -> service.listByTopLevelArmResource(this.client.getEndpoint(), + this.client.getApiVersion(), resourceUri, topLevelArmResourceName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -888,6 +921,10 @@ public void delete(String resourceUri, String topLevelArmResourceName, String ch @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelArmResourceSinglePageAsync(String resourceUri, String topLevelArmResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -898,8 +935,8 @@ public void delete(String resourceUri, String topLevelArmResourceName, String ch final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByTopLevelArmResource(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, accept, - context) + .listByTopLevelArmResource(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + topLevelArmResourceName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -974,8 +1011,6 @@ public PagedIterable listByTopLevelArmResource(Stri } /** - * List ChildExtensionResource resources by TopLevelArmResource - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -991,16 +1026,20 @@ public PagedIterable listByTopLevelArmResource(Stri if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listByTopLevelArmResourceNext(nextLink, accept, context)) + return FluxUtil + .withContext( + context -> service.listByTopLevelArmResourceNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List ChildExtensionResource resources by TopLevelArmResource - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1017,9 +1056,13 @@ public PagedIterable listByTopLevelArmResource(Stri if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByTopLevelArmResourceNext(nextLink, accept, context) + return service.listByTopLevelArmResourceNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java index 33b394e831..ecbd02657b 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java @@ -11,6 +11,7 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Post; @@ -69,72 +70,72 @@ public final class ChildResourcesInterfacesClientImpl implements ChildResourcesI * The interface defining all the services for ArmResourceProviderClientChildResourcesInterfaces to be used by the * proxy service to perform REST calls. */ - @Host("https://management.azure.com") + @Host("{endpoint}") @ServiceInterface(name = "ArmResourceProviderC") public interface ChildResourcesInterfacesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources/{childResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("Accept") String accept, + @PathParam("childResourceName") String childResourceName, @HeaderParam("accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources/{childResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") ChildResourceInner resource, - Context context); + @PathParam("childResourceName") String childResourceName, @HeaderParam("accept") String accept, + @BodyParam("application/json") ChildResourceInner resource, Context context); + @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources/{childResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") ChildResourceUpdate properties, - Context context); + @PathParam("childResourceName") String childResourceName, @HeaderParam("accept") String accept, + @BodyParam("application/json") ChildResourceUpdate properties, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources/{childResourceName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("Accept") String accept, + @PathParam("childResourceName") String childResourceName, @HeaderParam("accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByTopLevelArmResource(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> listByTopLevelArmResource(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Accept") String accept, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources/{childResourceName}/actionWithoutBody") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> actionWithoutBody(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> actionWithoutBody(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("Accept") String accept, + @PathParam("childResourceName") String childResourceName, @HeaderParam("accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -142,8 +143,8 @@ Mono>> actionWithoutBody(@QueryParam("api-version") St @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTopLevelArmResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("accept") String accept, Context context); } /** @@ -155,12 +156,15 @@ Mono> listByTopLevelArmResourceNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subresource of Top Level Arm Resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return a ChildResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -179,8 +183,9 @@ private Mono> getWithResponseAsync(String resourceG } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, childResourceName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -194,12 +199,15 @@ private Mono> getWithResponseAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subresource of Top Level Arm Resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return a ChildResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -218,8 +226,8 @@ private Mono> getWithResponseAsync(String resourceG } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelArmResourceName, childResourceName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, childResourceName, accept, context); } /** @@ -231,7 +239,7 @@ private Mono> getWithResponseAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subresource of Top Level Arm Resource on successful completion of {@link Mono}. + * @return a ChildResource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String topLevelArmResourceName, @@ -250,7 +258,7 @@ private Mono getAsync(String resourceGroupName, String topLe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subresource of Top Level Arm Resource along with {@link Response}. + * @return a ChildResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String topLevelArmResourceName, @@ -267,7 +275,7 @@ public Response getWithResponse(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subresource of Top Level Arm Resource. + * @return a ChildResource. */ @ServiceMethod(returns = ReturnType.SINGLE) public ChildResourceInner get(String resourceGroupName, String topLevelArmResourceName, String childResourceName) { @@ -290,6 +298,10 @@ public ChildResourceInner get(String resourceGroupName, String topLevelArmResour @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, ChildResourceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -311,11 +323,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, childResourceName, contentType, accept, resource, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, + resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -336,6 +348,10 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, ChildResourceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -357,11 +373,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelArmResourceName, childResourceName, contentType, accept, resource, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, + resource, context); } /** @@ -543,6 +559,10 @@ public ChildResourceInner createOrUpdate(String resourceGroupName, String topLev @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, ChildResourceUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -564,12 +584,11 @@ private Mono> updateWithResponseAsync(String resour } else { properties.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, childResourceName, contentType, accept, properties, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, + properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -590,6 +609,10 @@ private Mono> updateWithResponseAsync(String resour @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, ChildResourceUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -611,11 +634,10 @@ private Mono> updateWithResponseAsync(String resour } else { properties.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelArmResourceName, childResourceName, contentType, accept, properties, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, childResourceName, accept, properties, context); } /** @@ -690,6 +712,10 @@ public ChildResourceInner update(String resourceGroupName, String topLevelArmRes @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -708,8 +734,9 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, childResourceName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -728,6 +755,10 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -746,8 +777,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelArmResourceName, childResourceName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, childResourceName, accept, context); } /** @@ -910,6 +941,10 @@ public void delete(String resourceGroupName, String topLevelArmResourceName, Str @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelArmResourceSinglePageAsync(String resourceGroupName, String topLevelArmResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -924,8 +959,9 @@ private Mono> listByTopLevelArmResourceSingleP } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByTopLevelArmResource(this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context)) + .withContext( + context -> service.listByTopLevelArmResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -946,6 +982,10 @@ private Mono> listByTopLevelArmResourceSingleP @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelArmResourceSinglePageAsync(String resourceGroupName, String topLevelArmResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -961,8 +1001,8 @@ private Mono> listByTopLevelArmResourceSingleP final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByTopLevelArmResource(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelArmResourceName, accept, context) + .listByTopLevelArmResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1051,6 +1091,10 @@ public PagedIterable listByTopLevelArmResource(String resour @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> actionWithoutBodyWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1069,9 +1113,9 @@ private Mono>> actionWithoutBodyWithResponseAsync(Stri } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.actionWithoutBody(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, childResourceName, accept, context)) + .withContext(context -> service.actionWithoutBody(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1090,6 +1134,10 @@ private Mono>> actionWithoutBodyWithResponseAsync(Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> actionWithoutBodyWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1108,8 +1156,9 @@ private Mono>> actionWithoutBodyWithResponseAsync(Stri } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.actionWithoutBody(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, childResourceName, accept, context); + return service.actionWithoutBody(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, + context); } /** @@ -1262,8 +1311,6 @@ public void actionWithoutBody(String resourceGroupName, String topLevelArmResour } /** - * List ChildResource resources by TopLevelArmResource - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1278,16 +1325,20 @@ private Mono> listByTopLevelArmResourceNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listByTopLevelArmResourceNext(nextLink, accept, context)) + return FluxUtil + .withContext( + context -> service.listByTopLevelArmResourceNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List ChildResource resources by TopLevelArmResource - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1304,9 +1355,13 @@ private Mono> listByTopLevelArmResourceNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByTopLevelArmResourceNext(nextLink, accept, context) + return service.listByTopLevelArmResourceNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/CustomTemplateResourceInterfacesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/CustomTemplateResourceInterfacesClientImpl.java index 39dd40eb5f..f7e3bf336b 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/CustomTemplateResourceInterfacesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/CustomTemplateResourceInterfacesClientImpl.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; @@ -60,29 +62,31 @@ public final class CustomTemplateResourceInterfacesClientImpl implements CustomT * The interface defining all the services for ArmResourceProviderClientCustomTemplateResourceInterfaces to be used * by the proxy service to perform REST calls. */ - @Host("https://management.azure.com") + @Host("{endpoint}") @ServiceInterface(name = "ArmResourceProviderC") public interface CustomTemplateResourceInterfacesService { + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/customTemplateResources/{customTemplateResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @PathParam("customTemplateResourceName") String customTemplateResourceName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") CustomTemplateResourceInner resource, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") CustomTemplateResourceInner resource, + Context context); + @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/customTemplateResources/{customTemplateResourceName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateLongRunning(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> updateLongRunning(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("customTemplateResourceName") String customTemplateResourceName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") CustomTemplateResourcePatch properties, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") CustomTemplateResourcePatch properties, + Context context); } /** @@ -102,6 +106,10 @@ Mono>> updateLongRunning(@QueryParam("api-version") St @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String customTemplateResourceName, CustomTemplateResourceInner resource, String ifMatch, String ifNoneMatch) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -119,12 +127,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, ifMatch, ifNoneMatch, customTemplateResourceName, contentType, accept, resource, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, ifMatch, ifNoneMatch, customTemplateResourceName, + accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -147,6 +154,10 @@ private Mono>> createOrUpdateWithResponseAsync(String private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String customTemplateResourceName, CustomTemplateResourceInner resource, String ifMatch, String ifNoneMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -164,11 +175,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - ifMatch, ifNoneMatch, customTemplateResourceName, contentType, accept, resource, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, ifMatch, ifNoneMatch, customTemplateResourceName, + accept, resource, context); } /** @@ -417,6 +428,10 @@ public CustomTemplateResourceInner createOrUpdate(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateLongRunningWithResponseAsync(String resourceGroupName, String customTemplateResourceName, CustomTemplateResourcePatch properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -434,12 +449,11 @@ private Mono>> updateLongRunningWithResponseAsync(Stri } else { properties.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.updateLongRunning(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, customTemplateResourceName, contentType, accept, properties, context)) + .withContext(context -> service.updateLongRunning(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, customTemplateResourceName, accept, properties, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -459,6 +473,10 @@ private Mono>> updateLongRunningWithResponseAsync(Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateLongRunningWithResponseAsync(String resourceGroupName, String customTemplateResourceName, CustomTemplateResourcePatch properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -476,11 +494,11 @@ private Mono>> updateLongRunningWithResponseAsync(Stri } else { properties.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.updateLongRunning(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, customTemplateResourceName, contentType, accept, properties, context); + return service.updateLongRunning(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, customTemplateResourceName, accept, properties, + context); } /** diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/OperationsClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/OperationsClientImpl.java index 617d380ddd..a41589074e 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/OperationsClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/OperationsClientImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -58,22 +59,22 @@ public final class OperationsClientImpl implements OperationsClient { * The interface defining all the services for ArmResourceProviderClientOperations to be used by the proxy service * to perform REST calls. */ - @Host("https://management.azure.com") + @Host("{endpoint}") @ServiceInterface(name = "ArmResourceProviderC") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Cadl.ArmResourceProvider/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, Context context); } /** @@ -86,8 +87,14 @@ Mono> listNext(@PathParam(value = "nextLink", enco */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.list(this.client.getApiVersion(), accept, context)) + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -105,9 +112,13 @@ private Mono> listSinglePageAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getApiVersion(), accept, context) + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -170,8 +181,6 @@ public PagedIterable list(Context context) { } /** - * List the operations for the provider - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -186,16 +195,18 @@ private Mono> listNextSinglePageAsync(String nextL if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, accept, context)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List the operations for the provider - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -211,9 +222,13 @@ private Mono> listNextSinglePageAsync(String nextL if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listNext(nextLink, accept, context) + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java index 602ccd66dd..e1ebb896ef 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java @@ -11,6 +11,7 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Post; @@ -70,73 +71,74 @@ public final class TopLevelArmResourceInterfacesClientImpl implements TopLevelAr * The interface defining all the services for ArmResourceProviderClientTopLevelArmResourceInterfaces to be used by * the proxy service to perform REST calls. */ - @Host("https://management.azure.com") + @Host("{endpoint}") @ServiceInterface(name = "ArmResourceProviderC") public interface TopLevelArmResourceInterfacesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Accept") String accept, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, @BodyParam("application/json") TopLevelArmResourceInner resource, Context context); + @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, @BodyParam("application/json") TopLevelArmResourceUpdate properties, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Accept") String accept, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Cadl.ArmResourceProvider/topLevelArmResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/action") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> action(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> action(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Accept") String accept, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -144,16 +146,16 @@ Mono>> action(@QueryParam("api-version") String apiVer @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("accept") String accept, Context context); } /** @@ -164,12 +166,15 @@ Mono> listBySubscriptionNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response} on successful completion of {@link Mono}. + * @return a TopLevelArmResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String topLevelArmResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -184,7 +189,7 @@ private Mono> getByResourceGroupWithResponseA } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getApiVersion(), + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -198,12 +203,15 @@ private Mono> getByResourceGroupWithResponseA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response} on successful completion of {@link Mono}. + * @return a TopLevelArmResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -218,8 +226,8 @@ private Mono> getByResourceGroupWithResponseA } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, accept, context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context); } /** @@ -230,8 +238,7 @@ private Mono> getByResourceGroupWithResponseA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type on - * successful completion of {@link Mono}. + * @return a TopLevelArmResource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, @@ -249,8 +256,7 @@ private Mono getByResourceGroupAsync(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. + * @return a TopLevelArmResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, @@ -266,7 +272,7 @@ public Response getByResourceGroupWithResponse(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + * @return a TopLevelArmResource. */ @ServiceMethod(returns = ReturnType.SINGLE) public TopLevelArmResourceInner getByResourceGroup(String resourceGroupName, String topLevelArmResourceName) { @@ -288,6 +294,10 @@ public TopLevelArmResourceInner getByResourceGroup(String resourceGroupName, Str @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, TopLevelArmResourceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -305,11 +315,10 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, contentType, accept, resource, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -329,6 +338,10 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, TopLevelArmResourceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -346,11 +359,10 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelArmResourceName, contentType, accept, resource, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, resource, context); } /** @@ -525,6 +537,10 @@ public TopLevelArmResourceInner createOrUpdate(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, TopLevelArmResourceUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -542,11 +558,9 @@ private Mono> updateWithResponseAsync(String } else { properties.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, contentType, accept, properties, context)) + return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -566,6 +580,10 @@ private Mono> updateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, TopLevelArmResourceUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -583,11 +601,10 @@ private Mono> updateWithResponseAsync(String } else { properties.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelArmResourceName, contentType, accept, properties, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, accept, properties, context); } /** @@ -658,6 +675,10 @@ public TopLevelArmResourceInner update(String resourceGroupName, String topLevel @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelArmResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -672,8 +693,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -691,6 +712,10 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -705,8 +730,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelArmResourceName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, accept, context); } /** @@ -854,6 +879,10 @@ public void delete(String resourceGroupName, String topLevelArmResourceName, Con */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -864,7 +893,7 @@ private Mono> listByResourceGroupSingleP } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getApiVersion(), + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -885,6 +914,10 @@ private Mono> listByResourceGroupSingleP @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -896,8 +929,8 @@ private Mono> listByResourceGroupSingleP final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - accept, context) + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -972,14 +1005,18 @@ public PagedIterable listByResourceGroup(String resour */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.list(this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -997,13 +1034,19 @@ private Mono> listSinglePageAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1075,6 +1118,10 @@ public PagedIterable list(Context context) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> actionWithResponseAsync(String resourceGroupName, String topLevelArmResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1089,8 +1136,8 @@ private Mono>> actionWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.action(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, accept, context)) + .withContext(context -> service.action(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1108,6 +1155,10 @@ private Mono>> actionWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> actionWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1122,8 +1173,8 @@ private Mono>> actionWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.action(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelArmResourceName, accept, context); + return service.action(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, accept, context); } /** @@ -1263,8 +1314,6 @@ public ResultInner action(String resourceGroupName, String topLevelArmResourceNa } /** - * List TopLevelArmResource resources by resource group - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1279,16 +1328,20 @@ private Mono> listByResourceGroupNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listByResourceGroupNext(nextLink, accept, context)) + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List TopLevelArmResource resources by resource group - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1305,16 +1358,18 @@ private Mono> listByResourceGroupNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, accept, context) + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** - * List TopLevelArmResource resources by subscription ID - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1329,16 +1384,20 @@ private Mono> listBySubscriptionNextSing if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listBySubscriptionNext(nextLink, accept, context)) + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List TopLevelArmResource resources by subscription ID - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1355,9 +1414,13 @@ private Mono> listBySubscriptionNextSing if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, accept, context) + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildExtensionResourceInterfaces.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildExtensionResourceInterfaces.java index cbc5a6d658..6a967a0cc1 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildExtensionResourceInterfaces.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildExtensionResourceInterfaces.java @@ -22,7 +22,7 @@ public interface ChildExtensionResourceInterfaces { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extensionResource of Top Level Arm Resource along with {@link Response}. + * @return a ChildExtensionResource along with {@link Response}. */ Response getWithResponse(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, Context context); @@ -36,7 +36,7 @@ Response getWithResponse(String resourceUri, String topL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extensionResource of Top Level Arm Resource. + * @return a ChildExtensionResource. */ ChildExtensionResource get(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName); @@ -129,7 +129,7 @@ PagedIterable listByTopLevelArmResource(String resourceU * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extensionResource of Top Level Arm Resource along with {@link Response}. + * @return a ChildExtensionResource along with {@link Response}. */ ChildExtensionResource getById(String id); @@ -141,7 +141,7 @@ PagedIterable listByTopLevelArmResource(String resourceU * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extensionResource of Top Level Arm Resource along with {@link Response}. + * @return a ChildExtensionResource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildResourcesInterfaces.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildResourcesInterfaces.java index fa14eee2a4..36c43f5666 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildResourcesInterfaces.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildResourcesInterfaces.java @@ -22,7 +22,7 @@ public interface ChildResourcesInterfaces { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subresource of Top Level Arm Resource along with {@link Response}. + * @return a ChildResource along with {@link Response}. */ Response getWithResponse(String resourceGroupName, String topLevelArmResourceName, String childResourceName, Context context); @@ -36,7 +36,7 @@ Response getWithResponse(String resourceGroupName, String topLeve * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subresource of Top Level Arm Resource. + * @return a ChildResource. */ ChildResource get(String resourceGroupName, String topLevelArmResourceName, String childResourceName); @@ -124,7 +124,7 @@ void actionWithoutBody(String resourceGroupName, String topLevelArmResourceName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subresource of Top Level Arm Resource along with {@link Response}. + * @return a ChildResource along with {@link Response}. */ ChildResource getById(String id); @@ -136,7 +136,7 @@ void actionWithoutBody(String resourceGroupName, String topLevelArmResourceName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subresource of Top Level Arm Resource along with {@link Response}. + * @return a ChildResource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/TopLevelArmResourceInterfaces.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/TopLevelArmResourceInterfaces.java index abcb77f43c..b084c3eed9 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/TopLevelArmResourceInterfaces.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/TopLevelArmResourceInterfaces.java @@ -21,8 +21,7 @@ public interface TopLevelArmResourceInterfaces { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. + * @return a TopLevelArmResource along with {@link Response}. */ Response getByResourceGroupWithResponse(String resourceGroupName, String topLevelArmResourceName, Context context); @@ -35,7 +34,7 @@ Response getByResourceGroupWithResponse(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + * @return a TopLevelArmResource. */ TopLevelArmResource getByResourceGroup(String resourceGroupName, String topLevelArmResourceName); @@ -137,8 +136,7 @@ Response getByResourceGroupWithResponse(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. + * @return a TopLevelArmResource along with {@link Response}. */ TopLevelArmResource getById(String id); @@ -150,8 +148,7 @@ Response getByResourceGroupWithResponse(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. + * @return a TopLevelArmResource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/ArmStreamStyleSerializationManager.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/ArmStreamStyleSerializationManager.java index eb39c36857..7b24317712 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/ArmStreamStyleSerializationManager.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/ArmStreamStyleSerializationManager.java @@ -52,6 +52,7 @@ private ArmStreamStyleSerializationManager(HttpPipeline httpPipeline, AzureProfi Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); this.clientObject = new ArmStreamStyleSerializationClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) .buildClient(); diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/ArmStreamStyleSerializationClient.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/ArmStreamStyleSerializationClient.java index 6c2dc1e0da..ce27e1bede 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/ArmStreamStyleSerializationClient.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/ArmStreamStyleSerializationClient.java @@ -11,6 +11,13 @@ * The interface for ArmStreamStyleSerializationClient class. */ public interface ArmStreamStyleSerializationClient { + /** + * Gets Server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + /** * Gets Version parameter. * diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientBuilder.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientBuilder.java index d0659bf1b5..9b10cf2326 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientBuilder.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientBuilder.java @@ -19,6 +19,22 @@ */ @ServiceClientBuilder(serviceClients = { ArmStreamStyleSerializationClientImpl.class }) public final class ArmStreamStyleSerializationClientBuilder { + /* + * Server parameter + */ + private String endpoint; + + /** + * Sets Server parameter. + * + * @param endpoint the endpoint value. + * @return the ArmStreamStyleSerializationClientBuilder. + */ + public ArmStreamStyleSerializationClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The ID of the target subscription. The value must be an UUID. */ @@ -115,7 +131,7 @@ public ArmStreamStyleSerializationClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); ArmStreamStyleSerializationClientImpl client = new ArmStreamStyleSerializationClientImpl(localPipeline, - localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId); + localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId); return client; } } diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientImpl.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientImpl.java index 306a0a1e3b..29c56c88aa 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientImpl.java @@ -40,6 +40,20 @@ */ @ServiceClient(builder = ArmStreamStyleSerializationClientBuilder.class) public final class ArmStreamStyleSerializationClientImpl implements ArmStreamStyleSerializationClient { + /** + * Server parameter. + */ + private final String endpoint; + + /** + * Gets Server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * Version parameter. */ @@ -145,13 +159,15 @@ public TopLevelArmResourcesClient getTopLevelArmResources() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. + * @param endpoint Server parameter. * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ ArmStreamStyleSerializationClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId) { + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; + this.endpoint = endpoint; this.subscriptionId = subscriptionId; this.apiVersion = "2023-12-01-preview"; this.fishes = new FishesClientImpl(this); diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java index e62b2f2549..86f1103f2e 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java @@ -10,6 +10,7 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -52,20 +53,22 @@ public final class FishesClientImpl implements FishesClient { * The interface defining all the services for ArmStreamStyleSerializationClientFishes to be used by the proxy * service to perform REST calls. */ - @Host("https://management.azure.com") + @Host("{endpoint}") @ServiceInterface(name = "ArmStreamStyleSerial") public interface FishesService { @Headers({ "Content-Type: application/json" }) @Get("/model") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getModel(@HeaderParam("Accept") String accept, Context context); + Mono> getModel(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Put("/model") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> putModel(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") FishInner fish, Context context); + Mono> putModel(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + @BodyParam("application/json") FishInner fish, Context context); } /** @@ -78,8 +81,12 @@ Mono> putModel(@HeaderParam("Content-Type") String contentTy */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getModelWithResponseAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getModel(accept, context)) + return FluxUtil.withContext(context -> service.getModel(this.client.getEndpoint(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -95,9 +102,13 @@ private Mono> getModelWithResponseAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getModelWithResponseAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getModel(accept, context); + return service.getModel(this.client.getEndpoint(), accept, context); } /** @@ -152,14 +163,17 @@ public FishInner getModel() { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> putModelWithResponseAsync(FishInner fish) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (fish == null) { return Mono.error(new IllegalArgumentException("Parameter fish is required and cannot be null.")); } else { fish.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putModel(contentType, accept, fish, context)) + return FluxUtil.withContext(context -> service.putModel(this.client.getEndpoint(), accept, fish, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -176,15 +190,18 @@ private Mono> putModelWithResponseAsync(FishInner fish) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> putModelWithResponseAsync(FishInner fish, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (fish == null) { return Mono.error(new IllegalArgumentException("Parameter fish is required and cannot be null.")); } else { fish.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.putModel(contentType, accept, fish, context); + return service.putModel(this.client.getEndpoint(), accept, fish, context); } /** diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/TopLevelArmResourcesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/TopLevelArmResourcesClientImpl.java index 32ab73105b..7088f30ffd 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/TopLevelArmResourcesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/TopLevelArmResourcesClientImpl.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.QueryParam; @@ -59,17 +61,17 @@ public final class TopLevelArmResourcesClientImpl implements TopLevelArmResource * The interface defining all the services for ArmStreamStyleSerializationClientTopLevelArmResources to be used by * the proxy service to perform REST calls. */ - @Host("https://management.azure.com") + @Host("{endpoint}") @ServiceInterface(name = "ArmStreamStyleSerial") public interface TopLevelArmResourcesService { + @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmStreamStyleSerialization/topLevelArmResources/{topLevelArmResourceName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, @BodyParam("application/json") TopLevelArmResourceTagsUpdate properties, Context context); } @@ -88,6 +90,10 @@ Mono>> update(@QueryParam("api-version") String apiVer @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, TopLevelArmResourceTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -105,11 +111,9 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, contentType, accept, properties, context)) + return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -129,6 +133,10 @@ private Mono>> updateWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, TopLevelArmResourceTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -146,11 +154,10 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } - final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelArmResourceName, contentType, accept, properties, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, accept, properties, context); } /** diff --git a/typespec-tests/src/main/java/com/cadl/builtin/implementation/BuiltinClientImpl.java b/typespec-tests/src/main/java/com/cadl/builtin/implementation/BuiltinClientImpl.java index 5bfa379806..169d20a90e 100644 --- a/typespec-tests/src/main/java/com/cadl/builtin/implementation/BuiltinClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/builtin/implementation/BuiltinClientImpl.java @@ -16,12 +16,12 @@ */ public final class BuiltinClientImpl { /** - * Service host. + * Server parameter. */ private final String endpoint; /** - * Gets Service host. + * Gets Server parameter. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public BuiltinOpsImpl getBuiltinOps() { /** * Initializes an instance of BuiltinClient client. * - * @param endpoint Service host. + * @param endpoint Server parameter. */ public BuiltinClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public BuiltinClientImpl(String endpoint) { * Initializes an instance of BuiltinClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public BuiltinClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public BuiltinClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public BuiltinClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/builtin/implementation/BuiltinOpsImpl.java b/typespec-tests/src/main/java/com/cadl/builtin/implementation/BuiltinOpsImpl.java index 7ea2c40fd9..f16cba11b6 100644 --- a/typespec-tests/src/main/java/com/cadl/builtin/implementation/BuiltinOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/builtin/implementation/BuiltinOpsImpl.java @@ -68,7 +68,7 @@ public interface BuiltinOpsService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> read(@HostParam("endpoint") String endpoint, @QueryParam("query") String queryParam, @QueryParam(value = "query-encoded", encoded = true) String queryParamEncoded, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/builtin") @ExpectedResponses({ 200 }) @@ -78,7 +78,7 @@ Mono> read(@HostParam("endpoint") String endpoint, @QueryPa @UnexpectedResponseExceptionType(HttpResponseException.class) Response readSync(@HostParam("endpoint") String endpoint, @QueryParam("query") String queryParam, @QueryParam(value = "query-encoded", encoded = true) String queryParamEncoded, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/builtin") @ExpectedResponses({ 200 }) @@ -86,9 +86,8 @@ Response readSync(@HostParam("endpoint") String endpoint, @QueryPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> write(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> write(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/builtin") @ExpectedResponses({ 200 }) @@ -96,9 +95,8 @@ Mono> write(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response writeSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response writeSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -297,9 +295,9 @@ public Response readWithResponse(String queryParam, String queryPara */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> writeWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext( - context -> service.write(this.client.getEndpoint(), contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.write(this.client.getEndpoint(), accept, body, requestOptions, context)); } /** @@ -352,7 +350,7 @@ public Mono> writeWithResponseAsync(BinaryData body, RequestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Response writeWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.writeSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.writeSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/enumservice/implementation/EnumServiceClientImpl.java b/typespec-tests/src/main/java/com/cadl/enumservice/implementation/EnumServiceClientImpl.java index 12b6c27112..23979b9a52 100644 --- a/typespec-tests/src/main/java/com/cadl/enumservice/implementation/EnumServiceClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/enumservice/implementation/EnumServiceClientImpl.java @@ -47,12 +47,12 @@ public final class EnumServiceClientImpl { private final EnumServiceClientService service; /** - * Service host. + * Server parameter. */ private final String endpoint; /** - * Gets Service host. + * Gets Server parameter. * * @return the endpoint value. */ @@ -91,7 +91,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of EnumServiceClient client. * - * @param endpoint Service host. + * @param endpoint Server parameter. */ public EnumServiceClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -102,7 +102,7 @@ public EnumServiceClientImpl(String endpoint) { * Initializes an instance of EnumServiceClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public EnumServiceClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -113,7 +113,7 @@ public EnumServiceClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public EnumServiceClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; @@ -136,7 +136,7 @@ public interface EnumServiceClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getColor(@HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/enum/color") @ExpectedResponses({ 200 }) @@ -144,7 +144,7 @@ Mono> getColor(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getColorSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + Response getColorSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/enum/colormodel") @@ -154,7 +154,7 @@ Response getColorSync(@HostParam("endpoint") String endpoint, @Heade @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getColorModel(@HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/enum/colormodel") @ExpectedResponses({ 200 }) @@ -163,7 +163,7 @@ Mono> getColorModel(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getColorModelSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/colormodel") @ExpectedResponses({ 200 }) @@ -172,7 +172,7 @@ Response getColorModelSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setColorModel(@HostParam("endpoint") String endpoint, - @QueryParam("color") String color, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + @QueryParam("color") String color, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/colormodel") @@ -182,7 +182,7 @@ Mono> setColorModel(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response setColorModelSync(@HostParam("endpoint") String endpoint, - @QueryParam("color") String color, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + @QueryParam("color") String color, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/priority") @@ -192,7 +192,7 @@ Response setColorModelSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setPriority(@HostParam("endpoint") String endpoint, - @QueryParam("priority") String priority, @HeaderParam("Accept") String accept, + @QueryParam("priority") String priority, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/priority") @@ -202,7 +202,7 @@ Mono> setPriority(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response setPrioritySync(@HostParam("endpoint") String endpoint, - @QueryParam("priority") String priority, @HeaderParam("Accept") String accept, + @QueryParam("priority") String priority, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/enum/operation/state/running") @@ -212,7 +212,7 @@ Response setPrioritySync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getRunningOperation(@HostParam("endpoint") String endpoint, - @QueryParam("state") String state, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + @QueryParam("state") String state, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/enum/operation/state/running") @@ -222,7 +222,7 @@ Mono> getRunningOperation(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getRunningOperationSync(@HostParam("endpoint") String endpoint, - @QueryParam("state") String state, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + @QueryParam("state") String state, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/enum/operation/state") @@ -232,7 +232,7 @@ Response getRunningOperationSync(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getOperation(@HostParam("endpoint") String endpoint, - @QueryParam("state") String state, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + @QueryParam("state") String state, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/enum/operation/state") @@ -242,7 +242,7 @@ Mono> getOperation(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getOperationSync(@HostParam("endpoint") String endpoint, @QueryParam("state") String state, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringenumarray") @ExpectedResponses({ 200 }) @@ -251,7 +251,7 @@ Response getOperationSync(@HostParam("endpoint") String endpoint, @Q @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setStringEnumArray(@HostParam("endpoint") String endpoint, - @QueryParam("colorArray") String colorArray, @HeaderParam("Accept") String accept, + @QueryParam("colorArray") String colorArray, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringenumarray") @@ -261,7 +261,7 @@ Mono> setStringEnumArray(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response setStringEnumArraySync(@HostParam("endpoint") String endpoint, - @QueryParam("colorArray") String colorArray, @HeaderParam("Accept") String accept, + @QueryParam("colorArray") String colorArray, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/intenumarray") @@ -271,7 +271,7 @@ Response setStringEnumArraySync(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setIntEnumArray(@HostParam("endpoint") String endpoint, - @QueryParam("priorityArray") String priorityArray, @HeaderParam("Accept") String accept, + @QueryParam("priorityArray") String priorityArray, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/intenumarray") @@ -281,7 +281,7 @@ Mono> setIntEnumArray(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response setIntEnumArraySync(@HostParam("endpoint") String endpoint, - @QueryParam("priorityArray") String priorityArray, @HeaderParam("Accept") String accept, + @QueryParam("priorityArray") String priorityArray, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringarray") @@ -291,7 +291,7 @@ Response setIntEnumArraySync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setStringArray(@HostParam("endpoint") String endpoint, - @QueryParam("stringArray") String stringArray, @HeaderParam("Accept") String accept, + @QueryParam("stringArray") String stringArray, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringarray") @@ -301,7 +301,7 @@ Mono> setStringArray(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response setStringArraySync(@HostParam("endpoint") String endpoint, - @QueryParam("stringArray") String stringArray, @HeaderParam("Accept") String accept, + @QueryParam("stringArray") String stringArray, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/intarray") @@ -311,7 +311,7 @@ Response setStringArraySync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setIntArray(@HostParam("endpoint") String endpoint, - @QueryParam("intArray") String intArray, @HeaderParam("Accept") String accept, + @QueryParam("intArray") String intArray, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/intarray") @@ -321,7 +321,7 @@ Mono> setIntArray(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response setIntArraySync(@HostParam("endpoint") String endpoint, - @QueryParam("intArray") String intArray, @HeaderParam("Accept") String accept, + @QueryParam("intArray") String intArray, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringenummulti") @@ -332,7 +332,7 @@ Response setIntArraySync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setStringEnumMulti(@HostParam("endpoint") String endpoint, @QueryParam(value = "colorArray", multipleQueryParams = true) List colorArray, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringenummulti") @ExpectedResponses({ 200 }) @@ -342,7 +342,7 @@ Mono> setStringEnumMulti(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(HttpResponseException.class) Response setStringEnumMultiSync(@HostParam("endpoint") String endpoint, @QueryParam(value = "colorArray", multipleQueryParams = true) List colorArray, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/intenummulti") @ExpectedResponses({ 200 }) @@ -352,7 +352,7 @@ Response setStringEnumMultiSync(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setIntEnumMulti(@HostParam("endpoint") String endpoint, @QueryParam(value = "priorityArray", multipleQueryParams = true) List priorityArray, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/intenummulti") @ExpectedResponses({ 200 }) @@ -362,7 +362,7 @@ Mono> setIntEnumMulti(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(HttpResponseException.class) Response setIntEnumMultiSync(@HostParam("endpoint") String endpoint, @QueryParam(value = "priorityArray", multipleQueryParams = true) List priorityArray, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringmulti") @ExpectedResponses({ 200 }) @@ -372,7 +372,7 @@ Response setIntEnumMultiSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setStringMulti(@HostParam("endpoint") String endpoint, @QueryParam(value = "stringArray", multipleQueryParams = true) List stringArray, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringmulti") @ExpectedResponses({ 200 }) @@ -382,7 +382,7 @@ Mono> setStringMulti(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(HttpResponseException.class) Response setStringMultiSync(@HostParam("endpoint") String endpoint, @QueryParam(value = "stringArray", multipleQueryParams = true) List stringArray, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/intmulti") @ExpectedResponses({ 200 }) @@ -392,7 +392,7 @@ Response setStringMultiSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setIntMulti(@HostParam("endpoint") String endpoint, @QueryParam(value = "intArray", multipleQueryParams = true) List intArray, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/intmulti") @ExpectedResponses({ 200 }) @@ -402,7 +402,7 @@ Mono> setIntMulti(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response setIntMultiSync(@HostParam("endpoint") String endpoint, @QueryParam(value = "intArray", multipleQueryParams = true) List intArray, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringenumarrayheader") @ExpectedResponses({ 200 }) @@ -411,7 +411,7 @@ Response setIntMultiSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setStringEnumArrayHeader(@HostParam("endpoint") String endpoint, - @HeaderParam("color-array") String colorArray, @HeaderParam("Accept") String accept, + @HeaderParam("color-array") String colorArray, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringenumarrayheader") @@ -421,7 +421,7 @@ Mono> setStringEnumArrayHeader(@HostParam("endpoint") Strin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response setStringEnumArrayHeaderSync(@HostParam("endpoint") String endpoint, - @HeaderParam("color-array") String colorArray, @HeaderParam("Accept") String accept, + @HeaderParam("color-array") String colorArray, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorModelClientImpl.java b/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorModelClientImpl.java index ba7a4d34da..8274dc5b1a 100644 --- a/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorModelClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorModelClientImpl.java @@ -16,12 +16,12 @@ */ public final class ErrorModelClientImpl { /** - * Service host. + * Server parameter. */ private final String endpoint; /** - * Gets Service host. + * Gets Server parameter. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public ErrorOpsImpl getErrorOps() { /** * Initializes an instance of ErrorModelClient client. * - * @param endpoint Service host. + * @param endpoint Server parameter. */ public ErrorModelClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public ErrorModelClientImpl(String endpoint) { * Initializes an instance of ErrorModelClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public ErrorModelClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public ErrorModelClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public ErrorModelClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorOpsImpl.java b/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorOpsImpl.java index 259b2fa4b1..d422ad091e 100644 --- a/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorOpsImpl.java @@ -62,7 +62,7 @@ public interface ErrorOpsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> read(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + Mono> read(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/error") @@ -71,7 +71,7 @@ Mono> read(@HostParam("endpoint") String endpoint, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response readSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + Response readSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/cadl/flatten/FlattenAsyncClient.java b/typespec-tests/src/main/java/com/cadl/flatten/FlattenAsyncClient.java index e3c264ec57..97cbf888db 100644 --- a/typespec-tests/src/main/java/com/cadl/flatten/FlattenAsyncClient.java +++ b/typespec-tests/src/main/java/com/cadl/flatten/FlattenAsyncClient.java @@ -66,7 +66,7 @@ public final class FlattenAsyncClient { * } * * @param id The id parameter. - * @param sendRequest The sendRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -76,8 +76,8 @@ public final class FlattenAsyncClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendWithResponse(String id, BinaryData sendRequest, RequestOptions requestOptions) { - return this.serviceClient.sendWithResponseAsync(id, sendRequest, requestOptions); + public Mono> sendWithResponse(String id, BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.sendWithResponseAsync(id, request, requestOptions); } /** @@ -91,7 +91,7 @@ public Mono> sendWithResponse(String id, BinaryData sendRequest, * } * * @param id The id parameter. - * @param sendProjectedNameRequest The sendProjectedNameRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -101,9 +101,9 @@ public Mono> sendWithResponse(String id, BinaryData sendRequest, */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendProjectedNameWithResponse(String id, BinaryData sendProjectedNameRequest, + public Mono> sendProjectedNameWithResponse(String id, BinaryData request, RequestOptions requestOptions) { - return this.serviceClient.sendProjectedNameWithResponseAsync(id, sendProjectedNameRequest, requestOptions); + return this.serviceClient.sendProjectedNameWithResponseAsync(id, request, requestOptions); } /** @@ -136,7 +136,7 @@ public Mono> sendProjectedNameWithResponse(String id, BinaryData * } * * @param name The name parameter. - * @param sendLongRequest The sendLongRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -146,9 +146,8 @@ public Mono> sendProjectedNameWithResponse(String id, BinaryData */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendLongWithResponse(String name, BinaryData sendLongRequest, - RequestOptions requestOptions) { - return this.serviceClient.sendLongWithResponseAsync(name, sendLongRequest, requestOptions); + public Mono> sendLongWithResponse(String name, BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.sendLongWithResponseAsync(name, request, requestOptions); } /** @@ -181,7 +180,7 @@ public Mono> sendLongWithResponse(String name, BinaryData sendLon * } * * @param id The id parameter. - * @param updateRequest The updateRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -191,16 +190,15 @@ public Mono> sendLongWithResponse(String name, BinaryData sendLon */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponse(long id, BinaryData updateRequest, - RequestOptions requestOptions) { - return this.serviceClient.updateWithResponseAsync(id, updateRequest, requestOptions); + public Mono> updateWithResponse(long id, BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.updateWithResponseAsync(id, request, requestOptions); } /** * The uploadFile operation. * * @param name The name parameter. - * @param uploadFileRequest The uploadFileRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -210,17 +208,16 @@ public Mono> updateWithResponse(long id, BinaryData updateR */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono> uploadFileWithResponse(String name, BinaryData uploadFileRequest, - RequestOptions requestOptions) { + Mono> uploadFileWithResponse(String name, BinaryData request, RequestOptions requestOptions) { // Protocol API requires serialization of parts with content-disposition and data, as operation 'uploadFile' is // 'multipart/form-data' - return this.serviceClient.uploadFileWithResponseAsync(name, uploadFileRequest, requestOptions); + return this.serviceClient.uploadFileWithResponseAsync(name, request, requestOptions); } /** * The uploadTodo operation. * - * @param uploadTodoRequest The uploadTodoRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -230,10 +227,10 @@ Mono> uploadFileWithResponse(String name, BinaryData uploadFileRe */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono> uploadTodoWithResponse(BinaryData uploadTodoRequest, RequestOptions requestOptions) { + Mono> uploadTodoWithResponse(BinaryData request, RequestOptions requestOptions) { // Protocol API requires serialization of parts with content-disposition and data, as operation 'uploadTodo' is // 'multipart/form-data' - return this.serviceClient.uploadTodoWithResponseAsync(uploadTodoRequest, requestOptions); + return this.serviceClient.uploadTodoWithResponseAsync(request, requestOptions); } /** @@ -255,9 +252,9 @@ Mono> uploadTodoWithResponse(BinaryData uploadTodoRequest, Reques public Mono send(String id, String input, User user) { // Generated convenience method for sendWithResponse RequestOptions requestOptions = new RequestOptions(); - SendRequest sendRequestObj = new SendRequest(input).setUser(user); - BinaryData sendRequest = BinaryData.fromObject(sendRequestObj); - return sendWithResponse(id, sendRequest, requestOptions).flatMap(FluxUtil::toMono); + SendRequest requestObj = new SendRequest(input).setUser(user); + BinaryData request = BinaryData.fromObject(requestObj); + return sendWithResponse(id, request, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -278,9 +275,9 @@ public Mono send(String id, String input, User user) { public Mono send(String id, String input) { // Generated convenience method for sendWithResponse RequestOptions requestOptions = new RequestOptions(); - SendRequest sendRequestObj = new SendRequest(input); - BinaryData sendRequest = BinaryData.fromObject(sendRequestObj); - return sendWithResponse(id, sendRequest, requestOptions).flatMap(FluxUtil::toMono); + SendRequest requestObj = new SendRequest(input); + BinaryData request = BinaryData.fromObject(requestObj); + return sendWithResponse(id, request, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -301,9 +298,9 @@ public Mono send(String id, String input) { public Mono sendProjectedName(String id, String fileIdentifier) { // Generated convenience method for sendProjectedNameWithResponse RequestOptions requestOptions = new RequestOptions(); - SendProjectedNameRequest sendProjectedNameRequestObj = new SendProjectedNameRequest(fileIdentifier); - BinaryData sendProjectedNameRequest = BinaryData.fromObject(sendProjectedNameRequestObj); - return sendProjectedNameWithResponse(id, sendProjectedNameRequest, requestOptions).flatMap(FluxUtil::toMono); + SendProjectedNameRequest requestObj = new SendProjectedNameRequest(fileIdentifier); + BinaryData request = BinaryData.fromObject(requestObj); + return sendProjectedNameWithResponse(id, request, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -325,7 +322,7 @@ public Mono sendLong(SendLongOptions options) { RequestOptions requestOptions = new RequestOptions(); String name = options.getName(); String filter = options.getFilter(); - SendLongRequest sendLongRequestObj + SendLongRequest requestObj = new SendLongRequest(options.getInput(), options.getDataInt(), options.getTitle(), options.getStatus()) .setUser(options.getUser()) .setDataIntOptional(options.getDataIntOptional()) @@ -333,18 +330,18 @@ public Mono sendLong(SendLongOptions options) { .setDataFloat(options.getDataFloat()) .setDescription(options.getDescription()) .setDummy(options.getDummy()); - BinaryData sendLongRequest = BinaryData.fromObject(sendLongRequestObj); + BinaryData request = BinaryData.fromObject(requestObj); if (filter != null) { requestOptions.addQueryParam("filter", filter, false); } - return sendLongWithResponse(name, sendLongRequest, requestOptions).flatMap(FluxUtil::toMono); + return sendLongWithResponse(name, request, requestOptions).flatMap(FluxUtil::toMono); } /** * The update operation. * * @param id The id parameter. - * @param updateRequest The updateRequest parameter. + * @param request The request parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -355,15 +352,15 @@ public Mono sendLong(SendLongOptions options) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono update(long id, UpdatePatchRequest updateRequest) { + public Mono update(long id, UpdatePatchRequest request) { // Generated convenience method for updateWithResponse RequestOptions requestOptions = new RequestOptions(); - JsonMergePatchHelper.getUpdatePatchRequestAccessor().prepareModelForJsonMergePatch(updateRequest, true); - BinaryData updateRequestInBinaryData = BinaryData.fromObject(updateRequest); + JsonMergePatchHelper.getUpdatePatchRequestAccessor().prepareModelForJsonMergePatch(request, true); + BinaryData requestInBinaryData = BinaryData.fromObject(request); // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. - updateRequestInBinaryData.getLength(); - JsonMergePatchHelper.getUpdatePatchRequestAccessor().prepareModelForJsonMergePatch(updateRequest, false); - return updateWithResponse(id, updateRequestInBinaryData, requestOptions).flatMap(FluxUtil::toMono) + requestInBinaryData.getLength(); + JsonMergePatchHelper.getUpdatePatchRequestAccessor().prepareModelForJsonMergePatch(request, false); + return updateWithResponse(id, requestInBinaryData, requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(TodoItem.class)); } @@ -385,14 +382,14 @@ public Mono update(long id, UpdatePatchRequest updateRequest) { public Mono uploadFile(String name, FileDataFileDetails fileData) { // Generated convenience method for uploadFileWithResponse RequestOptions requestOptions = new RequestOptions(); - UploadFileRequest uploadFileRequestObj = new UploadFileRequest(fileData); - BinaryData uploadFileRequest = new MultipartFormDataHelper(requestOptions) - .serializeFileField("file_data", uploadFileRequestObj.getFileData().getContent(), - uploadFileRequestObj.getFileData().getContentType(), uploadFileRequestObj.getFileData().getFilename()) - .serializeTextField("constant", uploadFileRequestObj.getConstant()) + UploadFileRequest requestObj = new UploadFileRequest(fileData); + BinaryData request = new MultipartFormDataHelper(requestOptions) + .serializeFileField("file_data", requestObj.getFileData().getContent(), + requestObj.getFileData().getContentType(), requestObj.getFileData().getFilename()) + .serializeTextField("constant", requestObj.getConstant()) .end() .getRequestBody(); - return uploadFileWithResponse(name, uploadFileRequest, requestOptions).flatMap(FluxUtil::toMono); + return uploadFileWithResponse(name, request, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -412,22 +409,22 @@ public Mono uploadFile(String name, FileDataFileDetails fileData) { public Mono uploadTodo(UploadTodoOptions options) { // Generated convenience method for uploadTodoWithResponse RequestOptions requestOptions = new RequestOptions(); - UploadTodoRequest uploadTodoRequestObj + UploadTodoRequest requestObj = new UploadTodoRequest(options.getTitle(), options.getStatus()).setDescription(options.getDescription()) .setDummy(options.getDummy()) .setProp1(options.getProp1()) .setProp2(options.getProp2()) .setProp3(options.getProp3()); - BinaryData uploadTodoRequest - = new MultipartFormDataHelper(requestOptions).serializeTextField("title", uploadTodoRequestObj.getTitle()) - .serializeTextField("description", uploadTodoRequestObj.getDescription()) - .serializeTextField("status", Objects.toString(uploadTodoRequestObj.getStatus())) - .serializeTextField("_dummy", uploadTodoRequestObj.getDummy()) - .serializeTextField("prop1", uploadTodoRequestObj.getProp1()) - .serializeTextField("prop2", uploadTodoRequestObj.getProp2()) - .serializeTextField("prop3", uploadTodoRequestObj.getProp3()) + BinaryData request + = new MultipartFormDataHelper(requestOptions).serializeTextField("title", requestObj.getTitle()) + .serializeTextField("description", requestObj.getDescription()) + .serializeTextField("status", Objects.toString(requestObj.getStatus())) + .serializeTextField("_dummy", requestObj.getDummy()) + .serializeTextField("prop1", requestObj.getProp1()) + .serializeTextField("prop2", requestObj.getProp2()) + .serializeTextField("prop3", requestObj.getProp3()) .end() .getRequestBody(); - return uploadTodoWithResponse(uploadTodoRequest, requestOptions).flatMap(FluxUtil::toMono); + return uploadTodoWithResponse(request, requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/typespec-tests/src/main/java/com/cadl/flatten/FlattenClient.java b/typespec-tests/src/main/java/com/cadl/flatten/FlattenClient.java index 36a6f4af4f..9af9394dc0 100644 --- a/typespec-tests/src/main/java/com/cadl/flatten/FlattenClient.java +++ b/typespec-tests/src/main/java/com/cadl/flatten/FlattenClient.java @@ -64,7 +64,7 @@ public final class FlattenClient { * } * * @param id The id parameter. - * @param sendRequest The sendRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -74,8 +74,8 @@ public final class FlattenClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendWithResponse(String id, BinaryData sendRequest, RequestOptions requestOptions) { - return this.serviceClient.sendWithResponse(id, sendRequest, requestOptions); + public Response sendWithResponse(String id, BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.sendWithResponse(id, request, requestOptions); } /** @@ -89,7 +89,7 @@ public Response sendWithResponse(String id, BinaryData sendRequest, Reques * } * * @param id The id parameter. - * @param sendProjectedNameRequest The sendProjectedNameRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -99,9 +99,8 @@ public Response sendWithResponse(String id, BinaryData sendRequest, Reques */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendProjectedNameWithResponse(String id, BinaryData sendProjectedNameRequest, - RequestOptions requestOptions) { - return this.serviceClient.sendProjectedNameWithResponse(id, sendProjectedNameRequest, requestOptions); + public Response sendProjectedNameWithResponse(String id, BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.sendProjectedNameWithResponse(id, request, requestOptions); } /** @@ -134,7 +133,7 @@ public Response sendProjectedNameWithResponse(String id, BinaryData sendPr * } * * @param name The name parameter. - * @param sendLongRequest The sendLongRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -144,8 +143,8 @@ public Response sendProjectedNameWithResponse(String id, BinaryData sendPr */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendLongWithResponse(String name, BinaryData sendLongRequest, RequestOptions requestOptions) { - return this.serviceClient.sendLongWithResponse(name, sendLongRequest, requestOptions); + public Response sendLongWithResponse(String name, BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.sendLongWithResponse(name, request, requestOptions); } /** @@ -178,7 +177,7 @@ public Response sendLongWithResponse(String name, BinaryData sendLongReque * } * * @param id The id parameter. - * @param updateRequest The updateRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -188,15 +187,15 @@ public Response sendLongWithResponse(String name, BinaryData sendLongReque */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(long id, BinaryData updateRequest, RequestOptions requestOptions) { - return this.serviceClient.updateWithResponse(id, updateRequest, requestOptions); + public Response updateWithResponse(long id, BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.updateWithResponse(id, request, requestOptions); } /** * The uploadFile operation. * * @param name The name parameter. - * @param uploadFileRequest The uploadFileRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -206,16 +205,16 @@ public Response updateWithResponse(long id, BinaryData updateRequest */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Response uploadFileWithResponse(String name, BinaryData uploadFileRequest, RequestOptions requestOptions) { + Response uploadFileWithResponse(String name, BinaryData request, RequestOptions requestOptions) { // Protocol API requires serialization of parts with content-disposition and data, as operation 'uploadFile' is // 'multipart/form-data' - return this.serviceClient.uploadFileWithResponse(name, uploadFileRequest, requestOptions); + return this.serviceClient.uploadFileWithResponse(name, request, requestOptions); } /** * The uploadTodo operation. * - * @param uploadTodoRequest The uploadTodoRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -225,10 +224,10 @@ Response uploadFileWithResponse(String name, BinaryData uploadFileRequest, */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Response uploadTodoWithResponse(BinaryData uploadTodoRequest, RequestOptions requestOptions) { + Response uploadTodoWithResponse(BinaryData request, RequestOptions requestOptions) { // Protocol API requires serialization of parts with content-disposition and data, as operation 'uploadTodo' is // 'multipart/form-data' - return this.serviceClient.uploadTodoWithResponse(uploadTodoRequest, requestOptions); + return this.serviceClient.uploadTodoWithResponse(request, requestOptions); } /** @@ -249,9 +248,9 @@ Response uploadTodoWithResponse(BinaryData uploadTodoRequest, RequestOptio public void send(String id, String input, User user) { // Generated convenience method for sendWithResponse RequestOptions requestOptions = new RequestOptions(); - SendRequest sendRequestObj = new SendRequest(input).setUser(user); - BinaryData sendRequest = BinaryData.fromObject(sendRequestObj); - sendWithResponse(id, sendRequest, requestOptions).getValue(); + SendRequest requestObj = new SendRequest(input).setUser(user); + BinaryData request = BinaryData.fromObject(requestObj); + sendWithResponse(id, request, requestOptions).getValue(); } /** @@ -271,9 +270,9 @@ public void send(String id, String input, User user) { public void send(String id, String input) { // Generated convenience method for sendWithResponse RequestOptions requestOptions = new RequestOptions(); - SendRequest sendRequestObj = new SendRequest(input); - BinaryData sendRequest = BinaryData.fromObject(sendRequestObj); - sendWithResponse(id, sendRequest, requestOptions).getValue(); + SendRequest requestObj = new SendRequest(input); + BinaryData request = BinaryData.fromObject(requestObj); + sendWithResponse(id, request, requestOptions).getValue(); } /** @@ -293,9 +292,9 @@ public void send(String id, String input) { public void sendProjectedName(String id, String fileIdentifier) { // Generated convenience method for sendProjectedNameWithResponse RequestOptions requestOptions = new RequestOptions(); - SendProjectedNameRequest sendProjectedNameRequestObj = new SendProjectedNameRequest(fileIdentifier); - BinaryData sendProjectedNameRequest = BinaryData.fromObject(sendProjectedNameRequestObj); - sendProjectedNameWithResponse(id, sendProjectedNameRequest, requestOptions).getValue(); + SendProjectedNameRequest requestObj = new SendProjectedNameRequest(fileIdentifier); + BinaryData request = BinaryData.fromObject(requestObj); + sendProjectedNameWithResponse(id, request, requestOptions).getValue(); } /** @@ -316,7 +315,7 @@ public void sendLong(SendLongOptions options) { RequestOptions requestOptions = new RequestOptions(); String name = options.getName(); String filter = options.getFilter(); - SendLongRequest sendLongRequestObj + SendLongRequest requestObj = new SendLongRequest(options.getInput(), options.getDataInt(), options.getTitle(), options.getStatus()) .setUser(options.getUser()) .setDataIntOptional(options.getDataIntOptional()) @@ -324,18 +323,18 @@ public void sendLong(SendLongOptions options) { .setDataFloat(options.getDataFloat()) .setDescription(options.getDescription()) .setDummy(options.getDummy()); - BinaryData sendLongRequest = BinaryData.fromObject(sendLongRequestObj); + BinaryData request = BinaryData.fromObject(requestObj); if (filter != null) { requestOptions.addQueryParam("filter", filter, false); } - sendLongWithResponse(name, sendLongRequest, requestOptions).getValue(); + sendLongWithResponse(name, request, requestOptions).getValue(); } /** * The update operation. * * @param id The id parameter. - * @param updateRequest The updateRequest parameter. + * @param request The request parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -346,15 +345,15 @@ public void sendLong(SendLongOptions options) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public TodoItem update(long id, UpdatePatchRequest updateRequest) { + public TodoItem update(long id, UpdatePatchRequest request) { // Generated convenience method for updateWithResponse RequestOptions requestOptions = new RequestOptions(); - JsonMergePatchHelper.getUpdatePatchRequestAccessor().prepareModelForJsonMergePatch(updateRequest, true); - BinaryData updateRequestInBinaryData = BinaryData.fromObject(updateRequest); + JsonMergePatchHelper.getUpdatePatchRequestAccessor().prepareModelForJsonMergePatch(request, true); + BinaryData requestInBinaryData = BinaryData.fromObject(request); // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. - updateRequestInBinaryData.getLength(); - JsonMergePatchHelper.getUpdatePatchRequestAccessor().prepareModelForJsonMergePatch(updateRequest, false); - return updateWithResponse(id, updateRequestInBinaryData, requestOptions).getValue().toObject(TodoItem.class); + requestInBinaryData.getLength(); + JsonMergePatchHelper.getUpdatePatchRequestAccessor().prepareModelForJsonMergePatch(request, false); + return updateWithResponse(id, requestInBinaryData, requestOptions).getValue().toObject(TodoItem.class); } /** @@ -374,14 +373,14 @@ public TodoItem update(long id, UpdatePatchRequest updateRequest) { public void uploadFile(String name, FileDataFileDetails fileData) { // Generated convenience method for uploadFileWithResponse RequestOptions requestOptions = new RequestOptions(); - UploadFileRequest uploadFileRequestObj = new UploadFileRequest(fileData); - BinaryData uploadFileRequest = new MultipartFormDataHelper(requestOptions) - .serializeFileField("file_data", uploadFileRequestObj.getFileData().getContent(), - uploadFileRequestObj.getFileData().getContentType(), uploadFileRequestObj.getFileData().getFilename()) - .serializeTextField("constant", uploadFileRequestObj.getConstant()) + UploadFileRequest requestObj = new UploadFileRequest(fileData); + BinaryData request = new MultipartFormDataHelper(requestOptions) + .serializeFileField("file_data", requestObj.getFileData().getContent(), + requestObj.getFileData().getContentType(), requestObj.getFileData().getFilename()) + .serializeTextField("constant", requestObj.getConstant()) .end() .getRequestBody(); - uploadFileWithResponse(name, uploadFileRequest, requestOptions).getValue(); + uploadFileWithResponse(name, request, requestOptions).getValue(); } /** @@ -400,22 +399,22 @@ public void uploadFile(String name, FileDataFileDetails fileData) { public void uploadTodo(UploadTodoOptions options) { // Generated convenience method for uploadTodoWithResponse RequestOptions requestOptions = new RequestOptions(); - UploadTodoRequest uploadTodoRequestObj + UploadTodoRequest requestObj = new UploadTodoRequest(options.getTitle(), options.getStatus()).setDescription(options.getDescription()) .setDummy(options.getDummy()) .setProp1(options.getProp1()) .setProp2(options.getProp2()) .setProp3(options.getProp3()); - BinaryData uploadTodoRequest - = new MultipartFormDataHelper(requestOptions).serializeTextField("title", uploadTodoRequestObj.getTitle()) - .serializeTextField("description", uploadTodoRequestObj.getDescription()) - .serializeTextField("status", Objects.toString(uploadTodoRequestObj.getStatus())) - .serializeTextField("_dummy", uploadTodoRequestObj.getDummy()) - .serializeTextField("prop1", uploadTodoRequestObj.getProp1()) - .serializeTextField("prop2", uploadTodoRequestObj.getProp2()) - .serializeTextField("prop3", uploadTodoRequestObj.getProp3()) + BinaryData request + = new MultipartFormDataHelper(requestOptions).serializeTextField("title", requestObj.getTitle()) + .serializeTextField("description", requestObj.getDescription()) + .serializeTextField("status", Objects.toString(requestObj.getStatus())) + .serializeTextField("_dummy", requestObj.getDummy()) + .serializeTextField("prop1", requestObj.getProp1()) + .serializeTextField("prop2", requestObj.getProp2()) + .serializeTextField("prop3", requestObj.getProp3()) .end() .getRequestBody(); - uploadTodoWithResponse(uploadTodoRequest, requestOptions).getValue(); + uploadTodoWithResponse(request, requestOptions).getValue(); } } diff --git a/typespec-tests/src/main/java/com/cadl/flatten/implementation/FlattenClientImpl.java b/typespec-tests/src/main/java/com/cadl/flatten/implementation/FlattenClientImpl.java index 4218ccb66c..4fe8ec0071 100644 --- a/typespec-tests/src/main/java/com/cadl/flatten/implementation/FlattenClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/flatten/implementation/FlattenClientImpl.java @@ -46,12 +46,11 @@ public final class FlattenClientImpl { private final FlattenClientService service; /** - * Flatten. */ private final String endpoint; /** - * Gets Flatten. + * Gets. * * @return the endpoint value. */ @@ -104,7 +103,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of FlattenClient client. * - * @param endpoint Flatten. + * @param endpoint * @param serviceVersion Service version. */ public FlattenClientImpl(String endpoint, FlattenServiceVersion serviceVersion) { @@ -116,7 +115,7 @@ public FlattenClientImpl(String endpoint, FlattenServiceVersion serviceVersion) * Initializes an instance of FlattenClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Flatten. + * @param endpoint * @param serviceVersion Service version. */ public FlattenClientImpl(HttpPipeline httpPipeline, String endpoint, FlattenServiceVersion serviceVersion) { @@ -128,7 +127,7 @@ public FlattenClientImpl(HttpPipeline httpPipeline, String endpoint, FlattenServ * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Flatten. + * @param endpoint * @param serviceVersion Service version. */ public FlattenClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, @@ -153,8 +152,8 @@ public interface FlattenClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> send(@HostParam("endpoint") String endpoint, @QueryParam("id") String id, - @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData sendRequest, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); @Post("/flatten/send") @ExpectedResponses({ 200 }) @@ -163,8 +162,8 @@ Mono> send(@HostParam("endpoint") String endpoint, @QueryParam("i @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response sendSync(@HostParam("endpoint") String endpoint, @QueryParam("id") String id, - @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData sendRequest, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); @Post("/flatten/send-projected-name") @ExpectedResponses({ 200 }) @@ -173,9 +172,8 @@ Response sendSync(@HostParam("endpoint") String endpoint, @QueryParam("id" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> sendProjectedName(@HostParam("endpoint") String endpoint, @QueryParam("id") String id, - @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData sendProjectedNameRequest, RequestOptions requestOptions, - Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); @Post("/flatten/send-projected-name") @ExpectedResponses({ 200 }) @@ -184,9 +182,8 @@ Mono> sendProjectedName(@HostParam("endpoint") String endpoint, @ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response sendProjectedNameSync(@HostParam("endpoint") String endpoint, @QueryParam("id") String id, - @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData sendProjectedNameRequest, RequestOptions requestOptions, - Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); @Post("/flatten/send-long") @ExpectedResponses({ 200 }) @@ -195,8 +192,8 @@ Response sendProjectedNameSync(@HostParam("endpoint") String endpoint, @Qu @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> sendLong(@HostParam("endpoint") String endpoint, @QueryParam("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData sendLongRequest, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); @Post("/flatten/send-long") @ExpectedResponses({ 200 }) @@ -205,8 +202,8 @@ Mono> sendLong(@HostParam("endpoint") String endpoint, @QueryPara @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response sendLongSync(@HostParam("endpoint") String endpoint, @QueryParam("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData sendLongRequest, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); @Patch("/flatten/patch/{id}") @ExpectedResponses({ 200 }) @@ -215,8 +212,8 @@ Response sendLongSync(@HostParam("endpoint") String endpoint, @QueryParam( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> update(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @PathParam("id") long id, - @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData updateRequest, + @HeaderParam("Content-Type") String contentType, @PathParam("id") long id, + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData request, RequestOptions requestOptions, Context context); @Patch("/flatten/patch/{id}") @@ -226,8 +223,8 @@ Mono> update(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response updateSync(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @PathParam("id") long id, - @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData updateRequest, + @HeaderParam("Content-Type") String contentType, @PathParam("id") long id, + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData request, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -238,9 +235,8 @@ Response updateSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadFile(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData uploadFileRequest, RequestOptions requestOptions, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @BodyParam("multipart/form-data") BinaryData request, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/flatten/upload/{name}") @@ -250,9 +246,8 @@ Mono> uploadFile(@HostParam("endpoint") String endpoint, @PathPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadFileSync(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData uploadFileRequest, RequestOptions requestOptions, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @BodyParam("multipart/form-data") BinaryData request, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/flatten/upload-todo") @@ -262,9 +257,8 @@ Response uploadFileSync(@HostParam("endpoint") String endpoint, @PathParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadTodo(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData uploadTodoRequest, RequestOptions requestOptions, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @BodyParam("multipart/form-data") BinaryData request, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/flatten/upload-todo") @@ -274,9 +268,8 @@ Mono> uploadTodo(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadTodoSync(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData uploadTodoRequest, RequestOptions requestOptions, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @BodyParam("multipart/form-data") BinaryData request, RequestOptions requestOptions, Context context); } /** @@ -294,7 +287,7 @@ Response uploadTodoSync(@HostParam("endpoint") String endpoint, * } * * @param id The id parameter. - * @param sendRequest The sendRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -303,11 +296,10 @@ Response uploadTodoSync(@HostParam("endpoint") String endpoint, * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendWithResponseAsync(String id, BinaryData sendRequest, - RequestOptions requestOptions) { - final String contentType = "application/json"; + public Mono> sendWithResponseAsync(String id, BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; return FluxUtil.withContext(context -> service.send(this.getEndpoint(), id, - this.getServiceVersion().getVersion(), contentType, sendRequest, requestOptions, context)); + this.getServiceVersion().getVersion(), accept, request, requestOptions, context)); } /** @@ -325,7 +317,7 @@ public Mono> sendWithResponseAsync(String id, BinaryData sendRequ * } * * @param id The id parameter. - * @param sendRequest The sendRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -334,9 +326,9 @@ public Mono> sendWithResponseAsync(String id, BinaryData sendRequ * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendWithResponse(String id, BinaryData sendRequest, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.sendSync(this.getEndpoint(), id, this.getServiceVersion().getVersion(), contentType, sendRequest, + public Response sendWithResponse(String id, BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.sendSync(this.getEndpoint(), id, this.getServiceVersion().getVersion(), accept, request, requestOptions, Context.NONE); } @@ -351,7 +343,7 @@ public Response sendWithResponse(String id, BinaryData sendRequest, Reques * } * * @param id The id parameter. - * @param sendProjectedNameRequest The sendProjectedNameRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -360,11 +352,11 @@ public Response sendWithResponse(String id, BinaryData sendRequest, Reques * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendProjectedNameWithResponseAsync(String id, BinaryData sendProjectedNameRequest, + public Mono> sendProjectedNameWithResponseAsync(String id, BinaryData request, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.sendProjectedName(this.getEndpoint(), id, contentType, - sendProjectedNameRequest, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.sendProjectedName(this.getEndpoint(), id, accept, request, requestOptions, context)); } /** @@ -378,7 +370,7 @@ public Mono> sendProjectedNameWithResponseAsync(String id, Binary * } * * @param id The id parameter. - * @param sendProjectedNameRequest The sendProjectedNameRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -387,11 +379,9 @@ public Mono> sendProjectedNameWithResponseAsync(String id, Binary * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendProjectedNameWithResponse(String id, BinaryData sendProjectedNameRequest, - RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.sendProjectedNameSync(this.getEndpoint(), id, contentType, sendProjectedNameRequest, - requestOptions, Context.NONE); + public Response sendProjectedNameWithResponse(String id, BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.sendProjectedNameSync(this.getEndpoint(), id, accept, request, requestOptions, Context.NONE); } /** @@ -424,7 +414,7 @@ public Response sendProjectedNameWithResponse(String id, BinaryData sendPr * } * * @param name The name parameter. - * @param sendLongRequest The sendLongRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -433,11 +423,11 @@ public Response sendProjectedNameWithResponse(String id, BinaryData sendPr * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendLongWithResponseAsync(String name, BinaryData sendLongRequest, + public Mono> sendLongWithResponseAsync(String name, BinaryData request, RequestOptions requestOptions) { - final String contentType = "application/json"; + final String accept = "application/json"; return FluxUtil.withContext(context -> service.sendLong(this.getEndpoint(), name, - this.getServiceVersion().getVersion(), contentType, sendLongRequest, requestOptions, context)); + this.getServiceVersion().getVersion(), accept, request, requestOptions, context)); } /** @@ -470,7 +460,7 @@ public Mono> sendLongWithResponseAsync(String name, BinaryData se * } * * @param name The name parameter. - * @param sendLongRequest The sendLongRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -479,10 +469,10 @@ public Mono> sendLongWithResponseAsync(String name, BinaryData se * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendLongWithResponse(String name, BinaryData sendLongRequest, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.sendLongSync(this.getEndpoint(), name, this.getServiceVersion().getVersion(), contentType, - sendLongRequest, requestOptions, Context.NONE); + public Response sendLongWithResponse(String name, BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.sendLongSync(this.getEndpoint(), name, this.getServiceVersion().getVersion(), accept, request, + requestOptions, Context.NONE); } /** @@ -515,7 +505,7 @@ public Response sendLongWithResponse(String name, BinaryData sendLongReque * } * * @param id The id parameter. - * @param updateRequest The updateRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -524,12 +514,12 @@ public Response sendLongWithResponse(String name, BinaryData sendLongReque * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync(long id, BinaryData updateRequest, + public Mono> updateWithResponseAsync(long id, BinaryData request, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.update(this.getEndpoint(), contentType, id, accept, - updateRequest, requestOptions, context)); + return FluxUtil.withContext( + context -> service.update(this.getEndpoint(), contentType, id, accept, request, requestOptions, context)); } /** @@ -562,7 +552,7 @@ public Mono> updateWithResponseAsync(long id, BinaryData up * } * * @param id The id parameter. - * @param updateRequest The updateRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -571,18 +561,17 @@ public Mono> updateWithResponseAsync(long id, BinaryData up * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(long id, BinaryData updateRequest, RequestOptions requestOptions) { + public Response updateWithResponse(long id, BinaryData request, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; final String accept = "application/json"; - return service.updateSync(this.getEndpoint(), contentType, id, accept, updateRequest, requestOptions, - Context.NONE); + return service.updateSync(this.getEndpoint(), contentType, id, accept, request, requestOptions, Context.NONE); } /** * The uploadFile operation. * * @param name The name parameter. - * @param uploadFileRequest The uploadFileRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -591,18 +580,19 @@ public Response updateWithResponse(long id, BinaryData updateRequest * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadFileWithResponseAsync(String name, BinaryData uploadFileRequest, + public Mono> uploadFileWithResponseAsync(String name, BinaryData request, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return FluxUtil.withContext(context -> service.uploadFile(this.getEndpoint(), name, contentType, - uploadFileRequest, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.uploadFile(this.getEndpoint(), name, contentType, accept, + request, requestOptions, context)); } /** * The uploadFile operation. * * @param name The name parameter. - * @param uploadFileRequest The uploadFileRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -611,17 +601,17 @@ public Mono> uploadFileWithResponseAsync(String name, BinaryData * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response uploadFileWithResponse(String name, BinaryData uploadFileRequest, - RequestOptions requestOptions) { + public Response uploadFileWithResponse(String name, BinaryData request, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return service.uploadFileSync(this.getEndpoint(), name, contentType, uploadFileRequest, requestOptions, + final String accept = "application/json"; + return service.uploadFileSync(this.getEndpoint(), name, contentType, accept, request, requestOptions, Context.NONE); } /** * The uploadTodo operation. * - * @param uploadTodoRequest The uploadTodoRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -630,17 +620,17 @@ public Response uploadFileWithResponse(String name, BinaryData uploadFileR * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadTodoWithResponseAsync(BinaryData uploadTodoRequest, - RequestOptions requestOptions) { + public Mono> uploadTodoWithResponseAsync(BinaryData request, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; + final String accept = "application/json"; return FluxUtil.withContext( - context -> service.uploadTodo(this.getEndpoint(), contentType, uploadTodoRequest, requestOptions, context)); + context -> service.uploadTodo(this.getEndpoint(), contentType, accept, request, requestOptions, context)); } /** * The uploadTodo operation. * - * @param uploadTodoRequest The uploadTodoRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -649,8 +639,9 @@ public Mono> uploadTodoWithResponseAsync(BinaryData uploadTodoReq * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response uploadTodoWithResponse(BinaryData uploadTodoRequest, RequestOptions requestOptions) { + public Response uploadTodoWithResponse(BinaryData request, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return service.uploadTodoSync(this.getEndpoint(), contentType, uploadTodoRequest, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.uploadTodoSync(this.getEndpoint(), contentType, accept, request, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/internal/implementation/InternalClientImpl.java b/typespec-tests/src/main/java/com/cadl/internal/implementation/InternalClientImpl.java index d7f1cee9ee..aa279b79f4 100644 --- a/typespec-tests/src/main/java/com/cadl/internal/implementation/InternalClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/internal/implementation/InternalClientImpl.java @@ -16,12 +16,12 @@ */ public final class InternalClientImpl { /** - * Service host. + * Server parameter. */ private final String endpoint; /** - * Gets Service host. + * Gets Server parameter. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public InternalOpsImpl getInternalOps() { /** * Initializes an instance of InternalClient client. * - * @param endpoint Service host. + * @param endpoint Server parameter. */ public InternalClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public InternalClientImpl(String endpoint) { * Initializes an instance of InternalClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public InternalClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public InternalClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public InternalClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/internal/models/ResponseInternal.java b/typespec-tests/src/main/java/com/cadl/internal/implementation/models/ResponseInternal.java similarity index 98% rename from typespec-tests/src/main/java/com/cadl/internal/models/ResponseInternal.java rename to typespec-tests/src/main/java/com/cadl/internal/implementation/models/ResponseInternal.java index d2a475e9f4..7e55a05a5d 100644 --- a/typespec-tests/src/main/java/com/cadl/internal/models/ResponseInternal.java +++ b/typespec-tests/src/main/java/com/cadl/internal/implementation/models/ResponseInternal.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. -package com.cadl.internal.models; +package com.cadl.internal.implementation.models; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; diff --git a/typespec-tests/src/main/java/com/cadl/internal/models/ResponseInternalInner.java b/typespec-tests/src/main/java/com/cadl/internal/implementation/models/ResponseInternalInner.java similarity index 98% rename from typespec-tests/src/main/java/com/cadl/internal/models/ResponseInternalInner.java rename to typespec-tests/src/main/java/com/cadl/internal/implementation/models/ResponseInternalInner.java index c8ecd56401..8e6b5cf0ad 100644 --- a/typespec-tests/src/main/java/com/cadl/internal/models/ResponseInternalInner.java +++ b/typespec-tests/src/main/java/com/cadl/internal/implementation/models/ResponseInternalInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. -package com.cadl.internal.models; +package com.cadl.internal.implementation.models; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; diff --git a/typespec-tests/src/main/java/com/cadl/literalservice/implementation/LiteralServiceClientImpl.java b/typespec-tests/src/main/java/com/cadl/literalservice/implementation/LiteralServiceClientImpl.java index b0a0178bf1..a872510809 100644 --- a/typespec-tests/src/main/java/com/cadl/literalservice/implementation/LiteralServiceClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/literalservice/implementation/LiteralServiceClientImpl.java @@ -16,12 +16,12 @@ */ public final class LiteralServiceClientImpl { /** - * Service host. + * Server parameter. */ private final String endpoint; /** - * Gets Service host. + * Gets Server parameter. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public LiteralOpsImpl getLiteralOps() { /** * Initializes an instance of LiteralServiceClient client. * - * @param endpoint Service host. + * @param endpoint Server parameter. */ public LiteralServiceClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public LiteralServiceClientImpl(String endpoint) { * Initializes an instance of LiteralServiceClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public LiteralServiceClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public LiteralServiceClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public LiteralServiceClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/longrunning/LongRunningAsyncClient.java b/typespec-tests/src/main/java/com/cadl/longrunning/LongRunningAsyncClient.java index c2759fb1a0..2149dcf05b 100644 --- a/typespec-tests/src/main/java/com/cadl/longrunning/LongRunningAsyncClient.java +++ b/typespec-tests/src/main/java/com/cadl/longrunning/LongRunningAsyncClient.java @@ -21,6 +21,7 @@ import com.cadl.longrunning.models.JobData; import com.cadl.longrunning.models.JobResult; import com.cadl.longrunning.models.JobResultResult; +import com.cadl.longrunning.models.PollResponse; import reactor.core.publisher.Mono; /** @@ -49,12 +50,12 @@ public final class LongRunningAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of long-running operation. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> longRunningWithResponse(RequestOptions requestOptions) { - return this.serviceClient.longRunningWithResponseAsync(requestOptions); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginLongRunning(RequestOptions requestOptions) { + return this.serviceClient.beginLongRunningAsync(requestOptions); } /** @@ -168,14 +169,14 @@ public PollerFlux beginCreateJob(BinaryData body, Reques * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the {@link PollerFlux} for polling of long-running operation. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono longRunning() { - // Generated convenience method for longRunningWithResponse + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginLongRunning() { + // Generated convenience method for beginLongRunningWithModel RequestOptions requestOptions = new RequestOptions(); - return longRunningWithResponse(requestOptions).flatMap(FluxUtil::toMono); + return serviceClient.beginLongRunningWithModelAsync(requestOptions); } /** diff --git a/typespec-tests/src/main/java/com/cadl/longrunning/LongRunningClient.java b/typespec-tests/src/main/java/com/cadl/longrunning/LongRunningClient.java index ffa3c6f544..7b3d921fef 100644 --- a/typespec-tests/src/main/java/com/cadl/longrunning/LongRunningClient.java +++ b/typespec-tests/src/main/java/com/cadl/longrunning/LongRunningClient.java @@ -20,6 +20,7 @@ import com.cadl.longrunning.models.JobData; import com.cadl.longrunning.models.JobResult; import com.cadl.longrunning.models.JobResultResult; +import com.cadl.longrunning.models.PollResponse; /** * Initializes a new instance of the synchronous LongRunningClient type. @@ -47,12 +48,12 @@ public final class LongRunningClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. + * @return the {@link SyncPoller} for polling of long-running operation. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response longRunningWithResponse(RequestOptions requestOptions) { - return this.serviceClient.longRunningWithResponse(requestOptions); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginLongRunning(RequestOptions requestOptions) { + return this.serviceClient.beginLongRunning(requestOptions); } /** @@ -166,13 +167,14 @@ public SyncPoller beginCreateJob(BinaryData body, Reques * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void longRunning() { - // Generated convenience method for longRunningWithResponse + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginLongRunning() { + // Generated convenience method for beginLongRunningWithModel RequestOptions requestOptions = new RequestOptions(); - longRunningWithResponse(requestOptions).getValue(); + return serviceClient.beginLongRunningWithModel(requestOptions); } /** diff --git a/typespec-tests/src/main/java/com/cadl/longrunning/models/LroOperationStatusError.java b/typespec-tests/src/main/java/com/cadl/longrunning/models/LroOperationStatusError.java deleted file mode 100644 index 6604299687..0000000000 --- a/typespec-tests/src/main/java/com/cadl/longrunning/models/LroOperationStatusError.java +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.cadl.longrunning.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.core.models.ResponseError; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * The LroOperationStatusError model. - */ -@Immutable -public final class LroOperationStatusError implements JsonSerializable { - /* - * The id property. - */ - @Generated - private String id; - - /* - * The status property. - */ - @Generated - private JobStatus status; - - /* - * The createdDateTime property. - */ - @Generated - private OffsetDateTime createdDateTime; - - /* - * The expirationDateTime property. - */ - @Generated - private OffsetDateTime expirationDateTime; - - /* - * The lastUpdateDateTime property. - */ - @Generated - private OffsetDateTime lastUpdateDateTime; - - /* - * The error property. - */ - @Generated - private ResponseError error; - - /** - * Creates an instance of LroOperationStatusError class. - */ - @Generated - private LroOperationStatusError() { - } - - /** - * Get the id property: The id property. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Get the status property: The status property. - * - * @return the status value. - */ - @Generated - public JobStatus getStatus() { - return this.status; - } - - /** - * Get the createdDateTime property: The createdDateTime property. - * - * @return the createdDateTime value. - */ - @Generated - public OffsetDateTime getCreatedDateTime() { - return this.createdDateTime; - } - - /** - * Get the expirationDateTime property: The expirationDateTime property. - * - * @return the expirationDateTime value. - */ - @Generated - public OffsetDateTime getExpirationDateTime() { - return this.expirationDateTime; - } - - /** - * Get the lastUpdateDateTime property: The lastUpdateDateTime property. - * - * @return the lastUpdateDateTime value. - */ - @Generated - public OffsetDateTime getLastUpdateDateTime() { - return this.lastUpdateDateTime; - } - - /** - * Get the error property: The error property. - * - * @return the error value. - */ - @Generated - public ResponseError getError() { - return this.error; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("error", this.error); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of LroOperationStatusError from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LroOperationStatusError if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the LroOperationStatusError. - */ - @Generated - public static LroOperationStatusError fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - LroOperationStatusError deserializedLroOperationStatusError = new LroOperationStatusError(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedLroOperationStatusError.id = reader.getString(); - } else if ("status".equals(fieldName)) { - deserializedLroOperationStatusError.status = JobStatus.fromString(reader.getString()); - } else if ("createdDateTime".equals(fieldName)) { - deserializedLroOperationStatusError.createdDateTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("expirationDateTime".equals(fieldName)) { - deserializedLroOperationStatusError.expirationDateTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("lastUpdateDateTime".equals(fieldName)) { - deserializedLroOperationStatusError.lastUpdateDateTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("error".equals(fieldName)) { - deserializedLroOperationStatusError.error = ResponseError.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedLroOperationStatusError; - }); - } -} diff --git a/typespec-tests/src/main/java/com/cadl/model/implementation/ModelClientImpl.java b/typespec-tests/src/main/java/com/cadl/model/implementation/ModelClientImpl.java index 9063724024..82b8db3db3 100644 --- a/typespec-tests/src/main/java/com/cadl/model/implementation/ModelClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/model/implementation/ModelClientImpl.java @@ -16,12 +16,12 @@ */ public final class ModelClientImpl { /** - * Service host. + * Server parameter. */ private final String endpoint; /** - * Gets Service host. + * Gets Server parameter. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public ModelOpsImpl getModelOps() { /** * Initializes an instance of ModelClient client. * - * @param endpoint Service host. + * @param endpoint Server parameter. */ public ModelClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public ModelClientImpl(String endpoint) { * Initializes an instance of ModelClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public ModelClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public ModelClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public ModelClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/model/implementation/ModelOpsImpl.java b/typespec-tests/src/main/java/com/cadl/model/implementation/ModelOpsImpl.java index a9173a6cc1..b21c38e620 100644 --- a/typespec-tests/src/main/java/com/cadl/model/implementation/ModelOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/model/implementation/ModelOpsImpl.java @@ -64,8 +64,7 @@ public interface ModelOpsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put1(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + Mono> put1(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/model/resource1") @@ -74,8 +73,7 @@ Mono> put1(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response put1Sync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + Response put1Sync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/model/resource2") @@ -84,8 +82,7 @@ Response put1Sync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put2(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + Mono> put2(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/model/resource2") @@ -94,8 +91,7 @@ Mono> put2(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response put2Sync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + Response put2Sync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/model/resource3") @@ -104,7 +100,7 @@ Response put2Sync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get3(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + Mono> get3(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/model/resource3") @@ -113,7 +109,7 @@ Mono> get3(@HostParam("endpoint") String endpoint, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response get3Sync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + Response get3Sync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/model/nested") @@ -123,8 +119,8 @@ Response get3Sync(@HostParam("endpoint") String endpoint, @HeaderPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> putNested(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Get("/model/nested") @ExpectedResponses({ 200 }) @@ -132,8 +128,7 @@ Mono> putNested(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putNestedSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + Response putNestedSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -177,10 +172,9 @@ Response putNestedSync(@HostParam("endpoint") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put1WithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.put1(this.client.getEndpoint(), contentType, accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put1(this.client.getEndpoint(), accept, body, requestOptions, context)); } /** @@ -223,9 +217,8 @@ public Mono> put1WithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response put1WithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.put1Sync(this.client.getEndpoint(), contentType, accept, body, requestOptions, Context.NONE); + return service.put1Sync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); } /** @@ -262,10 +255,9 @@ public Response put1WithResponse(BinaryData body, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put2WithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.put2(this.client.getEndpoint(), contentType, accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put2(this.client.getEndpoint(), accept, body, requestOptions, context)); } /** @@ -302,9 +294,8 @@ public Mono> put2WithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response put2WithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.put2Sync(this.client.getEndpoint(), contentType, accept, body, requestOptions, Context.NONE); + return service.put2Sync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); } /** @@ -396,10 +387,9 @@ public Response get3WithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNestedWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putNested(this.client.getEndpoint(), contentType, accept, body, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.putNested(this.client.getEndpoint(), accept, body, requestOptions, context)); } /** @@ -438,9 +428,7 @@ public Mono> putNestedWithResponseAsync(BinaryData body, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putNestedWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.putNestedSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, - Context.NONE); + return service.putNestedSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/MultiContentTypesClientImpl.java b/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/MultiContentTypesClientImpl.java index cf7ce9bb35..085ee0e108 100644 --- a/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/MultiContentTypesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/MultiContentTypesClientImpl.java @@ -42,12 +42,12 @@ public final class MultiContentTypesClientImpl { private final MultiContentTypesClientService service; /** - * Service host. + * Server parameter. */ private final String endpoint; /** - * Gets Service host. + * Gets Server parameter. * * @return the endpoint value. */ @@ -114,7 +114,7 @@ public MultipleContentTypesOnRequestsImpl getMultipleContentTypesOnRequests() { /** * Initializes an instance of MultiContentTypesClient client. * - * @param endpoint Service host. + * @param endpoint Server parameter. */ public MultiContentTypesClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -125,7 +125,7 @@ public MultiContentTypesClientImpl(String endpoint) { * Initializes an instance of MultiContentTypesClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public MultiContentTypesClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -136,7 +136,7 @@ public MultiContentTypesClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public MultiContentTypesClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { @@ -163,8 +163,8 @@ public interface MultiContentTypesClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadWithOverload(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData data, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); @Post("/upload/overload/multi-body-types") @ExpectedResponses({ 204 }) @@ -173,8 +173,8 @@ Mono> uploadWithOverload(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadWithOverloadSync(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData data, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); } /** @@ -198,8 +198,9 @@ Response uploadWithOverloadSync(@HostParam("endpoint") String endpoint, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> uploadWithOverloadWithResponseAsync(String contentType, BinaryData data, RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.uploadWithOverload(this.getEndpoint(), contentType, data, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.uploadWithOverload(this.getEndpoint(), contentType, accept, data, + requestOptions, context)); } /** @@ -223,6 +224,8 @@ public Mono> uploadWithOverloadWithResponseAsync(String contentTy @ServiceMethod(returns = ReturnType.SINGLE) public Response uploadWithOverloadWithResponse(String contentType, BinaryData data, RequestOptions requestOptions) { - return service.uploadWithOverloadSync(this.getEndpoint(), contentType, data, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.uploadWithOverloadSync(this.getEndpoint(), contentType, accept, data, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/MultipleContentTypesOnRequestsImpl.java b/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/MultipleContentTypesOnRequestsImpl.java index 71562025f5..46b7d1cc06 100644 --- a/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/MultipleContentTypesOnRequestsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/MultipleContentTypesOnRequestsImpl.java @@ -65,8 +65,8 @@ public interface MultipleContentTypesOnRequestsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadBytesWithSingleBodyTypeForMultiContentTypes(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData data, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); @Post("/multiple/sharedroute/request/upload/single-body-type") @ExpectedResponses({ 204 }) @@ -75,8 +75,8 @@ Mono> uploadBytesWithSingleBodyTypeForMultiContentTypes(@HostPara @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadBytesWithSingleBodyTypeForMultiContentTypesSync(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData data, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); @Post("/multiple/sharedroute/request/upload/multi-body-types") @ExpectedResponses({ 204 }) @@ -85,8 +85,8 @@ Response uploadBytesWithSingleBodyTypeForMultiContentTypesSync(@HostParam( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadBytesWithMultiBodyTypesForMultiContentTypes(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData data, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); @Post("/multiple/sharedroute/request/upload/multi-body-types") @ExpectedResponses({ 204 }) @@ -95,8 +95,8 @@ Mono> uploadBytesWithMultiBodyTypesForMultiContentTypes(@HostPara @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadBytesWithMultiBodyTypesForMultiContentTypesSync(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData data, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); @Post("/multiple/sharedroute/request/upload/multi-body-types") @ExpectedResponses({ 204 }) @@ -105,8 +105,8 @@ Response uploadBytesWithMultiBodyTypesForMultiContentTypesSync(@HostParam( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadJsonWithMultiBodyTypesForMultiContentTypes(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData data, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); @Post("/multiple/sharedroute/request/upload/multi-body-types") @ExpectedResponses({ 204 }) @@ -115,8 +115,8 @@ Mono> uploadJsonWithMultiBodyTypesForMultiContentTypes(@HostParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadJsonWithMultiBodyTypesForMultiContentTypesSync(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData data, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); @Post("/multiple/sharedroute/request/upload/multi-body-types") @ExpectedResponses({ 204 }) @@ -125,8 +125,9 @@ Response uploadJsonWithMultiBodyTypesForMultiContentTypesSync(@HostParam(" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadJsonOrBytesWithMultiBodyTypesForMultiContentTypes( - @HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, - @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData data, + RequestOptions requestOptions, Context context); @Post("/multiple/sharedroute/request/upload/multi-body-types") @ExpectedResponses({ 204 }) @@ -135,8 +136,9 @@ Mono> uploadJsonOrBytesWithMultiBodyTypesForMultiContentTypes( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadJsonOrBytesWithMultiBodyTypesForMultiContentTypesSync( - @HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, - @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData data, + RequestOptions requestOptions, Context context); } /** @@ -160,9 +162,10 @@ Response uploadJsonOrBytesWithMultiBodyTypesForMultiContentTypesSync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono> uploadBytesWithSingleBodyTypeForMultiContentTypesWithResponseAsync(String contentType, BinaryData data, RequestOptions requestOptions) { + final String accept = "application/json"; return FluxUtil .withContext(context -> service.uploadBytesWithSingleBodyTypeForMultiContentTypes(this.client.getEndpoint(), - contentType, data, requestOptions, context)); + contentType, accept, data, requestOptions, context)); } /** @@ -186,8 +189,9 @@ public Mono> uploadBytesWithSingleBodyTypeForMultiContentTypesWit @ServiceMethod(returns = ReturnType.SINGLE) public Response uploadBytesWithSingleBodyTypeForMultiContentTypesWithResponse(String contentType, BinaryData data, RequestOptions requestOptions) { + final String accept = "application/json"; return service.uploadBytesWithSingleBodyTypeForMultiContentTypesSync(this.client.getEndpoint(), contentType, - data, requestOptions, Context.NONE); + accept, data, requestOptions, Context.NONE); } /** @@ -211,9 +215,10 @@ public Response uploadBytesWithSingleBodyTypeForMultiContentTypesWithRespo @ServiceMethod(returns = ReturnType.SINGLE) public Mono> uploadBytesWithMultiBodyTypesForMultiContentTypesWithResponseAsync(String contentType, BinaryData data, RequestOptions requestOptions) { + final String accept = "application/json"; return FluxUtil .withContext(context -> service.uploadBytesWithMultiBodyTypesForMultiContentTypes(this.client.getEndpoint(), - contentType, data, requestOptions, context)); + contentType, accept, data, requestOptions, context)); } /** @@ -237,8 +242,9 @@ public Mono> uploadBytesWithMultiBodyTypesForMultiContentTypesWit @ServiceMethod(returns = ReturnType.SINGLE) public Response uploadBytesWithMultiBodyTypesForMultiContentTypesWithResponse(String contentType, BinaryData data, RequestOptions requestOptions) { + final String accept = "application/json"; return service.uploadBytesWithMultiBodyTypesForMultiContentTypesSync(this.client.getEndpoint(), contentType, - data, requestOptions, Context.NONE); + accept, data, requestOptions, Context.NONE); } /** @@ -264,9 +270,10 @@ public Response uploadBytesWithMultiBodyTypesForMultiContentTypesWithRespo public Mono> uploadJsonWithMultiBodyTypesForMultiContentTypesWithResponseAsync(BinaryData data, RequestOptions requestOptions) { final String contentType = "application/json"; + final String accept = "application/json"; return FluxUtil .withContext(context -> service.uploadJsonWithMultiBodyTypesForMultiContentTypes(this.client.getEndpoint(), - contentType, data, requestOptions, context)); + contentType, accept, data, requestOptions, context)); } /** @@ -292,8 +299,9 @@ public Mono> uploadJsonWithMultiBodyTypesForMultiContentTypesWith public Response uploadJsonWithMultiBodyTypesForMultiContentTypesWithResponse(BinaryData data, RequestOptions requestOptions) { final String contentType = "application/json"; + final String accept = "application/json"; return service.uploadJsonWithMultiBodyTypesForMultiContentTypesSync(this.client.getEndpoint(), contentType, - data, requestOptions, Context.NONE); + accept, data, requestOptions, Context.NONE); } /** @@ -317,8 +325,9 @@ public Response uploadJsonWithMultiBodyTypesForMultiContentTypesWithRespon @ServiceMethod(returns = ReturnType.SINGLE) public Mono> uploadJsonOrBytesWithMultiBodyTypesForMultiContentTypesWithResponseAsync( String contentType, BinaryData data, RequestOptions requestOptions) { + final String accept = "application/json"; return FluxUtil.withContext(context -> service.uploadJsonOrBytesWithMultiBodyTypesForMultiContentTypes( - this.client.getEndpoint(), contentType, data, requestOptions, context)); + this.client.getEndpoint(), contentType, accept, data, requestOptions, context)); } /** @@ -342,7 +351,8 @@ public Mono> uploadJsonOrBytesWithMultiBodyTypesForMultiContentTy @ServiceMethod(returns = ReturnType.SINGLE) public Response uploadJsonOrBytesWithMultiBodyTypesForMultiContentTypesWithResponse(String contentType, BinaryData data, RequestOptions requestOptions) { + final String accept = "application/json"; return service.uploadJsonOrBytesWithMultiBodyTypesForMultiContentTypesSync(this.client.getEndpoint(), - contentType, data, requestOptions, Context.NONE); + contentType, accept, data, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/SingleContentTypesImpl.java b/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/SingleContentTypesImpl.java index 5ed3adbc93..cb4163656d 100644 --- a/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/SingleContentTypesImpl.java +++ b/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/SingleContentTypesImpl.java @@ -66,7 +66,7 @@ public interface SingleContentTypesService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> downloadImageForSingleContentType(@HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/single/request/download/image") @ExpectedResponses({ 200 }) @@ -75,7 +75,7 @@ Mono> downloadImageForSingleContentType(@HostParam("endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response downloadImageForSingleContentTypeSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/single/request/upload/image") @ExpectedResponses({ 204 }) @@ -84,8 +84,8 @@ Response downloadImageForSingleContentTypeSync(@HostParam("endpoint" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadImageForSingleContentType(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @BodyParam("image/png") BinaryData data, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @BodyParam("image/png") BinaryData data, RequestOptions requestOptions, Context context); @Post("/single/request/upload/image") @ExpectedResponses({ 204 }) @@ -94,8 +94,8 @@ Mono> uploadImageForSingleContentType(@HostParam("endpoint") Stri @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadImageForSingleContentTypeSync(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @BodyParam("image/png") BinaryData data, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @BodyParam("image/png") BinaryData data, RequestOptions requestOptions, Context context); } /** @@ -163,8 +163,9 @@ public Response downloadImageForSingleContentTypeWithResponse(Reques public Mono> uploadImageForSingleContentTypeWithResponseAsync(BinaryData data, RequestOptions requestOptions) { final String contentType = "image/png"; + final String accept = "application/json"; return FluxUtil.withContext(context -> service.uploadImageForSingleContentType(this.client.getEndpoint(), - contentType, data, requestOptions, context)); + contentType, accept, data, requestOptions, context)); } /** @@ -186,7 +187,8 @@ public Mono> uploadImageForSingleContentTypeWithResponseAsync(Bin @ServiceMethod(returns = ReturnType.SINGLE) public Response uploadImageForSingleContentTypeWithResponse(BinaryData data, RequestOptions requestOptions) { final String contentType = "image/png"; - return service.uploadImageForSingleContentTypeSync(this.client.getEndpoint(), contentType, data, requestOptions, - Context.NONE); + final String accept = "application/json"; + return service.uploadImageForSingleContentTypeSync(this.client.getEndpoint(), contentType, accept, data, + requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/multipart/implementation/MultipartClientImpl.java b/typespec-tests/src/main/java/com/cadl/multipart/implementation/MultipartClientImpl.java index d4fa9a6181..853c9204e5 100644 --- a/typespec-tests/src/main/java/com/cadl/multipart/implementation/MultipartClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/multipart/implementation/MultipartClientImpl.java @@ -43,12 +43,12 @@ public final class MultipartClientImpl { private final MultipartClientService service; /** - * Service host. + * Server parameter. */ private final String endpoint; /** - * Gets Service host. + * Gets Server parameter. * * @return the endpoint value. */ @@ -87,7 +87,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of MultipartClient client. * - * @param endpoint Service host. + * @param endpoint Server parameter. */ public MultipartClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -98,7 +98,7 @@ public MultipartClientImpl(String endpoint) { * Initializes an instance of MultipartClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public MultipartClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -109,7 +109,7 @@ public MultipartClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public MultipartClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; @@ -133,8 +133,8 @@ public interface MultipartClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> upload(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData data, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @BodyParam("multipart/form-data") BinaryData data, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/upload/images/{name}") @@ -144,8 +144,8 @@ Mono> upload(@HostParam("endpoint") String endpoint, @PathParam(" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadSync(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData data, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @BodyParam("multipart/form-data") BinaryData data, RequestOptions requestOptions, Context context); } /** @@ -170,8 +170,9 @@ Response uploadSync(@HostParam("endpoint") String endpoint, @PathParam("na @ServiceMethod(returns = ReturnType.SINGLE) public Mono> uploadWithResponseAsync(String name, BinaryData data, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; + final String accept = "application/json"; return FluxUtil.withContext( - context -> service.upload(this.getEndpoint(), name, contentType, data, requestOptions, context)); + context -> service.upload(this.getEndpoint(), name, contentType, accept, data, requestOptions, context)); } /** @@ -196,6 +197,7 @@ public Mono> uploadWithResponseAsync(String name, BinaryData data @ServiceMethod(returns = ReturnType.SINGLE) public Response uploadWithResponse(String name, BinaryData data, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return service.uploadSync(this.getEndpoint(), name, contentType, data, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.uploadSync(this.getEndpoint(), name, contentType, accept, data, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/FirstClientImpl.java b/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/FirstClientImpl.java index 72350c4d9d..bf980a08cd 100644 --- a/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/FirstClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/FirstClientImpl.java @@ -44,12 +44,12 @@ public final class FirstClientImpl { private final FirstClientService service; /** - * Service host. + * Server parameter. */ private final String endpoint; /** - * Gets Service host. + * Gets Server parameter. * * @return the endpoint value. */ @@ -102,7 +102,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of FirstClient client. * - * @param endpoint Service host. + * @param endpoint Server parameter. * @param serviceVersion Service version. */ public FirstClientImpl(String endpoint, FirstServiceVersion serviceVersion) { @@ -114,7 +114,7 @@ public FirstClientImpl(String endpoint, FirstServiceVersion serviceVersion) { * Initializes an instance of FirstClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. + * @param endpoint Server parameter. * @param serviceVersion Service version. */ public FirstClientImpl(HttpPipeline httpPipeline, String endpoint, FirstServiceVersion serviceVersion) { @@ -126,7 +126,7 @@ public FirstClientImpl(HttpPipeline httpPipeline, String endpoint, FirstServiceV * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Service host. + * @param endpoint Server parameter. * @param serviceVersion Service version. */ public FirstClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, @@ -152,7 +152,7 @@ public interface FirstClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/client1/resources/{name}") @ExpectedResponses({ 200 }) @@ -162,7 +162,7 @@ Mono> get(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } /** diff --git a/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/NoApiVersionClientImpl.java b/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/NoApiVersionClientImpl.java index bd0eb8a1b1..12ebd54b91 100644 --- a/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/NoApiVersionClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/NoApiVersionClientImpl.java @@ -5,6 +5,7 @@ package com.cadl.multipleapiversion.implementation; import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -40,12 +41,12 @@ public final class NoApiVersionClientImpl { private final NoApiVersionClientService service; /** - * Service host. + * Server parameter. */ private final String endpoint; /** - * Gets Service host. + * Gets Server parameter. * * @return the endpoint value. */ @@ -98,7 +99,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of NoApiVersionClient client. * - * @param endpoint Service host. + * @param endpoint Server parameter. * @param serviceVersion Service version. */ public NoApiVersionClientImpl(String endpoint, NoApiVersionServiceVersion serviceVersion) { @@ -110,7 +111,7 @@ public NoApiVersionClientImpl(String endpoint, NoApiVersionServiceVersion servic * Initializes an instance of NoApiVersionClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. + * @param endpoint Server parameter. * @param serviceVersion Service version. */ public NoApiVersionClientImpl(HttpPipeline httpPipeline, String endpoint, @@ -123,7 +124,7 @@ public NoApiVersionClientImpl(HttpPipeline httpPipeline, String endpoint, * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Service host. + * @param endpoint Server parameter. * @param serviceVersion Service version. */ public NoApiVersionClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, @@ -149,8 +150,8 @@ public interface NoApiVersionClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> action(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, - Context context); + Mono> action(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Post("/client3") @ExpectedResponses({ 200 }) @@ -158,8 +159,8 @@ Mono> action(@HostParam("endpoint") String endpoint, RequestOptio @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response actionSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, - Context context); + Response actionSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); } /** @@ -181,7 +182,8 @@ Response actionSync(@HostParam("endpoint") String endpoint, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> actionWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.action(this.getEndpoint(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.action(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -203,6 +205,7 @@ public Mono> actionWithResponseAsync(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response actionWithResponse(RequestOptions requestOptions) { - return service.actionSync(this.getEndpoint(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.actionSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/SecondClientImpl.java b/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/SecondClientImpl.java index 0e29c7149b..71cbdd9fb9 100644 --- a/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/SecondClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/SecondClientImpl.java @@ -44,12 +44,12 @@ public final class SecondClientImpl { private final SecondClientService service; /** - * Service host. + * Server parameter. */ private final String endpoint; /** - * Gets Service host. + * Gets Server parameter. * * @return the endpoint value. */ @@ -102,7 +102,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of SecondClient client. * - * @param endpoint Service host. + * @param endpoint Server parameter. * @param serviceVersion Service version. */ public SecondClientImpl(String endpoint, SecondServiceVersion serviceVersion) { @@ -114,7 +114,7 @@ public SecondClientImpl(String endpoint, SecondServiceVersion serviceVersion) { * Initializes an instance of SecondClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. + * @param endpoint Server parameter. * @param serviceVersion Service version. */ public SecondClientImpl(HttpPipeline httpPipeline, String endpoint, SecondServiceVersion serviceVersion) { @@ -126,7 +126,7 @@ public SecondClientImpl(HttpPipeline httpPipeline, String endpoint, SecondServic * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Service host. + * @param endpoint Server parameter. * @param serviceVersion Service version. */ public SecondClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, @@ -152,7 +152,7 @@ public interface SecondClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/client2/resources/{name}") @ExpectedResponses({ 200 }) @@ -162,7 +162,7 @@ Mono> get(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } /** diff --git a/typespec-tests/src/main/java/com/cadl/naming/implementation/NamingClientImpl.java b/typespec-tests/src/main/java/com/cadl/naming/implementation/NamingClientImpl.java index e45bea2aea..0c0c5b717d 100644 --- a/typespec-tests/src/main/java/com/cadl/naming/implementation/NamingClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/naming/implementation/NamingClientImpl.java @@ -16,12 +16,12 @@ */ public final class NamingClientImpl { /** - * Service host. + * Server parameter. */ private final String endpoint; /** - * Gets Service host. + * Gets Server parameter. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public NamingOpsImpl getNamingOps() { /** * Initializes an instance of NamingClient client. * - * @param endpoint Service host. + * @param endpoint Server parameter. */ public NamingClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public NamingClientImpl(String endpoint) { * Initializes an instance of NamingClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public NamingClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public NamingClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public NamingClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/optional/OptionalClientBuilder.java b/typespec-tests/src/main/java/com/cadl/optional/OptionalClientBuilder.java new file mode 100644 index 0000000000..509a7e7aee --- /dev/null +++ b/typespec-tests/src/main/java/com/cadl/optional/OptionalClientBuilder.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.cadl.optional; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; +import com.azure.core.client.traits.HttpTrait; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.serializer.JacksonAdapter; +import com.cadl.optional.implementation.OptionalClientImpl; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * A builder for creating a new instance of the OptionalClient type. + */ +@ServiceClientBuilder(serviceClients = { OptionalClient.class, OptionalAsyncClient.class }) +public final class OptionalClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { + @Generated + private static final String SDK_NAME = "name"; + + @Generated + private static final String SDK_VERSION = "version"; + + @Generated + private static final Map PROPERTIES = CoreUtils.getProperties("cadl-optional.properties"); + + @Generated + private final List pipelinePolicies; + + /** + * Create an instance of the OptionalClientBuilder. + */ + @Generated + public OptionalClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated + private HttpPipeline pipeline; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public OptionalClientBuilder pipeline(HttpPipeline pipeline) { + if (this.pipeline != null && pipeline == null) { + LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured."); + } + this.pipeline = pipeline; + return this; + } + + /* + * The HTTP client used to send the request. + */ + @Generated + private HttpClient httpClient; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public OptionalClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated + private HttpLogOptions httpLogOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public OptionalClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The client options such as application ID and custom headers to set on a request. + */ + @Generated + private ClientOptions clientOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public OptionalClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /* + * The retry options to configure retry policy for failed requests. + */ + @Generated + private RetryOptions retryOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public OptionalClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public OptionalClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); + pipelinePolicies.add(customPolicy); + return this; + } + + /* + * The configuration store that is used during construction of the service client. + */ + @Generated + private Configuration configuration; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public OptionalClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public OptionalClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The retry policy that will attempt to retry failed requests, if applicable. + */ + @Generated + private RetryPolicy retryPolicy; + + /** + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. + * @return the OptionalClientBuilder. + */ + @Generated + public OptionalClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of OptionalClientImpl with the provided parameters. + * + * @return an instance of OptionalClientImpl. + */ + @Generated + private OptionalClientImpl buildInnerClient() { + this.validateClient(); + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + OptionalClientImpl client + = new OptionalClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + return client; + } + + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration + = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; + ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; + List policies = new ArrayList<>(); + String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + policies.add(new RequestIdPolicy()); + policies.add(new AddHeadersFromContextPolicy()); + HttpHeaders headers = CoreUtils.createHttpHeadersFromClientOptions(localClientOptions); + if (headers != null) { + policies.add(new AddHeadersPolicy(headers)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); + policies.add(new AddDatePolicy()); + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(localHttpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(localClientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of OptionalAsyncClient class. + * + * @return an instance of OptionalAsyncClient. + */ + @Generated + public OptionalAsyncClient buildAsyncClient() { + return new OptionalAsyncClient(buildInnerClient().getOptionalOps()); + } + + /** + * Builds an instance of OptionalClient class. + * + * @return an instance of OptionalClient. + */ + @Generated + public OptionalClient buildClient() { + return new OptionalClient(buildInnerClient().getOptionalOps()); + } + + private static final ClientLogger LOGGER = new ClientLogger(OptionalClientBuilder.class); +} diff --git a/typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalClientImpl.java b/typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalClientImpl.java new file mode 100644 index 0000000000..8eee8db184 --- /dev/null +++ b/typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalClientImpl.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.cadl.optional.implementation; + +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; + +/** + * Initializes a new instance of the OptionalClient type. + */ +public final class OptionalClientImpl { + /** + * Server parameter. + */ + private final String endpoint; + + /** + * Gets Server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + public SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The OptionalOpsImpl object to access its operations. + */ + private final OptionalOpsImpl optionalOps; + + /** + * Gets the OptionalOpsImpl object to access its operations. + * + * @return the OptionalOpsImpl object. + */ + public OptionalOpsImpl getOptionalOps() { + return this.optionalOps; + } + + /** + * Initializes an instance of OptionalClient client. + * + * @param endpoint Server parameter. + */ + public OptionalClientImpl(String endpoint) { + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); + } + + /** + * Initializes an instance of OptionalClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Server parameter. + */ + public OptionalClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); + } + + /** + * Initializes an instance of OptionalClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Server parameter. + */ + public OptionalClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; + this.optionalOps = new OptionalOpsImpl(this); + } +} diff --git a/typespec-tests/src/main/java/com/cadl/optional/implementation/package-info.java b/typespec-tests/src/main/java/com/cadl/optional/implementation/package-info.java new file mode 100644 index 0000000000..57b1a7bdaa --- /dev/null +++ b/typespec-tests/src/main/java/com/cadl/optional/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * + * Package containing the implementations for Optional. + * + */ +package com.cadl.optional.implementation; diff --git a/typespec-tests/src/main/java/com/cadl/optional/models/AllPropertiesOptional.java b/typespec-tests/src/main/java/com/cadl/optional/models/AllPropertiesOptional.java new file mode 100644 index 0000000000..b8a309e2c0 --- /dev/null +++ b/typespec-tests/src/main/java/com/cadl/optional/models/AllPropertiesOptional.java @@ -0,0 +1,462 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.cadl.optional.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * The AllPropertiesOptional model. + */ +@Immutable +public final class AllPropertiesOptional implements JsonSerializable { + /* + * The boolean property. + */ + @Generated + private Boolean booleanProperty; + + /* + * The booleanNullable property. + */ + @Generated + private Boolean booleanNullable; + + /* + * The booleanRequired property. + */ + @Generated + private Boolean booleanRequired; + + /* + * The booleanRequiredNullable property. + */ + @Generated + private Boolean booleanRequiredNullable; + + /* + * The string property. + */ + @Generated + private String string; + + /* + * The stringNullable property. + */ + @Generated + private String stringNullable; + + /* + * The stringRequired property. + */ + @Generated + private String stringRequired; + + /* + * The stringRequiredNullable property. + */ + @Generated + private String stringRequiredNullable; + + /* + * The bytes property. + */ + @Generated + private byte[] bytes; + + /* + * The int property. + */ + @Generated + private Integer intProperty; + + /* + * The long property. + */ + @Generated + private Long longProperty; + + /* + * The float property. + */ + @Generated + private Double floatProperty; + + /* + * The double property. + */ + @Generated + private Double doubleProperty; + + /* + * The duration property. + */ + @Generated + private Duration duration; + + /* + * The dateTime property. + */ + @Generated + private OffsetDateTime dateTime; + + /* + * The stringList property. + */ + @Generated + private List stringList; + + /* + * The bytesDict property. + */ + @Generated + private Map bytesDict; + + /* + * The epochDateTimeRequiredNullable property. + */ + @Generated + private Long epochDateTimeRequiredNullable; + + /* + * The epochDateTimeNullable property. + */ + @Generated + private Long epochDateTimeNullable; + + /* + * The immutable property. + */ + @Generated + private ImmutableModel immutable; + + /** + * Creates an instance of AllPropertiesOptional class. + */ + @Generated + private AllPropertiesOptional() { + } + + /** + * Get the booleanProperty property: The boolean property. + * + * @return the booleanProperty value. + */ + @Generated + public Boolean isBooleanProperty() { + return this.booleanProperty; + } + + /** + * Get the booleanNullable property: The booleanNullable property. + * + * @return the booleanNullable value. + */ + @Generated + public Boolean isBooleanNullable() { + return this.booleanNullable; + } + + /** + * Get the booleanRequired property: The booleanRequired property. + * + * @return the booleanRequired value. + */ + @Generated + public Boolean isBooleanRequired() { + return this.booleanRequired; + } + + /** + * Get the booleanRequiredNullable property: The booleanRequiredNullable property. + * + * @return the booleanRequiredNullable value. + */ + @Generated + public Boolean isBooleanRequiredNullable() { + return this.booleanRequiredNullable; + } + + /** + * Get the string property: The string property. + * + * @return the string value. + */ + @Generated + public String getString() { + return this.string; + } + + /** + * Get the stringNullable property: The stringNullable property. + * + * @return the stringNullable value. + */ + @Generated + public String getStringNullable() { + return this.stringNullable; + } + + /** + * Get the stringRequired property: The stringRequired property. + * + * @return the stringRequired value. + */ + @Generated + public String getStringRequired() { + return this.stringRequired; + } + + /** + * Get the stringRequiredNullable property: The stringRequiredNullable property. + * + * @return the stringRequiredNullable value. + */ + @Generated + public String getStringRequiredNullable() { + return this.stringRequiredNullable; + } + + /** + * Get the bytes property: The bytes property. + * + * @return the bytes value. + */ + @Generated + public byte[] getBytes() { + return CoreUtils.clone(this.bytes); + } + + /** + * Get the intProperty property: The int property. + * + * @return the intProperty value. + */ + @Generated + public Integer getIntProperty() { + return this.intProperty; + } + + /** + * Get the longProperty property: The long property. + * + * @return the longProperty value. + */ + @Generated + public Long getLongProperty() { + return this.longProperty; + } + + /** + * Get the floatProperty property: The float property. + * + * @return the floatProperty value. + */ + @Generated + public Double getFloatProperty() { + return this.floatProperty; + } + + /** + * Get the doubleProperty property: The double property. + * + * @return the doubleProperty value. + */ + @Generated + public Double getDoubleProperty() { + return this.doubleProperty; + } + + /** + * Get the duration property: The duration property. + * + * @return the duration value. + */ + @Generated + public Duration getDuration() { + return this.duration; + } + + /** + * Get the dateTime property: The dateTime property. + * + * @return the dateTime value. + */ + @Generated + public OffsetDateTime getDateTime() { + return this.dateTime; + } + + /** + * Get the stringList property: The stringList property. + * + * @return the stringList value. + */ + @Generated + public List getStringList() { + return this.stringList; + } + + /** + * Get the bytesDict property: The bytesDict property. + * + * @return the bytesDict value. + */ + @Generated + public Map getBytesDict() { + return this.bytesDict; + } + + /** + * Get the epochDateTimeRequiredNullable property: The epochDateTimeRequiredNullable property. + * + * @return the epochDateTimeRequiredNullable value. + */ + @Generated + public OffsetDateTime getEpochDateTimeRequiredNullable() { + if (this.epochDateTimeRequiredNullable == null) { + return null; + } + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.epochDateTimeRequiredNullable), ZoneOffset.UTC); + } + + /** + * Get the epochDateTimeNullable property: The epochDateTimeNullable property. + * + * @return the epochDateTimeNullable value. + */ + @Generated + public OffsetDateTime getEpochDateTimeNullable() { + if (this.epochDateTimeNullable == null) { + return null; + } + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.epochDateTimeNullable), ZoneOffset.UTC); + } + + /** + * Get the immutable property: The immutable property. + * + * @return the immutable value. + */ + @Generated + public ImmutableModel getImmutable() { + return this.immutable; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("boolean", this.booleanProperty); + jsonWriter.writeBooleanField("booleanNullable", this.booleanNullable); + jsonWriter.writeBooleanField("booleanRequired", this.booleanRequired); + jsonWriter.writeBooleanField("booleanRequiredNullable", this.booleanRequiredNullable); + jsonWriter.writeStringField("string", this.string); + jsonWriter.writeStringField("stringNullable", this.stringNullable); + jsonWriter.writeStringField("stringRequired", this.stringRequired); + jsonWriter.writeStringField("stringRequiredNullable", this.stringRequiredNullable); + jsonWriter.writeBinaryField("bytes", this.bytes); + jsonWriter.writeNumberField("int", this.intProperty); + jsonWriter.writeNumberField("long", this.longProperty); + jsonWriter.writeNumberField("float", this.floatProperty); + jsonWriter.writeNumberField("double", this.doubleProperty); + jsonWriter.writeStringField("duration", CoreUtils.durationToStringWithDays(this.duration)); + jsonWriter.writeStringField("dateTime", + this.dateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.dateTime)); + jsonWriter.writeArrayField("stringList", this.stringList, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("bytesDict", this.bytesDict, (writer, element) -> writer.writeBinary(element)); + jsonWriter.writeNumberField("epochDateTimeRequiredNullable", this.epochDateTimeRequiredNullable); + jsonWriter.writeNumberField("epochDateTimeNullable", this.epochDateTimeNullable); + jsonWriter.writeJsonField("immutable", this.immutable); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AllPropertiesOptional from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AllPropertiesOptional if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AllPropertiesOptional. + */ + @Generated + public static AllPropertiesOptional fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AllPropertiesOptional deserializedAllPropertiesOptional = new AllPropertiesOptional(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("boolean".equals(fieldName)) { + deserializedAllPropertiesOptional.booleanProperty = reader.getNullable(JsonReader::getBoolean); + } else if ("booleanNullable".equals(fieldName)) { + deserializedAllPropertiesOptional.booleanNullable = reader.getNullable(JsonReader::getBoolean); + } else if ("booleanRequired".equals(fieldName)) { + deserializedAllPropertiesOptional.booleanRequired = reader.getNullable(JsonReader::getBoolean); + } else if ("booleanRequiredNullable".equals(fieldName)) { + deserializedAllPropertiesOptional.booleanRequiredNullable + = reader.getNullable(JsonReader::getBoolean); + } else if ("string".equals(fieldName)) { + deserializedAllPropertiesOptional.string = reader.getString(); + } else if ("stringNullable".equals(fieldName)) { + deserializedAllPropertiesOptional.stringNullable = reader.getString(); + } else if ("stringRequired".equals(fieldName)) { + deserializedAllPropertiesOptional.stringRequired = reader.getString(); + } else if ("stringRequiredNullable".equals(fieldName)) { + deserializedAllPropertiesOptional.stringRequiredNullable = reader.getString(); + } else if ("bytes".equals(fieldName)) { + deserializedAllPropertiesOptional.bytes = reader.getBinary(); + } else if ("int".equals(fieldName)) { + deserializedAllPropertiesOptional.intProperty = reader.getNullable(JsonReader::getInt); + } else if ("long".equals(fieldName)) { + deserializedAllPropertiesOptional.longProperty = reader.getNullable(JsonReader::getLong); + } else if ("float".equals(fieldName)) { + deserializedAllPropertiesOptional.floatProperty = reader.getNullable(JsonReader::getDouble); + } else if ("double".equals(fieldName)) { + deserializedAllPropertiesOptional.doubleProperty = reader.getNullable(JsonReader::getDouble); + } else if ("duration".equals(fieldName)) { + deserializedAllPropertiesOptional.duration + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("dateTime".equals(fieldName)) { + deserializedAllPropertiesOptional.dateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("stringList".equals(fieldName)) { + List stringList = reader.readArray(reader1 -> reader1.getString()); + deserializedAllPropertiesOptional.stringList = stringList; + } else if ("bytesDict".equals(fieldName)) { + Map bytesDict = reader.readMap(reader1 -> reader1.getBinary()); + deserializedAllPropertiesOptional.bytesDict = bytesDict; + } else if ("epochDateTimeRequiredNullable".equals(fieldName)) { + deserializedAllPropertiesOptional.epochDateTimeRequiredNullable + = reader.getNullable(JsonReader::getLong); + } else if ("epochDateTimeNullable".equals(fieldName)) { + deserializedAllPropertiesOptional.epochDateTimeNullable = reader.getNullable(JsonReader::getLong); + } else if ("immutable".equals(fieldName)) { + deserializedAllPropertiesOptional.immutable = ImmutableModel.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAllPropertiesOptional; + }); + } +} diff --git a/typespec-tests/src/main/java/com/cadl/optional/models/ImmutableModel.java b/typespec-tests/src/main/java/com/cadl/optional/models/ImmutableModel.java new file mode 100644 index 0000000000..6494cc8957 --- /dev/null +++ b/typespec-tests/src/main/java/com/cadl/optional/models/ImmutableModel.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.cadl.optional.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ImmutableModel model. + */ +@Immutable +public final class ImmutableModel implements JsonSerializable { + /* + * The stringReadWriteRequired property. + */ + @Generated + private final String stringReadWriteRequired; + + /* + * The stringReadOnlyOptional property. + */ + @Generated + private String stringReadOnlyOptional; + + /** + * Creates an instance of ImmutableModel class. + * + * @param stringReadWriteRequired the stringReadWriteRequired value to set. + */ + @Generated + private ImmutableModel(String stringReadWriteRequired) { + this.stringReadWriteRequired = stringReadWriteRequired; + } + + /** + * Get the stringReadWriteRequired property: The stringReadWriteRequired property. + * + * @return the stringReadWriteRequired value. + */ + @Generated + public String getStringReadWriteRequired() { + return this.stringReadWriteRequired; + } + + /** + * Get the stringReadOnlyOptional property: The stringReadOnlyOptional property. + * + * @return the stringReadOnlyOptional value. + */ + @Generated + public String getStringReadOnlyOptional() { + return this.stringReadOnlyOptional; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("stringReadWriteRequired", this.stringReadWriteRequired); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImmutableModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImmutableModel if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ImmutableModel. + */ + @Generated + public static ImmutableModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String stringReadWriteRequired = null; + String stringReadOnlyOptional = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("stringReadWriteRequired".equals(fieldName)) { + stringReadWriteRequired = reader.getString(); + } else if ("stringReadOnlyOptional".equals(fieldName)) { + stringReadOnlyOptional = reader.getString(); + } else { + reader.skipChildren(); + } + } + ImmutableModel deserializedImmutableModel = new ImmutableModel(stringReadWriteRequired); + deserializedImmutableModel.stringReadOnlyOptional = stringReadOnlyOptional; + + return deserializedImmutableModel; + }); + } +} diff --git a/typespec-tests/src/main/java/com/cadl/optional/models/Optional.java b/typespec-tests/src/main/java/com/cadl/optional/models/Optional.java new file mode 100644 index 0000000000..ed01145a4c --- /dev/null +++ b/typespec-tests/src/main/java/com/cadl/optional/models/Optional.java @@ -0,0 +1,665 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.cadl.optional.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * The Optional model. + */ +@Fluent +public final class Optional implements JsonSerializable { + /* + * The boolean property. + */ + @Generated + private Boolean booleanProperty; + + /* + * The booleanNullable property. + */ + @Generated + private Boolean booleanNullable; + + /* + * The booleanRequired property. + */ + @Generated + private final boolean booleanRequired; + + /* + * The booleanRequiredNullable property. + */ + @Generated + private final Boolean booleanRequiredNullable; + + /* + * The string property. + */ + @Generated + private String string; + + /* + * The stringNullable property. + */ + @Generated + private String stringNullable; + + /* + * The stringRequired property. + */ + @Generated + private final String stringRequired; + + /* + * The stringRequiredNullable property. + */ + @Generated + private final String stringRequiredNullable; + + /* + * The bytes property. + */ + @Generated + private byte[] bytes; + + /* + * The int property. + */ + @Generated + private Integer intProperty; + + /* + * The long property. + */ + @Generated + private Long longProperty; + + /* + * The float property. + */ + @Generated + private Double floatProperty; + + /* + * The double property. + */ + @Generated + private Double doubleProperty; + + /* + * The duration property. + */ + @Generated + private Duration duration; + + /* + * The dateTime property. + */ + @Generated + private OffsetDateTime dateTime; + + /* + * The stringList property. + */ + @Generated + private List stringList; + + /* + * The bytesDict property. + */ + @Generated + private Map bytesDict; + + /* + * The epochDateTimeRequiredNullable property. + */ + @Generated + private final Long epochDateTimeRequiredNullable; + + /* + * The epochDateTimeNullable property. + */ + @Generated + private Long epochDateTimeNullable; + + /** + * Creates an instance of Optional class. + * + * @param booleanRequired the booleanRequired value to set. + * @param booleanRequiredNullable the booleanRequiredNullable value to set. + * @param stringRequired the stringRequired value to set. + * @param stringRequiredNullable the stringRequiredNullable value to set. + * @param epochDateTimeRequiredNullable the epochDateTimeRequiredNullable value to set. + */ + @Generated + public Optional(boolean booleanRequired, Boolean booleanRequiredNullable, String stringRequired, + String stringRequiredNullable, OffsetDateTime epochDateTimeRequiredNullable) { + this.booleanRequired = booleanRequired; + this.booleanRequiredNullable = booleanRequiredNullable; + this.stringRequired = stringRequired; + this.stringRequiredNullable = stringRequiredNullable; + if (epochDateTimeRequiredNullable == null) { + this.epochDateTimeRequiredNullable = null; + } else { + this.epochDateTimeRequiredNullable = epochDateTimeRequiredNullable.toEpochSecond(); + } + } + + /** + * Get the booleanProperty property: The boolean property. + * + * @return the booleanProperty value. + */ + @Generated + public Boolean isBooleanProperty() { + return this.booleanProperty; + } + + /** + * Set the booleanProperty property: The boolean property. + * + * @param booleanProperty the booleanProperty value to set. + * @return the Optional object itself. + */ + @Generated + public Optional setBooleanProperty(Boolean booleanProperty) { + this.booleanProperty = booleanProperty; + return this; + } + + /** + * Get the booleanNullable property: The booleanNullable property. + * + * @return the booleanNullable value. + */ + @Generated + public Boolean isBooleanNullable() { + return this.booleanNullable; + } + + /** + * Set the booleanNullable property: The booleanNullable property. + * + * @param booleanNullable the booleanNullable value to set. + * @return the Optional object itself. + */ + @Generated + public Optional setBooleanNullable(Boolean booleanNullable) { + this.booleanNullable = booleanNullable; + return this; + } + + /** + * Get the booleanRequired property: The booleanRequired property. + * + * @return the booleanRequired value. + */ + @Generated + public boolean isBooleanRequired() { + return this.booleanRequired; + } + + /** + * Get the booleanRequiredNullable property: The booleanRequiredNullable property. + * + * @return the booleanRequiredNullable value. + */ + @Generated + public Boolean isBooleanRequiredNullable() { + return this.booleanRequiredNullable; + } + + /** + * Get the string property: The string property. + * + * @return the string value. + */ + @Generated + public String getString() { + return this.string; + } + + /** + * Set the string property: The string property. + * + * @param string the string value to set. + * @return the Optional object itself. + */ + @Generated + public Optional setString(String string) { + this.string = string; + return this; + } + + /** + * Get the stringNullable property: The stringNullable property. + * + * @return the stringNullable value. + */ + @Generated + public String getStringNullable() { + return this.stringNullable; + } + + /** + * Set the stringNullable property: The stringNullable property. + * + * @param stringNullable the stringNullable value to set. + * @return the Optional object itself. + */ + @Generated + public Optional setStringNullable(String stringNullable) { + this.stringNullable = stringNullable; + return this; + } + + /** + * Get the stringRequired property: The stringRequired property. + * + * @return the stringRequired value. + */ + @Generated + public String getStringRequired() { + return this.stringRequired; + } + + /** + * Get the stringRequiredNullable property: The stringRequiredNullable property. + * + * @return the stringRequiredNullable value. + */ + @Generated + public String getStringRequiredNullable() { + return this.stringRequiredNullable; + } + + /** + * Get the bytes property: The bytes property. + * + * @return the bytes value. + */ + @Generated + public byte[] getBytes() { + return CoreUtils.clone(this.bytes); + } + + /** + * Set the bytes property: The bytes property. + * + * @param bytes the bytes value to set. + * @return the Optional object itself. + */ + @Generated + public Optional setBytes(byte[] bytes) { + this.bytes = CoreUtils.clone(bytes); + return this; + } + + /** + * Get the intProperty property: The int property. + * + * @return the intProperty value. + */ + @Generated + public Integer getIntProperty() { + return this.intProperty; + } + + /** + * Set the intProperty property: The int property. + * + * @param intProperty the intProperty value to set. + * @return the Optional object itself. + */ + @Generated + public Optional setIntProperty(Integer intProperty) { + this.intProperty = intProperty; + return this; + } + + /** + * Get the longProperty property: The long property. + * + * @return the longProperty value. + */ + @Generated + public Long getLongProperty() { + return this.longProperty; + } + + /** + * Set the longProperty property: The long property. + * + * @param longProperty the longProperty value to set. + * @return the Optional object itself. + */ + @Generated + public Optional setLongProperty(Long longProperty) { + this.longProperty = longProperty; + return this; + } + + /** + * Get the floatProperty property: The float property. + * + * @return the floatProperty value. + */ + @Generated + public Double getFloatProperty() { + return this.floatProperty; + } + + /** + * Set the floatProperty property: The float property. + * + * @param floatProperty the floatProperty value to set. + * @return the Optional object itself. + */ + @Generated + public Optional setFloatProperty(Double floatProperty) { + this.floatProperty = floatProperty; + return this; + } + + /** + * Get the doubleProperty property: The double property. + * + * @return the doubleProperty value. + */ + @Generated + public Double getDoubleProperty() { + return this.doubleProperty; + } + + /** + * Set the doubleProperty property: The double property. + * + * @param doubleProperty the doubleProperty value to set. + * @return the Optional object itself. + */ + @Generated + public Optional setDoubleProperty(Double doubleProperty) { + this.doubleProperty = doubleProperty; + return this; + } + + /** + * Get the duration property: The duration property. + * + * @return the duration value. + */ + @Generated + public Duration getDuration() { + return this.duration; + } + + /** + * Set the duration property: The duration property. + * + * @param duration the duration value to set. + * @return the Optional object itself. + */ + @Generated + public Optional setDuration(Duration duration) { + this.duration = duration; + return this; + } + + /** + * Get the dateTime property: The dateTime property. + * + * @return the dateTime value. + */ + @Generated + public OffsetDateTime getDateTime() { + return this.dateTime; + } + + /** + * Set the dateTime property: The dateTime property. + * + * @param dateTime the dateTime value to set. + * @return the Optional object itself. + */ + @Generated + public Optional setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get the stringList property: The stringList property. + * + * @return the stringList value. + */ + @Generated + public List getStringList() { + return this.stringList; + } + + /** + * Set the stringList property: The stringList property. + * + * @param stringList the stringList value to set. + * @return the Optional object itself. + */ + @Generated + public Optional setStringList(List stringList) { + this.stringList = stringList; + return this; + } + + /** + * Get the bytesDict property: The bytesDict property. + * + * @return the bytesDict value. + */ + @Generated + public Map getBytesDict() { + return this.bytesDict; + } + + /** + * Set the bytesDict property: The bytesDict property. + * + * @param bytesDict the bytesDict value to set. + * @return the Optional object itself. + */ + @Generated + public Optional setBytesDict(Map bytesDict) { + this.bytesDict = bytesDict; + return this; + } + + /** + * Get the epochDateTimeRequiredNullable property: The epochDateTimeRequiredNullable property. + * + * @return the epochDateTimeRequiredNullable value. + */ + @Generated + public OffsetDateTime getEpochDateTimeRequiredNullable() { + if (this.epochDateTimeRequiredNullable == null) { + return null; + } + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.epochDateTimeRequiredNullable), ZoneOffset.UTC); + } + + /** + * Get the epochDateTimeNullable property: The epochDateTimeNullable property. + * + * @return the epochDateTimeNullable value. + */ + @Generated + public OffsetDateTime getEpochDateTimeNullable() { + if (this.epochDateTimeNullable == null) { + return null; + } + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.epochDateTimeNullable), ZoneOffset.UTC); + } + + /** + * Set the epochDateTimeNullable property: The epochDateTimeNullable property. + * + * @param epochDateTimeNullable the epochDateTimeNullable value to set. + * @return the Optional object itself. + */ + @Generated + public Optional setEpochDateTimeNullable(OffsetDateTime epochDateTimeNullable) { + if (epochDateTimeNullable == null) { + this.epochDateTimeNullable = null; + } else { + this.epochDateTimeNullable = epochDateTimeNullable.toEpochSecond(); + } + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("booleanRequired", this.booleanRequired); + jsonWriter.writeBooleanField("booleanRequiredNullable", this.booleanRequiredNullable); + jsonWriter.writeStringField("stringRequired", this.stringRequired); + jsonWriter.writeStringField("stringRequiredNullable", this.stringRequiredNullable); + jsonWriter.writeNumberField("epochDateTimeRequiredNullable", this.epochDateTimeRequiredNullable); + jsonWriter.writeBooleanField("boolean", this.booleanProperty); + jsonWriter.writeBooleanField("booleanNullable", this.booleanNullable); + jsonWriter.writeStringField("string", this.string); + jsonWriter.writeStringField("stringNullable", this.stringNullable); + jsonWriter.writeBinaryField("bytes", this.bytes); + jsonWriter.writeNumberField("int", this.intProperty); + jsonWriter.writeNumberField("long", this.longProperty); + jsonWriter.writeNumberField("float", this.floatProperty); + jsonWriter.writeNumberField("double", this.doubleProperty); + jsonWriter.writeStringField("duration", CoreUtils.durationToStringWithDays(this.duration)); + jsonWriter.writeStringField("dateTime", + this.dateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.dateTime)); + jsonWriter.writeArrayField("stringList", this.stringList, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("bytesDict", this.bytesDict, (writer, element) -> writer.writeBinary(element)); + jsonWriter.writeNumberField("epochDateTimeNullable", this.epochDateTimeNullable); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Optional from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Optional if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Optional. + */ + @Generated + public static Optional fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + boolean booleanRequired = false; + Boolean booleanRequiredNullable = null; + String stringRequired = null; + String stringRequiredNullable = null; + OffsetDateTime epochDateTimeRequiredNullable = null; + Boolean booleanProperty = null; + Boolean booleanNullable = null; + String string = null; + String stringNullable = null; + byte[] bytes = null; + Integer intProperty = null; + Long longProperty = null; + Double floatProperty = null; + Double doubleProperty = null; + Duration duration = null; + OffsetDateTime dateTime = null; + List stringList = null; + Map bytesDict = null; + Long epochDateTimeNullable = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("booleanRequired".equals(fieldName)) { + booleanRequired = reader.getBoolean(); + } else if ("booleanRequiredNullable".equals(fieldName)) { + booleanRequiredNullable = reader.getNullable(JsonReader::getBoolean); + } else if ("stringRequired".equals(fieldName)) { + stringRequired = reader.getString(); + } else if ("stringRequiredNullable".equals(fieldName)) { + stringRequiredNullable = reader.getString(); + } else if ("epochDateTimeRequiredNullable".equals(fieldName)) { + Long epochDateTimeRequiredNullableHolder = reader.getNullable(JsonReader::getLong); + if (epochDateTimeRequiredNullableHolder != null) { + epochDateTimeRequiredNullable = OffsetDateTime + .ofInstant(Instant.ofEpochSecond(epochDateTimeRequiredNullableHolder), ZoneOffset.UTC); + } + } else if ("boolean".equals(fieldName)) { + booleanProperty = reader.getNullable(JsonReader::getBoolean); + } else if ("booleanNullable".equals(fieldName)) { + booleanNullable = reader.getNullable(JsonReader::getBoolean); + } else if ("string".equals(fieldName)) { + string = reader.getString(); + } else if ("stringNullable".equals(fieldName)) { + stringNullable = reader.getString(); + } else if ("bytes".equals(fieldName)) { + bytes = reader.getBinary(); + } else if ("int".equals(fieldName)) { + intProperty = reader.getNullable(JsonReader::getInt); + } else if ("long".equals(fieldName)) { + longProperty = reader.getNullable(JsonReader::getLong); + } else if ("float".equals(fieldName)) { + floatProperty = reader.getNullable(JsonReader::getDouble); + } else if ("double".equals(fieldName)) { + doubleProperty = reader.getNullable(JsonReader::getDouble); + } else if ("duration".equals(fieldName)) { + duration = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("dateTime".equals(fieldName)) { + dateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("stringList".equals(fieldName)) { + stringList = reader.readArray(reader1 -> reader1.getString()); + } else if ("bytesDict".equals(fieldName)) { + bytesDict = reader.readMap(reader1 -> reader1.getBinary()); + } else if ("epochDateTimeNullable".equals(fieldName)) { + epochDateTimeNullable = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + Optional deserializedOptional = new Optional(booleanRequired, booleanRequiredNullable, stringRequired, + stringRequiredNullable, epochDateTimeRequiredNullable); + deserializedOptional.booleanProperty = booleanProperty; + deserializedOptional.booleanNullable = booleanNullable; + deserializedOptional.string = string; + deserializedOptional.stringNullable = stringNullable; + deserializedOptional.bytes = bytes; + deserializedOptional.intProperty = intProperty; + deserializedOptional.longProperty = longProperty; + deserializedOptional.floatProperty = floatProperty; + deserializedOptional.doubleProperty = doubleProperty; + deserializedOptional.duration = duration; + deserializedOptional.dateTime = dateTime; + deserializedOptional.stringList = stringList; + deserializedOptional.bytesDict = bytesDict; + deserializedOptional.epochDateTimeNullable = epochDateTimeNullable; + + return deserializedOptional; + }); + } +} diff --git a/typespec-tests/src/main/java/com/cadl/optional/models/package-info.java b/typespec-tests/src/main/java/com/cadl/optional/models/package-info.java new file mode 100644 index 0000000000..6b32eea60d --- /dev/null +++ b/typespec-tests/src/main/java/com/cadl/optional/models/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * + * Package containing the data models for Optional. + * + */ +package com.cadl.optional.models; diff --git a/typespec-tests/src/main/java/com/cadl/optional/package-info.java b/typespec-tests/src/main/java/com/cadl/optional/package-info.java new file mode 100644 index 0000000000..928b2f6905 --- /dev/null +++ b/typespec-tests/src/main/java/com/cadl/optional/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * + * Package containing the classes for Optional. + * + */ +package com.cadl.optional; diff --git a/typespec-tests/src/main/java/com/cadl/partialupdate/implementation/PartialUpdateClientImpl.java b/typespec-tests/src/main/java/com/cadl/partialupdate/implementation/PartialUpdateClientImpl.java index b845d53aad..dec63b0243 100644 --- a/typespec-tests/src/main/java/com/cadl/partialupdate/implementation/PartialUpdateClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/partialupdate/implementation/PartialUpdateClientImpl.java @@ -41,12 +41,12 @@ public final class PartialUpdateClientImpl { private final PartialUpdateClientService service; /** - * Service host. + * Server parameter. */ private final String endpoint; /** - * Gets Service host. + * Gets Server parameter. * * @return the endpoint value. */ @@ -85,7 +85,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of PartialUpdateClient client. * - * @param endpoint Service host. + * @param endpoint Server parameter. */ public PartialUpdateClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -96,7 +96,7 @@ public PartialUpdateClientImpl(String endpoint) { * Initializes an instance of PartialUpdateClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public PartialUpdateClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -107,7 +107,7 @@ public PartialUpdateClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public PartialUpdateClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; @@ -130,7 +130,7 @@ public interface PartialUpdateClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> read(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + Mono> read(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/partialupdate") @@ -139,7 +139,7 @@ Mono> read(@HostParam("endpoint") String endpoint, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response readSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + Response readSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchClientImpl.java b/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchClientImpl.java index e6cdd0a91f..87497b2dbd 100644 --- a/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchClientImpl.java @@ -16,12 +16,12 @@ */ public final class PatchClientImpl { /** - * Service host. + * Server parameter. */ private final String endpoint; /** - * Gets Service host. + * Gets Server parameter. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public PatchesImpl getPatches() { /** * Initializes an instance of PatchClient client. * - * @param endpoint Service host. + * @param endpoint Server parameter. */ public PatchClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public PatchClientImpl(String endpoint) { * Initializes an instance of PatchClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public PatchClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public PatchClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public PatchClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchesImpl.java b/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchesImpl.java index fd130e35dc..7b306b793a 100644 --- a/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchesImpl.java +++ b/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchesImpl.java @@ -65,7 +65,7 @@ public interface PatchesService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrUpdateResource(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -76,7 +76,7 @@ Mono> createOrUpdateResource(@HostParam("endpoint") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrUpdateResourceSync(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -87,7 +87,7 @@ Response createOrUpdateResourceSync(@HostParam("endpoint") String en @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrUpdateOptionalResource(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Patch("/patch/resource/optional") @@ -97,7 +97,7 @@ Mono> createOrUpdateOptionalResource(@HostParam("endpoint") @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrUpdateOptionalResourceSync(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Patch("/patch/fish") @@ -107,7 +107,7 @@ Response createOrUpdateOptionalResourceSync(@HostParam("endpoint") S @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrUpdateFish(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData fish, RequestOptions requestOptions, Context context); @Patch("/patch/fish") @@ -117,7 +117,7 @@ Mono> createOrUpdateFish(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrUpdateFishSync(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData fish, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/cadl/protocolandconvenient/implementation/ProtocolAndConvenienceOpsImpl.java b/typespec-tests/src/main/java/com/cadl/protocolandconvenient/implementation/ProtocolAndConvenienceOpsImpl.java index 2e3b98433e..aefc9d2a6a 100644 --- a/typespec-tests/src/main/java/com/cadl/protocolandconvenient/implementation/ProtocolAndConvenienceOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/protocolandconvenient/implementation/ProtocolAndConvenienceOpsImpl.java @@ -94,8 +94,8 @@ public interface ProtocolAndConvenienceOpsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> onlyConvenient(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/protocolandconvenient/onlyConvenient") @ExpectedResponses({ 200 }) @@ -104,8 +104,8 @@ Mono> onlyConvenient(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response onlyConvenientSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/protocolandconvenient/onlyProtocol") @ExpectedResponses({ 200 }) @@ -114,8 +114,8 @@ Response onlyConvenientSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> onlyProtocol(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/protocolandconvenient/onlyProtocol") @ExpectedResponses({ 200 }) @@ -124,8 +124,8 @@ Mono> onlyProtocol(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response onlyProtocolSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/protocolandconvenient/bothConvenientAndProtocol") @ExpectedResponses({ 200 }) @@ -134,8 +134,8 @@ Response onlyProtocolSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> bothConvenientAndProtocol(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/protocolandconvenient/bothConvenientAndProtocol") @ExpectedResponses({ 200 }) @@ -144,8 +144,8 @@ Mono> bothConvenientAndProtocol(@HostParam("endpoint") Stri @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response bothConvenientAndProtocolSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/protocolandconvenient/errorSetting") @ExpectedResponses({ 200 }) @@ -154,8 +154,8 @@ Response bothConvenientAndProtocolSync(@HostParam("endpoint") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> errorSetting(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/protocolandconvenient/errorSetting") @ExpectedResponses({ 200 }) @@ -164,8 +164,8 @@ Mono> errorSetting(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response errorSettingSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/protocolandconvenient/resources/{name}") @ExpectedResponses({ 200, 201 }) @@ -175,8 +175,8 @@ Response errorSettingSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrReplace(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, + RequestOptions requestOptions, Context context); @Put("/protocolandconvenient/resources/{name}") @ExpectedResponses({ 200, 201 }) @@ -186,8 +186,8 @@ Mono> createOrReplace(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrReplaceSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, + RequestOptions requestOptions, Context context); @Get("/protocolandconvenient/resources") @ExpectedResponses({ 200 }) @@ -196,7 +196,7 @@ Response createOrReplaceSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/protocolandconvenient/resources") @@ -206,7 +206,7 @@ Mono> list(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -216,7 +216,7 @@ Response listSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -226,7 +226,7 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = tru @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } @@ -260,10 +260,9 @@ Response listNextSync(@PathParam(value = "nextLink", encoded = true) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> onlyConvenientWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.onlyConvenient(this.client.getEndpoint(), contentType, accept, - body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.onlyConvenient(this.client.getEndpoint(), accept, body, requestOptions, context)); } /** @@ -296,10 +295,8 @@ public Mono> onlyConvenientWithResponseAsync(BinaryData bod */ @ServiceMethod(returns = ReturnType.SINGLE) public Response onlyConvenientWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.onlyConvenientSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, - Context.NONE); + return service.onlyConvenientSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); } /** @@ -333,10 +330,9 @@ public Response onlyConvenientWithResponse(BinaryData body, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> onlyProtocolWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.onlyProtocol(this.client.getEndpoint(), contentType, accept, - body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.onlyProtocol(this.client.getEndpoint(), accept, body, requestOptions, context)); } /** @@ -370,10 +366,8 @@ public Mono> onlyProtocolWithResponseAsync(BinaryData body, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response onlyProtocolWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.onlyProtocolSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, - Context.NONE); + return service.onlyProtocolSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); } /** @@ -407,10 +401,9 @@ public Response onlyProtocolWithResponse(BinaryData body, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> bothConvenientAndProtocolWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.bothConvenientAndProtocol(this.client.getEndpoint(), contentType, - accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.bothConvenientAndProtocol(this.client.getEndpoint(), accept, + body, requestOptions, context)); } /** @@ -443,10 +436,9 @@ public Mono> bothConvenientAndProtocolWithResponseAsync(Bin */ @ServiceMethod(returns = ReturnType.SINGLE) public Response bothConvenientAndProtocolWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.bothConvenientAndProtocolSync(this.client.getEndpoint(), contentType, accept, body, - requestOptions, Context.NONE); + return service.bothConvenientAndProtocolSync(this.client.getEndpoint(), accept, body, requestOptions, + Context.NONE); } /** @@ -479,10 +471,9 @@ public Response bothConvenientAndProtocolWithResponse(BinaryData bod */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> errorSettingWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.errorSetting(this.client.getEndpoint(), contentType, accept, - body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.errorSetting(this.client.getEndpoint(), accept, body, requestOptions, context)); } /** @@ -515,10 +506,8 @@ public Mono> errorSettingWithResponseAsync(BinaryData body, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response errorSettingWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.errorSettingSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, - Context.NONE); + return service.errorSettingSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); } /** @@ -555,11 +544,9 @@ public Response errorSettingWithResponse(BinaryData body, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrReplaceWithResponseAsync(String name, BinaryData resource, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.createOrReplace(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - name, contentType, accept, resource, requestOptions, context)); + return FluxUtil.withContext(context -> service.createOrReplace(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), name, accept, resource, requestOptions, context)); } /** @@ -596,10 +583,9 @@ private Mono> createOrReplaceWithResponseAsync(String name, @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrReplaceWithResponse(String name, BinaryData resource, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; return service.createOrReplaceSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - name, contentType, accept, resource, requestOptions, Context.NONE); + name, accept, resource, requestOptions, Context.NONE); } /** @@ -969,8 +955,6 @@ public PagedIterable list(RequestOptions requestOptions) { } /** - * Paging operation - * * Get the next page of items. *

Response Body Schema

* @@ -1002,8 +986,6 @@ private Mono> listNextSinglePageAsync(String nextLink, } /** - * Paging operation - * * Get the next page of items. *

Response Body Schema

* diff --git a/typespec-tests/src/main/java/com/cadl/protocolandconvenient/implementation/ProtocolAndConvenientClientImpl.java b/typespec-tests/src/main/java/com/cadl/protocolandconvenient/implementation/ProtocolAndConvenientClientImpl.java index 8c75e79e39..b11dcbcb44 100644 --- a/typespec-tests/src/main/java/com/cadl/protocolandconvenient/implementation/ProtocolAndConvenientClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/protocolandconvenient/implementation/ProtocolAndConvenientClientImpl.java @@ -17,12 +17,12 @@ */ public final class ProtocolAndConvenientClientImpl { /** - * Service host. + * Server parameter. */ private final String endpoint; /** - * Gets Service host. + * Gets Server parameter. * * @return the endpoint value. */ @@ -89,7 +89,7 @@ public ProtocolAndConvenienceOpsImpl getProtocolAndConvenienceOps() { /** * Initializes an instance of ProtocolAndConvenientClient client. * - * @param endpoint Service host. + * @param endpoint Server parameter. * @param serviceVersion Service version. */ public ProtocolAndConvenientClientImpl(String endpoint, ProtocolAndConvenientServiceVersion serviceVersion) { @@ -101,7 +101,7 @@ public ProtocolAndConvenientClientImpl(String endpoint, ProtocolAndConvenientSer * Initializes an instance of ProtocolAndConvenientClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. + * @param endpoint Server parameter. * @param serviceVersion Service version. */ public ProtocolAndConvenientClientImpl(HttpPipeline httpPipeline, String endpoint, @@ -114,7 +114,7 @@ public ProtocolAndConvenientClientImpl(HttpPipeline httpPipeline, String endpoin * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Service host. + * @param endpoint Server parameter. * @param serviceVersion Service version. */ public ProtocolAndConvenientClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, diff --git a/typespec-tests/src/main/java/com/cadl/response/implementation/ResponseClientImpl.java b/typespec-tests/src/main/java/com/cadl/response/implementation/ResponseClientImpl.java index 3e618b8217..50339e8d1f 100644 --- a/typespec-tests/src/main/java/com/cadl/response/implementation/ResponseClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/response/implementation/ResponseClientImpl.java @@ -64,12 +64,12 @@ public final class ResponseClientImpl { private final ResponseClientService service; /** - * Service host. + * Server parameter. */ private final String endpoint; /** - * Gets Service host. + * Gets Server parameter. * * @return the endpoint value. */ @@ -122,7 +122,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of ResponseClient client. * - * @param endpoint Service host. + * @param endpoint Server parameter. * @param serviceVersion Service version. */ public ResponseClientImpl(String endpoint, ResponseServiceVersion serviceVersion) { @@ -134,7 +134,7 @@ public ResponseClientImpl(String endpoint, ResponseServiceVersion serviceVersion * Initializes an instance of ResponseClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. + * @param endpoint Server parameter. * @param serviceVersion Service version. */ public ResponseClientImpl(HttpPipeline httpPipeline, String endpoint, ResponseServiceVersion serviceVersion) { @@ -146,7 +146,7 @@ public ResponseClientImpl(HttpPipeline httpPipeline, String endpoint, ResponseSe * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Service host. + * @param endpoint Server parameter. * @param serviceVersion Service version. */ public ResponseClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, @@ -171,7 +171,7 @@ public interface ResponseClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getBinary(@HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/get-binary") @ExpectedResponses({ 200 }) @@ -179,7 +179,7 @@ Mono> getBinary(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getBinarySync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + Response getBinarySync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/get-array") @@ -189,7 +189,7 @@ Response getBinarySync(@HostParam("endpoint") String endpoint, @Head @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getArray(@HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/get-array") @ExpectedResponses({ 200 }) @@ -197,7 +197,7 @@ Mono> getArray(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getArraySync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + Response getArraySync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/get-another-array") @@ -207,7 +207,7 @@ Response getArraySync(@HostParam("endpoint") String endpoint, @Heade @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getAnotherArray(@HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/get-another-array") @ExpectedResponses({ 200 }) @@ -216,7 +216,7 @@ Mono> getAnotherArray(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getAnotherArraySync(@HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/response/create-with-headers") @ExpectedResponses({ 201 }) @@ -225,7 +225,7 @@ Response getAnotherArraySync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createWithHeaders(@HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/response/create-with-headers") @ExpectedResponses({ 201 }) @@ -234,7 +234,7 @@ Mono> createWithHeaders(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createWithHeadersSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Delete("/response/delete-with-headers") @ExpectedResponses({ 204 }) @@ -242,8 +242,8 @@ Response createWithHeadersSync(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteWithHeaders(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, - Context context); + Mono> deleteWithHeaders(@HostParam("endpoint") String endpoint, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Delete("/response/delete-with-headers") @ExpectedResponses({ 204 }) @@ -251,8 +251,8 @@ Mono> deleteWithHeaders(@HostParam("endpoint") String endpoint, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteWithHeadersSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, - Context context); + Response deleteWithHeadersSync(@HostParam("endpoint") String endpoint, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Head("/response/exists") @ExpectedResponses({ 200, 404 }) @@ -260,7 +260,7 @@ Response deleteWithHeadersSync(@HostParam("endpoint") String endpoint, Req @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> exists(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Head("/response/exists") @@ -269,7 +269,7 @@ Mono> exists(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response existsSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/response/lro-invalid-poll-response") @@ -279,9 +279,8 @@ Response existsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> lroInvalidPollResponse(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData request, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); @Post("/response/lro-invalid-poll-response") @ExpectedResponses({ 202 }) @@ -290,9 +289,8 @@ Mono> lroInvalidPollResponse(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response lroInvalidPollResponseSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData request, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); @Post("/response/lro-invalid-result") @ExpectedResponses({ 202 }) @@ -301,9 +299,8 @@ Response lroInvalidPollResponseSync(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> lroInvalidResult(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData request, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); @Post("/response/lro-invalid-result") @ExpectedResponses({ 202 }) @@ -312,9 +309,8 @@ Mono> lroInvalidResult(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response lroInvalidResultSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData request, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); @Get("/response/paged-string") @ExpectedResponses({ 200 }) @@ -323,7 +319,7 @@ Response lroInvalidResultSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listStrings(@HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/paged-string") @ExpectedResponses({ 200 }) @@ -332,7 +328,7 @@ Mono> listStrings(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listStringsSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/paged-int32") @ExpectedResponses({ 200 }) @@ -341,7 +337,7 @@ Response listStringsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listIntegers(@HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/paged-int32") @ExpectedResponses({ 200 }) @@ -350,7 +346,7 @@ Mono> listIntegers(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listIntegersSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -359,7 +355,7 @@ Response listIntegersSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listStringsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -369,7 +365,7 @@ Mono> listStringsNext(@PathParam(value = "nextLink", encode @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listStringsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -379,7 +375,7 @@ Response listStringsNextSync(@PathParam(value = "nextLink", encoded @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listIntegersNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -389,7 +385,7 @@ Mono> listIntegersNext(@PathParam(value = "nextLink", encod @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listIntegersNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } @@ -613,7 +609,9 @@ public Response createWithHeadersWithResponse(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteWithHeadersWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.deleteWithHeaders(this.getEndpoint(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.deleteWithHeaders(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -628,7 +626,8 @@ public Mono> deleteWithHeadersWithResponseAsync(RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithHeadersWithResponse(RequestOptions requestOptions) { - return service.deleteWithHeadersSync(this.getEndpoint(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.deleteWithHeadersSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -697,10 +696,9 @@ public Response existsWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> lroInvalidPollResponseWithResponseAsync(BinaryData request, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.lroInvalidPollResponse(this.getEndpoint(), - this.getServiceVersion().getVersion(), contentType, accept, request, requestOptions, context)); + this.getServiceVersion().getVersion(), accept, request, requestOptions, context)); } /** @@ -726,10 +724,9 @@ private Mono> lroInvalidPollResponseWithResponseAsync(BinaryData */ @ServiceMethod(returns = ReturnType.SINGLE) private Response lroInvalidPollResponseWithResponse(BinaryData request, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.lroInvalidPollResponseSync(this.getEndpoint(), this.getServiceVersion().getVersion(), - contentType, accept, request, requestOptions, Context.NONE); + return service.lroInvalidPollResponseSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + request, requestOptions, Context.NONE); } /** @@ -903,10 +900,9 @@ public SyncPoller beginLroInvalidPollResponseWithMo */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> lroInvalidResultWithResponseAsync(BinaryData request, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.lroInvalidResult(this.getEndpoint(), - this.getServiceVersion().getVersion(), contentType, accept, request, requestOptions, context)); + this.getServiceVersion().getVersion(), accept, request, requestOptions, context)); } /** @@ -932,10 +928,9 @@ private Mono> lroInvalidResultWithResponseAsync(BinaryData reques */ @ServiceMethod(returns = ReturnType.SINGLE) private Response lroInvalidResultWithResponse(BinaryData request, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.lroInvalidResultSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, - accept, request, requestOptions, Context.NONE); + return service.lroInvalidResultSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, request, + requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/cadl/server/ContosoClientBuilder.java b/typespec-tests/src/main/java/com/cadl/server/ContosoClientBuilder.java index 09b7853e68..6df345a264 100644 --- a/typespec-tests/src/main/java/com/cadl/server/ContosoClientBuilder.java +++ b/typespec-tests/src/main/java/com/cadl/server/ContosoClientBuilder.java @@ -189,24 +189,6 @@ public ContosoClientBuilder endpoint(String endpoint) { return this; } - /* - * Api Version - */ - @Generated - private String apiVersion; - - /** - * Sets Api Version. - * - * @param apiVersion the apiVersion value. - * @return the ContosoClientBuilder. - */ - @Generated - public ContosoClientBuilder apiVersion(String apiVersion) { - this.apiVersion = apiVersion; - return this; - } - /* * Service version */ @@ -255,7 +237,7 @@ private ContosoClientImpl buildInnerClient() { ContosoServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : ContosoServiceVersion.getLatest(); ContosoClientImpl client = new ContosoClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), - this.endpoint, this.apiVersion, localServiceVersion); + this.endpoint, localServiceVersion); return client; } @@ -264,7 +246,6 @@ private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); - Objects.requireNonNull(apiVersion, "'apiVersion' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/cadl/server/HttpbinClientBuilder.java b/typespec-tests/src/main/java/com/cadl/server/HttpbinClientBuilder.java index 944dd98a8c..dadfb38252 100644 --- a/typespec-tests/src/main/java/com/cadl/server/HttpbinClientBuilder.java +++ b/typespec-tests/src/main/java/com/cadl/server/HttpbinClientBuilder.java @@ -264,7 +264,6 @@ private void validateClient() { // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(domain, "'domain' cannot be null."); Objects.requireNonNull(tld, "'tld' cannot be null."); - Objects.requireNonNull(relativePath, "'relativePath' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/cadl/server/implementation/ContosoClientImpl.java b/typespec-tests/src/main/java/com/cadl/server/implementation/ContosoClientImpl.java index 4bc0c43910..ef7a6aa8f1 100644 --- a/typespec-tests/src/main/java/com/cadl/server/implementation/ContosoClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/server/implementation/ContosoClientImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; @@ -54,20 +55,6 @@ public String getEndpoint() { return this.endpoint; } - /** - * Api Version. - */ - private final String apiVersion; - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - /** * Service version. */ @@ -114,12 +101,11 @@ public SerializerAdapter getSerializerAdapter() { * Initializes an instance of ContosoClient client. * * @param endpoint Service endpoint. - * @param apiVersion Api Version. * @param serviceVersion Service version. */ - public ContosoClientImpl(String endpoint, String apiVersion, ContosoServiceVersion serviceVersion) { + public ContosoClientImpl(String endpoint, ContosoServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion, serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** @@ -127,12 +113,10 @@ public ContosoClientImpl(String endpoint, String apiVersion, ContosoServiceVersi * * @param httpPipeline The HTTP pipeline to send requests through. * @param endpoint Service endpoint. - * @param apiVersion Api Version. * @param serviceVersion Service version. */ - public ContosoClientImpl(HttpPipeline httpPipeline, String endpoint, String apiVersion, - ContosoServiceVersion serviceVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion, serviceVersion); + public ContosoClientImpl(HttpPipeline httpPipeline, String endpoint, ContosoServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** @@ -141,15 +125,13 @@ public ContosoClientImpl(HttpPipeline httpPipeline, String endpoint, String apiV * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param endpoint Service endpoint. - * @param apiVersion Api Version. * @param serviceVersion Service version. */ public ContosoClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - String apiVersion, ContosoServiceVersion serviceVersion) { + ContosoServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; - this.apiVersion = apiVersion; this.serviceVersion = serviceVersion; this.service = RestProxy.create(ContosoClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -167,7 +149,8 @@ public interface ContosoClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> get(@HostParam("Endpoint") String endpoint, @HostParam("ApiVersion") String apiVersion, - @PathParam(value = "group", encoded = true) String group, RequestOptions requestOptions, Context context); + @PathParam(value = "group", encoded = true) String group, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/contoso/{group}") @ExpectedResponses({ 200, 204 }) @@ -176,7 +159,8 @@ Mono> get(@HostParam("Endpoint") String endpoint, @HostParam("Api @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSync(@HostParam("Endpoint") String endpoint, @HostParam("ApiVersion") String apiVersion, - @PathParam(value = "group", encoded = true) String group, RequestOptions requestOptions, Context context); + @PathParam(value = "group", encoded = true) String group, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); } /** @@ -192,8 +176,9 @@ Response getSync(@HostParam("Endpoint") String endpoint, @HostParam("ApiVe */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(String group, RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.get(this.getEndpoint(), this.getApiVersion(), group, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.get(this.getEndpoint(), this.getServiceVersion().getVersion(), + group, accept, requestOptions, context)); } /** @@ -209,6 +194,8 @@ public Mono> getWithResponseAsync(String group, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String group, RequestOptions requestOptions) { - return service.getSync(this.getEndpoint(), this.getApiVersion(), group, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.getSync(this.getEndpoint(), this.getServiceVersion().getVersion(), group, accept, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/server/implementation/HttpbinClientImpl.java b/typespec-tests/src/main/java/com/cadl/server/implementation/HttpbinClientImpl.java index 20c3a71dc2..95fc0c5668 100644 --- a/typespec-tests/src/main/java/com/cadl/server/implementation/HttpbinClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/server/implementation/HttpbinClientImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; @@ -165,8 +166,8 @@ public interface HttpbinClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> status(@HostParam("domain") String domain, @HostParam("tld") String tld, - @HostParam("relative-path") String relativePath, @PathParam("code") int code, RequestOptions requestOptions, - Context context); + @HostParam("relative-path") String relativePath, @PathParam("code") int code, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/status/{code}") @ExpectedResponses({ 200, 204 }) @@ -175,8 +176,8 @@ Mono> status(@HostParam("domain") String domain, @HostParam("tld" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response statusSync(@HostParam("domain") String domain, @HostParam("tld") String tld, - @HostParam("relative-path") String relativePath, @PathParam("code") int code, RequestOptions requestOptions, - Context context); + @HostParam("relative-path") String relativePath, @PathParam("code") int code, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -192,8 +193,9 @@ Response statusSync(@HostParam("domain") String domain, @HostParam("tld") */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> statusWithResponseAsync(int code, RequestOptions requestOptions) { + final String accept = "application/json"; return FluxUtil.withContext(context -> service.status(this.getDomain(), this.getTld(), this.getRelativePath(), - code, requestOptions, context)); + code, accept, requestOptions, context)); } /** @@ -209,7 +211,8 @@ public Mono> statusWithResponseAsync(int code, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Response statusWithResponse(int code, RequestOptions requestOptions) { - return service.statusSync(this.getDomain(), this.getTld(), this.getRelativePath(), code, requestOptions, + final String accept = "application/json"; + return service.statusSync(this.getDomain(), this.getTld(), this.getRelativePath(), code, accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/specialchars/implementation/BuiltinOpsImpl.java b/typespec-tests/src/main/java/com/cadl/specialchars/implementation/BuiltinOpsImpl.java index 95933ed802..5392d88b0a 100644 --- a/typespec-tests/src/main/java/com/cadl/specialchars/implementation/BuiltinOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/specialchars/implementation/BuiltinOpsImpl.java @@ -64,8 +64,7 @@ public interface BuiltinOpsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> read(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + Mono> read(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData readRequest, RequestOptions requestOptions, Context context); @Post("/specialchars") @@ -74,8 +73,7 @@ Mono> read(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response readSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + Response readSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData readRequest, RequestOptions requestOptions, Context context); } @@ -111,10 +109,9 @@ Response readSync(@HostParam("endpoint") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> readWithResponseAsync(BinaryData readRequest, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.read(this.client.getEndpoint(), contentType, accept, readRequest, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.read(this.client.getEndpoint(), accept, readRequest, requestOptions, context)); } /** @@ -149,9 +146,7 @@ public Mono> readWithResponseAsync(BinaryData readRequest, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response readWithResponse(BinaryData readRequest, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.readSync(this.client.getEndpoint(), contentType, accept, readRequest, requestOptions, - Context.NONE); + return service.readSync(this.client.getEndpoint(), accept, readRequest, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/specialchars/implementation/SpecialCharsClientImpl.java b/typespec-tests/src/main/java/com/cadl/specialchars/implementation/SpecialCharsClientImpl.java index a451aefaac..156eeb1699 100644 --- a/typespec-tests/src/main/java/com/cadl/specialchars/implementation/SpecialCharsClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/specialchars/implementation/SpecialCharsClientImpl.java @@ -16,12 +16,12 @@ */ public final class SpecialCharsClientImpl { /** - * Service host. + * Server parameter. */ private final String endpoint; /** - * Gets Service host. + * Gets Server parameter. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public BuiltinOpsImpl getBuiltinOps() { /** * Initializes an instance of SpecialCharsClient client. * - * @param endpoint Service host. + * @param endpoint Server parameter. */ public SpecialCharsClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public SpecialCharsClientImpl(String endpoint) { * Initializes an instance of SpecialCharsClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public SpecialCharsClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public SpecialCharsClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public SpecialCharsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersImpl.java b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersImpl.java index 18b60b8531..c3b31aafc6 100644 --- a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersImpl.java +++ b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersImpl.java @@ -87,8 +87,8 @@ public interface EtagHeadersService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> putWithRequestHeaders(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, + RequestOptions requestOptions, Context context); @Put("/etag-headers/resources/{name}") @ExpectedResponses({ 200, 201 }) @@ -98,8 +98,8 @@ Mono> putWithRequestHeaders(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(HttpResponseException.class) Response putWithRequestHeadersSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, + RequestOptions requestOptions, Context context); @Patch("/etag-headers/resources/{name}") @ExpectedResponses({ 200, 201 }) @@ -109,7 +109,7 @@ Response putWithRequestHeadersSync(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchWithMatchHeaders(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -121,7 +121,7 @@ Mono> patchWithMatchHeaders(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchWithMatchHeadersSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -132,7 +132,7 @@ Response patchWithMatchHeadersSync(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithEtag(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/etag-headers/resources") @@ -142,7 +142,7 @@ Mono> listWithEtag(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithEtagSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -152,7 +152,7 @@ Response listWithEtagSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithEtagNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -162,7 +162,7 @@ Mono> listWithEtagNext(@PathParam(value = "nextLink", encod @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithEtagNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } @@ -216,11 +216,9 @@ Response listWithEtagNextSync(@PathParam(value = "nextLink", encoded @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithRequestHeadersWithResponseAsync(String name, BinaryData resource, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.putWithRequestHeaders(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), name, contentType, accept, resource, requestOptions, - context)); + this.client.getServiceVersion().getVersion(), name, accept, resource, requestOptions, context)); } /** @@ -273,11 +271,9 @@ public Mono> putWithRequestHeadersWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithRequestHeadersWithResponse(String name, BinaryData resource, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; return service.putWithRequestHeadersSync(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), name, contentType, accept, resource, requestOptions, - Context.NONE); + this.client.getServiceVersion().getVersion(), name, accept, resource, requestOptions, Context.NONE); } /** @@ -505,8 +501,6 @@ public PagedIterable listWithEtag(RequestOptions requestOptions) { } /** - * Resource list operation template. - * * Get the next page of items. *

Response Body Schema

* @@ -539,8 +533,6 @@ private Mono> listWithEtagNextSinglePageAsync(String n } /** - * Resource list operation template. - * * Get the next page of items. *

Response Body Schema

* diff --git a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersOptionalBodiesImpl.java b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersOptionalBodiesImpl.java index 00ba46cf14..eb05187da8 100644 --- a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersOptionalBodiesImpl.java +++ b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersOptionalBodiesImpl.java @@ -76,8 +76,8 @@ public interface EtagHeadersOptionalBodiesService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> putWithOptionalBody(@HostParam("endpoint") String endpoint, - @QueryParam("format") String format, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("format") String format, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Put("/etag-headers-optional-body") @ExpectedResponses({ 200 }) @@ -86,8 +86,8 @@ Mono> putWithOptionalBody(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response putWithOptionalBodySync(@HostParam("endpoint") String endpoint, - @QueryParam("format") String format, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("format") String format, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); } /** @@ -149,7 +149,6 @@ Response putWithOptionalBodySync(@HostParam("endpoint") String endpo @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithOptionalBodyWithResponseAsync(String format, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { @@ -157,8 +156,8 @@ public Mono> putWithOptionalBodyWithResponseAsync(String fo requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); } }); - return FluxUtil.withContext(context -> service.putWithOptionalBody(this.client.getEndpoint(), format, - contentType, accept, requestOptionsLocal, context)); + return FluxUtil.withContext(context -> service.putWithOptionalBody(this.client.getEndpoint(), format, accept, + requestOptionsLocal, context)); } /** @@ -219,7 +218,6 @@ public Mono> putWithOptionalBodyWithResponseAsync(String fo */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithOptionalBodyWithResponse(String format, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { @@ -227,7 +225,7 @@ public Response putWithOptionalBodyWithResponse(String format, Reque requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); } }); - return service.putWithOptionalBodySync(this.client.getEndpoint(), format, contentType, accept, - requestOptionsLocal, Context.NONE); + return service.putWithOptionalBodySync(this.client.getEndpoint(), format, accept, requestOptionsLocal, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/RepeatabilityHeadersImpl.java b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/RepeatabilityHeadersImpl.java index 269349dec9..8f526691ca 100644 --- a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/RepeatabilityHeadersImpl.java +++ b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/RepeatabilityHeadersImpl.java @@ -92,7 +92,7 @@ public interface RepeatabilityHeadersService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/repeatability-headers/resources/{name}") @ExpectedResponses({ 200 }) @@ -102,7 +102,7 @@ Mono> get(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/repeatability-headers/resources/{name}") @ExpectedResponses({ 200, 201 }) @@ -112,8 +112,8 @@ Response getSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> put(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, + RequestOptions requestOptions, Context context); @Put("/repeatability-headers/resources/{name}") @ExpectedResponses({ 200, 201 }) @@ -123,8 +123,8 @@ Mono> put(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response putSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, + RequestOptions requestOptions, Context context); @Post("/repeatability-headers/resources/{name}:post") @ExpectedResponses({ 200 }) @@ -134,7 +134,7 @@ Response putSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> post(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/repeatability-headers/resources/{name}:post") @ExpectedResponses({ 200 }) @@ -144,7 +144,7 @@ Mono> post(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response postSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Patch("/repeatability-headers/resources/{name}") @ExpectedResponses({ 200, 201 }) @@ -154,7 +154,7 @@ Response postSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createLro(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -166,7 +166,7 @@ Mono> createLro(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response createLroSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); } @@ -272,7 +272,6 @@ public Response getWithResponse(String name, RequestOptions requestO @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(String name, BinaryData resource, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; String repeatabilityRequestId = CoreUtils.randomUuid().toString(); @@ -289,9 +288,8 @@ public Mono> putWithResponseAsync(String name, BinaryData r .set(HttpHeaderName.fromString("repeatability-first-sent"), repeatabilityFirstSent); } }); - return FluxUtil - .withContext(context -> service.put(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - name, contentType, accept, resource, requestOptionsLocal, context)); + return FluxUtil.withContext(context -> service.put(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), name, accept, resource, requestOptionsLocal, context)); } /** @@ -338,7 +336,6 @@ public Mono> putWithResponseAsync(String name, BinaryData r */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(String name, BinaryData resource, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; String repeatabilityRequestId = CoreUtils.randomUuid().toString(); @@ -355,8 +352,8 @@ public Response putWithResponse(String name, BinaryData resource, Re .set(HttpHeaderName.fromString("repeatability-first-sent"), repeatabilityFirstSent); } }); - return service.putSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), name, - contentType, accept, resource, requestOptionsLocal, Context.NONE); + return service.putSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), name, accept, + resource, requestOptionsLocal, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/SkipSpecialHeadersImpl.java b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/SkipSpecialHeadersImpl.java index 0903fb3eeb..fe882ab8ec 100644 --- a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/SkipSpecialHeadersImpl.java +++ b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/SkipSpecialHeadersImpl.java @@ -76,7 +76,7 @@ public interface SkipSpecialHeadersService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteWithSpecialHeaders(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("foo") String foo, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + @HeaderParam("foo") String foo, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Delete("/skip-special-headers/resources/{name}") @@ -87,7 +87,7 @@ Mono> deleteWithSpecialHeaders(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteWithSpecialHeadersSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("foo") String foo, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + @HeaderParam("foo") String foo, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/SpecialHeadersClientImpl.java b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/SpecialHeadersClientImpl.java index fd88cb4588..55e36167c3 100644 --- a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/SpecialHeadersClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/SpecialHeadersClientImpl.java @@ -17,12 +17,12 @@ */ public final class SpecialHeadersClientImpl { /** - * Service host. + * Server parameter. */ private final String endpoint; /** - * Gets Service host. + * Gets Server parameter. * * @return the endpoint value. */ @@ -131,7 +131,7 @@ public SkipSpecialHeadersImpl getSkipSpecialHeaders() { /** * Initializes an instance of SpecialHeadersClient client. * - * @param endpoint Service host. + * @param endpoint Server parameter. * @param serviceVersion Service version. */ public SpecialHeadersClientImpl(String endpoint, SpecialHeadersServiceVersion serviceVersion) { @@ -143,7 +143,7 @@ public SpecialHeadersClientImpl(String endpoint, SpecialHeadersServiceVersion se * Initializes an instance of SpecialHeadersClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. + * @param endpoint Server parameter. * @param serviceVersion Service version. */ public SpecialHeadersClientImpl(HttpPipeline httpPipeline, String endpoint, @@ -156,7 +156,7 @@ public SpecialHeadersClientImpl(HttpPipeline httpPipeline, String endpoint, * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Service host. + * @param endpoint Server parameter. * @param serviceVersion Service version. */ public SpecialHeadersClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, diff --git a/typespec-tests/src/main/java/com/cadl/union/UnionAsyncClient.java b/typespec-tests/src/main/java/com/cadl/union/UnionAsyncClient.java index cf6c83781e..a9f2954204 100644 --- a/typespec-tests/src/main/java/com/cadl/union/UnionAsyncClient.java +++ b/typespec-tests/src/main/java/com/cadl/union/UnionAsyncClient.java @@ -58,7 +58,7 @@ public final class UnionAsyncClient { * } * * @param id The id parameter. - * @param sendRequest The sendRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -68,8 +68,8 @@ public final class UnionAsyncClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendWithResponse(String id, BinaryData sendRequest, RequestOptions requestOptions) { - return this.serviceClient.sendWithResponseAsync(id, sendRequest, requestOptions); + public Mono> sendWithResponse(String id, BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.sendWithResponseAsync(id, request, requestOptions); } /** @@ -97,7 +97,7 @@ public Mono> sendWithResponse(String id, BinaryData sendRequest, * } * * @param id The id parameter. - * @param sendLongRequest The sendLongRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -107,9 +107,8 @@ public Mono> sendWithResponse(String id, BinaryData sendRequest, */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendLongWithResponse(String id, BinaryData sendLongRequest, - RequestOptions requestOptions) { - return this.serviceClient.sendLongWithResponseAsync(id, sendLongRequest, requestOptions); + public Mono> sendLongWithResponse(String id, BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.sendLongWithResponseAsync(id, request, requestOptions); } /** @@ -191,9 +190,9 @@ public PollerFlux beginGenerate(RequestOptions requestOp public Mono send(String id, BinaryData input, User user) { // Generated convenience method for sendWithResponse RequestOptions requestOptions = new RequestOptions(); - SendRequest sendRequestObj = new SendRequest(input).setUser(user); - BinaryData sendRequest = BinaryData.fromObject(sendRequestObj); - return sendWithResponse(id, sendRequest, requestOptions).flatMap(FluxUtil::toMono); + SendRequest requestObj = new SendRequest(input).setUser(user); + BinaryData request = BinaryData.fromObject(requestObj); + return sendWithResponse(id, request, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -214,9 +213,9 @@ public Mono send(String id, BinaryData input, User user) { public Mono send(String id, BinaryData input) { // Generated convenience method for sendWithResponse RequestOptions requestOptions = new RequestOptions(); - SendRequest sendRequestObj = new SendRequest(input); - BinaryData sendRequest = BinaryData.fromObject(sendRequestObj); - return sendWithResponse(id, sendRequest, requestOptions).flatMap(FluxUtil::toMono); + SendRequest requestObj = new SendRequest(input); + BinaryData request = BinaryData.fromObject(requestObj); + return sendWithResponse(id, request, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -238,16 +237,16 @@ public Mono sendLong(SendLongOptions options) { RequestOptions requestOptions = new RequestOptions(); String id = options.getId(); String filter = options.getFilter(); - SendLongRequest sendLongRequestObj + SendLongRequest requestObj = new SendLongRequest(options.getInput(), options.getDataInt()).setUser(options.getUser()) .setDataUnion(options.getDataUnion()) .setDataLong(options.getDataLong()) .setDataFloat(options.getDataFloat()); - BinaryData sendLongRequest = BinaryData.fromObject(sendLongRequestObj); + BinaryData request = BinaryData.fromObject(requestObj); if (filter != null) { requestOptions.addQueryParam("filter", filter, false); } - return sendLongWithResponse(id, sendLongRequest, requestOptions).flatMap(FluxUtil::toMono); + return sendLongWithResponse(id, request, requestOptions).flatMap(FluxUtil::toMono); } /** diff --git a/typespec-tests/src/main/java/com/cadl/union/UnionClient.java b/typespec-tests/src/main/java/com/cadl/union/UnionClient.java index ed19ddb792..98f1039c4e 100644 --- a/typespec-tests/src/main/java/com/cadl/union/UnionClient.java +++ b/typespec-tests/src/main/java/com/cadl/union/UnionClient.java @@ -56,7 +56,7 @@ public final class UnionClient { * } * * @param id The id parameter. - * @param sendRequest The sendRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -66,8 +66,8 @@ public final class UnionClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendWithResponse(String id, BinaryData sendRequest, RequestOptions requestOptions) { - return this.serviceClient.sendWithResponse(id, sendRequest, requestOptions); + public Response sendWithResponse(String id, BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.sendWithResponse(id, request, requestOptions); } /** @@ -95,7 +95,7 @@ public Response sendWithResponse(String id, BinaryData sendRequest, Reques * } * * @param id The id parameter. - * @param sendLongRequest The sendLongRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -105,8 +105,8 @@ public Response sendWithResponse(String id, BinaryData sendRequest, Reques */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendLongWithResponse(String id, BinaryData sendLongRequest, RequestOptions requestOptions) { - return this.serviceClient.sendLongWithResponse(id, sendLongRequest, requestOptions); + public Response sendLongWithResponse(String id, BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.sendLongWithResponse(id, request, requestOptions); } /** @@ -187,9 +187,9 @@ public SyncPoller beginGenerate(RequestOptions requestOp public void send(String id, BinaryData input, User user) { // Generated convenience method for sendWithResponse RequestOptions requestOptions = new RequestOptions(); - SendRequest sendRequestObj = new SendRequest(input).setUser(user); - BinaryData sendRequest = BinaryData.fromObject(sendRequestObj); - sendWithResponse(id, sendRequest, requestOptions).getValue(); + SendRequest requestObj = new SendRequest(input).setUser(user); + BinaryData request = BinaryData.fromObject(requestObj); + sendWithResponse(id, request, requestOptions).getValue(); } /** @@ -209,9 +209,9 @@ public void send(String id, BinaryData input, User user) { public void send(String id, BinaryData input) { // Generated convenience method for sendWithResponse RequestOptions requestOptions = new RequestOptions(); - SendRequest sendRequestObj = new SendRequest(input); - BinaryData sendRequest = BinaryData.fromObject(sendRequestObj); - sendWithResponse(id, sendRequest, requestOptions).getValue(); + SendRequest requestObj = new SendRequest(input); + BinaryData request = BinaryData.fromObject(requestObj); + sendWithResponse(id, request, requestOptions).getValue(); } /** @@ -232,16 +232,16 @@ public void sendLong(SendLongOptions options) { RequestOptions requestOptions = new RequestOptions(); String id = options.getId(); String filter = options.getFilter(); - SendLongRequest sendLongRequestObj + SendLongRequest requestObj = new SendLongRequest(options.getInput(), options.getDataInt()).setUser(options.getUser()) .setDataUnion(options.getDataUnion()) .setDataLong(options.getDataLong()) .setDataFloat(options.getDataFloat()); - BinaryData sendLongRequest = BinaryData.fromObject(sendLongRequestObj); + BinaryData request = BinaryData.fromObject(requestObj); if (filter != null) { requestOptions.addQueryParam("filter", filter, false); } - sendLongWithResponse(id, sendLongRequest, requestOptions).getValue(); + sendLongWithResponse(id, request, requestOptions).getValue(); } /** diff --git a/typespec-tests/src/main/java/com/cadl/union/implementation/UnionClientImpl.java b/typespec-tests/src/main/java/com/cadl/union/implementation/UnionClientImpl.java index c2598deaec..240291b036 100644 --- a/typespec-tests/src/main/java/com/cadl/union/implementation/UnionClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/union/implementation/UnionClientImpl.java @@ -17,12 +17,11 @@ */ public final class UnionClientImpl { /** - * Union. */ private final String endpoint; /** - * Gets Union. + * Gets. * * @return the endpoint value. */ @@ -89,7 +88,7 @@ public UnionFlattenOpsImpl getUnionFlattenOps() { /** * Initializes an instance of UnionClient client. * - * @param endpoint Union. + * @param endpoint * @param serviceVersion Service version. */ public UnionClientImpl(String endpoint, UnionServiceVersion serviceVersion) { @@ -101,7 +100,7 @@ public UnionClientImpl(String endpoint, UnionServiceVersion serviceVersion) { * Initializes an instance of UnionClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Union. + * @param endpoint * @param serviceVersion Service version. */ public UnionClientImpl(HttpPipeline httpPipeline, String endpoint, UnionServiceVersion serviceVersion) { @@ -113,7 +112,7 @@ public UnionClientImpl(HttpPipeline httpPipeline, String endpoint, UnionServiceV * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Union. + * @param endpoint * @param serviceVersion Service version. */ public UnionClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, diff --git a/typespec-tests/src/main/java/com/cadl/union/implementation/UnionFlattenOpsImpl.java b/typespec-tests/src/main/java/com/cadl/union/implementation/UnionFlattenOpsImpl.java index 9a7ee5cd53..1bad303211 100644 --- a/typespec-tests/src/main/java/com/cadl/union/implementation/UnionFlattenOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/union/implementation/UnionFlattenOpsImpl.java @@ -84,8 +84,8 @@ public interface UnionFlattenOpsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> send(@HostParam("endpoint") String endpoint, @QueryParam("id") String id, - @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData sendRequest, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); @Post("/union/send") @ExpectedResponses({ 200 }) @@ -94,8 +94,8 @@ Mono> send(@HostParam("endpoint") String endpoint, @QueryParam("i @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response sendSync(@HostParam("endpoint") String endpoint, @QueryParam("id") String id, - @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData sendRequest, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); @Post("/union/send-long") @ExpectedResponses({ 200 }) @@ -104,8 +104,8 @@ Response sendSync(@HostParam("endpoint") String endpoint, @QueryParam("id" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> sendLong(@HostParam("endpoint") String endpoint, @QueryParam("id") String id, - @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData sendLongRequest, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); @Post("/union/send-long") @ExpectedResponses({ 200 }) @@ -114,8 +114,8 @@ Mono> sendLong(@HostParam("endpoint") String endpoint, @QueryPara @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response sendLongSync(@HostParam("endpoint") String endpoint, @QueryParam("id") String id, - @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData sendLongRequest, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); @Get("/union/param") @ExpectedResponses({ 200 }) @@ -123,8 +123,8 @@ Response sendLongSync(@HostParam("endpoint") String endpoint, @QueryParam( @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/union/param") @ExpectedResponses({ 200 }) @@ -132,7 +132,8 @@ Mono> get(@HostParam("endpoint") String endpoint, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Post("/union/generate") @ExpectedResponses({ 202 }) @@ -141,7 +142,7 @@ Mono> get(@HostParam("endpoint") String endpoint, RequestOptions @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> generate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/union/generate") @@ -151,7 +152,7 @@ Mono> generate(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response generateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } @@ -169,7 +170,7 @@ Response generateSync(@HostParam("endpoint") String endpoint, * } * * @param id The id parameter. - * @param sendRequest The sendRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -178,11 +179,10 @@ Response generateSync(@HostParam("endpoint") String endpoint, * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendWithResponseAsync(String id, BinaryData sendRequest, - RequestOptions requestOptions) { - final String contentType = "application/json"; + public Mono> sendWithResponseAsync(String id, BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; return FluxUtil.withContext(context -> service.send(this.client.getEndpoint(), id, - this.client.getServiceVersion().getVersion(), contentType, sendRequest, requestOptions, context)); + this.client.getServiceVersion().getVersion(), accept, request, requestOptions, context)); } /** @@ -199,7 +199,7 @@ public Mono> sendWithResponseAsync(String id, BinaryData sendRequ * } * * @param id The id parameter. - * @param sendRequest The sendRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -208,10 +208,10 @@ public Mono> sendWithResponseAsync(String id, BinaryData sendRequ * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendWithResponse(String id, BinaryData sendRequest, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.sendSync(this.client.getEndpoint(), id, this.client.getServiceVersion().getVersion(), - contentType, sendRequest, requestOptions, Context.NONE); + public Response sendWithResponse(String id, BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.sendSync(this.client.getEndpoint(), id, this.client.getServiceVersion().getVersion(), accept, + request, requestOptions, Context.NONE); } /** @@ -239,7 +239,7 @@ public Response sendWithResponse(String id, BinaryData sendRequest, Reques * } * * @param id The id parameter. - * @param sendLongRequest The sendLongRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -248,11 +248,11 @@ public Response sendWithResponse(String id, BinaryData sendRequest, Reques * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendLongWithResponseAsync(String id, BinaryData sendLongRequest, + public Mono> sendLongWithResponseAsync(String id, BinaryData request, RequestOptions requestOptions) { - final String contentType = "application/json"; + final String accept = "application/json"; return FluxUtil.withContext(context -> service.sendLong(this.client.getEndpoint(), id, - this.client.getServiceVersion().getVersion(), contentType, sendLongRequest, requestOptions, context)); + this.client.getServiceVersion().getVersion(), accept, request, requestOptions, context)); } /** @@ -280,7 +280,7 @@ public Mono> sendLongWithResponseAsync(String id, BinaryData send * } * * @param id The id parameter. - * @param sendLongRequest The sendLongRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -289,10 +289,10 @@ public Mono> sendLongWithResponseAsync(String id, BinaryData send * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendLongWithResponse(String id, BinaryData sendLongRequest, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.sendLongSync(this.client.getEndpoint(), id, this.client.getServiceVersion().getVersion(), - contentType, sendLongRequest, requestOptions, Context.NONE); + public Response sendLongWithResponse(String id, BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.sendLongSync(this.client.getEndpoint(), id, this.client.getServiceVersion().getVersion(), accept, + request, requestOptions, Context.NONE); } /** @@ -314,7 +314,8 @@ public Response sendLongWithResponse(String id, BinaryData sendLongRequest */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -336,7 +337,8 @@ public Mono> getWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { - return service.getSync(this.client.getEndpoint(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/cadl/union/models/OperationState.java b/typespec-tests/src/main/java/com/cadl/union/models/OperationState.java deleted file mode 100644 index 202a15ce22..0000000000 --- a/typespec-tests/src/main/java/com/cadl/union/models/OperationState.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.cadl.union.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Enum describing allowed operation states. - */ -public final class OperationState extends ExpandableStringEnum { - /** - * The operation has not started. - */ - @Generated - public static final OperationState NOT_STARTED = fromString("NotStarted"); - - /** - * The operation is in progress. - */ - @Generated - public static final OperationState RUNNING = fromString("Running"); - - /** - * The operation has completed successfully. - */ - @Generated - public static final OperationState SUCCEEDED = fromString("Succeeded"); - - /** - * The operation has failed. - */ - @Generated - public static final OperationState FAILED = fromString("Failed"); - - /** - * The operation has been canceled by the user. - */ - @Generated - public static final OperationState CANCELED = fromString("Canceled"); - - /** - * Creates a new instance of OperationState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public OperationState() { - } - - /** - * Creates or finds a OperationState from its string representation. - * - * @param name a name to look for. - * @return the corresponding OperationState. - */ - @Generated - public static OperationState fromString(String name) { - return fromString(name, OperationState.class); - } - - /** - * Gets known OperationState values. - * - * @return known OperationState values. - */ - @Generated - public static Collection values() { - return values(OperationState.class); - } -} diff --git a/typespec-tests/src/main/java/com/cadl/union/models/ResourceOperationStatusOperationStatusResultError.java b/typespec-tests/src/main/java/com/cadl/union/models/ResourceOperationStatusOperationStatusResultError.java deleted file mode 100644 index 42e3ddbf64..0000000000 --- a/typespec-tests/src/main/java/com/cadl/union/models/ResourceOperationStatusOperationStatusResultError.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.cadl.union.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.core.models.ResponseError; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Provides status details for long running operations. - */ -@Immutable -public final class ResourceOperationStatusOperationStatusResultError - implements JsonSerializable { - /* - * The unique ID of the operation. - */ - @Generated - private String id; - - /* - * The status of the operation - */ - @Generated - private final OperationState status; - - /* - * Error object that describes the error when status is "Failed". - */ - @Generated - private ResponseError error; - - /* - * The result of the operation. - */ - @Generated - private Result result; - - /** - * Creates an instance of ResourceOperationStatusOperationStatusResultError class. - * - * @param status the status value to set. - */ - @Generated - private ResourceOperationStatusOperationStatusResultError(OperationState status) { - this.status = status; - } - - /** - * Get the id property: The unique ID of the operation. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Get the status property: The status of the operation. - * - * @return the status value. - */ - @Generated - public OperationState getStatus() { - return this.status; - } - - /** - * Get the error property: Error object that describes the error when status is "Failed". - * - * @return the error value. - */ - @Generated - public ResponseError getError() { - return this.error; - } - - /** - * Get the result property: The result of the operation. - * - * @return the result value. - */ - @Generated - public Result getResult() { - return this.result; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeJsonField("error", this.error); - jsonWriter.writeJsonField("result", this.result); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceOperationStatusOperationStatusResultError from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceOperationStatusOperationStatusResultError if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ResourceOperationStatusOperationStatusResultError. - */ - @Generated - public static ResourceOperationStatusOperationStatusResultError fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String id = null; - OperationState status = null; - ResponseError error = null; - Result result = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("status".equals(fieldName)) { - status = OperationState.fromString(reader.getString()); - } else if ("error".equals(fieldName)) { - error = ResponseError.fromJson(reader); - } else if ("result".equals(fieldName)) { - result = Result.fromJson(reader); - } else { - reader.skipChildren(); - } - } - ResourceOperationStatusOperationStatusResultError deserializedResourceOperationStatusOperationStatusResultError - = new ResourceOperationStatusOperationStatusResultError(status); - deserializedResourceOperationStatusOperationStatusResultError.id = id; - deserializedResourceOperationStatusOperationStatusResultError.error = error; - deserializedResourceOperationStatusOperationStatusResultError.result = result; - - return deserializedResourceOperationStatusOperationStatusResultError; - }); - } -} diff --git a/typespec-tests/src/main/java/com/cadl/versioning/implementation/VersioningClientImpl.java b/typespec-tests/src/main/java/com/cadl/versioning/implementation/VersioningClientImpl.java index b64dbb93fa..52829b6d51 100644 --- a/typespec-tests/src/main/java/com/cadl/versioning/implementation/VersioningClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/versioning/implementation/VersioningClientImpl.java @@ -17,12 +17,12 @@ */ public final class VersioningClientImpl { /** - * Service host. + * Server parameter. */ private final String endpoint; /** - * Gets Service host. + * Gets Server parameter. * * @return the endpoint value. */ @@ -89,7 +89,7 @@ public VersioningOpsImpl getVersioningOps() { /** * Initializes an instance of VersioningClient client. * - * @param endpoint Service host. + * @param endpoint Server parameter. * @param serviceVersion Service version. */ public VersioningClientImpl(String endpoint, VersioningServiceVersion serviceVersion) { @@ -101,7 +101,7 @@ public VersioningClientImpl(String endpoint, VersioningServiceVersion serviceVer * Initializes an instance of VersioningClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. + * @param endpoint Server parameter. * @param serviceVersion Service version. */ public VersioningClientImpl(HttpPipeline httpPipeline, String endpoint, VersioningServiceVersion serviceVersion) { @@ -113,7 +113,7 @@ public VersioningClientImpl(HttpPipeline httpPipeline, String endpoint, Versioni * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Service host. + * @param endpoint Server parameter. * @param serviceVersion Service version. */ public VersioningClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, diff --git a/typespec-tests/src/main/java/com/cadl/versioning/implementation/VersioningOpsImpl.java b/typespec-tests/src/main/java/com/cadl/versioning/implementation/VersioningOpsImpl.java index e32901663d..dda7074b57 100644 --- a/typespec-tests/src/main/java/com/cadl/versioning/implementation/VersioningOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/versioning/implementation/VersioningOpsImpl.java @@ -95,7 +95,7 @@ public interface VersioningOpsService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> export(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/versioning/resources/{name}:export") @ExpectedResponses({ 202 }) @@ -105,7 +105,7 @@ Mono> export(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response exportSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/versioning/resources") @ExpectedResponses({ 200 }) @@ -114,7 +114,7 @@ Response exportSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/versioning/resources") @@ -124,7 +124,7 @@ Mono> list(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/versioning/resources/{name}") @@ -135,8 +135,8 @@ Response listSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createLongRunning(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, + RequestOptions requestOptions, Context context); @Put("/versioning/resources/{name}") @ExpectedResponses({ 200, 201 }) @@ -146,8 +146,8 @@ Mono> createLongRunning(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(HttpResponseException.class) Response createLongRunningSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, + RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -156,7 +156,7 @@ Response createLongRunningSync(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -166,7 +166,7 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = tru @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } @@ -657,11 +657,9 @@ public PagedIterable list(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createLongRunningWithResponseAsync(String name, BinaryData resource, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.createLongRunning(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), name, contentType, accept, resource, requestOptions, - context)); + this.client.getServiceVersion().getVersion(), name, accept, resource, requestOptions, context)); } /** @@ -698,10 +696,9 @@ private Mono> createLongRunningWithResponseAsync(String nam @ServiceMethod(returns = ReturnType.SINGLE) private Response createLongRunningWithResponse(String name, BinaryData resource, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; return service.createLongRunningSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - name, contentType, accept, resource, requestOptions, Context.NONE); + name, accept, resource, requestOptions, Context.NONE); } /** @@ -889,8 +886,6 @@ public SyncPoller beginCreateLongRunningWithMode } /** - * Resource list operation template. - * * Get the next page of items. *

Response Body Schema

* @@ -922,8 +917,6 @@ private Mono> listNextSinglePageAsync(String nextLink, } /** - * Resource list operation template. - * * Get the next page of items. *

Response Body Schema

* diff --git a/typespec-tests/src/main/java/com/cadl/versioning/models/OperationState.java b/typespec-tests/src/main/java/com/cadl/versioning/models/OperationState.java deleted file mode 100644 index a7a4931780..0000000000 --- a/typespec-tests/src/main/java/com/cadl/versioning/models/OperationState.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.cadl.versioning.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Enum describing allowed operation states. - */ -public final class OperationState extends ExpandableStringEnum { - /** - * The operation has not started. - */ - @Generated - public static final OperationState NOT_STARTED = fromString("NotStarted"); - - /** - * The operation is in progress. - */ - @Generated - public static final OperationState RUNNING = fromString("Running"); - - /** - * The operation has completed successfully. - */ - @Generated - public static final OperationState SUCCEEDED = fromString("Succeeded"); - - /** - * The operation has failed. - */ - @Generated - public static final OperationState FAILED = fromString("Failed"); - - /** - * The operation has been canceled by the user. - */ - @Generated - public static final OperationState CANCELED = fromString("Canceled"); - - /** - * Creates a new instance of OperationState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public OperationState() { - } - - /** - * Creates or finds a OperationState from its string representation. - * - * @param name a name to look for. - * @return the corresponding OperationState. - */ - @Generated - public static OperationState fromString(String name) { - return fromString(name, OperationState.class); - } - - /** - * Gets known OperationState values. - * - * @return known OperationState values. - */ - @Generated - public static Collection values() { - return values(OperationState.class); - } -} diff --git a/typespec-tests/src/main/java/com/cadl/versioning/models/ResourceOperationStatusResourceExportedResourceError.java b/typespec-tests/src/main/java/com/cadl/versioning/models/ResourceOperationStatusResourceExportedResourceError.java deleted file mode 100644 index de9a241510..0000000000 --- a/typespec-tests/src/main/java/com/cadl/versioning/models/ResourceOperationStatusResourceExportedResourceError.java +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.cadl.versioning.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.core.models.ResponseError; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Provides status details for long running operations. - */ -@Immutable -public final class ResourceOperationStatusResourceExportedResourceError - implements JsonSerializable { - /* - * The unique ID of the operation. - */ - @Generated - private String id; - - /* - * The status of the operation - */ - @Generated - private final OperationState status; - - /* - * Error object that describes the error when status is "Failed". - */ - @Generated - private ResponseError error; - - /* - * The result of the operation. - */ - @Generated - private ExportedResource result; - - /** - * Creates an instance of ResourceOperationStatusResourceExportedResourceError class. - * - * @param status the status value to set. - */ - @Generated - private ResourceOperationStatusResourceExportedResourceError(OperationState status) { - this.status = status; - } - - /** - * Get the id property: The unique ID of the operation. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Get the status property: The status of the operation. - * - * @return the status value. - */ - @Generated - public OperationState getStatus() { - return this.status; - } - - /** - * Get the error property: Error object that describes the error when status is "Failed". - * - * @return the error value. - */ - @Generated - public ResponseError getError() { - return this.error; - } - - /** - * Get the result property: The result of the operation. - * - * @return the result value. - */ - @Generated - public ExportedResource getResult() { - return this.result; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeJsonField("error", this.error); - jsonWriter.writeJsonField("result", this.result); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceOperationStatusResourceExportedResourceError from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceOperationStatusResourceExportedResourceError if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ResourceOperationStatusResourceExportedResourceError. - */ - @Generated - public static ResourceOperationStatusResourceExportedResourceError fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - String id = null; - OperationState status = null; - ResponseError error = null; - ExportedResource result = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("status".equals(fieldName)) { - status = OperationState.fromString(reader.getString()); - } else if ("error".equals(fieldName)) { - error = ResponseError.fromJson(reader); - } else if ("result".equals(fieldName)) { - result = ExportedResource.fromJson(reader); - } else { - reader.skipChildren(); - } - } - ResourceOperationStatusResourceExportedResourceError deserializedResourceOperationStatusResourceExportedResourceError - = new ResourceOperationStatusResourceExportedResourceError(status); - deserializedResourceOperationStatusResourceExportedResourceError.id = id; - deserializedResourceOperationStatusResourceExportedResourceError.error = error; - deserializedResourceOperationStatusResourceExportedResourceError.result = result; - - return deserializedResourceOperationStatusResourceExportedResourceError; - }); - } -} diff --git a/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityClientImpl.java b/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityClientImpl.java index e7e9451941..e5b08514f9 100644 --- a/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityClientImpl.java @@ -44,12 +44,12 @@ public final class VisibilityClientImpl { private final VisibilityClientService service; /** - * Service host. + * Server parameter. */ private final String endpoint; /** - * Gets Service host. + * Gets Server parameter. * * @return the endpoint value. */ @@ -116,7 +116,7 @@ public VisibilityWritesImpl getVisibilityWrites() { /** * Initializes an instance of VisibilityClient client. * - * @param endpoint Service host. + * @param endpoint Server parameter. */ public VisibilityClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -127,7 +127,7 @@ public VisibilityClientImpl(String endpoint) { * Initializes an instance of VisibilityClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public VisibilityClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -138,7 +138,7 @@ public VisibilityClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public VisibilityClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; @@ -162,7 +162,7 @@ public interface VisibilityClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/visibility/read") @@ -171,7 +171,7 @@ Mono> get(@HostParam("endpoint") String endpoint, @HeaderPa @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/visibility/write") @@ -180,8 +180,7 @@ Response getSync(@HostParam("endpoint") String endpoint, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> create(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + Mono> create(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData dog, RequestOptions requestOptions, Context context); @Put("/visibility/write") @@ -190,8 +189,7 @@ Mono> create(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + Response createSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData dog, RequestOptions requestOptions, Context context); @Post("/visibility/query") @@ -200,8 +198,7 @@ Response createSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> query(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + Mono> query(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData dog, RequestOptions requestOptions, Context context); @Post("/visibility/query") @@ -210,8 +207,7 @@ Mono> query(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response querySync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + Response querySync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData dog, RequestOptions requestOptions, Context context); @Put("/visibility/roundtrip") @@ -221,8 +217,8 @@ Response querySync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> roundtrip(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/visibility/roundtrip") @ExpectedResponses({ 200 }) @@ -230,8 +226,7 @@ Mono> roundtrip(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response roundtripSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + Response roundtripSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -315,10 +310,9 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createWithResponseAsync(BinaryData dog, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.create(this.getEndpoint(), contentType, accept, dog, requestOptions, context)); + return FluxUtil + .withContext(context -> service.create(this.getEndpoint(), accept, dog, requestOptions, context)); } /** @@ -351,9 +345,8 @@ public Mono> createWithResponseAsync(BinaryData dog, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createWithResponse(BinaryData dog, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.createSync(this.getEndpoint(), contentType, accept, dog, requestOptions, Context.NONE); + return service.createSync(this.getEndpoint(), accept, dog, requestOptions, Context.NONE); } /** @@ -387,10 +380,8 @@ public Response createWithResponse(BinaryData dog, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> queryWithResponseAsync(BinaryData dog, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.query(this.getEndpoint(), contentType, accept, dog, requestOptions, context)); + return FluxUtil.withContext(context -> service.query(this.getEndpoint(), accept, dog, requestOptions, context)); } /** @@ -424,9 +415,8 @@ public Mono> queryWithResponseAsync(BinaryData dog, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response queryWithResponse(BinaryData dog, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.querySync(this.getEndpoint(), contentType, accept, dog, requestOptions, Context.NONE); + return service.querySync(this.getEndpoint(), accept, dog, requestOptions, Context.NONE); } /** @@ -459,10 +449,9 @@ public Response queryWithResponse(BinaryData dog, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> roundtripWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.roundtrip(this.getEndpoint(), contentType, accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.roundtrip(this.getEndpoint(), accept, body, requestOptions, context)); } /** @@ -495,8 +484,7 @@ public Mono> roundtripWithResponseAsync(BinaryData body, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response roundtripWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.roundtripSync(this.getEndpoint(), contentType, accept, body, requestOptions, Context.NONE); + return service.roundtripSync(this.getEndpoint(), accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityReadsImpl.java b/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityReadsImpl.java index 0cc46f0a42..1f963da1e5 100644 --- a/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityReadsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityReadsImpl.java @@ -63,7 +63,7 @@ public interface VisibilityReadsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/read") @@ -72,7 +72,7 @@ Mono> get(@HostParam("endpoint") String endpoint, @HeaderPa @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityWritesImpl.java b/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityWritesImpl.java index 19648f316f..f9949728ad 100644 --- a/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityWritesImpl.java +++ b/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityWritesImpl.java @@ -64,8 +64,7 @@ public interface VisibilityWritesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> create(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + Mono> create(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData dog, RequestOptions requestOptions, Context context); @Put("/write") @@ -74,8 +73,7 @@ Mono> create(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + Response createSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData dog, RequestOptions requestOptions, Context context); } @@ -109,10 +107,9 @@ Response createSync(@HostParam("endpoint") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createWithResponseAsync(BinaryData dog, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.create(this.client.getEndpoint(), contentType, accept, dog, requestOptions, context)); + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), accept, dog, requestOptions, context)); } /** @@ -145,8 +142,7 @@ public Mono> createWithResponseAsync(BinaryData dog, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createWithResponse(BinaryData dog, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.createSync(this.client.getEndpoint(), contentType, accept, dog, requestOptions, Context.NONE); + return service.createSync(this.client.getEndpoint(), accept, dog, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/wiretype/implementation/WireTypeClientImpl.java b/typespec-tests/src/main/java/com/cadl/wiretype/implementation/WireTypeClientImpl.java index 8a6e2a8d30..f6f76dd425 100644 --- a/typespec-tests/src/main/java/com/cadl/wiretype/implementation/WireTypeClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/wiretype/implementation/WireTypeClientImpl.java @@ -16,12 +16,12 @@ */ public final class WireTypeClientImpl { /** - * Service host. + * Server parameter. */ private final String endpoint; /** - * Gets Service host. + * Gets Server parameter. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public WireTypeOpsImpl getWireTypeOps() { /** * Initializes an instance of WireTypeClient client. * - * @param endpoint Service host. + * @param endpoint Server parameter. */ public WireTypeClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public WireTypeClientImpl(String endpoint) { * Initializes an instance of WireTypeClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public WireTypeClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public WireTypeClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public WireTypeClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/client/naming/implementation/ModelsImpl.java b/typespec-tests/src/main/java/com/client/naming/implementation/ModelsImpl.java index a051101a98..90de3ba70b 100644 --- a/typespec-tests/src/main/java/com/client/naming/implementation/ModelsImpl.java +++ b/typespec-tests/src/main/java/com/client/naming/implementation/ModelsImpl.java @@ -62,7 +62,7 @@ public interface ModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> client(@HeaderParam("Content-Type") String contentType, + Mono> client(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData clientModel, RequestOptions requestOptions, Context context); @Post("/client/naming/model/client") @@ -71,7 +71,7 @@ Mono> client(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response clientSync(@HeaderParam("Content-Type") String contentType, + Response clientSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData clientModel, RequestOptions requestOptions, Context context); @Post("/client/naming/model/language") @@ -80,7 +80,7 @@ Response clientSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> language(@HeaderParam("Content-Type") String contentType, + Mono> language(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData javaModel, RequestOptions requestOptions, Context context); @Post("/client/naming/model/language") @@ -89,7 +89,7 @@ Mono> language(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response languageSync(@HeaderParam("Content-Type") String contentType, + Response languageSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData javaModel, RequestOptions requestOptions, Context context); } @@ -113,8 +113,8 @@ Response languageSync(@HeaderParam("Content-Type") String contentType, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> clientWithResponseAsync(BinaryData clientModel, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.client(contentType, clientModel, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.client(accept, clientModel, requestOptions, context)); } /** @@ -137,8 +137,8 @@ public Mono> clientWithResponseAsync(BinaryData clientModel, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response clientWithResponse(BinaryData clientModel, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.clientSync(contentType, clientModel, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.clientSync(accept, clientModel, requestOptions, Context.NONE); } /** @@ -161,8 +161,8 @@ public Response clientWithResponse(BinaryData clientModel, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> languageWithResponseAsync(BinaryData javaModel, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.language(contentType, javaModel, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.language(accept, javaModel, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> languageWithResponseAsync(BinaryData javaModel, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response languageWithResponse(BinaryData javaModel, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.languageSync(contentType, javaModel, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.languageSync(accept, javaModel, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/naming/implementation/NamingClientImpl.java b/typespec-tests/src/main/java/com/client/naming/implementation/NamingClientImpl.java index ae149bc935..9ed5aa375d 100644 --- a/typespec-tests/src/main/java/com/client/naming/implementation/NamingClientImpl.java +++ b/typespec-tests/src/main/java/com/client/naming/implementation/NamingClientImpl.java @@ -141,7 +141,8 @@ public interface NamingClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> clientName(RequestOptions requestOptions, Context context); + Mono> clientName(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Post("/client/naming/operation") @ExpectedResponses({ 204 }) @@ -149,7 +150,8 @@ public interface NamingClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response clientNameSync(RequestOptions requestOptions, Context context); + Response clientNameSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Post("/client/naming/parameter") @ExpectedResponses({ 204 }) @@ -157,8 +159,8 @@ public interface NamingClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> parameter(@QueryParam("defaultName") String clientName, RequestOptions requestOptions, - Context context); + Mono> parameter(@QueryParam("defaultName") String clientName, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/client/naming/parameter") @ExpectedResponses({ 204 }) @@ -166,8 +168,8 @@ Mono> parameter(@QueryParam("defaultName") String clientName, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response parameterSync(@QueryParam("defaultName") String clientName, RequestOptions requestOptions, - Context context); + Response parameterSync(@QueryParam("defaultName") String clientName, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Post("/client/naming/property/client") @ExpectedResponses({ 204 }) @@ -175,7 +177,7 @@ Response parameterSync(@QueryParam("defaultName") String clientName, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> client(@HeaderParam("Content-Type") String contentType, + Mono> client(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData clientNameModel, RequestOptions requestOptions, Context context); @Post("/client/naming/property/client") @@ -184,7 +186,7 @@ Mono> client(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response clientSync(@HeaderParam("Content-Type") String contentType, + Response clientSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData clientNameModel, RequestOptions requestOptions, Context context); @Post("/client/naming/property/language") @@ -193,7 +195,7 @@ Response clientSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> language(@HeaderParam("Content-Type") String contentType, + Mono> language(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData languageClientNameModel, RequestOptions requestOptions, Context context); @@ -203,7 +205,7 @@ Mono> language(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response languageSync(@HeaderParam("Content-Type") String contentType, + Response languageSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData languageClientNameModel, RequestOptions requestOptions, Context context); @@ -213,7 +215,7 @@ Response languageSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> compatibleWithEncodedName(@HeaderParam("Content-Type") String contentType, + Mono> compatibleWithEncodedName(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData clientNameAndJsonEncodedNameModel, RequestOptions requestOptions, Context context); @@ -223,7 +225,7 @@ Mono> compatibleWithEncodedName(@HeaderParam("Content-Type") Stri @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response compatibleWithEncodedNameSync(@HeaderParam("Content-Type") String contentType, + Response compatibleWithEncodedNameSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData clientNameAndJsonEncodedNameModel, RequestOptions requestOptions, Context context); @@ -233,8 +235,8 @@ Response compatibleWithEncodedNameSync(@HeaderParam("Content-Type") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> request(@HeaderParam("default-name") String clientName, RequestOptions requestOptions, - Context context); + Mono> request(@HeaderParam("default-name") String clientName, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/client/naming/header") @ExpectedResponses({ 204 }) @@ -242,8 +244,8 @@ Mono> request(@HeaderParam("default-name") String clientName, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requestSync(@HeaderParam("default-name") String clientName, RequestOptions requestOptions, - Context context); + Response requestSync(@HeaderParam("default-name") String clientName, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/client/naming/header") @ExpectedResponses({ 204 }) @@ -251,7 +253,8 @@ Response requestSync(@HeaderParam("default-name") String clientName, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> response(RequestOptions requestOptions, Context context); + Mono> response(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/client/naming/header") @ExpectedResponses({ 204 }) @@ -259,7 +262,8 @@ Response requestSync(@HeaderParam("default-name") String clientName, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response responseSync(RequestOptions requestOptions, Context context); + Response responseSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); } /** @@ -274,7 +278,8 @@ Response requestSync(@HeaderParam("default-name") String clientName, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> clientNameWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.clientName(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.clientName(accept, requestOptions, context)); } /** @@ -289,7 +294,8 @@ public Mono> clientNameWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response clientNameWithResponse(RequestOptions requestOptions) { - return service.clientNameSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.clientNameSync(accept, requestOptions, Context.NONE); } /** @@ -305,7 +311,8 @@ public Response clientNameWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> parameterWithResponseAsync(String clientName, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.parameter(clientName, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.parameter(clientName, accept, requestOptions, context)); } /** @@ -321,7 +328,8 @@ public Mono> parameterWithResponseAsync(String clientName, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response parameterWithResponse(String clientName, RequestOptions requestOptions) { - return service.parameterSync(clientName, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.parameterSync(clientName, accept, requestOptions, Context.NONE); } /** @@ -344,8 +352,8 @@ public Response parameterWithResponse(String clientName, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> clientWithResponseAsync(BinaryData clientNameModel, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.client(contentType, clientNameModel, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.client(accept, clientNameModel, requestOptions, context)); } /** @@ -368,8 +376,8 @@ public Mono> clientWithResponseAsync(BinaryData clientNameModel, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response clientWithResponse(BinaryData clientNameModel, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.clientSync(contentType, clientNameModel, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.clientSync(accept, clientNameModel, requestOptions, Context.NONE); } /** @@ -393,9 +401,9 @@ public Response clientWithResponse(BinaryData clientNameModel, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Mono> languageWithResponseAsync(BinaryData languageClientNameModel, RequestOptions requestOptions) { - final String contentType = "application/json"; + final String accept = "application/json"; return FluxUtil - .withContext(context -> service.language(contentType, languageClientNameModel, requestOptions, context)); + .withContext(context -> service.language(accept, languageClientNameModel, requestOptions, context)); } /** @@ -418,8 +426,8 @@ public Mono> languageWithResponseAsync(BinaryData languageClientN */ @ServiceMethod(returns = ReturnType.SINGLE) public Response languageWithResponse(BinaryData languageClientNameModel, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.languageSync(contentType, languageClientNameModel, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.languageSync(accept, languageClientNameModel, requestOptions, Context.NONE); } /** @@ -443,8 +451,8 @@ public Response languageWithResponse(BinaryData languageClientNameModel, R @ServiceMethod(returns = ReturnType.SINGLE) public Mono> compatibleWithEncodedNameWithResponseAsync(BinaryData clientNameAndJsonEncodedNameModel, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.compatibleWithEncodedName(contentType, + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.compatibleWithEncodedName(accept, clientNameAndJsonEncodedNameModel, requestOptions, context)); } @@ -469,8 +477,8 @@ public Mono> compatibleWithEncodedNameWithResponseAsync(BinaryDat @ServiceMethod(returns = ReturnType.SINGLE) public Response compatibleWithEncodedNameWithResponse(BinaryData clientNameAndJsonEncodedNameModel, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.compatibleWithEncodedNameSync(contentType, clientNameAndJsonEncodedNameModel, requestOptions, + final String accept = "application/json"; + return service.compatibleWithEncodedNameSync(accept, clientNameAndJsonEncodedNameModel, requestOptions, Context.NONE); } @@ -487,7 +495,8 @@ public Response compatibleWithEncodedNameWithResponse(BinaryData clientNam */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> requestWithResponseAsync(String clientName, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.request(clientName, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.request(clientName, accept, requestOptions, context)); } /** @@ -503,7 +512,8 @@ public Mono> requestWithResponseAsync(String clientName, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response requestWithResponse(String clientName, RequestOptions requestOptions) { - return service.requestSync(clientName, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.requestSync(clientName, accept, requestOptions, Context.NONE); } /** @@ -518,7 +528,8 @@ public Response requestWithResponse(String clientName, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.response(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.response(accept, requestOptions, context)); } /** @@ -533,6 +544,7 @@ public Mono> responseWithResponseAsync(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response responseWithResponse(RequestOptions requestOptions) { - return service.responseSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.responseSync(accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/naming/implementation/UnionEnumsImpl.java b/typespec-tests/src/main/java/com/client/naming/implementation/UnionEnumsImpl.java index b7ff363129..5e4fab48e7 100644 --- a/typespec-tests/src/main/java/com/client/naming/implementation/UnionEnumsImpl.java +++ b/typespec-tests/src/main/java/com/client/naming/implementation/UnionEnumsImpl.java @@ -63,7 +63,7 @@ public interface UnionEnumsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unionEnumName(@HeaderParam("Content-Type") String contentType, + Mono> unionEnumName(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/client/naming/union-enum/union-enum-name") @@ -72,7 +72,7 @@ Mono> unionEnumName(@HeaderParam("Content-Type") String contentTy @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unionEnumNameSync(@HeaderParam("Content-Type") String contentType, + Response unionEnumNameSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/client/naming/union-enum/union-enum-member-name") @@ -81,7 +81,7 @@ Response unionEnumNameSync(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unionEnumMemberName(@HeaderParam("Content-Type") String contentType, + Mono> unionEnumMemberName(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/client/naming/union-enum/union-enum-member-name") @@ -90,7 +90,7 @@ Mono> unionEnumMemberName(@HeaderParam("Content-Type") String con @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unionEnumMemberNameSync(@HeaderParam("Content-Type") String contentType, + Response unionEnumMemberNameSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -112,8 +112,8 @@ Response unionEnumMemberNameSync(@HeaderParam("Content-Type") String conte */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unionEnumNameWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.unionEnumName(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.unionEnumName(accept, body, requestOptions, context)); } /** @@ -134,8 +134,8 @@ public Mono> unionEnumNameWithResponseAsync(BinaryData body, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response unionEnumNameWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.unionEnumNameSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.unionEnumNameSync(accept, body, requestOptions, Context.NONE); } /** @@ -156,8 +156,8 @@ public Response unionEnumNameWithResponse(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unionEnumMemberNameWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.unionEnumMemberName(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.unionEnumMemberName(accept, body, requestOptions, context)); } /** @@ -178,7 +178,7 @@ public Mono> unionEnumMemberNameWithResponseAsync(BinaryData body */ @ServiceMethod(returns = ReturnType.SINGLE) public Response unionEnumMemberNameWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.unionEnumMemberNameSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.unionEnumMemberNameSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/BarAsyncClient.java b/typespec-tests/src/main/java/com/client/structure/service/BarAsyncClient.java index 8f79908e4a..bbe990bbf5 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/BarAsyncClient.java +++ b/typespec-tests/src/main/java/com/client/structure/service/BarAsyncClient.java @@ -37,7 +37,7 @@ public final class BarAsyncClient { } /** - * The nine operation. + * The five operation. * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -48,12 +48,46 @@ public final class BarAsyncClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> nineWithResponse(RequestOptions requestOptions) { - return this.serviceClient.nineWithResponseAsync(requestOptions); + public Mono> fiveWithResponse(RequestOptions requestOptions) { + return this.serviceClient.fiveWithResponseAsync(requestOptions); } /** - * The nine operation. + * The six operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> sixWithResponse(RequestOptions requestOptions) { + return this.serviceClient.sixWithResponseAsync(requestOptions); + } + + /** + * The five operation. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono five() { + // Generated convenience method for fiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + return fiveWithResponse(requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The six operation. * * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -64,9 +98,9 @@ public Mono> nineWithResponse(RequestOptions requestOptions) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono nine() { - // Generated convenience method for nineWithResponse + public Mono six() { + // Generated convenience method for sixWithResponse RequestOptions requestOptions = new RequestOptions(); - return nineWithResponse(requestOptions).flatMap(FluxUtil::toMono); + return sixWithResponse(requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/BarClient.java b/typespec-tests/src/main/java/com/client/structure/service/BarClient.java index 674e32e86d..143f32d994 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/BarClient.java +++ b/typespec-tests/src/main/java/com/client/structure/service/BarClient.java @@ -35,7 +35,7 @@ public final class BarClient { } /** - * The nine operation. + * The five operation. * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -46,12 +46,45 @@ public final class BarClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response nineWithResponse(RequestOptions requestOptions) { - return this.serviceClient.nineWithResponse(requestOptions); + public Response fiveWithResponse(RequestOptions requestOptions) { + return this.serviceClient.fiveWithResponse(requestOptions); } /** - * The nine operation. + * The six operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response sixWithResponse(RequestOptions requestOptions) { + return this.serviceClient.sixWithResponse(requestOptions); + } + + /** + * The five operation. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void five() { + // Generated convenience method for fiveWithResponse + RequestOptions requestOptions = new RequestOptions(); + fiveWithResponse(requestOptions).getValue(); + } + + /** + * The six operation. * * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -61,9 +94,9 @@ public Response nineWithResponse(RequestOptions requestOptions) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void nine() { - // Generated convenience method for nineWithResponse + public void six() { + // Generated convenience method for sixWithResponse RequestOptions requestOptions = new RequestOptions(); - nineWithResponse(requestOptions).getValue(); + sixWithResponse(requestOptions).getValue(); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/BazAsyncClient.java b/typespec-tests/src/main/java/com/client/structure/service/BazFooAsyncClient.java similarity index 91% rename from typespec-tests/src/main/java/com/client/structure/service/BazAsyncClient.java rename to typespec-tests/src/main/java/com/client/structure/service/BazFooAsyncClient.java index 75b42367f2..148e5f967e 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/BazAsyncClient.java +++ b/typespec-tests/src/main/java/com/client/structure/service/BazFooAsyncClient.java @@ -15,24 +15,24 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.FluxUtil; -import com.client.structure.service.implementation.BazesImpl; +import com.client.structure.service.implementation.BazFoosImpl; import reactor.core.publisher.Mono; /** * Initializes a new instance of the asynchronous ServiceClientClient type. */ @ServiceClient(builder = ServiceClientClientBuilder.class, isAsync = true) -public final class BazAsyncClient { +public final class BazFooAsyncClient { @Generated - private final BazesImpl serviceClient; + private final BazFoosImpl serviceClient; /** - * Initializes an instance of BazAsyncClient class. + * Initializes an instance of BazFooAsyncClient class. * * @param serviceClient the service client implementation. */ @Generated - BazAsyncClient(BazesImpl serviceClient) { + BazFooAsyncClient(BazFoosImpl serviceClient) { this.serviceClient = serviceClient; } diff --git a/typespec-tests/src/main/java/com/client/structure/service/BazClient.java b/typespec-tests/src/main/java/com/client/structure/service/BazFooClient.java similarity index 91% rename from typespec-tests/src/main/java/com/client/structure/service/BazClient.java rename to typespec-tests/src/main/java/com/client/structure/service/BazFooClient.java index 99c1653bb4..ad4d877d21 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/BazClient.java +++ b/typespec-tests/src/main/java/com/client/structure/service/BazFooClient.java @@ -14,23 +14,23 @@ import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; -import com.client.structure.service.implementation.BazesImpl; +import com.client.structure.service.implementation.BazFoosImpl; /** * Initializes a new instance of the synchronous ServiceClientClient type. */ @ServiceClient(builder = ServiceClientClientBuilder.class) -public final class BazClient { +public final class BazFooClient { @Generated - private final BazesImpl serviceClient; + private final BazFoosImpl serviceClient; /** - * Initializes an instance of BazClient class. + * Initializes an instance of BazFooClient class. * * @param serviceClient the service client implementation. */ @Generated - BazClient(BazesImpl serviceClient) { + BazFooClient(BazFoosImpl serviceClient) { this.serviceClient = serviceClient; } diff --git a/typespec-tests/src/main/java/com/client/structure/service/FooAsyncClient.java b/typespec-tests/src/main/java/com/client/structure/service/FooAsyncClient.java index 6f00f9b921..59cad1963c 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/FooAsyncClient.java +++ b/typespec-tests/src/main/java/com/client/structure/service/FooAsyncClient.java @@ -37,7 +37,7 @@ public final class FooAsyncClient { } /** - * The seven operation. + * The three operation. * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -48,12 +48,46 @@ public final class FooAsyncClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sevenWithResponse(RequestOptions requestOptions) { - return this.serviceClient.sevenWithResponseAsync(requestOptions); + public Mono> threeWithResponse(RequestOptions requestOptions) { + return this.serviceClient.threeWithResponseAsync(requestOptions); } /** - * The seven operation. + * The four operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> fourWithResponse(RequestOptions requestOptions) { + return this.serviceClient.fourWithResponseAsync(requestOptions); + } + + /** + * The three operation. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono three() { + // Generated convenience method for threeWithResponse + RequestOptions requestOptions = new RequestOptions(); + return threeWithResponse(requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The four operation. * * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -64,9 +98,9 @@ public Mono> sevenWithResponse(RequestOptions requestOptions) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono seven() { - // Generated convenience method for sevenWithResponse + public Mono four() { + // Generated convenience method for fourWithResponse RequestOptions requestOptions = new RequestOptions(); - return sevenWithResponse(requestOptions).flatMap(FluxUtil::toMono); + return fourWithResponse(requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/FooClient.java b/typespec-tests/src/main/java/com/client/structure/service/FooClient.java index 73c6686240..1117edf9dc 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/FooClient.java +++ b/typespec-tests/src/main/java/com/client/structure/service/FooClient.java @@ -35,7 +35,7 @@ public final class FooClient { } /** - * The seven operation. + * The three operation. * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -46,12 +46,45 @@ public final class FooClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response sevenWithResponse(RequestOptions requestOptions) { - return this.serviceClient.sevenWithResponse(requestOptions); + public Response threeWithResponse(RequestOptions requestOptions) { + return this.serviceClient.threeWithResponse(requestOptions); } /** - * The seven operation. + * The four operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response fourWithResponse(RequestOptions requestOptions) { + return this.serviceClient.fourWithResponse(requestOptions); + } + + /** + * The three operation. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void three() { + // Generated convenience method for threeWithResponse + RequestOptions requestOptions = new RequestOptions(); + threeWithResponse(requestOptions).getValue(); + } + + /** + * The four operation. * * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -61,9 +94,9 @@ public Response sevenWithResponse(RequestOptions requestOptions) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void seven() { - // Generated convenience method for sevenWithResponse + public void four() { + // Generated convenience method for fourWithResponse RequestOptions requestOptions = new RequestOptions(); - sevenWithResponse(requestOptions).getValue(); + fourWithResponse(requestOptions).getValue(); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/QuxAsyncClient.java b/typespec-tests/src/main/java/com/client/structure/service/QuxAsyncClient.java index f49c3673c8..e030c34110 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/QuxAsyncClient.java +++ b/typespec-tests/src/main/java/com/client/structure/service/QuxAsyncClient.java @@ -52,22 +52,6 @@ public Mono> eightWithResponse(RequestOptions requestOptions) { return this.serviceClient.eightWithResponseAsync(requestOptions); } - /** - * The nine operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> nineWithResponse(RequestOptions requestOptions) { - return this.serviceClient.nineWithResponseAsync(requestOptions); - } - /** * The eight operation. * @@ -85,22 +69,4 @@ public Mono eight() { RequestOptions requestOptions = new RequestOptions(); return eightWithResponse(requestOptions).flatMap(FluxUtil::toMono); } - - /** - * The nine operation. - * - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono nine() { - // Generated convenience method for nineWithResponse - RequestOptions requestOptions = new RequestOptions(); - return nineWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/QuxBarAsyncClient.java b/typespec-tests/src/main/java/com/client/structure/service/QuxBarAsyncClient.java new file mode 100644 index 0000000000..0b2b66db87 --- /dev/null +++ b/typespec-tests/src/main/java/com/client/structure/service/QuxBarAsyncClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.client.structure.service; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.FluxUtil; +import com.client.structure.service.implementation.QuxBarsImpl; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous ServiceClientClient type. + */ +@ServiceClient(builder = ServiceClientClientBuilder.class, isAsync = true) +public final class QuxBarAsyncClient { + @Generated + private final QuxBarsImpl serviceClient; + + /** + * Initializes an instance of QuxBarAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + QuxBarAsyncClient(QuxBarsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The nine operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> nineWithResponse(RequestOptions requestOptions) { + return this.serviceClient.nineWithResponseAsync(requestOptions); + } + + /** + * The nine operation. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono nine() { + // Generated convenience method for nineWithResponse + RequestOptions requestOptions = new RequestOptions(); + return nineWithResponse(requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/typespec-tests/src/main/java/com/client/structure/service/QuxBarClient.java b/typespec-tests/src/main/java/com/client/structure/service/QuxBarClient.java new file mode 100644 index 0000000000..e78b9258e7 --- /dev/null +++ b/typespec-tests/src/main/java/com/client/structure/service/QuxBarClient.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.client.structure.service; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.client.structure.service.implementation.QuxBarsImpl; + +/** + * Initializes a new instance of the synchronous ServiceClientClient type. + */ +@ServiceClient(builder = ServiceClientClientBuilder.class) +public final class QuxBarClient { + @Generated + private final QuxBarsImpl serviceClient; + + /** + * Initializes an instance of QuxBarClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + QuxBarClient(QuxBarsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The nine operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response nineWithResponse(RequestOptions requestOptions) { + return this.serviceClient.nineWithResponse(requestOptions); + } + + /** + * The nine operation. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void nine() { + // Generated convenience method for nineWithResponse + RequestOptions requestOptions = new RequestOptions(); + nineWithResponse(requestOptions).getValue(); + } +} diff --git a/typespec-tests/src/main/java/com/client/structure/service/QuxClient.java b/typespec-tests/src/main/java/com/client/structure/service/QuxClient.java index c369e62d6f..0bc793ca58 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/QuxClient.java +++ b/typespec-tests/src/main/java/com/client/structure/service/QuxClient.java @@ -50,22 +50,6 @@ public Response eightWithResponse(RequestOptions requestOptions) { return this.serviceClient.eightWithResponse(requestOptions); } - /** - * The nine operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response nineWithResponse(RequestOptions requestOptions) { - return this.serviceClient.nineWithResponse(requestOptions); - } - /** * The eight operation. * @@ -82,21 +66,4 @@ public void eight() { RequestOptions requestOptions = new RequestOptions(); eightWithResponse(requestOptions).getValue(); } - - /** - * The nine operation. - * - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void nine() { - // Generated convenience method for nineWithResponse - RequestOptions requestOptions = new RequestOptions(); - nineWithResponse(requestOptions).getValue(); - } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/ServiceClientClientBuilder.java b/typespec-tests/src/main/java/com/client/structure/service/ServiceClientClientBuilder.java index 68d24f132d..b162ae1114 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/ServiceClientClientBuilder.java +++ b/typespec-tests/src/main/java/com/client/structure/service/ServiceClientClientBuilder.java @@ -43,17 +43,15 @@ @ServiceClientBuilder( serviceClients = { ServiceClientClient.class, - BazClient.class, - FooClient.class, + BazFooClient.class, QuxClient.class, - BarClient.class, + QuxBarClient.class, FooClient.class, BarClient.class, ServiceClientAsyncClient.class, - BazAsyncClient.class, - FooAsyncClient.class, + BazFooAsyncClient.class, QuxAsyncClient.class, - BarAsyncClient.class, + QuxBarAsyncClient.class, FooAsyncClient.class, BarAsyncClient.class }) public final class ServiceClientClientBuilder implements HttpTrait, @@ -309,23 +307,13 @@ public ServiceClientAsyncClient buildAsyncClient() { } /** - * Builds an instance of BazAsyncClient class. - * - * @return an instance of BazAsyncClient. - */ - @Generated - public BazAsyncClient buildBazAsyncClient() { - return new BazAsyncClient(buildInnerClient().getBazes()); - } - - /** - * Builds an instance of FooAsyncClient class. + * Builds an instance of BazFooAsyncClient class. * - * @return an instance of FooAsyncClient. + * @return an instance of BazFooAsyncClient. */ @Generated - public FooAsyncClient buildFooAsyncClient() { - return new FooAsyncClient(buildInnerClient().getFoos()); + public BazFooAsyncClient buildBazFooAsyncClient() { + return new BazFooAsyncClient(buildInnerClient().getBazFoos()); } /** @@ -339,13 +327,13 @@ public QuxAsyncClient buildQuxAsyncClient() { } /** - * Builds an instance of BarAsyncClient class. + * Builds an instance of QuxBarAsyncClient class. * - * @return an instance of BarAsyncClient. + * @return an instance of QuxBarAsyncClient. */ @Generated - public BarAsyncClient buildBarAsyncClient() { - return new BarAsyncClient(buildInnerClient().getBars()); + public QuxBarAsyncClient buildQuxBarAsyncClient() { + return new QuxBarAsyncClient(buildInnerClient().getQuxBars()); } /** @@ -355,7 +343,7 @@ public BarAsyncClient buildBarAsyncClient() { */ @Generated public FooAsyncClient buildFooAsyncClient() { - return new FooAsyncClient(buildInnerClient().getFoosOperations()); + return new FooAsyncClient(buildInnerClient().getFoos()); } /** @@ -365,7 +353,7 @@ public FooAsyncClient buildFooAsyncClient() { */ @Generated public BarAsyncClient buildBarAsyncClient() { - return new BarAsyncClient(buildInnerClient().getBarsOperations()); + return new BarAsyncClient(buildInnerClient().getBars()); } /** @@ -379,23 +367,13 @@ public ServiceClientClient buildClient() { } /** - * Builds an instance of BazClient class. + * Builds an instance of BazFooClient class. * - * @return an instance of BazClient. + * @return an instance of BazFooClient. */ @Generated - public BazClient buildBazClient() { - return new BazClient(buildInnerClient().getBazes()); - } - - /** - * Builds an instance of FooClient class. - * - * @return an instance of FooClient. - */ - @Generated - public FooClient buildFooClient() { - return new FooClient(buildInnerClient().getFoos()); + public BazFooClient buildBazFooClient() { + return new BazFooClient(buildInnerClient().getBazFoos()); } /** @@ -409,13 +387,13 @@ public QuxClient buildQuxClient() { } /** - * Builds an instance of BarClient class. + * Builds an instance of QuxBarClient class. * - * @return an instance of BarClient. + * @return an instance of QuxBarClient. */ @Generated - public BarClient buildBarClient() { - return new BarClient(buildInnerClient().getBars()); + public QuxBarClient buildQuxBarClient() { + return new QuxBarClient(buildInnerClient().getQuxBars()); } /** @@ -425,7 +403,7 @@ public BarClient buildBarClient() { */ @Generated public FooClient buildFooClient() { - return new FooClient(buildInnerClient().getFoosOperations()); + return new FooClient(buildInnerClient().getFoos()); } /** @@ -435,7 +413,7 @@ public FooClient buildFooClient() { */ @Generated public BarClient buildBarClient() { - return new BarClient(buildInnerClient().getBarsOperations()); + return new BarClient(buildInnerClient().getBars()); } private static final ClientLogger LOGGER = new ClientLogger(ServiceClientClientBuilder.class); diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/BarsImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/BarsImpl.java index 742dfdc2b5..310679abf4 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/BarsImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/BarsImpl.java @@ -5,6 +5,7 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -54,27 +55,79 @@ public final class BarsImpl { @Host("{endpoint}/client/structure/{client}") @ServiceInterface(name = "ServiceClientClientB") public interface BarsService { - @Post("/nine") + @Post("/five") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> nine(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + Mono> five(@HostParam("endpoint") String endpoint, @HostParam("client") String client, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - @Post("/nine") + @Post("/five") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response nineSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + Response fiveSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/six") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> six(@HostParam("endpoint") String endpoint, @HostParam("client") String client, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/six") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response sixSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + } + + /** + * The five operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> fiveWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.five(this.client.getEndpoint(), this.client.getClient(), accept, + requestOptions, context)); + } + + /** + * The five operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response fiveWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.fiveSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, + Context.NONE); } /** - * The nine operation. + * The six operation. * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -84,13 +137,14 @@ Response nineSync(@HostParam("endpoint") String endpoint, @HostParam("clie * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> nineWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.nine(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); + public Mono> sixWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.six(this.client.getEndpoint(), this.client.getClient(), accept, + requestOptions, context)); } /** - * The nine operation. + * The six operation. * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -100,7 +154,9 @@ public Mono> nineWithResponseAsync(RequestOptions requestOptions) * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response nineWithResponse(RequestOptions requestOptions) { - return service.nineSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); + public Response sixWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.sixSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/BarsOperationsImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/BarsOperationsImpl.java deleted file mode 100644 index cadfd0af7a..0000000000 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/BarsOperationsImpl.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.client.structure.service.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in BarsOperations. - */ -public final class BarsOperationsImpl { - /** - * The proxy service used to perform REST calls. - */ - private final BarsService service; - - /** - * The service client containing this operation class. - */ - private final ServiceClientClientImpl client; - - /** - * Initializes an instance of BarsOperationsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BarsOperationsImpl(ServiceClientClientImpl client) { - this.service = RestProxy.create(BarsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ServiceClientClientBarsOperations to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}/client/structure/{client}") - @ServiceInterface(name = "ServiceClientClientB") - public interface BarsService { - @Post("/five") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> five(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); - - @Post("/five") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response fiveSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); - - @Post("/six") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> six(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); - - @Post("/six") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sixSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); - } - - /** - * The five operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> fiveWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.five(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); - } - - /** - * The five operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response fiveWithResponse(RequestOptions requestOptions) { - return service.fiveSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); - } - - /** - * The six operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sixWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.six(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); - } - - /** - * The six operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response sixWithResponse(RequestOptions requestOptions) { - return service.sixSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); - } -} diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/BazesImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/BazFoosImpl.java similarity index 81% rename from typespec-tests/src/main/java/com/client/structure/service/implementation/BazesImpl.java rename to typespec-tests/src/main/java/com/client/structure/service/implementation/BazFoosImpl.java index 465ec4f84c..93f545ee85 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/BazesImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/BazFoosImpl.java @@ -5,6 +5,7 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -24,13 +25,13 @@ import reactor.core.publisher.Mono; /** - * An instance of this class provides access to all the operations defined in Bazes. + * An instance of this class provides access to all the operations defined in BazFoos. */ -public final class BazesImpl { +public final class BazFoosImpl { /** * The proxy service used to perform REST calls. */ - private final BazesService service; + private final BazFoosService service; /** * The service client containing this operation class. @@ -38,22 +39,22 @@ public final class BazesImpl { private final ServiceClientClientImpl client; /** - * Initializes an instance of BazesImpl. + * Initializes an instance of BazFoosImpl. * * @param client the instance of the service client containing this operation class. */ - BazesImpl(ServiceClientClientImpl client) { - this.service = RestProxy.create(BazesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + BazFoosImpl(ServiceClientClientImpl client) { + this.service = RestProxy.create(BazFoosService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for ServiceClientClientBazes to be used by the proxy service to perform + * The interface defining all the services for ServiceClientClientBazFoos to be used by the proxy service to perform * REST calls. */ @Host("{endpoint}/client/structure/{client}") @ServiceInterface(name = "ServiceClientClientB") - public interface BazesService { + public interface BazFoosService { @Post("/seven") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -61,7 +62,7 @@ public interface BazesService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> seven(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/seven") @ExpectedResponses({ 204 }) @@ -70,7 +71,7 @@ Mono> seven(@HostParam("endpoint") String endpoint, @HostParam("c @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response sevenSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -85,8 +86,9 @@ Response sevenSync(@HostParam("endpoint") String endpoint, @HostParam("cli */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sevenWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.seven(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.seven(this.client.getEndpoint(), this.client.getClient(), accept, + requestOptions, context)); } /** @@ -101,6 +103,8 @@ public Mono> sevenWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sevenWithResponse(RequestOptions requestOptions) { - return service.sevenSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.sevenSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/ClientAClientImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/ClientAClientImpl.java index 0522be5c4f..b0d94bf2d0 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/ClientAClientImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/ClientAClientImpl.java @@ -5,6 +5,7 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -146,7 +147,7 @@ public interface ClientAClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedOne(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/one") @ExpectedResponses({ 204 }) @@ -155,7 +156,7 @@ Mono> renamedOne(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedOneSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/three") @ExpectedResponses({ 204 }) @@ -164,7 +165,7 @@ Response renamedOneSync(@HostParam("endpoint") String endpoint, @HostParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedThree(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/three") @ExpectedResponses({ 204 }) @@ -173,7 +174,7 @@ Mono> renamedThree(@HostParam("endpoint") String endpoint, @HostP @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedThreeSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/five") @ExpectedResponses({ 204 }) @@ -182,7 +183,7 @@ Response renamedThreeSync(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedFive(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/five") @ExpectedResponses({ 204 }) @@ -191,7 +192,7 @@ Mono> renamedFive(@HostParam("endpoint") String endpoint, @HostPa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedFiveSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -206,8 +207,9 @@ Response renamedFiveSync(@HostParam("endpoint") String endpoint, @HostPara */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedOneWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil - .withContext(context -> service.renamedOne(this.getEndpoint(), this.getClient(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.renamedOne(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); } /** @@ -222,7 +224,8 @@ public Mono> renamedOneWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedOneWithResponse(RequestOptions requestOptions) { - return service.renamedOneSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.renamedOneSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); } /** @@ -237,8 +240,9 @@ public Response renamedOneWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedThreeWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; return FluxUtil.withContext( - context -> service.renamedThree(this.getEndpoint(), this.getClient(), requestOptions, context)); + context -> service.renamedThree(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); } /** @@ -253,7 +257,8 @@ public Mono> renamedThreeWithResponseAsync(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedThreeWithResponse(RequestOptions requestOptions) { - return service.renamedThreeSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.renamedThreeSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); } /** @@ -268,8 +273,9 @@ public Response renamedThreeWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedFiveWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil - .withContext(context -> service.renamedFive(this.getEndpoint(), this.getClient(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.renamedFive(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); } /** @@ -284,6 +290,7 @@ public Mono> renamedFiveWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedFiveWithResponse(RequestOptions requestOptions) { - return service.renamedFiveSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.renamedFiveSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/ClientBClientImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/ClientBClientImpl.java index e52b68219d..15a1ba56f1 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/ClientBClientImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/ClientBClientImpl.java @@ -5,6 +5,7 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -146,7 +147,7 @@ public interface ClientBClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedTwo(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/two") @ExpectedResponses({ 204 }) @@ -155,7 +156,7 @@ Mono> renamedTwo(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedTwoSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/four") @ExpectedResponses({ 204 }) @@ -164,7 +165,7 @@ Response renamedTwoSync(@HostParam("endpoint") String endpoint, @HostParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedFour(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/four") @ExpectedResponses({ 204 }) @@ -173,7 +174,7 @@ Mono> renamedFour(@HostParam("endpoint") String endpoint, @HostPa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedFourSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/six") @ExpectedResponses({ 204 }) @@ -182,7 +183,7 @@ Response renamedFourSync(@HostParam("endpoint") String endpoint, @HostPara @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedSix(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/six") @ExpectedResponses({ 204 }) @@ -191,7 +192,7 @@ Mono> renamedSix(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedSixSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -206,8 +207,9 @@ Response renamedSixSync(@HostParam("endpoint") String endpoint, @HostParam */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedTwoWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil - .withContext(context -> service.renamedTwo(this.getEndpoint(), this.getClient(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.renamedTwo(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); } /** @@ -222,7 +224,8 @@ public Mono> renamedTwoWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedTwoWithResponse(RequestOptions requestOptions) { - return service.renamedTwoSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.renamedTwoSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); } /** @@ -237,8 +240,9 @@ public Response renamedTwoWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedFourWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil - .withContext(context -> service.renamedFour(this.getEndpoint(), this.getClient(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.renamedFour(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); } /** @@ -253,7 +257,8 @@ public Mono> renamedFourWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedFourWithResponse(RequestOptions requestOptions) { - return service.renamedFourSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.renamedFourSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); } /** @@ -268,8 +273,9 @@ public Response renamedFourWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedSixWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil - .withContext(context -> service.renamedSix(this.getEndpoint(), this.getClient(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.renamedSix(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); } /** @@ -284,6 +290,7 @@ public Mono> renamedSixWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedSixWithResponse(RequestOptions requestOptions) { - return service.renamedSixSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.renamedSixSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/FoosImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/FoosImpl.java index 6e0139b80b..424e5a6589 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/FoosImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/FoosImpl.java @@ -5,6 +5,7 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -54,27 +55,79 @@ public final class FoosImpl { @Host("{endpoint}/client/structure/{client}") @ServiceInterface(name = "ServiceClientClientF") public interface FoosService { - @Post("/seven") + @Post("/three") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> seven(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + Mono> three(@HostParam("endpoint") String endpoint, @HostParam("client") String client, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - @Post("/seven") + @Post("/three") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sevenSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + Response threeSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/four") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> four(@HostParam("endpoint") String endpoint, @HostParam("client") String client, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/four") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response fourSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + } + + /** + * The three operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> threeWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.three(this.client.getEndpoint(), this.client.getClient(), accept, + requestOptions, context)); + } + + /** + * The three operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response threeWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.threeSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, + Context.NONE); } /** - * The seven operation. + * The four operation. * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -84,13 +137,14 @@ Response sevenSync(@HostParam("endpoint") String endpoint, @HostParam("cli * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sevenWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.seven(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); + public Mono> fourWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.four(this.client.getEndpoint(), this.client.getClient(), accept, + requestOptions, context)); } /** - * The seven operation. + * The four operation. * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -100,7 +154,9 @@ public Mono> sevenWithResponseAsync(RequestOptions requestOptions * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response sevenWithResponse(RequestOptions requestOptions) { - return service.sevenSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); + public Response fourWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.fourSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/FoosOperationsImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/FoosOperationsImpl.java deleted file mode 100644 index 76337fde7d..0000000000 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/FoosOperationsImpl.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.client.structure.service.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in FoosOperations. - */ -public final class FoosOperationsImpl { - /** - * The proxy service used to perform REST calls. - */ - private final FoosService service; - - /** - * The service client containing this operation class. - */ - private final ServiceClientClientImpl client; - - /** - * Initializes an instance of FoosOperationsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - FoosOperationsImpl(ServiceClientClientImpl client) { - this.service = RestProxy.create(FoosService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ServiceClientClientFoosOperations to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}/client/structure/{client}") - @ServiceInterface(name = "ServiceClientClientF") - public interface FoosService { - @Post("/three") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> three(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); - - @Post("/three") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response threeSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); - - @Post("/four") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> four(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); - - @Post("/four") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response fourSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); - } - - /** - * The three operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> threeWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.three(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); - } - - /** - * The three operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response threeWithResponse(RequestOptions requestOptions) { - return service.threeSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); - } - - /** - * The four operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> fourWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.four(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); - } - - /** - * The four operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response fourWithResponse(RequestOptions requestOptions) { - return service.fourSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); - } -} diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/Group1sImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/Group1sImpl.java index bdd1938e5b..68238b8d42 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/Group1sImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/Group1sImpl.java @@ -5,6 +5,7 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -61,7 +62,7 @@ public interface Group1sService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> one(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/one") @ExpectedResponses({ 204 }) @@ -70,7 +71,7 @@ Mono> one(@HostParam("endpoint") String endpoint, @HostParam("cli @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response oneSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/three") @ExpectedResponses({ 204 }) @@ -79,7 +80,7 @@ Response oneSync(@HostParam("endpoint") String endpoint, @HostParam("clien @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> three(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/three") @ExpectedResponses({ 204 }) @@ -88,7 +89,7 @@ Mono> three(@HostParam("endpoint") String endpoint, @HostParam("c @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response threeSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/four") @ExpectedResponses({ 204 }) @@ -97,7 +98,7 @@ Response threeSync(@HostParam("endpoint") String endpoint, @HostParam("cli @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> four(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/four") @ExpectedResponses({ 204 }) @@ -106,7 +107,7 @@ Mono> four(@HostParam("endpoint") String endpoint, @HostParam("cl @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response fourSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -121,8 +122,9 @@ Response fourSync(@HostParam("endpoint") String endpoint, @HostParam("clie */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> oneWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.one(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.one(this.client.getEndpoint(), this.client.getClient(), accept, + requestOptions, context)); } /** @@ -137,7 +139,9 @@ public Mono> oneWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response oneWithResponse(RequestOptions requestOptions) { - return service.oneSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.oneSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, + Context.NONE); } /** @@ -152,8 +156,9 @@ public Response oneWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> threeWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.three(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.three(this.client.getEndpoint(), this.client.getClient(), accept, + requestOptions, context)); } /** @@ -168,7 +173,9 @@ public Mono> threeWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response threeWithResponse(RequestOptions requestOptions) { - return service.threeSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.threeSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, + Context.NONE); } /** @@ -183,8 +190,9 @@ public Response threeWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fourWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.four(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.four(this.client.getEndpoint(), this.client.getClient(), accept, + requestOptions, context)); } /** @@ -199,6 +207,8 @@ public Mono> fourWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fourWithResponse(RequestOptions requestOptions) { - return service.fourSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.fourSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/Group2sImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/Group2sImpl.java index 01e5b55919..44db47a66c 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/Group2sImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/Group2sImpl.java @@ -5,6 +5,7 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -61,7 +62,7 @@ public interface Group2sService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> two(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/two") @ExpectedResponses({ 204 }) @@ -70,7 +71,7 @@ Mono> two(@HostParam("endpoint") String endpoint, @HostParam("cli @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response twoSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/five") @ExpectedResponses({ 204 }) @@ -79,7 +80,7 @@ Response twoSync(@HostParam("endpoint") String endpoint, @HostParam("clien @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> five(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/five") @ExpectedResponses({ 204 }) @@ -88,7 +89,7 @@ Mono> five(@HostParam("endpoint") String endpoint, @HostParam("cl @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response fiveSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/six") @ExpectedResponses({ 204 }) @@ -97,7 +98,7 @@ Response fiveSync(@HostParam("endpoint") String endpoint, @HostParam("clie @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> six(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/six") @ExpectedResponses({ 204 }) @@ -106,7 +107,7 @@ Mono> six(@HostParam("endpoint") String endpoint, @HostParam("cli @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response sixSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -121,8 +122,9 @@ Response sixSync(@HostParam("endpoint") String endpoint, @HostParam("clien */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> twoWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.two(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.two(this.client.getEndpoint(), this.client.getClient(), accept, + requestOptions, context)); } /** @@ -137,7 +139,9 @@ public Mono> twoWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response twoWithResponse(RequestOptions requestOptions) { - return service.twoSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.twoSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, + Context.NONE); } /** @@ -152,8 +156,9 @@ public Response twoWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fiveWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.five(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.five(this.client.getEndpoint(), this.client.getClient(), accept, + requestOptions, context)); } /** @@ -168,7 +173,9 @@ public Mono> fiveWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fiveWithResponse(RequestOptions requestOptions) { - return service.fiveSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.fiveSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, + Context.NONE); } /** @@ -183,8 +190,9 @@ public Response fiveWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sixWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.six(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.six(this.client.getEndpoint(), this.client.getClient(), accept, + requestOptions, context)); } /** @@ -199,6 +207,8 @@ public Mono> sixWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sixWithResponse(RequestOptions requestOptions) { - return service.sixSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.sixSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/GroupsImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/GroupsImpl.java index 3d53989732..a2b4164e04 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/GroupsImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/GroupsImpl.java @@ -5,6 +5,7 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -61,7 +62,7 @@ public interface GroupsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedTwo(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/two") @ExpectedResponses({ 204 }) @@ -70,7 +71,7 @@ Mono> renamedTwo(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedTwoSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/four") @ExpectedResponses({ 204 }) @@ -79,7 +80,7 @@ Response renamedTwoSync(@HostParam("endpoint") String endpoint, @HostParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedFour(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/four") @ExpectedResponses({ 204 }) @@ -88,7 +89,7 @@ Mono> renamedFour(@HostParam("endpoint") String endpoint, @HostPa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedFourSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/six") @ExpectedResponses({ 204 }) @@ -97,7 +98,7 @@ Response renamedFourSync(@HostParam("endpoint") String endpoint, @HostPara @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedSix(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/six") @ExpectedResponses({ 204 }) @@ -106,7 +107,7 @@ Mono> renamedSix(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedSixSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -121,8 +122,9 @@ Response renamedSixSync(@HostParam("endpoint") String endpoint, @HostParam */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedTwoWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.renamedTwo(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.renamedTwo(this.client.getEndpoint(), this.client.getClient(), + accept, requestOptions, context)); } /** @@ -137,7 +139,9 @@ public Mono> renamedTwoWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedTwoWithResponse(RequestOptions requestOptions) { - return service.renamedTwoSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.renamedTwoSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, + Context.NONE); } /** @@ -152,8 +156,9 @@ public Response renamedTwoWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedFourWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; return FluxUtil.withContext(context -> service.renamedFour(this.client.getEndpoint(), this.client.getClient(), - requestOptions, context)); + accept, requestOptions, context)); } /** @@ -168,7 +173,8 @@ public Mono> renamedFourWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedFourWithResponse(RequestOptions requestOptions) { - return service.renamedFourSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, + final String accept = "application/json"; + return service.renamedFourSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, Context.NONE); } @@ -184,8 +190,9 @@ public Response renamedFourWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedSixWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.renamedSix(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.renamedSix(this.client.getEndpoint(), this.client.getClient(), + accept, requestOptions, context)); } /** @@ -200,6 +207,8 @@ public Mono> renamedSixWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedSixWithResponse(RequestOptions requestOptions) { - return service.renamedSixSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.renamedSixSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/QuxBarsImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/QuxBarsImpl.java new file mode 100644 index 0000000000..04b716e90d --- /dev/null +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/QuxBarsImpl.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.client.structure.service.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in QuxBars. + */ +public final class QuxBarsImpl { + /** + * The proxy service used to perform REST calls. + */ + private final QuxBarsService service; + + /** + * The service client containing this operation class. + */ + private final ServiceClientClientImpl client; + + /** + * Initializes an instance of QuxBarsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + QuxBarsImpl(ServiceClientClientImpl client) { + this.service = RestProxy.create(QuxBarsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceClientClientQuxBars to be used by the proxy service to perform + * REST calls. + */ + @Host("{endpoint}/client/structure/{client}") + @ServiceInterface(name = "ServiceClientClientQ") + public interface QuxBarsService { + @Post("/nine") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> nine(@HostParam("endpoint") String endpoint, @HostParam("client") String client, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/nine") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response nineSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + } + + /** + * The nine operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> nineWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.nine(this.client.getEndpoint(), this.client.getClient(), accept, + requestOptions, context)); + } + + /** + * The nine operation. + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response nineWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.nineSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, + Context.NONE); + } +} diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/QuxesImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/QuxesImpl.java index e680d627cc..4ef2e29bea 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/QuxesImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/QuxesImpl.java @@ -5,6 +5,7 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -61,7 +62,7 @@ public interface QuxesService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> eight(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/eight") @ExpectedResponses({ 204 }) @@ -70,25 +71,7 @@ Mono> eight(@HostParam("endpoint") String endpoint, @HostParam("c @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response eightSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); - - @Post("/nine") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> nine(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); - - @Post("/nine") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response nineSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -103,8 +86,9 @@ Response nineSync(@HostParam("endpoint") String endpoint, @HostParam("clie */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> eightWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.eight(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.eight(this.client.getEndpoint(), this.client.getClient(), accept, + requestOptions, context)); } /** @@ -119,37 +103,8 @@ public Mono> eightWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response eightWithResponse(RequestOptions requestOptions) { - return service.eightSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); - } - - /** - * The nine operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> nineWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.nine(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); - } - - /** - * The nine operation. - * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response nineWithResponse(RequestOptions requestOptions) { - return service.nineSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.eightSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/RenamedOperationClientImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/RenamedOperationClientImpl.java index a0727fb3f3..2c13fe09ce 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/RenamedOperationClientImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/RenamedOperationClientImpl.java @@ -5,6 +5,7 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -163,7 +164,7 @@ public interface RenamedOperationClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedOne(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/one") @ExpectedResponses({ 204 }) @@ -172,7 +173,7 @@ Mono> renamedOne(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedOneSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/three") @ExpectedResponses({ 204 }) @@ -181,7 +182,7 @@ Response renamedOneSync(@HostParam("endpoint") String endpoint, @HostParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedThree(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/three") @ExpectedResponses({ 204 }) @@ -190,7 +191,7 @@ Mono> renamedThree(@HostParam("endpoint") String endpoint, @HostP @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedThreeSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/five") @ExpectedResponses({ 204 }) @@ -199,7 +200,7 @@ Response renamedThreeSync(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedFive(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/five") @ExpectedResponses({ 204 }) @@ -208,7 +209,7 @@ Mono> renamedFive(@HostParam("endpoint") String endpoint, @HostPa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedFiveSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -223,8 +224,9 @@ Response renamedFiveSync(@HostParam("endpoint") String endpoint, @HostPara */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedOneWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil - .withContext(context -> service.renamedOne(this.getEndpoint(), this.getClient(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.renamedOne(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); } /** @@ -239,7 +241,8 @@ public Mono> renamedOneWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedOneWithResponse(RequestOptions requestOptions) { - return service.renamedOneSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.renamedOneSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); } /** @@ -254,8 +257,9 @@ public Response renamedOneWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedThreeWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; return FluxUtil.withContext( - context -> service.renamedThree(this.getEndpoint(), this.getClient(), requestOptions, context)); + context -> service.renamedThree(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); } /** @@ -270,7 +274,8 @@ public Mono> renamedThreeWithResponseAsync(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedThreeWithResponse(RequestOptions requestOptions) { - return service.renamedThreeSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.renamedThreeSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); } /** @@ -285,8 +290,9 @@ public Response renamedThreeWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedFiveWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil - .withContext(context -> service.renamedFive(this.getEndpoint(), this.getClient(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.renamedFive(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); } /** @@ -301,6 +307,7 @@ public Mono> renamedFiveWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedFiveWithResponse(RequestOptions requestOptions) { - return service.renamedFiveSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.renamedFiveSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/ServiceClientClientImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/ServiceClientClientImpl.java index 467ae6d16c..83b972b012 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/ServiceClientClientImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/ServiceClientClientImpl.java @@ -5,6 +5,7 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -95,31 +96,17 @@ public SerializerAdapter getSerializerAdapter() { } /** - * The BazesImpl object to access its operations. + * The BazFoosImpl object to access its operations. */ - private final BazesImpl bazes; + private final BazFoosImpl bazFoos; /** - * Gets the BazesImpl object to access its operations. + * Gets the BazFoosImpl object to access its operations. * - * @return the BazesImpl object. + * @return the BazFoosImpl object. */ - public BazesImpl getBazes() { - return this.bazes; - } - - /** - * The FoosImpl object to access its operations. - */ - private final FoosImpl foos; - - /** - * Gets the FoosImpl object to access its operations. - * - * @return the FoosImpl object. - */ - public FoosImpl getFoos() { - return this.foos; + public BazFoosImpl getBazFoos() { + return this.bazFoos; } /** @@ -137,45 +124,45 @@ public QuxesImpl getQuxes() { } /** - * The BarsImpl object to access its operations. + * The QuxBarsImpl object to access its operations. */ - private final BarsImpl bars; + private final QuxBarsImpl quxBars; /** - * Gets the BarsImpl object to access its operations. + * Gets the QuxBarsImpl object to access its operations. * - * @return the BarsImpl object. + * @return the QuxBarsImpl object. */ - public BarsImpl getBars() { - return this.bars; + public QuxBarsImpl getQuxBars() { + return this.quxBars; } /** - * The FoosOperationsImpl object to access its operations. + * The FoosImpl object to access its operations. */ - private final FoosOperationsImpl foosOperations; + private final FoosImpl foos; /** - * Gets the FoosOperationsImpl object to access its operations. + * Gets the FoosImpl object to access its operations. * - * @return the FoosOperationsImpl object. + * @return the FoosImpl object. */ - public FoosOperationsImpl getFoosOperations() { - return this.foosOperations; + public FoosImpl getFoos() { + return this.foos; } /** - * The BarsOperationsImpl object to access its operations. + * The BarsImpl object to access its operations. */ - private final BarsOperationsImpl barsOperations; + private final BarsImpl bars; /** - * Gets the BarsOperationsImpl object to access its operations. + * Gets the BarsImpl object to access its operations. * - * @return the BarsOperationsImpl object. + * @return the BarsImpl object. */ - public BarsOperationsImpl getBarsOperations() { - return this.barsOperations; + public BarsImpl getBars() { + return this.bars; } /** @@ -214,12 +201,11 @@ public ServiceClientClientImpl(HttpPipeline httpPipeline, SerializerAdapter seri this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; this.client = client; - this.bazes = new BazesImpl(this); - this.foos = new FoosImpl(this); + this.bazFoos = new BazFoosImpl(this); this.quxes = new QuxesImpl(this); + this.quxBars = new QuxBarsImpl(this); + this.foos = new FoosImpl(this); this.bars = new BarsImpl(this); - this.foosOperations = new FoosOperationsImpl(this); - this.barsOperations = new BarsOperationsImpl(this); this.service = RestProxy.create(ServiceClientClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -238,7 +224,7 @@ public interface ServiceClientClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> one(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/one") @ExpectedResponses({ 204 }) @@ -247,7 +233,7 @@ Mono> one(@HostParam("endpoint") String endpoint, @HostParam("cli @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response oneSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/two") @ExpectedResponses({ 204 }) @@ -256,7 +242,7 @@ Response oneSync(@HostParam("endpoint") String endpoint, @HostParam("clien @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> two(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/two") @ExpectedResponses({ 204 }) @@ -265,7 +251,7 @@ Mono> two(@HostParam("endpoint") String endpoint, @HostParam("cli @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response twoSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -280,8 +266,9 @@ Response twoSync(@HostParam("endpoint") String endpoint, @HostParam("clien */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> oneWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; return FluxUtil - .withContext(context -> service.one(this.getEndpoint(), this.getClient(), requestOptions, context)); + .withContext(context -> service.one(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); } /** @@ -296,7 +283,8 @@ public Mono> oneWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response oneWithResponse(RequestOptions requestOptions) { - return service.oneSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.oneSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); } /** @@ -311,8 +299,9 @@ public Response oneWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> twoWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; return FluxUtil - .withContext(context -> service.two(this.getEndpoint(), this.getClient(), requestOptions, context)); + .withContext(context -> service.two(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); } /** @@ -327,6 +316,7 @@ public Mono> twoWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response twoWithResponse(RequestOptions requestOptions) { - return service.twoSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.twoSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/bytes/implementation/HeadersImpl.java b/typespec-tests/src/main/java/com/encode/bytes/implementation/HeadersImpl.java index 6ff5c712a4..ade2fdb28e 100644 --- a/typespec-tests/src/main/java/com/encode/bytes/implementation/HeadersImpl.java +++ b/typespec-tests/src/main/java/com/encode/bytes/implementation/HeadersImpl.java @@ -66,8 +66,8 @@ public interface HeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("value") String value, RequestOptions requestOptions, - Context context); + Mono> defaultMethod(@HeaderParam("value") String value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/header/default") @ExpectedResponses({ 204 }) @@ -75,8 +75,8 @@ Mono> defaultMethod(@HeaderParam("value") String value, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("value") String value, RequestOptions requestOptions, - Context context); + Response defaultMethodSync(@HeaderParam("value") String value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/header/base64") @ExpectedResponses({ 204 }) @@ -84,7 +84,8 @@ Response defaultMethodSync(@HeaderParam("value") String value, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64(@HeaderParam("value") String value, RequestOptions requestOptions, Context context); + Mono> base64(@HeaderParam("value") String value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/header/base64") @ExpectedResponses({ 204 }) @@ -92,7 +93,8 @@ Response defaultMethodSync(@HeaderParam("value") String value, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64Sync(@HeaderParam("value") String value, RequestOptions requestOptions, Context context); + Response base64Sync(@HeaderParam("value") String value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/header/base64url") @ExpectedResponses({ 204 }) @@ -100,8 +102,8 @@ Response defaultMethodSync(@HeaderParam("value") String value, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64url(@HeaderParam("value") Base64Url value, RequestOptions requestOptions, - Context context); + Mono> base64url(@HeaderParam("value") Base64Url value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/header/base64url") @ExpectedResponses({ 204 }) @@ -109,8 +111,8 @@ Mono> base64url(@HeaderParam("value") Base64Url value, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlSync(@HeaderParam("value") Base64Url value, RequestOptions requestOptions, - Context context); + Response base64urlSync(@HeaderParam("value") Base64Url value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/header/base64url-array") @ExpectedResponses({ 204 }) @@ -118,8 +120,8 @@ Response base64urlSync(@HeaderParam("value") Base64Url value, RequestOptio @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64urlArray(@HeaderParam("value") String value, RequestOptions requestOptions, - Context context); + Mono> base64urlArray(@HeaderParam("value") String value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/header/base64url-array") @ExpectedResponses({ 204 }) @@ -127,8 +129,8 @@ Mono> base64urlArray(@HeaderParam("value") String value, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlArraySync(@HeaderParam("value") String value, RequestOptions requestOptions, - Context context); + Response base64urlArraySync(@HeaderParam("value") String value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); } /** @@ -144,8 +146,9 @@ Response base64urlArraySync(@HeaderParam("value") String value, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(byte[] value, RequestOptions requestOptions) { + final String accept = "application/json"; String valueConverted = Base64Util.encodeToString(value); - return FluxUtil.withContext(context -> service.defaultMethod(valueConverted, requestOptions, context)); + return FluxUtil.withContext(context -> service.defaultMethod(valueConverted, accept, requestOptions, context)); } /** @@ -161,8 +164,9 @@ public Mono> defaultMethodWithResponseAsync(byte[] value, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(byte[] value, RequestOptions requestOptions) { + final String accept = "application/json"; String valueConverted = Base64Util.encodeToString(value); - return service.defaultMethodSync(valueConverted, requestOptions, Context.NONE); + return service.defaultMethodSync(valueConverted, accept, requestOptions, Context.NONE); } /** @@ -178,8 +182,9 @@ public Response defaultMethodWithResponse(byte[] value, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64WithResponseAsync(byte[] value, RequestOptions requestOptions) { + final String accept = "application/json"; String valueConverted = Base64Util.encodeToString(value); - return FluxUtil.withContext(context -> service.base64(valueConverted, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64(valueConverted, accept, requestOptions, context)); } /** @@ -195,8 +200,9 @@ public Mono> base64WithResponseAsync(byte[] value, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64WithResponse(byte[] value, RequestOptions requestOptions) { + final String accept = "application/json"; String valueConverted = Base64Util.encodeToString(value); - return service.base64Sync(valueConverted, requestOptions, Context.NONE); + return service.base64Sync(valueConverted, accept, requestOptions, Context.NONE); } /** @@ -212,8 +218,9 @@ public Response base64WithResponse(byte[] value, RequestOptions requestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64urlWithResponseAsync(byte[] value, RequestOptions requestOptions) { + final String accept = "application/json"; Base64Url valueConverted = Base64Url.encode(value); - return FluxUtil.withContext(context -> service.base64url(valueConverted, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64url(valueConverted, accept, requestOptions, context)); } /** @@ -229,8 +236,9 @@ public Mono> base64urlWithResponseAsync(byte[] value, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64urlWithResponse(byte[] value, RequestOptions requestOptions) { + final String accept = "application/json"; Base64Url valueConverted = Base64Url.encode(value); - return service.base64urlSync(valueConverted, requestOptions, Context.NONE); + return service.base64urlSync(valueConverted, accept, requestOptions, Context.NONE); } /** @@ -246,11 +254,12 @@ public Response base64urlWithResponse(byte[] value, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64urlArrayWithResponseAsync(List value, RequestOptions requestOptions) { + final String accept = "application/json"; String valueConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( value.stream().map(paramItemValue -> Base64Url.encode(paramItemValue)).collect(Collectors.toList()), CollectionFormat.CSV); - return FluxUtil.withContext(context -> service.base64urlArray(valueConverted, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64urlArray(valueConverted, accept, requestOptions, context)); } /** @@ -266,10 +275,11 @@ public Mono> base64urlArrayWithResponseAsync(List value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64urlArrayWithResponse(List value, RequestOptions requestOptions) { + final String accept = "application/json"; String valueConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( value.stream().map(paramItemValue -> Base64Url.encode(paramItemValue)).collect(Collectors.toList()), CollectionFormat.CSV); - return service.base64urlArraySync(valueConverted, requestOptions, Context.NONE); + return service.base64urlArraySync(valueConverted, accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/bytes/implementation/PropertiesImpl.java b/typespec-tests/src/main/java/com/encode/bytes/implementation/PropertiesImpl.java index fadb0b0f01..bbf7991a31 100644 --- a/typespec-tests/src/main/java/com/encode/bytes/implementation/PropertiesImpl.java +++ b/typespec-tests/src/main/java/com/encode/bytes/implementation/PropertiesImpl.java @@ -63,9 +63,8 @@ public interface PropertiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> defaultMethod(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/default") @ExpectedResponses({ 200 }) @@ -73,9 +72,8 @@ Mono> defaultMethod(@HeaderParam("Content-Type") String con @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response defaultMethodSync(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/base64") @ExpectedResponses({ 200 }) @@ -83,9 +81,8 @@ Response defaultMethodSync(@HeaderParam("Content-Type") String conte @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> base64(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/base64") @ExpectedResponses({ 200 }) @@ -93,9 +90,8 @@ Mono> base64(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64Sync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response base64Sync(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/base64url") @ExpectedResponses({ 200 }) @@ -103,9 +99,8 @@ Response base64Sync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64url(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> base64url(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/base64url") @ExpectedResponses({ 200 }) @@ -113,9 +108,8 @@ Mono> base64url(@HeaderParam("Content-Type") String content @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response base64urlSync(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/base64url-array") @ExpectedResponses({ 200 }) @@ -123,9 +117,8 @@ Response base64urlSync(@HeaderParam("Content-Type") String contentTy @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64urlArray(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> base64urlArray(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/base64url-array") @ExpectedResponses({ 200 }) @@ -133,9 +126,8 @@ Mono> base64urlArray(@HeaderParam("Content-Type") String co @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlArraySync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response base64urlArraySync(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -166,10 +158,8 @@ Response base64urlArraySync(@HeaderParam("Content-Type") String cont */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.defaultMethod(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.defaultMethod(accept, body, requestOptions, context)); } /** @@ -200,9 +190,8 @@ public Mono> defaultMethodWithResponseAsync(BinaryData body */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.defaultMethodSync(contentType, accept, body, requestOptions, Context.NONE); + return service.defaultMethodSync(accept, body, requestOptions, Context.NONE); } /** @@ -233,9 +222,8 @@ public Response defaultMethodWithResponse(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64WithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.base64(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64(accept, body, requestOptions, context)); } /** @@ -266,9 +254,8 @@ public Mono> base64WithResponseAsync(BinaryData body, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64WithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.base64Sync(contentType, accept, body, requestOptions, Context.NONE); + return service.base64Sync(accept, body, requestOptions, Context.NONE); } /** @@ -299,9 +286,8 @@ public Response base64WithResponse(BinaryData body, RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64urlWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.base64url(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64url(accept, body, requestOptions, context)); } /** @@ -332,9 +318,8 @@ public Mono> base64urlWithResponseAsync(BinaryData body, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64urlWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.base64urlSync(contentType, accept, body, requestOptions, Context.NONE); + return service.base64urlSync(accept, body, requestOptions, Context.NONE); } /** @@ -369,10 +354,8 @@ public Response base64urlWithResponse(BinaryData body, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64urlArrayWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.base64urlArray(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64urlArray(accept, body, requestOptions, context)); } /** @@ -407,8 +390,7 @@ public Mono> base64urlArrayWithResponseAsync(BinaryData bod */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64urlArrayWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.base64urlArraySync(contentType, accept, body, requestOptions, Context.NONE); + return service.base64urlArraySync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/bytes/implementation/QueriesImpl.java b/typespec-tests/src/main/java/com/encode/bytes/implementation/QueriesImpl.java index 176ea4989f..a902ff21d0 100644 --- a/typespec-tests/src/main/java/com/encode/bytes/implementation/QueriesImpl.java +++ b/typespec-tests/src/main/java/com/encode/bytes/implementation/QueriesImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -66,8 +67,8 @@ public interface QueriesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@QueryParam("value") String value, RequestOptions requestOptions, - Context context); + Mono> defaultMethod(@QueryParam("value") String value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/query/default") @ExpectedResponses({ 204 }) @@ -75,8 +76,8 @@ Mono> defaultMethod(@QueryParam("value") String value, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@QueryParam("value") String value, RequestOptions requestOptions, - Context context); + Response defaultMethodSync(@QueryParam("value") String value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/query/base64") @ExpectedResponses({ 204 }) @@ -84,7 +85,8 @@ Response defaultMethodSync(@QueryParam("value") String value, RequestOptio @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64(@QueryParam("value") String value, RequestOptions requestOptions, Context context); + Mono> base64(@QueryParam("value") String value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/query/base64") @ExpectedResponses({ 204 }) @@ -92,7 +94,8 @@ Response defaultMethodSync(@QueryParam("value") String value, RequestOptio @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64Sync(@QueryParam("value") String value, RequestOptions requestOptions, Context context); + Response base64Sync(@QueryParam("value") String value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/query/base64url") @ExpectedResponses({ 204 }) @@ -100,8 +103,8 @@ Response defaultMethodSync(@QueryParam("value") String value, RequestOptio @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64url(@QueryParam("value") Base64Url value, RequestOptions requestOptions, - Context context); + Mono> base64url(@QueryParam("value") Base64Url value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/query/base64url") @ExpectedResponses({ 204 }) @@ -109,8 +112,8 @@ Mono> base64url(@QueryParam("value") Base64Url value, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlSync(@QueryParam("value") Base64Url value, RequestOptions requestOptions, - Context context); + Response base64urlSync(@QueryParam("value") Base64Url value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/query/base64url-array") @ExpectedResponses({ 204 }) @@ -118,8 +121,8 @@ Response base64urlSync(@QueryParam("value") Base64Url value, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64urlArray(@QueryParam("value") String value, RequestOptions requestOptions, - Context context); + Mono> base64urlArray(@QueryParam("value") String value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/query/base64url-array") @ExpectedResponses({ 204 }) @@ -127,8 +130,8 @@ Mono> base64urlArray(@QueryParam("value") String value, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlArraySync(@QueryParam("value") String value, RequestOptions requestOptions, - Context context); + Response base64urlArraySync(@QueryParam("value") String value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); } /** @@ -144,8 +147,9 @@ Response base64urlArraySync(@QueryParam("value") String value, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(byte[] value, RequestOptions requestOptions) { + final String accept = "application/json"; String valueConverted = Base64Util.encodeToString(value); - return FluxUtil.withContext(context -> service.defaultMethod(valueConverted, requestOptions, context)); + return FluxUtil.withContext(context -> service.defaultMethod(valueConverted, accept, requestOptions, context)); } /** @@ -161,8 +165,9 @@ public Mono> defaultMethodWithResponseAsync(byte[] value, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(byte[] value, RequestOptions requestOptions) { + final String accept = "application/json"; String valueConverted = Base64Util.encodeToString(value); - return service.defaultMethodSync(valueConverted, requestOptions, Context.NONE); + return service.defaultMethodSync(valueConverted, accept, requestOptions, Context.NONE); } /** @@ -178,8 +183,9 @@ public Response defaultMethodWithResponse(byte[] value, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64WithResponseAsync(byte[] value, RequestOptions requestOptions) { + final String accept = "application/json"; String valueConverted = Base64Util.encodeToString(value); - return FluxUtil.withContext(context -> service.base64(valueConverted, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64(valueConverted, accept, requestOptions, context)); } /** @@ -195,8 +201,9 @@ public Mono> base64WithResponseAsync(byte[] value, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64WithResponse(byte[] value, RequestOptions requestOptions) { + final String accept = "application/json"; String valueConverted = Base64Util.encodeToString(value); - return service.base64Sync(valueConverted, requestOptions, Context.NONE); + return service.base64Sync(valueConverted, accept, requestOptions, Context.NONE); } /** @@ -212,8 +219,9 @@ public Response base64WithResponse(byte[] value, RequestOptions requestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64urlWithResponseAsync(byte[] value, RequestOptions requestOptions) { + final String accept = "application/json"; Base64Url valueConverted = Base64Url.encode(value); - return FluxUtil.withContext(context -> service.base64url(valueConverted, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64url(valueConverted, accept, requestOptions, context)); } /** @@ -229,8 +237,9 @@ public Mono> base64urlWithResponseAsync(byte[] value, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64urlWithResponse(byte[] value, RequestOptions requestOptions) { + final String accept = "application/json"; Base64Url valueConverted = Base64Url.encode(value); - return service.base64urlSync(valueConverted, requestOptions, Context.NONE); + return service.base64urlSync(valueConverted, accept, requestOptions, Context.NONE); } /** @@ -246,11 +255,12 @@ public Response base64urlWithResponse(byte[] value, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64urlArrayWithResponseAsync(List value, RequestOptions requestOptions) { + final String accept = "application/json"; String valueConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( value.stream().map(paramItemValue -> Base64Url.encode(paramItemValue)).collect(Collectors.toList()), CollectionFormat.CSV); - return FluxUtil.withContext(context -> service.base64urlArray(valueConverted, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64urlArray(valueConverted, accept, requestOptions, context)); } /** @@ -266,10 +276,11 @@ public Mono> base64urlArrayWithResponseAsync(List value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64urlArrayWithResponse(List value, RequestOptions requestOptions) { + final String accept = "application/json"; String valueConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( value.stream().map(paramItemValue -> Base64Url.encode(paramItemValue)).collect(Collectors.toList()), CollectionFormat.CSV); - return service.base64urlArraySync(valueConverted, requestOptions, Context.NONE); + return service.base64urlArraySync(valueConverted, accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/bytes/implementation/RequestBodiesImpl.java b/typespec-tests/src/main/java/com/encode/bytes/implementation/RequestBodiesImpl.java index 0d8c967708..762be5849e 100644 --- a/typespec-tests/src/main/java/com/encode/bytes/implementation/RequestBodiesImpl.java +++ b/typespec-tests/src/main/java/com/encode/bytes/implementation/RequestBodiesImpl.java @@ -63,7 +63,7 @@ public interface RequestBodiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("Content-Type") String contentType, + Mono> defaultMethod(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/default") @@ -72,7 +72,7 @@ Mono> defaultMethod(@HeaderParam("Content-Type") String contentTy @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("Content-Type") String contentType, + Response defaultMethodSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/octet-stream") @@ -81,8 +81,9 @@ Response defaultMethodSync(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> octetStream(@HeaderParam("content-type") String contentType, - @BodyParam("application/octet-stream") BinaryData value, RequestOptions requestOptions, Context context); + Mono> octetStream(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("application/octet-stream") BinaryData value, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/octet-stream") @ExpectedResponses({ 204 }) @@ -90,8 +91,9 @@ Mono> octetStream(@HeaderParam("content-type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response octetStreamSync(@HeaderParam("content-type") String contentType, - @BodyParam("application/octet-stream") BinaryData value, RequestOptions requestOptions, Context context); + Response octetStreamSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("application/octet-stream") BinaryData value, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/custom-content-type") @ExpectedResponses({ 204 }) @@ -99,8 +101,9 @@ Response octetStreamSync(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> customContentType(@HeaderParam("content-type") String contentType, - @BodyParam("image/png") BinaryData value, RequestOptions requestOptions, Context context); + Mono> customContentType(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("image/png") BinaryData value, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/custom-content-type") @ExpectedResponses({ 204 }) @@ -108,8 +111,9 @@ Mono> customContentType(@HeaderParam("content-type") String conte @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response customContentTypeSync(@HeaderParam("content-type") String contentType, - @BodyParam("image/png") BinaryData value, RequestOptions requestOptions, Context context); + Response customContentTypeSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("image/png") BinaryData value, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/base64") @ExpectedResponses({ 204 }) @@ -117,7 +121,7 @@ Response customContentTypeSync(@HeaderParam("content-type") String content @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64(@HeaderParam("Content-Type") String contentType, + Mono> base64(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/base64") @@ -126,8 +130,8 @@ Mono> base64(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64Sync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); + Response base64Sync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData value, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/base64url") @ExpectedResponses({ 204 }) @@ -135,7 +139,7 @@ Response base64Sync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64url(@HeaderParam("Content-Type") String contentType, + Mono> base64url(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/base64url") @@ -144,7 +148,7 @@ Mono> base64url(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlSync(@HeaderParam("Content-Type") String contentType, + Response base64urlSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); } @@ -166,8 +170,8 @@ Response base64urlSync(@HeaderParam("Content-Type") String contentType, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(BinaryData value, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.defaultMethod(contentType, value, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.defaultMethod(accept, value, requestOptions, context)); } /** @@ -188,8 +192,8 @@ public Mono> defaultMethodWithResponseAsync(BinaryData value, Req */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(BinaryData value, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.defaultMethodSync(contentType, value, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.defaultMethodSync(accept, value, requestOptions, Context.NONE); } /** @@ -211,7 +215,9 @@ public Response defaultMethodWithResponse(BinaryData value, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> octetStreamWithResponseAsync(BinaryData value, RequestOptions requestOptions) { final String contentType = "application/octet-stream"; - return FluxUtil.withContext(context -> service.octetStream(contentType, value, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.octetStream(contentType, accept, value, requestOptions, context)); } /** @@ -233,7 +239,8 @@ public Mono> octetStreamWithResponseAsync(BinaryData value, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response octetStreamWithResponse(BinaryData value, RequestOptions requestOptions) { final String contentType = "application/octet-stream"; - return service.octetStreamSync(contentType, value, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.octetStreamSync(contentType, accept, value, requestOptions, Context.NONE); } /** @@ -255,7 +262,9 @@ public Response octetStreamWithResponse(BinaryData value, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> customContentTypeWithResponseAsync(BinaryData value, RequestOptions requestOptions) { final String contentType = "image/png"; - return FluxUtil.withContext(context -> service.customContentType(contentType, value, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.customContentType(contentType, accept, value, requestOptions, context)); } /** @@ -277,7 +286,8 @@ public Mono> customContentTypeWithResponseAsync(BinaryData value, @ServiceMethod(returns = ReturnType.SINGLE) public Response customContentTypeWithResponse(BinaryData value, RequestOptions requestOptions) { final String contentType = "image/png"; - return service.customContentTypeSync(contentType, value, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.customContentTypeSync(contentType, accept, value, requestOptions, Context.NONE); } /** @@ -298,8 +308,8 @@ public Response customContentTypeWithResponse(BinaryData value, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64WithResponseAsync(BinaryData value, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.base64(contentType, value, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.base64(accept, value, requestOptions, context)); } /** @@ -320,8 +330,8 @@ public Mono> base64WithResponseAsync(BinaryData value, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64WithResponse(BinaryData value, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.base64Sync(contentType, value, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.base64Sync(accept, value, requestOptions, Context.NONE); } /** @@ -342,8 +352,8 @@ public Response base64WithResponse(BinaryData value, RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64urlWithResponseAsync(BinaryData value, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.base64url(contentType, value, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.base64url(accept, value, requestOptions, context)); } /** @@ -364,7 +374,7 @@ public Mono> base64urlWithResponseAsync(BinaryData value, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64urlWithResponse(BinaryData value, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.base64urlSync(contentType, value, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.base64urlSync(accept, value, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/bytes/implementation/ResponseBodiesImpl.java b/typespec-tests/src/main/java/com/encode/bytes/implementation/ResponseBodiesImpl.java index 7aa9f06c83..771602d9f8 100644 --- a/typespec-tests/src/main/java/com/encode/bytes/implementation/ResponseBodiesImpl.java +++ b/typespec-tests/src/main/java/com/encode/bytes/implementation/ResponseBodiesImpl.java @@ -62,7 +62,7 @@ public interface ResponseBodiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> defaultMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/default") @@ -71,7 +71,7 @@ Mono> defaultMethod(@HeaderParam("Accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response defaultMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/octet-stream") @@ -80,7 +80,7 @@ Response defaultMethodSync(@HeaderParam("Accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> octetStream(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> octetStream(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/octet-stream") @@ -89,7 +89,7 @@ Mono> octetStream(@HeaderParam("Accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response octetStreamSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response octetStreamSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/custom-content-type") @@ -98,7 +98,7 @@ Response octetStreamSync(@HeaderParam("Accept") String accept, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> customContentType(@HeaderParam("Accept") String accept, + Mono> customContentType(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/custom-content-type") @@ -107,7 +107,7 @@ Mono> customContentType(@HeaderParam("Accept") String accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response customContentTypeSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response customContentTypeSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/base64") @@ -116,7 +116,7 @@ Response customContentTypeSync(@HeaderParam("Accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> base64(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/base64") @@ -125,7 +125,7 @@ Mono> base64(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64Sync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response base64Sync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/base64url") @@ -134,7 +134,7 @@ Response base64Sync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64url(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> base64url(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/base64url") @@ -143,7 +143,7 @@ Mono> base64url(@HeaderParam("Accept") String accept, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response base64urlSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/encode/datetime/implementation/HeadersImpl.java b/typespec-tests/src/main/java/com/encode/datetime/implementation/HeadersImpl.java index a28340f48f..1df2acf9e8 100644 --- a/typespec-tests/src/main/java/com/encode/datetime/implementation/HeadersImpl.java +++ b/typespec-tests/src/main/java/com/encode/datetime/implementation/HeadersImpl.java @@ -66,8 +66,8 @@ public interface HeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, - Context context); + Mono> defaultMethod(@HeaderParam("value") DateTimeRfc1123 value, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/datetime/header/default") @ExpectedResponses({ 204 }) @@ -75,8 +75,8 @@ Mono> defaultMethod(@HeaderParam("value") DateTimeRfc1123 value, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, - Context context); + Response defaultMethodSync(@HeaderParam("value") DateTimeRfc1123 value, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/datetime/header/rfc3339") @ExpectedResponses({ 204 }) @@ -84,8 +84,8 @@ Response defaultMethodSync(@HeaderParam("value") DateTimeRfc1123 value, Re @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc3339(@HeaderParam("value") OffsetDateTime value, RequestOptions requestOptions, - Context context); + Mono> rfc3339(@HeaderParam("value") OffsetDateTime value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/datetime/header/rfc3339") @ExpectedResponses({ 204 }) @@ -93,8 +93,8 @@ Mono> rfc3339(@HeaderParam("value") OffsetDateTime value, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc3339Sync(@HeaderParam("value") OffsetDateTime value, RequestOptions requestOptions, - Context context); + Response rfc3339Sync(@HeaderParam("value") OffsetDateTime value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/datetime/header/rfc7231") @ExpectedResponses({ 204 }) @@ -102,8 +102,8 @@ Response rfc3339Sync(@HeaderParam("value") OffsetDateTime value, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc7231(@HeaderParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, - Context context); + Mono> rfc7231(@HeaderParam("value") DateTimeRfc1123 value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/datetime/header/rfc7231") @ExpectedResponses({ 204 }) @@ -111,8 +111,8 @@ Mono> rfc7231(@HeaderParam("value") DateTimeRfc1123 value, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc7231Sync(@HeaderParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, - Context context); + Response rfc7231Sync(@HeaderParam("value") DateTimeRfc1123 value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/datetime/header/unix-timestamp") @ExpectedResponses({ 204 }) @@ -120,8 +120,8 @@ Response rfc7231Sync(@HeaderParam("value") DateTimeRfc1123 value, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestamp(@HeaderParam("value") long value, RequestOptions requestOptions, - Context context); + Mono> unixTimestamp(@HeaderParam("value") long value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/datetime/header/unix-timestamp") @ExpectedResponses({ 204 }) @@ -129,8 +129,8 @@ Mono> unixTimestamp(@HeaderParam("value") long value, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampSync(@HeaderParam("value") long value, RequestOptions requestOptions, - Context context); + Response unixTimestampSync(@HeaderParam("value") long value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/datetime/header/unix-timestamp-array") @ExpectedResponses({ 204 }) @@ -138,8 +138,8 @@ Response unixTimestampSync(@HeaderParam("value") long value, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestampArray(@HeaderParam("value") String value, RequestOptions requestOptions, - Context context); + Mono> unixTimestampArray(@HeaderParam("value") String value, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/datetime/header/unix-timestamp-array") @ExpectedResponses({ 204 }) @@ -147,8 +147,8 @@ Mono> unixTimestampArray(@HeaderParam("value") String value, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampArraySync(@HeaderParam("value") String value, RequestOptions requestOptions, - Context context); + Response unixTimestampArraySync(@HeaderParam("value") String value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); } /** @@ -164,8 +164,9 @@ Response unixTimestampArraySync(@HeaderParam("value") String value, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { + final String accept = "application/json"; DateTimeRfc1123 valueConverted = new DateTimeRfc1123(value); - return FluxUtil.withContext(context -> service.defaultMethod(valueConverted, requestOptions, context)); + return FluxUtil.withContext(context -> service.defaultMethod(valueConverted, accept, requestOptions, context)); } /** @@ -181,8 +182,9 @@ public Mono> defaultMethodWithResponseAsync(OffsetDateTime value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(OffsetDateTime value, RequestOptions requestOptions) { + final String accept = "application/json"; DateTimeRfc1123 valueConverted = new DateTimeRfc1123(value); - return service.defaultMethodSync(valueConverted, requestOptions, Context.NONE); + return service.defaultMethodSync(valueConverted, accept, requestOptions, Context.NONE); } /** @@ -198,7 +200,8 @@ public Response defaultMethodWithResponse(OffsetDateTime value, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc3339WithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.rfc3339(value, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.rfc3339(value, accept, requestOptions, context)); } /** @@ -214,7 +217,8 @@ public Mono> rfc3339WithResponseAsync(OffsetDateTime value, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc3339WithResponse(OffsetDateTime value, RequestOptions requestOptions) { - return service.rfc3339Sync(value, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.rfc3339Sync(value, accept, requestOptions, Context.NONE); } /** @@ -230,8 +234,9 @@ public Response rfc3339WithResponse(OffsetDateTime value, RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc7231WithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { + final String accept = "application/json"; DateTimeRfc1123 valueConverted = new DateTimeRfc1123(value); - return FluxUtil.withContext(context -> service.rfc7231(valueConverted, requestOptions, context)); + return FluxUtil.withContext(context -> service.rfc7231(valueConverted, accept, requestOptions, context)); } /** @@ -247,8 +252,9 @@ public Mono> rfc7231WithResponseAsync(OffsetDateTime value, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc7231WithResponse(OffsetDateTime value, RequestOptions requestOptions) { + final String accept = "application/json"; DateTimeRfc1123 valueConverted = new DateTimeRfc1123(value); - return service.rfc7231Sync(valueConverted, requestOptions, Context.NONE); + return service.rfc7231Sync(valueConverted, accept, requestOptions, Context.NONE); } /** @@ -264,8 +270,9 @@ public Response rfc7231WithResponse(OffsetDateTime value, RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unixTimestampWithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { + final String accept = "application/json"; long valueConverted = value.toEpochSecond(); - return FluxUtil.withContext(context -> service.unixTimestamp(valueConverted, requestOptions, context)); + return FluxUtil.withContext(context -> service.unixTimestamp(valueConverted, accept, requestOptions, context)); } /** @@ -281,8 +288,9 @@ public Mono> unixTimestampWithResponseAsync(OffsetDateTime value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response unixTimestampWithResponse(OffsetDateTime value, RequestOptions requestOptions) { + final String accept = "application/json"; long valueConverted = value.toEpochSecond(); - return service.unixTimestampSync(valueConverted, requestOptions, Context.NONE); + return service.unixTimestampSync(valueConverted, accept, requestOptions, Context.NONE); } /** @@ -299,11 +307,13 @@ public Response unixTimestampWithResponse(OffsetDateTime value, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unixTimestampArrayWithResponseAsync(List value, RequestOptions requestOptions) { + final String accept = "application/json"; String valueConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( value.stream().map(paramItemValue -> paramItemValue.toEpochSecond()).collect(Collectors.toList()), CollectionFormat.CSV); - return FluxUtil.withContext(context -> service.unixTimestampArray(valueConverted, requestOptions, context)); + return FluxUtil + .withContext(context -> service.unixTimestampArray(valueConverted, accept, requestOptions, context)); } /** @@ -319,10 +329,11 @@ public Mono> unixTimestampArrayWithResponseAsync(List unixTimestampArrayWithResponse(List value, RequestOptions requestOptions) { + final String accept = "application/json"; String valueConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( value.stream().map(paramItemValue -> paramItemValue.toEpochSecond()).collect(Collectors.toList()), CollectionFormat.CSV); - return service.unixTimestampArraySync(valueConverted, requestOptions, Context.NONE); + return service.unixTimestampArraySync(valueConverted, accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/datetime/implementation/PropertiesImpl.java b/typespec-tests/src/main/java/com/encode/datetime/implementation/PropertiesImpl.java index 7b1be1ade9..6fed967c47 100644 --- a/typespec-tests/src/main/java/com/encode/datetime/implementation/PropertiesImpl.java +++ b/typespec-tests/src/main/java/com/encode/datetime/implementation/PropertiesImpl.java @@ -63,9 +63,8 @@ public interface PropertiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> defaultMethod(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/default") @ExpectedResponses({ 200 }) @@ -73,9 +72,8 @@ Mono> defaultMethod(@HeaderParam("Content-Type") String con @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response defaultMethodSync(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/rfc3339") @ExpectedResponses({ 200 }) @@ -83,9 +81,8 @@ Response defaultMethodSync(@HeaderParam("Content-Type") String conte @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc3339(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> rfc3339(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/rfc3339") @ExpectedResponses({ 200 }) @@ -93,9 +90,8 @@ Mono> rfc3339(@HeaderParam("Content-Type") String contentTy @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc3339Sync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response rfc3339Sync(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/rfc7231") @ExpectedResponses({ 200 }) @@ -103,9 +99,8 @@ Response rfc3339Sync(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc7231(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> rfc7231(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/rfc7231") @ExpectedResponses({ 200 }) @@ -113,9 +108,8 @@ Mono> rfc7231(@HeaderParam("Content-Type") String contentTy @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc7231Sync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response rfc7231Sync(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/unix-timestamp") @ExpectedResponses({ 200 }) @@ -123,9 +117,8 @@ Response rfc7231Sync(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestamp(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> unixTimestamp(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/unix-timestamp") @ExpectedResponses({ 200 }) @@ -133,9 +126,8 @@ Mono> unixTimestamp(@HeaderParam("Content-Type") String con @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response unixTimestampSync(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/unix-timestamp-array") @ExpectedResponses({ 200 }) @@ -143,9 +135,8 @@ Response unixTimestampSync(@HeaderParam("Content-Type") String conte @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestampArray(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> unixTimestampArray(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/unix-timestamp-array") @ExpectedResponses({ 200 }) @@ -153,9 +144,8 @@ Mono> unixTimestampArray(@HeaderParam("Content-Type") Strin @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampArraySync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response unixTimestampArraySync(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -186,10 +176,8 @@ Response unixTimestampArraySync(@HeaderParam("Content-Type") String */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.defaultMethod(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.defaultMethod(accept, body, requestOptions, context)); } /** @@ -220,9 +208,8 @@ public Mono> defaultMethodWithResponseAsync(BinaryData body */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.defaultMethodSync(contentType, accept, body, requestOptions, Context.NONE); + return service.defaultMethodSync(accept, body, requestOptions, Context.NONE); } /** @@ -253,9 +240,8 @@ public Response defaultMethodWithResponse(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc3339WithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.rfc3339(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.rfc3339(accept, body, requestOptions, context)); } /** @@ -286,9 +272,8 @@ public Mono> rfc3339WithResponseAsync(BinaryData body, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc3339WithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.rfc3339Sync(contentType, accept, body, requestOptions, Context.NONE); + return service.rfc3339Sync(accept, body, requestOptions, Context.NONE); } /** @@ -319,9 +304,8 @@ public Response rfc3339WithResponse(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc7231WithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.rfc7231(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.rfc7231(accept, body, requestOptions, context)); } /** @@ -352,9 +336,8 @@ public Mono> rfc7231WithResponseAsync(BinaryData body, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc7231WithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.rfc7231Sync(contentType, accept, body, requestOptions, Context.NONE); + return service.rfc7231Sync(accept, body, requestOptions, Context.NONE); } /** @@ -385,10 +368,8 @@ public Response rfc7231WithResponse(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unixTimestampWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.unixTimestamp(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.unixTimestamp(accept, body, requestOptions, context)); } /** @@ -419,9 +400,8 @@ public Mono> unixTimestampWithResponseAsync(BinaryData body */ @ServiceMethod(returns = ReturnType.SINGLE) public Response unixTimestampWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.unixTimestampSync(contentType, accept, body, requestOptions, Context.NONE); + return service.unixTimestampSync(accept, body, requestOptions, Context.NONE); } /** @@ -457,10 +437,8 @@ public Response unixTimestampWithResponse(BinaryData body, RequestOp @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unixTimestampArrayWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.unixTimestampArray(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.unixTimestampArray(accept, body, requestOptions, context)); } /** @@ -495,8 +473,7 @@ public Mono> unixTimestampArrayWithResponseAsync(BinaryData */ @ServiceMethod(returns = ReturnType.SINGLE) public Response unixTimestampArrayWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.unixTimestampArraySync(contentType, accept, body, requestOptions, Context.NONE); + return service.unixTimestampArraySync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/datetime/implementation/QueriesImpl.java b/typespec-tests/src/main/java/com/encode/datetime/implementation/QueriesImpl.java index c093cd7e19..9aa4c27e97 100644 --- a/typespec-tests/src/main/java/com/encode/datetime/implementation/QueriesImpl.java +++ b/typespec-tests/src/main/java/com/encode/datetime/implementation/QueriesImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -66,8 +67,8 @@ public interface QueriesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@QueryParam("value") OffsetDateTime value, RequestOptions requestOptions, - Context context); + Mono> defaultMethod(@QueryParam("value") OffsetDateTime value, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/datetime/query/default") @ExpectedResponses({ 204 }) @@ -75,8 +76,8 @@ Mono> defaultMethod(@QueryParam("value") OffsetDateTime value, Re @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@QueryParam("value") OffsetDateTime value, RequestOptions requestOptions, - Context context); + Response defaultMethodSync(@QueryParam("value") OffsetDateTime value, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/datetime/query/rfc3339") @ExpectedResponses({ 204 }) @@ -84,8 +85,8 @@ Response defaultMethodSync(@QueryParam("value") OffsetDateTime value, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc3339(@QueryParam("value") OffsetDateTime value, RequestOptions requestOptions, - Context context); + Mono> rfc3339(@QueryParam("value") OffsetDateTime value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/datetime/query/rfc3339") @ExpectedResponses({ 204 }) @@ -93,8 +94,8 @@ Mono> rfc3339(@QueryParam("value") OffsetDateTime value, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc3339Sync(@QueryParam("value") OffsetDateTime value, RequestOptions requestOptions, - Context context); + Response rfc3339Sync(@QueryParam("value") OffsetDateTime value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/datetime/query/rfc7231") @ExpectedResponses({ 204 }) @@ -102,8 +103,8 @@ Response rfc3339Sync(@QueryParam("value") OffsetDateTime value, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc7231(@QueryParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, - Context context); + Mono> rfc7231(@QueryParam("value") DateTimeRfc1123 value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/datetime/query/rfc7231") @ExpectedResponses({ 204 }) @@ -111,8 +112,8 @@ Mono> rfc7231(@QueryParam("value") DateTimeRfc1123 value, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc7231Sync(@QueryParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, - Context context); + Response rfc7231Sync(@QueryParam("value") DateTimeRfc1123 value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/datetime/query/unix-timestamp") @ExpectedResponses({ 204 }) @@ -120,8 +121,8 @@ Response rfc7231Sync(@QueryParam("value") DateTimeRfc1123 value, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestamp(@QueryParam("value") long value, RequestOptions requestOptions, - Context context); + Mono> unixTimestamp(@QueryParam("value") long value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/datetime/query/unix-timestamp") @ExpectedResponses({ 204 }) @@ -129,8 +130,8 @@ Mono> unixTimestamp(@QueryParam("value") long value, RequestOptio @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampSync(@QueryParam("value") long value, RequestOptions requestOptions, - Context context); + Response unixTimestampSync(@QueryParam("value") long value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/datetime/query/unix-timestamp-array") @ExpectedResponses({ 204 }) @@ -138,8 +139,8 @@ Response unixTimestampSync(@QueryParam("value") long value, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestampArray(@QueryParam("value") String value, RequestOptions requestOptions, - Context context); + Mono> unixTimestampArray(@QueryParam("value") String value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/datetime/query/unix-timestamp-array") @ExpectedResponses({ 204 }) @@ -147,8 +148,8 @@ Mono> unixTimestampArray(@QueryParam("value") String value, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampArraySync(@QueryParam("value") String value, RequestOptions requestOptions, - Context context); + Response unixTimestampArraySync(@QueryParam("value") String value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); } /** @@ -164,7 +165,8 @@ Response unixTimestampArraySync(@QueryParam("value") String value, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.defaultMethod(value, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.defaultMethod(value, accept, requestOptions, context)); } /** @@ -180,7 +182,8 @@ public Mono> defaultMethodWithResponseAsync(OffsetDateTime value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(OffsetDateTime value, RequestOptions requestOptions) { - return service.defaultMethodSync(value, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.defaultMethodSync(value, accept, requestOptions, Context.NONE); } /** @@ -196,7 +199,8 @@ public Response defaultMethodWithResponse(OffsetDateTime value, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc3339WithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.rfc3339(value, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.rfc3339(value, accept, requestOptions, context)); } /** @@ -212,7 +216,8 @@ public Mono> rfc3339WithResponseAsync(OffsetDateTime value, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc3339WithResponse(OffsetDateTime value, RequestOptions requestOptions) { - return service.rfc3339Sync(value, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.rfc3339Sync(value, accept, requestOptions, Context.NONE); } /** @@ -228,8 +233,9 @@ public Response rfc3339WithResponse(OffsetDateTime value, RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc7231WithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { + final String accept = "application/json"; DateTimeRfc1123 valueConverted = new DateTimeRfc1123(value); - return FluxUtil.withContext(context -> service.rfc7231(valueConverted, requestOptions, context)); + return FluxUtil.withContext(context -> service.rfc7231(valueConverted, accept, requestOptions, context)); } /** @@ -245,8 +251,9 @@ public Mono> rfc7231WithResponseAsync(OffsetDateTime value, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc7231WithResponse(OffsetDateTime value, RequestOptions requestOptions) { + final String accept = "application/json"; DateTimeRfc1123 valueConverted = new DateTimeRfc1123(value); - return service.rfc7231Sync(valueConverted, requestOptions, Context.NONE); + return service.rfc7231Sync(valueConverted, accept, requestOptions, Context.NONE); } /** @@ -262,8 +269,9 @@ public Response rfc7231WithResponse(OffsetDateTime value, RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unixTimestampWithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { + final String accept = "application/json"; long valueConverted = value.toEpochSecond(); - return FluxUtil.withContext(context -> service.unixTimestamp(valueConverted, requestOptions, context)); + return FluxUtil.withContext(context -> service.unixTimestamp(valueConverted, accept, requestOptions, context)); } /** @@ -279,8 +287,9 @@ public Mono> unixTimestampWithResponseAsync(OffsetDateTime value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response unixTimestampWithResponse(OffsetDateTime value, RequestOptions requestOptions) { + final String accept = "application/json"; long valueConverted = value.toEpochSecond(); - return service.unixTimestampSync(valueConverted, requestOptions, Context.NONE); + return service.unixTimestampSync(valueConverted, accept, requestOptions, Context.NONE); } /** @@ -297,11 +306,13 @@ public Response unixTimestampWithResponse(OffsetDateTime value, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unixTimestampArrayWithResponseAsync(List value, RequestOptions requestOptions) { + final String accept = "application/json"; String valueConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( value.stream().map(paramItemValue -> paramItemValue.toEpochSecond()).collect(Collectors.toList()), CollectionFormat.CSV); - return FluxUtil.withContext(context -> service.unixTimestampArray(valueConverted, requestOptions, context)); + return FluxUtil + .withContext(context -> service.unixTimestampArray(valueConverted, accept, requestOptions, context)); } /** @@ -317,10 +328,11 @@ public Mono> unixTimestampArrayWithResponseAsync(List unixTimestampArrayWithResponse(List value, RequestOptions requestOptions) { + final String accept = "application/json"; String valueConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( value.stream().map(paramItemValue -> paramItemValue.toEpochSecond()).collect(Collectors.toList()), CollectionFormat.CSV); - return service.unixTimestampArraySync(valueConverted, requestOptions, Context.NONE); + return service.unixTimestampArraySync(valueConverted, accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/datetime/implementation/ResponseHeadersImpl.java b/typespec-tests/src/main/java/com/encode/datetime/implementation/ResponseHeadersImpl.java index 5f01e18700..c731513bbb 100644 --- a/typespec-tests/src/main/java/com/encode/datetime/implementation/ResponseHeadersImpl.java +++ b/typespec-tests/src/main/java/com/encode/datetime/implementation/ResponseHeadersImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -60,7 +61,8 @@ public interface ResponseHeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(RequestOptions requestOptions, Context context); + Mono> defaultMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/responseheader/default") @ExpectedResponses({ 204 }) @@ -68,7 +70,8 @@ public interface ResponseHeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(RequestOptions requestOptions, Context context); + Response defaultMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/responseheader/rfc3339") @ExpectedResponses({ 204 }) @@ -76,7 +79,8 @@ public interface ResponseHeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc3339(RequestOptions requestOptions, Context context); + Mono> rfc3339(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/responseheader/rfc3339") @ExpectedResponses({ 204 }) @@ -84,7 +88,8 @@ public interface ResponseHeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc3339Sync(RequestOptions requestOptions, Context context); + Response rfc3339Sync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/responseheader/rfc7231") @ExpectedResponses({ 204 }) @@ -92,7 +97,8 @@ public interface ResponseHeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc7231(RequestOptions requestOptions, Context context); + Mono> rfc7231(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/responseheader/rfc7231") @ExpectedResponses({ 204 }) @@ -100,7 +106,8 @@ public interface ResponseHeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc7231Sync(RequestOptions requestOptions, Context context); + Response rfc7231Sync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/responseheader/unix-timestamp") @ExpectedResponses({ 204 }) @@ -108,7 +115,8 @@ public interface ResponseHeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestamp(RequestOptions requestOptions, Context context); + Mono> unixTimestamp(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/responseheader/unix-timestamp") @ExpectedResponses({ 204 }) @@ -116,7 +124,8 @@ public interface ResponseHeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampSync(RequestOptions requestOptions, Context context); + Response unixTimestampSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); } /** @@ -131,7 +140,8 @@ public interface ResponseHeadersService { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.defaultMethod(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.defaultMethod(accept, requestOptions, context)); } /** @@ -146,7 +156,8 @@ public Mono> defaultMethodWithResponseAsync(RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(RequestOptions requestOptions) { - return service.defaultMethodSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.defaultMethodSync(accept, requestOptions, Context.NONE); } /** @@ -161,7 +172,8 @@ public Response defaultMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc3339WithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.rfc3339(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.rfc3339(accept, requestOptions, context)); } /** @@ -176,7 +188,8 @@ public Mono> rfc3339WithResponseAsync(RequestOptions requestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc3339WithResponse(RequestOptions requestOptions) { - return service.rfc3339Sync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.rfc3339Sync(accept, requestOptions, Context.NONE); } /** @@ -191,7 +204,8 @@ public Response rfc3339WithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc7231WithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.rfc7231(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.rfc7231(accept, requestOptions, context)); } /** @@ -206,7 +220,8 @@ public Mono> rfc7231WithResponseAsync(RequestOptions requestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc7231WithResponse(RequestOptions requestOptions) { - return service.rfc7231Sync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.rfc7231Sync(accept, requestOptions, Context.NONE); } /** @@ -221,7 +236,8 @@ public Response rfc7231WithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unixTimestampWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.unixTimestamp(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.unixTimestamp(accept, requestOptions, context)); } /** @@ -236,6 +252,7 @@ public Mono> unixTimestampWithResponseAsync(RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response unixTimestampWithResponse(RequestOptions requestOptions) { - return service.unixTimestampSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.unixTimestampSync(accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/duration/implementation/HeadersImpl.java b/typespec-tests/src/main/java/com/encode/duration/implementation/HeadersImpl.java index 466082b506..602448ae71 100644 --- a/typespec-tests/src/main/java/com/encode/duration/implementation/HeadersImpl.java +++ b/typespec-tests/src/main/java/com/encode/duration/implementation/HeadersImpl.java @@ -64,8 +64,8 @@ public interface HeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("duration") Duration duration, RequestOptions requestOptions, - Context context); + Mono> defaultMethod(@HeaderParam("duration") Duration duration, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/duration/header/default") @ExpectedResponses({ 204 }) @@ -73,8 +73,8 @@ Mono> defaultMethod(@HeaderParam("duration") Duration duration, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("duration") Duration duration, RequestOptions requestOptions, - Context context); + Response defaultMethodSync(@HeaderParam("duration") Duration duration, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/duration/header/iso8601") @ExpectedResponses({ 204 }) @@ -82,8 +82,8 @@ Response defaultMethodSync(@HeaderParam("duration") Duration duration, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> iso8601(@HeaderParam("duration") Duration duration, RequestOptions requestOptions, - Context context); + Mono> iso8601(@HeaderParam("duration") Duration duration, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/duration/header/iso8601") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> iso8601(@HeaderParam("duration") Duration duration, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response iso8601Sync(@HeaderParam("duration") Duration duration, RequestOptions requestOptions, - Context context); + Response iso8601Sync(@HeaderParam("duration") Duration duration, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/duration/header/iso8601-array") @ExpectedResponses({ 204 }) @@ -100,8 +100,8 @@ Response iso8601Sync(@HeaderParam("duration") Duration duration, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> iso8601Array(@HeaderParam("duration") String duration, RequestOptions requestOptions, - Context context); + Mono> iso8601Array(@HeaderParam("duration") String duration, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/duration/header/iso8601-array") @ExpectedResponses({ 204 }) @@ -109,8 +109,8 @@ Mono> iso8601Array(@HeaderParam("duration") String duration, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response iso8601ArraySync(@HeaderParam("duration") String duration, RequestOptions requestOptions, - Context context); + Response iso8601ArraySync(@HeaderParam("duration") String duration, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/duration/header/int32-seconds") @ExpectedResponses({ 204 }) @@ -118,8 +118,8 @@ Response iso8601ArraySync(@HeaderParam("duration") String duration, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> int32Seconds(@HeaderParam("duration") long duration, RequestOptions requestOptions, - Context context); + Mono> int32Seconds(@HeaderParam("duration") long duration, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/duration/header/int32-seconds") @ExpectedResponses({ 204 }) @@ -127,8 +127,8 @@ Mono> int32Seconds(@HeaderParam("duration") long duration, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response int32SecondsSync(@HeaderParam("duration") long duration, RequestOptions requestOptions, - Context context); + Response int32SecondsSync(@HeaderParam("duration") long duration, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/duration/header/float-seconds") @ExpectedResponses({ 204 }) @@ -136,8 +136,8 @@ Response int32SecondsSync(@HeaderParam("duration") long duration, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> floatSeconds(@HeaderParam("duration") double duration, RequestOptions requestOptions, - Context context); + Mono> floatSeconds(@HeaderParam("duration") double duration, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/duration/header/float-seconds") @ExpectedResponses({ 204 }) @@ -145,8 +145,8 @@ Mono> floatSeconds(@HeaderParam("duration") double duration, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response floatSecondsSync(@HeaderParam("duration") double duration, RequestOptions requestOptions, - Context context); + Response floatSecondsSync(@HeaderParam("duration") double duration, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/duration/header/float64-seconds") @ExpectedResponses({ 204 }) @@ -154,8 +154,8 @@ Response floatSecondsSync(@HeaderParam("duration") double duration, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> float64Seconds(@HeaderParam("duration") double duration, RequestOptions requestOptions, - Context context); + Mono> float64Seconds(@HeaderParam("duration") double duration, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/duration/header/float64-seconds") @ExpectedResponses({ 204 }) @@ -163,8 +163,8 @@ Mono> float64Seconds(@HeaderParam("duration") double duration, Re @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response float64SecondsSync(@HeaderParam("duration") double duration, RequestOptions requestOptions, - Context context); + Response float64SecondsSync(@HeaderParam("duration") double duration, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -180,7 +180,8 @@ Response float64SecondsSync(@HeaderParam("duration") double duration, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(Duration duration, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.defaultMethod(duration, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.defaultMethod(duration, accept, requestOptions, context)); } /** @@ -196,7 +197,8 @@ public Mono> defaultMethodWithResponseAsync(Duration duration, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(Duration duration, RequestOptions requestOptions) { - return service.defaultMethodSync(duration, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.defaultMethodSync(duration, accept, requestOptions, Context.NONE); } /** @@ -212,7 +214,8 @@ public Response defaultMethodWithResponse(Duration duration, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> iso8601WithResponseAsync(Duration duration, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.iso8601(duration, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.iso8601(duration, accept, requestOptions, context)); } /** @@ -228,7 +231,8 @@ public Mono> iso8601WithResponseAsync(Duration duration, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response iso8601WithResponse(Duration duration, RequestOptions requestOptions) { - return service.iso8601Sync(duration, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.iso8601Sync(duration, accept, requestOptions, Context.NONE); } /** @@ -244,9 +248,11 @@ public Response iso8601WithResponse(Duration duration, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> iso8601ArrayWithResponseAsync(List duration, RequestOptions requestOptions) { + final String accept = "application/json"; String durationConverted = JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(duration, CollectionFormat.CSV); - return FluxUtil.withContext(context -> service.iso8601Array(durationConverted, requestOptions, context)); + return FluxUtil + .withContext(context -> service.iso8601Array(durationConverted, accept, requestOptions, context)); } /** @@ -262,9 +268,10 @@ public Mono> iso8601ArrayWithResponseAsync(List duratio */ @ServiceMethod(returns = ReturnType.SINGLE) public Response iso8601ArrayWithResponse(List duration, RequestOptions requestOptions) { + final String accept = "application/json"; String durationConverted = JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(duration, CollectionFormat.CSV); - return service.iso8601ArraySync(durationConverted, requestOptions, Context.NONE); + return service.iso8601ArraySync(durationConverted, accept, requestOptions, Context.NONE); } /** @@ -280,8 +287,10 @@ public Response iso8601ArrayWithResponse(List duration, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> int32SecondsWithResponseAsync(Duration duration, RequestOptions requestOptions) { + final String accept = "application/json"; long durationConverted = duration.getSeconds(); - return FluxUtil.withContext(context -> service.int32Seconds(durationConverted, requestOptions, context)); + return FluxUtil + .withContext(context -> service.int32Seconds(durationConverted, accept, requestOptions, context)); } /** @@ -297,8 +306,9 @@ public Mono> int32SecondsWithResponseAsync(Duration duration, Req */ @ServiceMethod(returns = ReturnType.SINGLE) public Response int32SecondsWithResponse(Duration duration, RequestOptions requestOptions) { + final String accept = "application/json"; long durationConverted = duration.getSeconds(); - return service.int32SecondsSync(durationConverted, requestOptions, Context.NONE); + return service.int32SecondsSync(durationConverted, accept, requestOptions, Context.NONE); } /** @@ -314,8 +324,10 @@ public Response int32SecondsWithResponse(Duration duration, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> floatSecondsWithResponseAsync(Duration duration, RequestOptions requestOptions) { + final String accept = "application/json"; double durationConverted = (double) duration.toNanos() / 1000_000_000L; - return FluxUtil.withContext(context -> service.floatSeconds(durationConverted, requestOptions, context)); + return FluxUtil + .withContext(context -> service.floatSeconds(durationConverted, accept, requestOptions, context)); } /** @@ -331,8 +343,9 @@ public Mono> floatSecondsWithResponseAsync(Duration duration, Req */ @ServiceMethod(returns = ReturnType.SINGLE) public Response floatSecondsWithResponse(Duration duration, RequestOptions requestOptions) { + final String accept = "application/json"; double durationConverted = (double) duration.toNanos() / 1000_000_000L; - return service.floatSecondsSync(durationConverted, requestOptions, Context.NONE); + return service.floatSecondsSync(durationConverted, accept, requestOptions, Context.NONE); } /** @@ -348,8 +361,10 @@ public Response floatSecondsWithResponse(Duration duration, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> float64SecondsWithResponseAsync(Duration duration, RequestOptions requestOptions) { + final String accept = "application/json"; double durationConverted = (double) duration.toNanos() / 1000_000_000L; - return FluxUtil.withContext(context -> service.float64Seconds(durationConverted, requestOptions, context)); + return FluxUtil + .withContext(context -> service.float64Seconds(durationConverted, accept, requestOptions, context)); } /** @@ -365,7 +380,8 @@ public Mono> float64SecondsWithResponseAsync(Duration duration, R */ @ServiceMethod(returns = ReturnType.SINGLE) public Response float64SecondsWithResponse(Duration duration, RequestOptions requestOptions) { + final String accept = "application/json"; double durationConverted = (double) duration.toNanos() / 1000_000_000L; - return service.float64SecondsSync(durationConverted, requestOptions, Context.NONE); + return service.float64SecondsSync(durationConverted, accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/duration/implementation/PropertiesImpl.java b/typespec-tests/src/main/java/com/encode/duration/implementation/PropertiesImpl.java index 5c97a30990..b21e32a5c1 100644 --- a/typespec-tests/src/main/java/com/encode/duration/implementation/PropertiesImpl.java +++ b/typespec-tests/src/main/java/com/encode/duration/implementation/PropertiesImpl.java @@ -63,9 +63,8 @@ public interface PropertiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> defaultMethod(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/duration/property/default") @ExpectedResponses({ 200 }) @@ -73,9 +72,8 @@ Mono> defaultMethod(@HeaderParam("Content-Type") String con @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response defaultMethodSync(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/duration/property/iso8601") @ExpectedResponses({ 200 }) @@ -83,9 +81,8 @@ Response defaultMethodSync(@HeaderParam("Content-Type") String conte @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> iso8601(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> iso8601(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/duration/property/iso8601") @ExpectedResponses({ 200 }) @@ -93,9 +90,8 @@ Mono> iso8601(@HeaderParam("Content-Type") String contentTy @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response iso8601Sync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response iso8601Sync(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/duration/property/int32-seconds") @ExpectedResponses({ 200 }) @@ -103,9 +99,8 @@ Response iso8601Sync(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> int32Seconds(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> int32Seconds(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/duration/property/int32-seconds") @ExpectedResponses({ 200 }) @@ -113,9 +108,8 @@ Mono> int32Seconds(@HeaderParam("Content-Type") String cont @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response int32SecondsSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response int32SecondsSync(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/duration/property/float-seconds") @ExpectedResponses({ 200 }) @@ -123,9 +117,8 @@ Response int32SecondsSync(@HeaderParam("Content-Type") String conten @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> floatSeconds(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> floatSeconds(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/duration/property/float-seconds") @ExpectedResponses({ 200 }) @@ -133,9 +126,8 @@ Mono> floatSeconds(@HeaderParam("Content-Type") String cont @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response floatSecondsSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response floatSecondsSync(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/duration/property/float64-seconds") @ExpectedResponses({ 200 }) @@ -143,9 +135,8 @@ Response floatSecondsSync(@HeaderParam("Content-Type") String conten @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> float64Seconds(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> float64Seconds(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/duration/property/float64-seconds") @ExpectedResponses({ 200 }) @@ -153,9 +144,8 @@ Mono> float64Seconds(@HeaderParam("Content-Type") String co @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response float64SecondsSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response float64SecondsSync(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/duration/property/float-seconds-array") @ExpectedResponses({ 200 }) @@ -163,9 +153,8 @@ Response float64SecondsSync(@HeaderParam("Content-Type") String cont @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> floatSecondsArray(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> floatSecondsArray(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/duration/property/float-seconds-array") @ExpectedResponses({ 200 }) @@ -173,9 +162,8 @@ Mono> floatSecondsArray(@HeaderParam("Content-Type") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response floatSecondsArraySync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response floatSecondsArraySync(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -206,10 +194,8 @@ Response floatSecondsArraySync(@HeaderParam("Content-Type") String c */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.defaultMethod(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.defaultMethod(accept, body, requestOptions, context)); } /** @@ -240,9 +226,8 @@ public Mono> defaultMethodWithResponseAsync(BinaryData body */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.defaultMethodSync(contentType, accept, body, requestOptions, Context.NONE); + return service.defaultMethodSync(accept, body, requestOptions, Context.NONE); } /** @@ -273,9 +258,8 @@ public Response defaultMethodWithResponse(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> iso8601WithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.iso8601(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.iso8601(accept, body, requestOptions, context)); } /** @@ -306,9 +290,8 @@ public Mono> iso8601WithResponseAsync(BinaryData body, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response iso8601WithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.iso8601Sync(contentType, accept, body, requestOptions, Context.NONE); + return service.iso8601Sync(accept, body, requestOptions, Context.NONE); } /** @@ -339,10 +322,8 @@ public Response iso8601WithResponse(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> int32SecondsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.int32Seconds(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.int32Seconds(accept, body, requestOptions, context)); } /** @@ -373,9 +354,8 @@ public Mono> int32SecondsWithResponseAsync(BinaryData body, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response int32SecondsWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.int32SecondsSync(contentType, accept, body, requestOptions, Context.NONE); + return service.int32SecondsSync(accept, body, requestOptions, Context.NONE); } /** @@ -406,10 +386,8 @@ public Response int32SecondsWithResponse(BinaryData body, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> floatSecondsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.floatSeconds(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.floatSeconds(accept, body, requestOptions, context)); } /** @@ -440,9 +418,8 @@ public Mono> floatSecondsWithResponseAsync(BinaryData body, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response floatSecondsWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.floatSecondsSync(contentType, accept, body, requestOptions, Context.NONE); + return service.floatSecondsSync(accept, body, requestOptions, Context.NONE); } /** @@ -473,10 +450,8 @@ public Response floatSecondsWithResponse(BinaryData body, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> float64SecondsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.float64Seconds(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.float64Seconds(accept, body, requestOptions, context)); } /** @@ -507,9 +482,8 @@ public Mono> float64SecondsWithResponseAsync(BinaryData bod */ @ServiceMethod(returns = ReturnType.SINGLE) public Response float64SecondsWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.float64SecondsSync(contentType, accept, body, requestOptions, Context.NONE); + return service.float64SecondsSync(accept, body, requestOptions, Context.NONE); } /** @@ -545,10 +519,8 @@ public Response float64SecondsWithResponse(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Mono> floatSecondsArrayWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.floatSecondsArray(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.floatSecondsArray(accept, body, requestOptions, context)); } /** @@ -583,8 +555,7 @@ public Mono> floatSecondsArrayWithResponseAsync(BinaryData */ @ServiceMethod(returns = ReturnType.SINGLE) public Response floatSecondsArrayWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.floatSecondsArraySync(contentType, accept, body, requestOptions, Context.NONE); + return service.floatSecondsArraySync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/duration/implementation/QueriesImpl.java b/typespec-tests/src/main/java/com/encode/duration/implementation/QueriesImpl.java index bccb586fc2..ad2e6d2387 100644 --- a/typespec-tests/src/main/java/com/encode/duration/implementation/QueriesImpl.java +++ b/typespec-tests/src/main/java/com/encode/duration/implementation/QueriesImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -65,8 +66,8 @@ public interface QueriesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@QueryParam("input") Duration input, RequestOptions requestOptions, - Context context); + Mono> defaultMethod(@QueryParam("input") Duration input, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/duration/query/default") @ExpectedResponses({ 204 }) @@ -74,8 +75,8 @@ Mono> defaultMethod(@QueryParam("input") Duration input, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@QueryParam("input") Duration input, RequestOptions requestOptions, - Context context); + Response defaultMethodSync(@QueryParam("input") Duration input, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/duration/query/iso8601") @ExpectedResponses({ 204 }) @@ -83,8 +84,8 @@ Response defaultMethodSync(@QueryParam("input") Duration input, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> iso8601(@QueryParam("input") Duration input, RequestOptions requestOptions, - Context context); + Mono> iso8601(@QueryParam("input") Duration input, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/duration/query/iso8601") @ExpectedResponses({ 204 }) @@ -92,7 +93,8 @@ Mono> iso8601(@QueryParam("input") Duration input, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response iso8601Sync(@QueryParam("input") Duration input, RequestOptions requestOptions, Context context); + Response iso8601Sync(@QueryParam("input") Duration input, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/duration/query/int32-seconds") @ExpectedResponses({ 204 }) @@ -100,8 +102,8 @@ Mono> iso8601(@QueryParam("input") Duration input, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> int32Seconds(@QueryParam("input") long input, RequestOptions requestOptions, - Context context); + Mono> int32Seconds(@QueryParam("input") long input, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/duration/query/int32-seconds") @ExpectedResponses({ 204 }) @@ -109,8 +111,8 @@ Mono> int32Seconds(@QueryParam("input") long input, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response int32SecondsSync(@QueryParam("input") long input, RequestOptions requestOptions, - Context context); + Response int32SecondsSync(@QueryParam("input") long input, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/duration/query/float-seconds") @ExpectedResponses({ 204 }) @@ -118,8 +120,8 @@ Response int32SecondsSync(@QueryParam("input") long input, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> floatSeconds(@QueryParam("input") double input, RequestOptions requestOptions, - Context context); + Mono> floatSeconds(@QueryParam("input") double input, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/duration/query/float-seconds") @ExpectedResponses({ 204 }) @@ -127,8 +129,8 @@ Mono> floatSeconds(@QueryParam("input") double input, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response floatSecondsSync(@QueryParam("input") double input, RequestOptions requestOptions, - Context context); + Response floatSecondsSync(@QueryParam("input") double input, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/duration/query/float64-seconds") @ExpectedResponses({ 204 }) @@ -136,8 +138,8 @@ Response floatSecondsSync(@QueryParam("input") double input, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> float64Seconds(@QueryParam("input") double input, RequestOptions requestOptions, - Context context); + Mono> float64Seconds(@QueryParam("input") double input, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/duration/query/float64-seconds") @ExpectedResponses({ 204 }) @@ -145,8 +147,8 @@ Mono> float64Seconds(@QueryParam("input") double input, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response float64SecondsSync(@QueryParam("input") double input, RequestOptions requestOptions, - Context context); + Response float64SecondsSync(@QueryParam("input") double input, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/duration/query/int32-seconds-array") @ExpectedResponses({ 204 }) @@ -154,8 +156,8 @@ Response float64SecondsSync(@QueryParam("input") double input, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> int32SecondsArray(@QueryParam("input") String input, RequestOptions requestOptions, - Context context); + Mono> int32SecondsArray(@QueryParam("input") String input, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/duration/query/int32-seconds-array") @ExpectedResponses({ 204 }) @@ -163,8 +165,8 @@ Mono> int32SecondsArray(@QueryParam("input") String input, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response int32SecondsArraySync(@QueryParam("input") String input, RequestOptions requestOptions, - Context context); + Response int32SecondsArraySync(@QueryParam("input") String input, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); } /** @@ -180,7 +182,8 @@ Response int32SecondsArraySync(@QueryParam("input") String input, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(Duration input, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.defaultMethod(input, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.defaultMethod(input, accept, requestOptions, context)); } /** @@ -196,7 +199,8 @@ public Mono> defaultMethodWithResponseAsync(Duration input, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(Duration input, RequestOptions requestOptions) { - return service.defaultMethodSync(input, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.defaultMethodSync(input, accept, requestOptions, Context.NONE); } /** @@ -212,7 +216,8 @@ public Response defaultMethodWithResponse(Duration input, RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> iso8601WithResponseAsync(Duration input, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.iso8601(input, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.iso8601(input, accept, requestOptions, context)); } /** @@ -228,7 +233,8 @@ public Mono> iso8601WithResponseAsync(Duration input, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response iso8601WithResponse(Duration input, RequestOptions requestOptions) { - return service.iso8601Sync(input, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.iso8601Sync(input, accept, requestOptions, Context.NONE); } /** @@ -244,8 +250,9 @@ public Response iso8601WithResponse(Duration input, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> int32SecondsWithResponseAsync(Duration input, RequestOptions requestOptions) { + final String accept = "application/json"; long inputConverted = input.getSeconds(); - return FluxUtil.withContext(context -> service.int32Seconds(inputConverted, requestOptions, context)); + return FluxUtil.withContext(context -> service.int32Seconds(inputConverted, accept, requestOptions, context)); } /** @@ -261,8 +268,9 @@ public Mono> int32SecondsWithResponseAsync(Duration input, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response int32SecondsWithResponse(Duration input, RequestOptions requestOptions) { + final String accept = "application/json"; long inputConverted = input.getSeconds(); - return service.int32SecondsSync(inputConverted, requestOptions, Context.NONE); + return service.int32SecondsSync(inputConverted, accept, requestOptions, Context.NONE); } /** @@ -278,8 +286,9 @@ public Response int32SecondsWithResponse(Duration input, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> floatSecondsWithResponseAsync(Duration input, RequestOptions requestOptions) { + final String accept = "application/json"; double inputConverted = (double) input.toNanos() / 1000_000_000L; - return FluxUtil.withContext(context -> service.floatSeconds(inputConverted, requestOptions, context)); + return FluxUtil.withContext(context -> service.floatSeconds(inputConverted, accept, requestOptions, context)); } /** @@ -295,8 +304,9 @@ public Mono> floatSecondsWithResponseAsync(Duration input, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response floatSecondsWithResponse(Duration input, RequestOptions requestOptions) { + final String accept = "application/json"; double inputConverted = (double) input.toNanos() / 1000_000_000L; - return service.floatSecondsSync(inputConverted, requestOptions, Context.NONE); + return service.floatSecondsSync(inputConverted, accept, requestOptions, Context.NONE); } /** @@ -312,8 +322,9 @@ public Response floatSecondsWithResponse(Duration input, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> float64SecondsWithResponseAsync(Duration input, RequestOptions requestOptions) { + final String accept = "application/json"; double inputConverted = (double) input.toNanos() / 1000_000_000L; - return FluxUtil.withContext(context -> service.float64Seconds(inputConverted, requestOptions, context)); + return FluxUtil.withContext(context -> service.float64Seconds(inputConverted, accept, requestOptions, context)); } /** @@ -329,8 +340,9 @@ public Mono> float64SecondsWithResponseAsync(Duration input, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response float64SecondsWithResponse(Duration input, RequestOptions requestOptions) { + final String accept = "application/json"; double inputConverted = (double) input.toNanos() / 1000_000_000L; - return service.float64SecondsSync(inputConverted, requestOptions, Context.NONE); + return service.float64SecondsSync(inputConverted, accept, requestOptions, Context.NONE); } /** @@ -347,11 +359,13 @@ public Response float64SecondsWithResponse(Duration input, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> int32SecondsArrayWithResponseAsync(List input, RequestOptions requestOptions) { + final String accept = "application/json"; String inputConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( input.stream().map(paramItemValue -> paramItemValue.getSeconds()).collect(Collectors.toList()), CollectionFormat.CSV); - return FluxUtil.withContext(context -> service.int32SecondsArray(inputConverted, requestOptions, context)); + return FluxUtil + .withContext(context -> service.int32SecondsArray(inputConverted, accept, requestOptions, context)); } /** @@ -367,10 +381,11 @@ public Mono> int32SecondsArrayWithResponseAsync(List in */ @ServiceMethod(returns = ReturnType.SINGLE) public Response int32SecondsArrayWithResponse(List input, RequestOptions requestOptions) { + final String accept = "application/json"; String inputConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( input.stream().map(paramItemValue -> paramItemValue.getSeconds()).collect(Collectors.toList()), CollectionFormat.CSV); - return service.int32SecondsArraySync(inputConverted, requestOptions, Context.NONE); + return service.int32SecondsArraySync(inputConverted, accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/basic/implementation/ExplicitBodiesImpl.java b/typespec-tests/src/main/java/com/parameters/basic/implementation/ExplicitBodiesImpl.java index b8fba3c8c3..0da230c5da 100644 --- a/typespec-tests/src/main/java/com/parameters/basic/implementation/ExplicitBodiesImpl.java +++ b/typespec-tests/src/main/java/com/parameters/basic/implementation/ExplicitBodiesImpl.java @@ -63,7 +63,7 @@ public interface ExplicitBodiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> simple(@HeaderParam("Content-Type") String contentType, + Mono> simple(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/parameters/basic/explicit-body/simple") @@ -72,8 +72,8 @@ Mono> simple(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response simpleSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response simpleSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -96,8 +96,8 @@ Response simpleSync(@HeaderParam("Content-Type") String contentType, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> simpleWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.simple(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.simple(accept, body, requestOptions, context)); } /** @@ -120,7 +120,7 @@ public Mono> simpleWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response simpleWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.simpleSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.simpleSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/basic/implementation/ImplicitBodiesImpl.java b/typespec-tests/src/main/java/com/parameters/basic/implementation/ImplicitBodiesImpl.java index 94e75bcb9d..e6488ff8c4 100644 --- a/typespec-tests/src/main/java/com/parameters/basic/implementation/ImplicitBodiesImpl.java +++ b/typespec-tests/src/main/java/com/parameters/basic/implementation/ImplicitBodiesImpl.java @@ -63,7 +63,7 @@ public interface ImplicitBodiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> simple(@HeaderParam("Content-Type") String contentType, + Mono> simple(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData simpleRequest, RequestOptions requestOptions, Context context); @Put("/parameters/basic/implicit-body/simple") @@ -72,7 +72,7 @@ Mono> simple(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response simpleSync(@HeaderParam("Content-Type") String contentType, + Response simpleSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData simpleRequest, RequestOptions requestOptions, Context context); } @@ -96,8 +96,8 @@ Response simpleSync(@HeaderParam("Content-Type") String contentType, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> simpleWithResponseAsync(BinaryData simpleRequest, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.simple(contentType, simpleRequest, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.simple(accept, simpleRequest, requestOptions, context)); } /** @@ -120,7 +120,7 @@ public Mono> simpleWithResponseAsync(BinaryData simpleRequest, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response simpleWithResponse(BinaryData simpleRequest, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.simpleSync(contentType, simpleRequest, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.simpleSync(accept, simpleRequest, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/BodyOptionalityClientImpl.java b/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/BodyOptionalityClientImpl.java index aa69cfa6b6..ea96a36d13 100644 --- a/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/BodyOptionalityClientImpl.java +++ b/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/BodyOptionalityClientImpl.java @@ -126,7 +126,7 @@ public interface BodyOptionalityClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> requiredExplicit(@HeaderParam("Content-Type") String contentType, + Mono> requiredExplicit(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/parameters/body-optionality/required-explicit") @@ -135,7 +135,7 @@ Mono> requiredExplicit(@HeaderParam("Content-Type") String conten @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requiredExplicitSync(@HeaderParam("Content-Type") String contentType, + Response requiredExplicitSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/parameters/body-optionality/required-implicit") @@ -144,7 +144,7 @@ Response requiredExplicitSync(@HeaderParam("Content-Type") String contentT @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> requiredImplicit(@HeaderParam("Content-Type") String contentType, + Mono> requiredImplicit(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData bodyModel, RequestOptions requestOptions, Context context); @Post("/parameters/body-optionality/required-implicit") @@ -153,7 +153,7 @@ Mono> requiredImplicit(@HeaderParam("Content-Type") String conten @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requiredImplicitSync(@HeaderParam("Content-Type") String contentType, + Response requiredImplicitSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData bodyModel, RequestOptions requestOptions, Context context); } @@ -177,8 +177,8 @@ Response requiredImplicitSync(@HeaderParam("Content-Type") String contentT */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> requiredExplicitWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.requiredExplicit(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.requiredExplicit(accept, body, requestOptions, context)); } /** @@ -201,8 +201,8 @@ public Mono> requiredExplicitWithResponseAsync(BinaryData body, R */ @ServiceMethod(returns = ReturnType.SINGLE) public Response requiredExplicitWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.requiredExplicitSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.requiredExplicitSync(accept, body, requestOptions, Context.NONE); } /** @@ -225,9 +225,8 @@ public Response requiredExplicitWithResponse(BinaryData body, RequestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> requiredImplicitWithResponseAsync(BinaryData bodyModel, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil - .withContext(context -> service.requiredImplicit(contentType, bodyModel, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.requiredImplicit(accept, bodyModel, requestOptions, context)); } /** @@ -250,7 +249,7 @@ public Mono> requiredImplicitWithResponseAsync(BinaryData bodyMod */ @ServiceMethod(returns = ReturnType.SINGLE) public Response requiredImplicitWithResponse(BinaryData bodyModel, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.requiredImplicitSync(contentType, bodyModel, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.requiredImplicitSync(accept, bodyModel, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/OptionalExplicitsImpl.java b/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/OptionalExplicitsImpl.java index 3cc0c6b5fb..91b84dee3f 100644 --- a/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/OptionalExplicitsImpl.java +++ b/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/OptionalExplicitsImpl.java @@ -62,8 +62,7 @@ public interface OptionalExplicitsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> set(@HeaderParam("Content-Type") String contentType, RequestOptions requestOptions, - Context context); + Mono> set(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/parameters/body-optionality/optional-explicit/set") @ExpectedResponses({ 204 }) @@ -71,8 +70,7 @@ Mono> set(@HeaderParam("Content-Type") String contentType, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response setSync(@HeaderParam("Content-Type") String contentType, RequestOptions requestOptions, - Context context); + Response setSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/parameters/body-optionality/optional-explicit/omit") @ExpectedResponses({ 204 }) @@ -80,8 +78,7 @@ Response setSync(@HeaderParam("Content-Type") String contentType, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> omit(@HeaderParam("Content-Type") String contentType, RequestOptions requestOptions, - Context context); + Mono> omit(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/parameters/body-optionality/optional-explicit/omit") @ExpectedResponses({ 204 }) @@ -89,8 +86,7 @@ Mono> omit(@HeaderParam("Content-Type") String contentType, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response omitSync(@HeaderParam("Content-Type") String contentType, RequestOptions requestOptions, - Context context); + Response omitSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -120,14 +116,14 @@ Response omitSync(@HeaderParam("Content-Type") String contentType, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> setWithResponseAsync(RequestOptions requestOptions) { - final String contentType = "application/json"; + final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); } }); - return FluxUtil.withContext(context -> service.set(contentType, requestOptionsLocal, context)); + return FluxUtil.withContext(context -> service.set(accept, requestOptionsLocal, context)); } /** @@ -157,14 +153,14 @@ public Mono> setWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response setWithResponse(RequestOptions requestOptions) { - final String contentType = "application/json"; + final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); } }); - return service.setSync(contentType, requestOptionsLocal, Context.NONE); + return service.setSync(accept, requestOptionsLocal, Context.NONE); } /** @@ -194,14 +190,14 @@ public Response setWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> omitWithResponseAsync(RequestOptions requestOptions) { - final String contentType = "application/json"; + final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); } }); - return FluxUtil.withContext(context -> service.omit(contentType, requestOptionsLocal, context)); + return FluxUtil.withContext(context -> service.omit(accept, requestOptionsLocal, context)); } /** @@ -231,13 +227,13 @@ public Mono> omitWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response omitWithResponse(RequestOptions requestOptions) { - final String contentType = "application/json"; + final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); } }); - return service.omitSync(contentType, requestOptionsLocal, Context.NONE); + return service.omitSync(accept, requestOptionsLocal, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/HeadersImpl.java b/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/HeadersImpl.java index 6e220ab978..267582535c 100644 --- a/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/HeadersImpl.java +++ b/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/HeadersImpl.java @@ -63,7 +63,8 @@ public interface HeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> csv(@HeaderParam("colors") String colors, RequestOptions requestOptions, Context context); + Mono> csv(@HeaderParam("colors") String colors, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/header/csv") @ExpectedResponses({ 204 }) @@ -71,7 +72,8 @@ public interface HeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response csvSync(@HeaderParam("colors") String colors, RequestOptions requestOptions, Context context); + Response csvSync(@HeaderParam("colors") String colors, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); } /** @@ -87,10 +89,11 @@ public interface HeadersService { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> csvWithResponseAsync(List colors, RequestOptions requestOptions) { + final String accept = "application/json"; String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return FluxUtil.withContext(context -> service.csv(colorsConverted, requestOptions, context)); + return FluxUtil.withContext(context -> service.csv(colorsConverted, accept, requestOptions, context)); } /** @@ -106,9 +109,10 @@ public Mono> csvWithResponseAsync(List colors, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response csvWithResponse(List colors, RequestOptions requestOptions) { + final String accept = "application/json"; String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return service.csvSync(colorsConverted, requestOptions, Context.NONE); + return service.csvSync(colorsConverted, accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/QueriesImpl.java b/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/QueriesImpl.java index 695c4a5eab..b55f7842f8 100644 --- a/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/QueriesImpl.java +++ b/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/QueriesImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -64,7 +65,7 @@ public interface QueriesService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> multi(@QueryParam(value = "colors", multipleQueryParams = true) List colors, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/multi") @ExpectedResponses({ 204 }) @@ -73,7 +74,7 @@ Mono> multi(@QueryParam(value = "colors", multipleQueryParams = t @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response multiSync(@QueryParam(value = "colors", multipleQueryParams = true) List colors, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/ssv") @ExpectedResponses({ 204 }) @@ -81,7 +82,8 @@ Response multiSync(@QueryParam(value = "colors", multipleQueryParams = tru @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> ssv(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context); + Mono> ssv(@QueryParam("colors") String colors, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/ssv") @ExpectedResponses({ 204 }) @@ -89,7 +91,8 @@ Response multiSync(@QueryParam(value = "colors", multipleQueryParams = tru @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response ssvSync(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context); + Response ssvSync(@QueryParam("colors") String colors, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/tsv") @ExpectedResponses({ 204 }) @@ -97,7 +100,8 @@ Response multiSync(@QueryParam(value = "colors", multipleQueryParams = tru @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> tsv(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context); + Mono> tsv(@QueryParam("colors") String colors, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/tsv") @ExpectedResponses({ 204 }) @@ -105,7 +109,8 @@ Response multiSync(@QueryParam(value = "colors", multipleQueryParams = tru @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response tsvSync(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context); + Response tsvSync(@QueryParam("colors") String colors, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/pipes") @ExpectedResponses({ 204 }) @@ -113,7 +118,8 @@ Response multiSync(@QueryParam(value = "colors", multipleQueryParams = tru @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> pipes(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context); + Mono> pipes(@QueryParam("colors") String colors, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/pipes") @ExpectedResponses({ 204 }) @@ -121,7 +127,8 @@ Response multiSync(@QueryParam(value = "colors", multipleQueryParams = tru @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response pipesSync(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context); + Response pipesSync(@QueryParam("colors") String colors, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/csv") @ExpectedResponses({ 204 }) @@ -129,7 +136,8 @@ Response multiSync(@QueryParam(value = "colors", multipleQueryParams = tru @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> csv(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context); + Mono> csv(@QueryParam("colors") String colors, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/csv") @ExpectedResponses({ 204 }) @@ -137,7 +145,8 @@ Response multiSync(@QueryParam(value = "colors", multipleQueryParams = tru @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response csvSync(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context); + Response csvSync(@QueryParam("colors") String colors, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); } /** @@ -153,9 +162,10 @@ Response multiSync(@QueryParam(value = "colors", multipleQueryParams = tru */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> multiWithResponseAsync(List colors, RequestOptions requestOptions) { + final String accept = "application/json"; List colorsConverted = colors.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return FluxUtil.withContext(context -> service.multi(colorsConverted, requestOptions, context)); + return FluxUtil.withContext(context -> service.multi(colorsConverted, accept, requestOptions, context)); } /** @@ -171,9 +181,10 @@ public Mono> multiWithResponseAsync(List colors, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response multiWithResponse(List colors, RequestOptions requestOptions) { + final String accept = "application/json"; List colorsConverted = colors.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return service.multiSync(colorsConverted, requestOptions, Context.NONE); + return service.multiSync(colorsConverted, accept, requestOptions, Context.NONE); } /** @@ -189,10 +200,11 @@ public Response multiWithResponse(List colors, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> ssvWithResponseAsync(List colors, RequestOptions requestOptions) { + final String accept = "application/json"; String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(" ")); - return FluxUtil.withContext(context -> service.ssv(colorsConverted, requestOptions, context)); + return FluxUtil.withContext(context -> service.ssv(colorsConverted, accept, requestOptions, context)); } /** @@ -208,10 +220,11 @@ public Mono> ssvWithResponseAsync(List colors, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response ssvWithResponse(List colors, RequestOptions requestOptions) { + final String accept = "application/json"; String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(" ")); - return service.ssvSync(colorsConverted, requestOptions, Context.NONE); + return service.ssvSync(colorsConverted, accept, requestOptions, Context.NONE); } /** @@ -227,10 +240,11 @@ public Response ssvWithResponse(List colors, RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> tsvWithResponseAsync(List colors, RequestOptions requestOptions) { + final String accept = "application/json"; String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining("\t")); - return FluxUtil.withContext(context -> service.tsv(colorsConverted, requestOptions, context)); + return FluxUtil.withContext(context -> service.tsv(colorsConverted, accept, requestOptions, context)); } /** @@ -246,10 +260,11 @@ public Mono> tsvWithResponseAsync(List colors, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response tsvWithResponse(List colors, RequestOptions requestOptions) { + final String accept = "application/json"; String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining("\t")); - return service.tsvSync(colorsConverted, requestOptions, Context.NONE); + return service.tsvSync(colorsConverted, accept, requestOptions, Context.NONE); } /** @@ -265,10 +280,11 @@ public Response tsvWithResponse(List colors, RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> pipesWithResponseAsync(List colors, RequestOptions requestOptions) { + final String accept = "application/json"; String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining("|")); - return FluxUtil.withContext(context -> service.pipes(colorsConverted, requestOptions, context)); + return FluxUtil.withContext(context -> service.pipes(colorsConverted, accept, requestOptions, context)); } /** @@ -284,10 +300,11 @@ public Mono> pipesWithResponseAsync(List colors, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response pipesWithResponse(List colors, RequestOptions requestOptions) { + final String accept = "application/json"; String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining("|")); - return service.pipesSync(colorsConverted, requestOptions, Context.NONE); + return service.pipesSync(colorsConverted, accept, requestOptions, Context.NONE); } /** @@ -303,10 +320,11 @@ public Response pipesWithResponse(List colors, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> csvWithResponseAsync(List colors, RequestOptions requestOptions) { + final String accept = "application/json"; String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return FluxUtil.withContext(context -> service.csv(colorsConverted, requestOptions, context)); + return FluxUtil.withContext(context -> service.csv(colorsConverted, accept, requestOptions, context)); } /** @@ -322,9 +340,10 @@ public Mono> csvWithResponseAsync(List colors, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response csvWithResponse(List colors, RequestOptions requestOptions) { + final String accept = "application/json"; String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return service.csvSync(colorsConverted, requestOptions, Context.NONE); + return service.csvSync(colorsConverted, accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/spread/AliasAsyncClient.java b/typespec-tests/src/main/java/com/parameters/spread/AliasAsyncClient.java index 1bc86e295c..3b6905e66c 100644 --- a/typespec-tests/src/main/java/com/parameters/spread/AliasAsyncClient.java +++ b/typespec-tests/src/main/java/com/parameters/spread/AliasAsyncClient.java @@ -78,7 +78,7 @@ public Mono> spreadAsRequestBodyWithResponse(BinaryData spreadAsR * * @param id The id parameter. * @param xMsTestHeader The xMsTestHeader parameter. - * @param spreadAsRequestParameterRequest The spreadAsRequestParameterRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -89,9 +89,8 @@ public Mono> spreadAsRequestBodyWithResponse(BinaryData spreadAsR @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono> spreadAsRequestParameterWithResponse(String id, String xMsTestHeader, - BinaryData spreadAsRequestParameterRequest, RequestOptions requestOptions) { - return this.serviceClient.spreadAsRequestParameterWithResponseAsync(id, xMsTestHeader, - spreadAsRequestParameterRequest, requestOptions); + BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.spreadAsRequestParameterWithResponseAsync(id, xMsTestHeader, request, requestOptions); } /** @@ -111,7 +110,7 @@ public Mono> spreadAsRequestParameterWithResponse(String id, Stri * * @param id The id parameter. * @param xMsTestHeader The xMsTestHeader parameter. - * @param spreadWithMultipleParametersRequest The spreadWithMultipleParametersRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -122,9 +121,9 @@ public Mono> spreadAsRequestParameterWithResponse(String id, Stri @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono> spreadWithMultipleParametersWithResponse(String id, String xMsTestHeader, - BinaryData spreadWithMultipleParametersRequest, RequestOptions requestOptions) { - return this.serviceClient.spreadWithMultipleParametersWithResponseAsync(id, xMsTestHeader, - spreadWithMultipleParametersRequest, requestOptions); + BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.spreadWithMultipleParametersWithResponseAsync(id, xMsTestHeader, request, + requestOptions); } /** @@ -168,9 +167,9 @@ public Mono spreadAsRequestBody(String name) { public Mono spreadAsRequestParameter(String id, String xMsTestHeader, String name) { // Generated convenience method for spreadAsRequestParameterWithResponse RequestOptions requestOptions = new RequestOptions(); - SpreadAsRequestParameterRequest spreadAsRequestParameterRequestObj = new SpreadAsRequestParameterRequest(name); - BinaryData spreadAsRequestParameterRequest = BinaryData.fromObject(spreadAsRequestParameterRequestObj); - return spreadAsRequestParameterWithResponse(id, xMsTestHeader, spreadAsRequestParameterRequest, requestOptions) + SpreadAsRequestParameterRequest requestObj = new SpreadAsRequestParameterRequest(name); + BinaryData request = BinaryData.fromObject(requestObj); + return spreadAsRequestParameterWithResponse(id, xMsTestHeader, request, requestOptions) .flatMap(FluxUtil::toMono); } @@ -193,11 +192,10 @@ public Mono spreadWithMultipleParameters(SpreadWithMultipleParametersOptio RequestOptions requestOptions = new RequestOptions(); String id = options.getId(); String xMsTestHeader = options.getXMsTestHeader(); - SpreadWithMultipleParametersRequest spreadWithMultipleParametersRequestObj - = new SpreadWithMultipleParametersRequest(options.getProp1(), options.getProp2(), options.getProp3(), - options.getProp4(), options.getProp5(), options.getProp6()); - BinaryData spreadWithMultipleParametersRequest = BinaryData.fromObject(spreadWithMultipleParametersRequestObj); - return spreadWithMultipleParametersWithResponse(id, xMsTestHeader, spreadWithMultipleParametersRequest, - requestOptions).flatMap(FluxUtil::toMono); + SpreadWithMultipleParametersRequest requestObj = new SpreadWithMultipleParametersRequest(options.getProp1(), + options.getProp2(), options.getProp3(), options.getProp4(), options.getProp5(), options.getProp6()); + BinaryData request = BinaryData.fromObject(requestObj); + return spreadWithMultipleParametersWithResponse(id, xMsTestHeader, request, requestOptions) + .flatMap(FluxUtil::toMono); } } diff --git a/typespec-tests/src/main/java/com/parameters/spread/AliasClient.java b/typespec-tests/src/main/java/com/parameters/spread/AliasClient.java index e0e081738a..d163e2282d 100644 --- a/typespec-tests/src/main/java/com/parameters/spread/AliasClient.java +++ b/typespec-tests/src/main/java/com/parameters/spread/AliasClient.java @@ -76,7 +76,7 @@ public Response spreadAsRequestBodyWithResponse(BinaryData spreadAsRequest * * @param id The id parameter. * @param xMsTestHeader The xMsTestHeader parameter. - * @param spreadAsRequestParameterRequest The spreadAsRequestParameterRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -86,10 +86,9 @@ public Response spreadAsRequestBodyWithResponse(BinaryData spreadAsRequest */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response spreadAsRequestParameterWithResponse(String id, String xMsTestHeader, - BinaryData spreadAsRequestParameterRequest, RequestOptions requestOptions) { - return this.serviceClient.spreadAsRequestParameterWithResponse(id, xMsTestHeader, - spreadAsRequestParameterRequest, requestOptions); + public Response spreadAsRequestParameterWithResponse(String id, String xMsTestHeader, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.spreadAsRequestParameterWithResponse(id, xMsTestHeader, request, requestOptions); } /** @@ -109,7 +108,7 @@ public Response spreadAsRequestParameterWithResponse(String id, String xMs * * @param id The id parameter. * @param xMsTestHeader The xMsTestHeader parameter. - * @param spreadWithMultipleParametersRequest The spreadWithMultipleParametersRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -119,10 +118,9 @@ public Response spreadAsRequestParameterWithResponse(String id, String xMs */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response spreadWithMultipleParametersWithResponse(String id, String xMsTestHeader, - BinaryData spreadWithMultipleParametersRequest, RequestOptions requestOptions) { - return this.serviceClient.spreadWithMultipleParametersWithResponse(id, xMsTestHeader, - spreadWithMultipleParametersRequest, requestOptions); + public Response spreadWithMultipleParametersWithResponse(String id, String xMsTestHeader, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.spreadWithMultipleParametersWithResponse(id, xMsTestHeader, request, requestOptions); } /** @@ -164,10 +162,9 @@ public void spreadAsRequestBody(String name) { public void spreadAsRequestParameter(String id, String xMsTestHeader, String name) { // Generated convenience method for spreadAsRequestParameterWithResponse RequestOptions requestOptions = new RequestOptions(); - SpreadAsRequestParameterRequest spreadAsRequestParameterRequestObj = new SpreadAsRequestParameterRequest(name); - BinaryData spreadAsRequestParameterRequest = BinaryData.fromObject(spreadAsRequestParameterRequestObj); - spreadAsRequestParameterWithResponse(id, xMsTestHeader, spreadAsRequestParameterRequest, requestOptions) - .getValue(); + SpreadAsRequestParameterRequest requestObj = new SpreadAsRequestParameterRequest(name); + BinaryData request = BinaryData.fromObject(requestObj); + spreadAsRequestParameterWithResponse(id, xMsTestHeader, request, requestOptions).getValue(); } /** @@ -188,11 +185,9 @@ public void spreadWithMultipleParameters(SpreadWithMultipleParametersOptions opt RequestOptions requestOptions = new RequestOptions(); String id = options.getId(); String xMsTestHeader = options.getXMsTestHeader(); - SpreadWithMultipleParametersRequest spreadWithMultipleParametersRequestObj - = new SpreadWithMultipleParametersRequest(options.getProp1(), options.getProp2(), options.getProp3(), - options.getProp4(), options.getProp5(), options.getProp6()); - BinaryData spreadWithMultipleParametersRequest = BinaryData.fromObject(spreadWithMultipleParametersRequestObj); - spreadWithMultipleParametersWithResponse(id, xMsTestHeader, spreadWithMultipleParametersRequest, requestOptions) - .getValue(); + SpreadWithMultipleParametersRequest requestObj = new SpreadWithMultipleParametersRequest(options.getProp1(), + options.getProp2(), options.getProp3(), options.getProp4(), options.getProp5(), options.getProp6()); + BinaryData request = BinaryData.fromObject(requestObj); + spreadWithMultipleParametersWithResponse(id, xMsTestHeader, request, requestOptions).getValue(); } } diff --git a/typespec-tests/src/main/java/com/parameters/spread/ModelAsyncClient.java b/typespec-tests/src/main/java/com/parameters/spread/ModelAsyncClient.java index 9658ce5d9b..5d560ed155 100644 --- a/typespec-tests/src/main/java/com/parameters/spread/ModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/parameters/spread/ModelAsyncClient.java @@ -49,7 +49,7 @@ public final class ModelAsyncClient { * } * } * - * @param bodyParameter The bodyParameter parameter. + * @param bodyParameter This is a simple model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -147,7 +147,7 @@ public Mono> spreadCompositeRequestWithResponse(String name, Stri * * @param name The name parameter. * @param testHeader The testHeader parameter. - * @param compositeRequestMix The compositeRequestMix parameter. + * @param compositeRequestMix This is a model with non-body http request decorator. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -166,7 +166,7 @@ public Mono> spreadCompositeRequestMixWithResponse(String name, S /** * The spreadAsRequestBody operation. * - * @param bodyParameter The bodyParameter parameter. + * @param bodyParameter This is a simple model. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -255,7 +255,7 @@ public Mono spreadCompositeRequest(String name, String testHeader, BodyPar * * @param name The name parameter. * @param testHeader The testHeader parameter. - * @param compositeRequestMix The compositeRequestMix parameter. + * @param compositeRequestMix This is a model with non-body http request decorator. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. diff --git a/typespec-tests/src/main/java/com/parameters/spread/ModelClient.java b/typespec-tests/src/main/java/com/parameters/spread/ModelClient.java index 2d939811e9..162a7ae04b 100644 --- a/typespec-tests/src/main/java/com/parameters/spread/ModelClient.java +++ b/typespec-tests/src/main/java/com/parameters/spread/ModelClient.java @@ -47,7 +47,7 @@ public final class ModelClient { * } * } * - * @param bodyParameter The bodyParameter parameter. + * @param bodyParameter This is a simple model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -144,7 +144,7 @@ public Response spreadCompositeRequestWithResponse(String name, String tes * * @param name The name parameter. * @param testHeader The testHeader parameter. - * @param compositeRequestMix The compositeRequestMix parameter. + * @param compositeRequestMix This is a model with non-body http request decorator. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -163,7 +163,7 @@ public Response spreadCompositeRequestMixWithResponse(String name, String /** * The spreadAsRequestBody operation. * - * @param bodyParameter The bodyParameter parameter. + * @param bodyParameter This is a simple model. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -244,7 +244,7 @@ public void spreadCompositeRequest(String name, String testHeader, BodyParameter * * @param name The name parameter. * @param testHeader The testHeader parameter. - * @param compositeRequestMix The compositeRequestMix parameter. + * @param compositeRequestMix This is a model with non-body http request decorator. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. diff --git a/typespec-tests/src/main/java/com/parameters/spread/implementation/AliasImpl.java b/typespec-tests/src/main/java/com/parameters/spread/implementation/AliasImpl.java index 2c723ca0d0..b991b74332 100644 --- a/typespec-tests/src/main/java/com/parameters/spread/implementation/AliasImpl.java +++ b/typespec-tests/src/main/java/com/parameters/spread/implementation/AliasImpl.java @@ -63,7 +63,7 @@ public interface AliasService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> spreadAsRequestBody(@HeaderParam("Content-Type") String contentType, + Mono> spreadAsRequestBody(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData spreadAsRequestBodyRequest, RequestOptions requestOptions, Context context); @@ -73,7 +73,7 @@ Mono> spreadAsRequestBody(@HeaderParam("Content-Type") String con @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response spreadAsRequestBodySync(@HeaderParam("Content-Type") String contentType, + Response spreadAsRequestBodySync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData spreadAsRequestBodyRequest, RequestOptions requestOptions, Context context); @@ -84,9 +84,8 @@ Response spreadAsRequestBodySync(@HeaderParam("Content-Type") String conte @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> spreadAsRequestParameter(@PathParam("id") String id, - @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData spreadAsRequestParameterRequest, RequestOptions requestOptions, - Context context); + @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); @Put("/parameters/spread/alias/request-parameter/{id}") @ExpectedResponses({ 204 }) @@ -95,9 +94,8 @@ Mono> spreadAsRequestParameter(@PathParam("id") String id, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response spreadAsRequestParameterSync(@PathParam("id") String id, - @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData spreadAsRequestParameterRequest, RequestOptions requestOptions, - Context context); + @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); @Put("/parameters/spread/alias/multiple-parameters/{id}") @ExpectedResponses({ 204 }) @@ -106,9 +104,8 @@ Response spreadAsRequestParameterSync(@PathParam("id") String id, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> spreadWithMultipleParameters(@PathParam("id") String id, - @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData spreadWithMultipleParametersRequest, - RequestOptions requestOptions, Context context); + @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); @Put("/parameters/spread/alias/multiple-parameters/{id}") @ExpectedResponses({ 204 }) @@ -117,9 +114,8 @@ Mono> spreadWithMultipleParameters(@PathParam("id") String id, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response spreadWithMultipleParametersSync(@PathParam("id") String id, - @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData spreadWithMultipleParametersRequest, - RequestOptions requestOptions, Context context); + @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); } /** @@ -143,9 +139,9 @@ Response spreadWithMultipleParametersSync(@PathParam("id") String id, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> spreadAsRequestBodyWithResponseAsync(BinaryData spreadAsRequestBodyRequest, RequestOptions requestOptions) { - final String contentType = "application/json"; + final String accept = "application/json"; return FluxUtil.withContext( - context -> service.spreadAsRequestBody(contentType, spreadAsRequestBodyRequest, requestOptions, context)); + context -> service.spreadAsRequestBody(accept, spreadAsRequestBodyRequest, requestOptions, context)); } /** @@ -169,8 +165,8 @@ public Mono> spreadAsRequestBodyWithResponseAsync(BinaryData spre @ServiceMethod(returns = ReturnType.SINGLE) public Response spreadAsRequestBodyWithResponse(BinaryData spreadAsRequestBodyRequest, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.spreadAsRequestBodySync(contentType, spreadAsRequestBodyRequest, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.spreadAsRequestBodySync(accept, spreadAsRequestBodyRequest, requestOptions, Context.NONE); } /** @@ -185,7 +181,7 @@ public Response spreadAsRequestBodyWithResponse(BinaryData spreadAsRequest * * @param id The id parameter. * @param xMsTestHeader The xMsTestHeader parameter. - * @param spreadAsRequestParameterRequest The spreadAsRequestParameterRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -195,10 +191,10 @@ public Response spreadAsRequestBodyWithResponse(BinaryData spreadAsRequest */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> spreadAsRequestParameterWithResponseAsync(String id, String xMsTestHeader, - BinaryData spreadAsRequestParameterRequest, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.spreadAsRequestParameter(id, xMsTestHeader, contentType, - spreadAsRequestParameterRequest, requestOptions, context)); + BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.spreadAsRequestParameter(id, xMsTestHeader, accept, request, requestOptions, context)); } /** @@ -213,7 +209,7 @@ public Mono> spreadAsRequestParameterWithResponseAsync(String id, * * @param id The id parameter. * @param xMsTestHeader The xMsTestHeader parameter. - * @param spreadAsRequestParameterRequest The spreadAsRequestParameterRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -222,11 +218,10 @@ public Mono> spreadAsRequestParameterWithResponseAsync(String id, * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response spreadAsRequestParameterWithResponse(String id, String xMsTestHeader, - BinaryData spreadAsRequestParameterRequest, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.spreadAsRequestParameterSync(id, xMsTestHeader, contentType, spreadAsRequestParameterRequest, - requestOptions, Context.NONE); + public Response spreadAsRequestParameterWithResponse(String id, String xMsTestHeader, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.spreadAsRequestParameterSync(id, xMsTestHeader, accept, request, requestOptions, Context.NONE); } /** @@ -246,7 +241,7 @@ public Response spreadAsRequestParameterWithResponse(String id, String xMs * * @param id The id parameter. * @param xMsTestHeader The xMsTestHeader parameter. - * @param spreadWithMultipleParametersRequest The spreadWithMultipleParametersRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -256,10 +251,10 @@ public Response spreadAsRequestParameterWithResponse(String id, String xMs */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> spreadWithMultipleParametersWithResponseAsync(String id, String xMsTestHeader, - BinaryData spreadWithMultipleParametersRequest, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.spreadWithMultipleParameters(id, xMsTestHeader, contentType, - spreadWithMultipleParametersRequest, requestOptions, context)); + BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.spreadWithMultipleParameters(id, xMsTestHeader, accept, request, + requestOptions, context)); } /** @@ -279,7 +274,7 @@ public Mono> spreadWithMultipleParametersWithResponseAsync(String * * @param id The id parameter. * @param xMsTestHeader The xMsTestHeader parameter. - * @param spreadWithMultipleParametersRequest The spreadWithMultipleParametersRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -288,10 +283,10 @@ public Mono> spreadWithMultipleParametersWithResponseAsync(String * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response spreadWithMultipleParametersWithResponse(String id, String xMsTestHeader, - BinaryData spreadWithMultipleParametersRequest, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.spreadWithMultipleParametersSync(id, xMsTestHeader, contentType, - spreadWithMultipleParametersRequest, requestOptions, Context.NONE); + public Response spreadWithMultipleParametersWithResponse(String id, String xMsTestHeader, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.spreadWithMultipleParametersSync(id, xMsTestHeader, accept, request, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/spread/implementation/ModelsImpl.java b/typespec-tests/src/main/java/com/parameters/spread/implementation/ModelsImpl.java index 59c7c427fd..ba34bb436d 100644 --- a/typespec-tests/src/main/java/com/parameters/spread/implementation/ModelsImpl.java +++ b/typespec-tests/src/main/java/com/parameters/spread/implementation/ModelsImpl.java @@ -63,7 +63,7 @@ public interface ModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> spreadAsRequestBody(@HeaderParam("Content-Type") String contentType, + Mono> spreadAsRequestBody(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData bodyParameter, RequestOptions requestOptions, Context context); @Put("/parameters/spread/model/request-body") @@ -72,7 +72,7 @@ Mono> spreadAsRequestBody(@HeaderParam("Content-Type") String con @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response spreadAsRequestBodySync(@HeaderParam("Content-Type") String contentType, + Response spreadAsRequestBodySync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData bodyParameter, RequestOptions requestOptions, Context context); @Put("/parameters/spread/model/composite-request-only-with-body") @@ -81,7 +81,7 @@ Response spreadAsRequestBodySync(@HeaderParam("Content-Type") String conte @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> spreadCompositeRequestOnlyWithBody(@HeaderParam("Content-Type") String contentType, + Mono> spreadCompositeRequestOnlyWithBody(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/parameters/spread/model/composite-request-only-with-body") @@ -90,7 +90,7 @@ Mono> spreadCompositeRequestOnlyWithBody(@HeaderParam("Content-Ty @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response spreadCompositeRequestOnlyWithBodySync(@HeaderParam("Content-Type") String contentType, + Response spreadCompositeRequestOnlyWithBodySync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/parameters/spread/model/composite-request-without-body/{name}") @@ -100,7 +100,8 @@ Response spreadCompositeRequestOnlyWithBodySync(@HeaderParam("Content-Type @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> spreadCompositeRequestWithoutBody(@PathParam("name") String name, - @HeaderParam("test-header") String testHeader, RequestOptions requestOptions, Context context); + @HeaderParam("test-header") String testHeader, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Put("/parameters/spread/model/composite-request-without-body/{name}") @ExpectedResponses({ 204 }) @@ -109,7 +110,8 @@ Mono> spreadCompositeRequestWithoutBody(@PathParam("name") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response spreadCompositeRequestWithoutBodySync(@PathParam("name") String name, - @HeaderParam("test-header") String testHeader, RequestOptions requestOptions, Context context); + @HeaderParam("test-header") String testHeader, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Put("/parameters/spread/model/composite-request/{name}") @ExpectedResponses({ 204 }) @@ -118,7 +120,7 @@ Response spreadCompositeRequestWithoutBodySync(@PathParam("name") String n @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> spreadCompositeRequest(@PathParam("name") String name, - @HeaderParam("test-header") String testHeader, @HeaderParam("Content-Type") String contentType, + @HeaderParam("test-header") String testHeader, @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/parameters/spread/model/composite-request/{name}") @@ -128,7 +130,7 @@ Mono> spreadCompositeRequest(@PathParam("name") String name, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response spreadCompositeRequestSync(@PathParam("name") String name, - @HeaderParam("test-header") String testHeader, @HeaderParam("Content-Type") String contentType, + @HeaderParam("test-header") String testHeader, @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/parameters/spread/model/composite-request-mix/{name}") @@ -138,7 +140,7 @@ Response spreadCompositeRequestSync(@PathParam("name") String name, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> spreadCompositeRequestMix(@PathParam("name") String name, - @HeaderParam("test-header") String testHeader, @HeaderParam("Content-Type") String contentType, + @HeaderParam("test-header") String testHeader, @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData compositeRequestMix, RequestOptions requestOptions, Context context); @@ -149,7 +151,7 @@ Mono> spreadCompositeRequestMix(@PathParam("name") String name, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response spreadCompositeRequestMixSync(@PathParam("name") String name, - @HeaderParam("test-header") String testHeader, @HeaderParam("Content-Type") String contentType, + @HeaderParam("test-header") String testHeader, @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData compositeRequestMix, RequestOptions requestOptions, Context context); } @@ -164,7 +166,7 @@ Response spreadCompositeRequestMixSync(@PathParam("name") String name, * } * } * - * @param bodyParameter The bodyParameter parameter. + * @param bodyParameter This is a simple model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -175,9 +177,9 @@ Response spreadCompositeRequestMixSync(@PathParam("name") String name, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> spreadAsRequestBodyWithResponseAsync(BinaryData bodyParameter, RequestOptions requestOptions) { - final String contentType = "application/json"; + final String accept = "application/json"; return FluxUtil - .withContext(context -> service.spreadAsRequestBody(contentType, bodyParameter, requestOptions, context)); + .withContext(context -> service.spreadAsRequestBody(accept, bodyParameter, requestOptions, context)); } /** @@ -190,7 +192,7 @@ public Mono> spreadAsRequestBodyWithResponseAsync(BinaryData body * } * } * - * @param bodyParameter The bodyParameter parameter. + * @param bodyParameter This is a simple model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -200,8 +202,8 @@ public Mono> spreadAsRequestBodyWithResponseAsync(BinaryData body */ @ServiceMethod(returns = ReturnType.SINGLE) public Response spreadAsRequestBodyWithResponse(BinaryData bodyParameter, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.spreadAsRequestBodySync(contentType, bodyParameter, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.spreadAsRequestBodySync(accept, bodyParameter, requestOptions, Context.NONE); } /** @@ -225,9 +227,9 @@ public Response spreadAsRequestBodyWithResponse(BinaryData bodyParameter, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> spreadCompositeRequestOnlyWithBodyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext( - context -> service.spreadCompositeRequestOnlyWithBody(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.spreadCompositeRequestOnlyWithBody(accept, body, requestOptions, context)); } /** @@ -251,8 +253,8 @@ public Mono> spreadCompositeRequestOnlyWithBodyWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Response spreadCompositeRequestOnlyWithBodyWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.spreadCompositeRequestOnlyWithBodySync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.spreadCompositeRequestOnlyWithBodySync(accept, body, requestOptions, Context.NONE); } /** @@ -270,8 +272,9 @@ public Response spreadCompositeRequestOnlyWithBodyWithResponse(BinaryData @ServiceMethod(returns = ReturnType.SINGLE) public Mono> spreadCompositeRequestWithoutBodyWithResponseAsync(String name, String testHeader, RequestOptions requestOptions) { + final String accept = "application/json"; return FluxUtil.withContext( - context -> service.spreadCompositeRequestWithoutBody(name, testHeader, requestOptions, context)); + context -> service.spreadCompositeRequestWithoutBody(name, testHeader, accept, requestOptions, context)); } /** @@ -289,7 +292,8 @@ public Mono> spreadCompositeRequestWithoutBodyWithResponseAsync(S @ServiceMethod(returns = ReturnType.SINGLE) public Response spreadCompositeRequestWithoutBodyWithResponse(String name, String testHeader, RequestOptions requestOptions) { - return service.spreadCompositeRequestWithoutBodySync(name, testHeader, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.spreadCompositeRequestWithoutBodySync(name, testHeader, accept, requestOptions, Context.NONE); } /** @@ -315,9 +319,9 @@ public Response spreadCompositeRequestWithoutBodyWithResponse(String name, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> spreadCompositeRequestWithResponseAsync(String name, String testHeader, BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; + final String accept = "application/json"; return FluxUtil.withContext( - context -> service.spreadCompositeRequest(name, testHeader, contentType, body, requestOptions, context)); + context -> service.spreadCompositeRequest(name, testHeader, accept, body, requestOptions, context)); } /** @@ -343,8 +347,8 @@ public Mono> spreadCompositeRequestWithResponseAsync(String name, @ServiceMethod(returns = ReturnType.SINGLE) public Response spreadCompositeRequestWithResponse(String name, String testHeader, BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.spreadCompositeRequestSync(name, testHeader, contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.spreadCompositeRequestSync(name, testHeader, accept, body, requestOptions, Context.NONE); } /** @@ -359,7 +363,7 @@ public Response spreadCompositeRequestWithResponse(String name, String tes * * @param name The name parameter. * @param testHeader The testHeader parameter. - * @param compositeRequestMix The compositeRequestMix parameter. + * @param compositeRequestMix This is a model with non-body http request decorator. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -370,8 +374,8 @@ public Response spreadCompositeRequestWithResponse(String name, String tes @ServiceMethod(returns = ReturnType.SINGLE) public Mono> spreadCompositeRequestMixWithResponseAsync(String name, String testHeader, BinaryData compositeRequestMix, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.spreadCompositeRequestMix(name, testHeader, contentType, + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.spreadCompositeRequestMix(name, testHeader, accept, compositeRequestMix, requestOptions, context)); } @@ -387,7 +391,7 @@ public Mono> spreadCompositeRequestMixWithResponseAsync(String na * * @param name The name parameter. * @param testHeader The testHeader parameter. - * @param compositeRequestMix The compositeRequestMix parameter. + * @param compositeRequestMix This is a model with non-body http request decorator. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -398,8 +402,8 @@ public Mono> spreadCompositeRequestMixWithResponseAsync(String na @ServiceMethod(returns = ReturnType.SINGLE) public Response spreadCompositeRequestMixWithResponse(String name, String testHeader, BinaryData compositeRequestMix, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.spreadCompositeRequestMixSync(name, testHeader, contentType, compositeRequestMix, requestOptions, + final String accept = "application/json"; + return service.spreadCompositeRequestMixSync(name, testHeader, accept, compositeRequestMix, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/payload/jsonmergepatch/implementation/JsonMergePatchClientImpl.java b/typespec-tests/src/main/java/com/payload/jsonmergepatch/implementation/JsonMergePatchClientImpl.java index cfe0492c3f..fdd1cb6e35 100644 --- a/typespec-tests/src/main/java/com/payload/jsonmergepatch/implementation/JsonMergePatchClientImpl.java +++ b/typespec-tests/src/main/java/com/payload/jsonmergepatch/implementation/JsonMergePatchClientImpl.java @@ -113,9 +113,8 @@ public interface JsonMergePatchClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createResource(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> createResource(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/json-merge-patch/create/resource") @ExpectedResponses({ 200 }) @@ -123,9 +122,8 @@ Mono> createResource(@HeaderParam("Content-Type") String co @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createResourceSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response createResourceSync(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/json-merge-patch/update/resource") @ExpectedResponses({ 200 }) @@ -133,8 +131,8 @@ Response createResourceSync(@HeaderParam("Content-Type") String cont @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> updateResource(@HeaderParam("content-type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + Mono> updateResource(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/json-merge-patch/update/resource") @@ -143,8 +141,8 @@ Mono> updateResource(@HeaderParam("content-type") String co @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response updateResourceSync(@HeaderParam("content-type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + Response updateResourceSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/json-merge-patch/update/resource/optional") @@ -153,8 +151,8 @@ Response updateResourceSync(@HeaderParam("content-type") String cont @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> updateOptionalResource(@HeaderParam("content-type") String contentType, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Mono> updateOptionalResource(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Patch("/json-merge-patch/update/resource/optional") @ExpectedResponses({ 200 }) @@ -162,8 +160,8 @@ Mono> updateOptionalResource(@HeaderParam("content-type") S @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response updateOptionalResourceSync(@HeaderParam("content-type") String contentType, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Response updateOptionalResourceSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -226,10 +224,8 @@ Response updateOptionalResourceSync(@HeaderParam("content-type") Str */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createResourceWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createResource(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.createResource(accept, body, requestOptions, context)); } /** @@ -292,9 +288,8 @@ public Mono> createResourceWithResponseAsync(BinaryData bod */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createResourceWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.createResourceSync(contentType, accept, body, requestOptions, Context.NONE); + return service.createResourceSync(accept, body, requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/payload/mediatype/implementation/StringBodiesImpl.java b/typespec-tests/src/main/java/com/payload/mediatype/implementation/StringBodiesImpl.java index 205b382e4c..e513ab62de 100644 --- a/typespec-tests/src/main/java/com/payload/mediatype/implementation/StringBodiesImpl.java +++ b/typespec-tests/src/main/java/com/payload/mediatype/implementation/StringBodiesImpl.java @@ -64,8 +64,9 @@ public interface StringBodiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> sendAsText(@HeaderParam("content-type") String contentType, - @BodyParam("text/plain") BinaryData text, RequestOptions requestOptions, Context context); + Mono> sendAsText(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("text/plain") BinaryData text, + RequestOptions requestOptions, Context context); @Post("/payload/media-type/string-body/sendAsText") @ExpectedResponses({ 200 }) @@ -73,8 +74,9 @@ Mono> sendAsText(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendAsTextSync(@HeaderParam("content-type") String contentType, - @BodyParam("text/plain") BinaryData text, RequestOptions requestOptions, Context context); + Response sendAsTextSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("text/plain") BinaryData text, + RequestOptions requestOptions, Context context); @Get("/payload/media-type/string-body/getAsText") @ExpectedResponses({ 200 }) @@ -82,7 +84,7 @@ Response sendAsTextSync(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAsText(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getAsText(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/payload/media-type/string-body/getAsText") @@ -91,7 +93,7 @@ Mono> getAsText(@HeaderParam("Accept") String accept, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAsTextSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getAsTextSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/payload/media-type/string-body/sendAsJson") @@ -100,8 +102,9 @@ Response getAsTextSync(@HeaderParam("Accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> sendAsJson(@HeaderParam("content-type") String contentType, - @BodyParam("application/json") BinaryData text, RequestOptions requestOptions, Context context); + Mono> sendAsJson(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData text, + RequestOptions requestOptions, Context context); @Post("/payload/media-type/string-body/sendAsJson") @ExpectedResponses({ 200 }) @@ -109,8 +112,9 @@ Mono> sendAsJson(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendAsJsonSync(@HeaderParam("content-type") String contentType, - @BodyParam("application/json") BinaryData text, RequestOptions requestOptions, Context context); + Response sendAsJsonSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData text, + RequestOptions requestOptions, Context context); @Get("/payload/media-type/string-body/getAsJson") @ExpectedResponses({ 200 }) @@ -118,7 +122,7 @@ Response sendAsJsonSync(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAsJson(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getAsJson(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/payload/media-type/string-body/getAsJson") @@ -127,7 +131,7 @@ Mono> getAsJson(@HeaderParam("Accept") String accept, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAsJsonSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getAsJsonSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } @@ -150,7 +154,8 @@ Response getAsJsonSync(@HeaderParam("Accept") String accept, Request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendAsTextWithResponseAsync(BinaryData text, RequestOptions requestOptions) { final String contentType = "text/plain"; - return FluxUtil.withContext(context -> service.sendAsText(contentType, text, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.sendAsText(contentType, accept, text, requestOptions, context)); } /** @@ -172,7 +177,8 @@ public Mono> sendAsTextWithResponseAsync(BinaryData text, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response sendAsTextWithResponse(BinaryData text, RequestOptions requestOptions) { final String contentType = "text/plain"; - return service.sendAsTextSync(contentType, text, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.sendAsTextSync(contentType, accept, text, requestOptions, Context.NONE); } /** @@ -236,7 +242,8 @@ public Response getAsTextWithResponse(RequestOptions requestOptions) @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendAsJsonWithResponseAsync(BinaryData text, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.sendAsJson(contentType, text, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.sendAsJson(contentType, accept, text, requestOptions, context)); } /** @@ -258,7 +265,8 @@ public Mono> sendAsJsonWithResponseAsync(BinaryData text, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response sendAsJsonWithResponse(BinaryData text, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.sendAsJsonSync(contentType, text, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.sendAsJsonSync(contentType, accept, text, requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/payload/multipart/MultiPartAsyncClient.java b/typespec-tests/src/main/java/com/payload/multipart/MultiPartAsyncClient.java index a9998c3c2c..92b5389c20 100644 --- a/typespec-tests/src/main/java/com/payload/multipart/MultiPartAsyncClient.java +++ b/typespec-tests/src/main/java/com/payload/multipart/MultiPartAsyncClient.java @@ -184,7 +184,7 @@ Mono> checkFileNameAndContentTypeWithResponse(BinaryData body, Re /** * Test content-type: multipart/form-data. * - * @param anonymousModelRequest The anonymousModelRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -194,10 +194,10 @@ Mono> checkFileNameAndContentTypeWithResponse(BinaryData body, Re */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono> anonymousModelWithResponse(BinaryData anonymousModelRequest, RequestOptions requestOptions) { + Mono> anonymousModelWithResponse(BinaryData request, RequestOptions requestOptions) { // Protocol API requires serialization of parts with content-disposition and data, as operation 'anonymousModel' // is 'multipart/form-data' - return this.serviceClient.anonymousModelWithResponseAsync(anonymousModelRequest, requestOptions); + return this.serviceClient.anonymousModelWithResponseAsync(request, requestOptions); } /** @@ -403,14 +403,12 @@ public Mono checkFileNameAndContentType(MultiPartRequest body) { public Mono anonymousModel(ProfileImageFileDetails profileImage) { // Generated convenience method for anonymousModelWithResponse RequestOptions requestOptions = new RequestOptions(); - AnonymousModelRequest anonymousModelRequestObj = new AnonymousModelRequest(profileImage); - BinaryData anonymousModelRequest - = new MultipartFormDataHelper(requestOptions) - .serializeFileField("profileImage", anonymousModelRequestObj.getProfileImage().getContent(), - anonymousModelRequestObj.getProfileImage().getContentType(), - anonymousModelRequestObj.getProfileImage().getFilename()) - .end() - .getRequestBody(); - return anonymousModelWithResponse(anonymousModelRequest, requestOptions).flatMap(FluxUtil::toMono); + AnonymousModelRequest requestObj = new AnonymousModelRequest(profileImage); + BinaryData request = new MultipartFormDataHelper(requestOptions) + .serializeFileField("profileImage", requestObj.getProfileImage().getContent(), + requestObj.getProfileImage().getContentType(), requestObj.getProfileImage().getFilename()) + .end() + .getRequestBody(); + return anonymousModelWithResponse(request, requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/typespec-tests/src/main/java/com/payload/multipart/MultiPartClient.java b/typespec-tests/src/main/java/com/payload/multipart/MultiPartClient.java index ee58a1c551..7d5e8c1362 100644 --- a/typespec-tests/src/main/java/com/payload/multipart/MultiPartClient.java +++ b/typespec-tests/src/main/java/com/payload/multipart/MultiPartClient.java @@ -182,7 +182,7 @@ Response checkFileNameAndContentTypeWithResponse(BinaryData body, RequestO /** * Test content-type: multipart/form-data. * - * @param anonymousModelRequest The anonymousModelRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -192,10 +192,10 @@ Response checkFileNameAndContentTypeWithResponse(BinaryData body, RequestO */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Response anonymousModelWithResponse(BinaryData anonymousModelRequest, RequestOptions requestOptions) { + Response anonymousModelWithResponse(BinaryData request, RequestOptions requestOptions) { // Protocol API requires serialization of parts with content-disposition and data, as operation 'anonymousModel' // is 'multipart/form-data' - return this.serviceClient.anonymousModelWithResponse(anonymousModelRequest, requestOptions); + return this.serviceClient.anonymousModelWithResponse(request, requestOptions); } /** @@ -391,14 +391,12 @@ public void checkFileNameAndContentType(MultiPartRequest body) { public void anonymousModel(ProfileImageFileDetails profileImage) { // Generated convenience method for anonymousModelWithResponse RequestOptions requestOptions = new RequestOptions(); - AnonymousModelRequest anonymousModelRequestObj = new AnonymousModelRequest(profileImage); - BinaryData anonymousModelRequest - = new MultipartFormDataHelper(requestOptions) - .serializeFileField("profileImage", anonymousModelRequestObj.getProfileImage().getContent(), - anonymousModelRequestObj.getProfileImage().getContentType(), - anonymousModelRequestObj.getProfileImage().getFilename()) - .end() - .getRequestBody(); - anonymousModelWithResponse(anonymousModelRequest, requestOptions).getValue(); + AnonymousModelRequest requestObj = new AnonymousModelRequest(profileImage); + BinaryData request = new MultipartFormDataHelper(requestOptions) + .serializeFileField("profileImage", requestObj.getProfileImage().getContent(), + requestObj.getProfileImage().getContentType(), requestObj.getProfileImage().getFilename()) + .end() + .getRequestBody(); + anonymousModelWithResponse(request, requestOptions).getValue(); } } diff --git a/typespec-tests/src/main/java/com/payload/multipart/implementation/FormDatasImpl.java b/typespec-tests/src/main/java/com/payload/multipart/implementation/FormDatasImpl.java index d34df545a8..fb0060c5d4 100644 --- a/typespec-tests/src/main/java/com/payload/multipart/implementation/FormDatasImpl.java +++ b/typespec-tests/src/main/java/com/payload/multipart/implementation/FormDatasImpl.java @@ -64,8 +64,9 @@ public interface FormDatasService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> basic(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Mono> basic(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/mixed-parts") @@ -74,7 +75,7 @@ Mono> basic(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response basicSync(@HeaderParam("content-type") String contentType, + Response basicSync(@HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -84,8 +85,9 @@ Response basicSync(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> complex(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Mono> complex(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/complex-parts") @@ -94,8 +96,9 @@ Mono> complex(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response complexSync(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Response complexSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/json-part") @@ -104,8 +107,9 @@ Response complexSync(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> jsonPart(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Mono> jsonPart(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/json-part") @@ -114,8 +118,9 @@ Mono> jsonPart(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response jsonPartSync(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Response jsonPartSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/binary-array-parts") @@ -124,8 +129,9 @@ Response jsonPartSync(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> binaryArrayParts(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Mono> binaryArrayParts(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/binary-array-parts") @@ -134,8 +140,9 @@ Mono> binaryArrayParts(@HeaderParam("content-type") String conten @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response binaryArrayPartsSync(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Response binaryArrayPartsSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/json-array-parts") @@ -144,8 +151,9 @@ Response binaryArrayPartsSync(@HeaderParam("content-type") String contentT @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> jsonArrayParts(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Mono> jsonArrayParts(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/json-array-parts") @@ -154,8 +162,9 @@ Mono> jsonArrayParts(@HeaderParam("content-type") String contentT @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response jsonArrayPartsSync(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Response jsonArrayPartsSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/multi-binary-parts") @@ -164,8 +173,9 @@ Response jsonArrayPartsSync(@HeaderParam("content-type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> multiBinaryParts(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Mono> multiBinaryParts(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/multi-binary-parts") @@ -174,8 +184,9 @@ Mono> multiBinaryParts(@HeaderParam("content-type") String conten @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response multiBinaryPartsSync(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Response multiBinaryPartsSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/check-filename-and-content-type") @@ -184,8 +195,9 @@ Response multiBinaryPartsSync(@HeaderParam("content-type") String contentT @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> checkFileNameAndContentType(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Mono> checkFileNameAndContentType(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/check-filename-and-content-type") @@ -194,8 +206,9 @@ Mono> checkFileNameAndContentType(@HeaderParam("content-type") St @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response checkFileNameAndContentTypeSync(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Response checkFileNameAndContentTypeSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/anonymous-model") @@ -204,9 +217,9 @@ Response checkFileNameAndContentTypeSync(@HeaderParam("content-type") Stri @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> anonymousModel(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData anonymousModelRequest, RequestOptions requestOptions, - Context context); + Mono> anonymousModel(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData request, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/anonymous-model") @@ -215,9 +228,9 @@ Mono> anonymousModel(@HeaderParam("content-type") String contentT @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response anonymousModelSync(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData anonymousModelRequest, RequestOptions requestOptions, - Context context); + Response anonymousModelSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData request, + RequestOptions requestOptions, Context context); } /** @@ -234,7 +247,8 @@ Response anonymousModelSync(@HeaderParam("content-type") String contentTyp @ServiceMethod(returns = ReturnType.SINGLE) public Mono> basicWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return FluxUtil.withContext(context -> service.basic(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.basic(contentType, accept, body, requestOptions, context)); } /** @@ -251,7 +265,8 @@ public Mono> basicWithResponseAsync(BinaryData body, RequestOptio @ServiceMethod(returns = ReturnType.SINGLE) public Response basicWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return service.basicSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.basicSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -268,7 +283,8 @@ public Response basicWithResponse(BinaryData body, RequestOptions requestO @ServiceMethod(returns = ReturnType.SINGLE) public Mono> complexWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return FluxUtil.withContext(context -> service.complex(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.complex(contentType, accept, body, requestOptions, context)); } /** @@ -285,7 +301,8 @@ public Mono> complexWithResponseAsync(BinaryData body, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response complexWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return service.complexSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.complexSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -302,7 +319,8 @@ public Response complexWithResponse(BinaryData body, RequestOptions reques @ServiceMethod(returns = ReturnType.SINGLE) public Mono> jsonPartWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return FluxUtil.withContext(context -> service.jsonPart(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.jsonPart(contentType, accept, body, requestOptions, context)); } /** @@ -319,7 +337,8 @@ public Mono> jsonPartWithResponseAsync(BinaryData body, RequestOp @ServiceMethod(returns = ReturnType.SINGLE) public Response jsonPartWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return service.jsonPartSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.jsonPartSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -336,7 +355,9 @@ public Response jsonPartWithResponse(BinaryData body, RequestOptions reque @ServiceMethod(returns = ReturnType.SINGLE) public Mono> binaryArrayPartsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return FluxUtil.withContext(context -> service.binaryArrayParts(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.binaryArrayParts(contentType, accept, body, requestOptions, context)); } /** @@ -353,7 +374,8 @@ public Mono> binaryArrayPartsWithResponseAsync(BinaryData body, R @ServiceMethod(returns = ReturnType.SINGLE) public Response binaryArrayPartsWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return service.binaryArrayPartsSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.binaryArrayPartsSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -370,7 +392,9 @@ public Response binaryArrayPartsWithResponse(BinaryData body, RequestOptio @ServiceMethod(returns = ReturnType.SINGLE) public Mono> jsonArrayPartsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return FluxUtil.withContext(context -> service.jsonArrayParts(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.jsonArrayParts(contentType, accept, body, requestOptions, context)); } /** @@ -387,7 +411,8 @@ public Mono> jsonArrayPartsWithResponseAsync(BinaryData body, Req @ServiceMethod(returns = ReturnType.SINGLE) public Response jsonArrayPartsWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return service.jsonArrayPartsSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.jsonArrayPartsSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -404,7 +429,9 @@ public Response jsonArrayPartsWithResponse(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> multiBinaryPartsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return FluxUtil.withContext(context -> service.multiBinaryParts(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.multiBinaryParts(contentType, accept, body, requestOptions, context)); } /** @@ -421,7 +448,8 @@ public Mono> multiBinaryPartsWithResponseAsync(BinaryData body, R @ServiceMethod(returns = ReturnType.SINGLE) public Response multiBinaryPartsWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return service.multiBinaryPartsSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.multiBinaryPartsSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -439,8 +467,9 @@ public Response multiBinaryPartsWithResponse(BinaryData body, RequestOptio public Mono> checkFileNameAndContentTypeWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return FluxUtil - .withContext(context -> service.checkFileNameAndContentType(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.checkFileNameAndContentType(contentType, accept, body, requestOptions, context)); } /** @@ -457,13 +486,14 @@ public Mono> checkFileNameAndContentTypeWithResponseAsync(BinaryD @ServiceMethod(returns = ReturnType.SINGLE) public Response checkFileNameAndContentTypeWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return service.checkFileNameAndContentTypeSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.checkFileNameAndContentTypeSync(contentType, accept, body, requestOptions, Context.NONE); } /** * Test content-type: multipart/form-data. * - * @param anonymousModelRequest The anonymousModelRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -472,17 +502,17 @@ public Response checkFileNameAndContentTypeWithResponse(BinaryData body, R * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> anonymousModelWithResponseAsync(BinaryData anonymousModelRequest, - RequestOptions requestOptions) { + public Mono> anonymousModelWithResponseAsync(BinaryData request, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return FluxUtil.withContext( - context -> service.anonymousModel(contentType, anonymousModelRequest, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.anonymousModel(contentType, accept, request, requestOptions, context)); } /** * Test content-type: multipart/form-data. * - * @param anonymousModelRequest The anonymousModelRequest parameter. + * @param request The request parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -491,8 +521,9 @@ public Mono> anonymousModelWithResponseAsync(BinaryData anonymous * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response anonymousModelWithResponse(BinaryData anonymousModelRequest, RequestOptions requestOptions) { + public Response anonymousModelWithResponse(BinaryData request, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return service.anonymousModelSync(contentType, anonymousModelRequest, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.anonymousModelSync(contentType, accept, request, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/payload/pageable/implementation/PageableClientImpl.java b/typespec-tests/src/main/java/com/payload/pageable/implementation/PageableClientImpl.java index 7f63146b5f..6e4347e371 100644 --- a/typespec-tests/src/main/java/com/payload/pageable/implementation/PageableClientImpl.java +++ b/typespec-tests/src/main/java/com/payload/pageable/implementation/PageableClientImpl.java @@ -117,7 +117,7 @@ public interface PageableClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> list(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/payload/pageable") @@ -126,7 +126,7 @@ Mono> list(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response listSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -136,7 +136,7 @@ Response listSync(@HeaderParam("Accept") String accept, RequestOptio @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -145,7 +145,7 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = tru @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -319,8 +319,6 @@ public PagedIterable list(RequestOptions requestOptions) { } /** - * List users - * * Get the next page of items. *

Response Body Schema

* @@ -347,8 +345,6 @@ private Mono> listNextSinglePageAsync(String nextLink, } /** - * List users - * * Get the next page of items. *

Response Body Schema

* diff --git a/typespec-tests/src/main/java/com/resiliency/servicedriven/ResiliencyServiceDrivenClientBuilder.java b/typespec-tests/src/main/java/com/resiliency/servicedriven/ResiliencyServiceDrivenClientBuilder.java index a833d3c4d1..e56acf8643 100644 --- a/typespec-tests/src/main/java/com/resiliency/servicedriven/ResiliencyServiceDrivenClientBuilder.java +++ b/typespec-tests/src/main/java/com/resiliency/servicedriven/ResiliencyServiceDrivenClientBuilder.java @@ -213,24 +213,6 @@ public ResiliencyServiceDrivenClientBuilder serviceDeploymentVersion(String serv return this; } - /* - * Pass in either 'v1' or 'v2'. This represents the API version of a service. - */ - @Generated - private String apiVersion; - - /** - * Sets Pass in either 'v1' or 'v2'. This represents the API version of a service. - * - * @param apiVersion the apiVersion value. - * @return the ResiliencyServiceDrivenClientBuilder. - */ - @Generated - public ResiliencyServiceDrivenClientBuilder apiVersion(String apiVersion) { - this.apiVersion = apiVersion; - return this; - } - /* * Service version */ @@ -280,7 +262,7 @@ private ResiliencyServiceDrivenClientImpl buildInnerClient() { = (serviceVersion != null) ? serviceVersion : ServiceDrivenServiceVersion.getLatest(); ResiliencyServiceDrivenClientImpl client = new ResiliencyServiceDrivenClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), - this.endpoint, this.serviceDeploymentVersion, this.apiVersion, localServiceVersion); + this.endpoint, this.serviceDeploymentVersion, localServiceVersion); return client; } @@ -290,7 +272,6 @@ private void validateClient() { // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); Objects.requireNonNull(serviceDeploymentVersion, "'serviceDeploymentVersion' cannot be null."); - Objects.requireNonNull(apiVersion, "'apiVersion' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/resiliency/servicedriven/implementation/ResiliencyServiceDrivenClientImpl.java b/typespec-tests/src/main/java/com/resiliency/servicedriven/implementation/ResiliencyServiceDrivenClientImpl.java index 9bf3d7c0bb..0ab9638406 100644 --- a/typespec-tests/src/main/java/com/resiliency/servicedriven/implementation/ResiliencyServiceDrivenClientImpl.java +++ b/typespec-tests/src/main/java/com/resiliency/servicedriven/implementation/ResiliencyServiceDrivenClientImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; import com.azure.core.annotation.Head; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.QueryParam; @@ -74,20 +75,6 @@ public String getServiceDeploymentVersion() { return this.serviceDeploymentVersion; } - /** - * Pass in either 'v1' or 'v2'. This represents the API version of a service. - */ - private final String apiVersion; - - /** - * Gets Pass in either 'v1' or 'v2'. This represents the API version of a service. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - /** * Service version. */ @@ -137,14 +124,12 @@ public SerializerAdapter getSerializerAdapter() { * @param serviceDeploymentVersion Pass in either 'v1' or 'v2'. This represents a version of the service deployment * in history. 'v1' is for the deployment when the service had only one api version. 'v2' is for the deployment when * the service had api-versions 'v1' and 'v2'. - * @param apiVersion Pass in either 'v1' or 'v2'. This represents the API version of a service. * @param serviceVersion Service version. */ - public ResiliencyServiceDrivenClientImpl(String endpoint, String serviceDeploymentVersion, String apiVersion, + public ResiliencyServiceDrivenClientImpl(String endpoint, String serviceDeploymentVersion, ServiceDrivenServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceDeploymentVersion, apiVersion, - serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceDeploymentVersion, serviceVersion); } /** @@ -155,13 +140,12 @@ public ResiliencyServiceDrivenClientImpl(String endpoint, String serviceDeployme * @param serviceDeploymentVersion Pass in either 'v1' or 'v2'. This represents a version of the service deployment * in history. 'v1' is for the deployment when the service had only one api version. 'v2' is for the deployment when * the service had api-versions 'v1' and 'v2'. - * @param apiVersion Pass in either 'v1' or 'v2'. This represents the API version of a service. * @param serviceVersion Service version. */ public ResiliencyServiceDrivenClientImpl(HttpPipeline httpPipeline, String endpoint, - String serviceDeploymentVersion, String apiVersion, ServiceDrivenServiceVersion serviceVersion) { + String serviceDeploymentVersion, ServiceDrivenServiceVersion serviceVersion) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceDeploymentVersion, - apiVersion, serviceVersion); + serviceVersion); } /** @@ -173,17 +157,14 @@ public ResiliencyServiceDrivenClientImpl(HttpPipeline httpPipeline, String endpo * @param serviceDeploymentVersion Pass in either 'v1' or 'v2'. This represents a version of the service deployment * in history. 'v1' is for the deployment when the service had only one api version. 'v2' is for the deployment when * the service had api-versions 'v1' and 'v2'. - * @param apiVersion Pass in either 'v1' or 'v2'. This represents the API version of a service. * @param serviceVersion Service version. */ public ResiliencyServiceDrivenClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint, String serviceDeploymentVersion, String apiVersion, - ServiceDrivenServiceVersion serviceVersion) { + String endpoint, String serviceDeploymentVersion, ServiceDrivenServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; this.serviceDeploymentVersion = serviceDeploymentVersion; - this.apiVersion = apiVersion; this.serviceVersion = serviceVersion; this.service = RestProxy.create(ResiliencyServiceDrivenClientService.class, this.httpPipeline, this.getSerializerAdapter()); @@ -204,7 +185,8 @@ public interface ResiliencyServiceDrivenClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> addOperation(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Delete("/add-operation") @ExpectedResponses({ 204 }) @@ -214,7 +196,8 @@ Mono> addOperation(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response addOperationSync(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Head("/add-optional-param/from-none") @ExpectedResponses({ 204 }) @@ -224,7 +207,8 @@ Response addOperationSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> fromNone(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Head("/add-optional-param/from-none") @ExpectedResponses({ 204 }) @@ -234,7 +218,8 @@ Mono> fromNone(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response fromNoneSync(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/add-optional-param/from-one-required") @ExpectedResponses({ 204 }) @@ -245,7 +230,7 @@ Response fromNoneSync(@HostParam("endpoint") String endpoint, Mono> fromOneRequired(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, @HostParam("apiVersion") String apiVersion, @QueryParam("parameter") String parameter, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/add-optional-param/from-one-required") @ExpectedResponses({ 204 }) @@ -256,7 +241,7 @@ Mono> fromOneRequired(@HostParam("endpoint") String endpoint, Response fromOneRequiredSync(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, @HostParam("apiVersion") String apiVersion, @QueryParam("parameter") String parameter, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/add-optional-param/from-one-optional") @ExpectedResponses({ 204 }) @@ -266,7 +251,8 @@ Response fromOneRequiredSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> fromOneOptional(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/add-optional-param/from-one-optional") @ExpectedResponses({ 204 }) @@ -276,7 +262,8 @@ Mono> fromOneOptional(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response fromOneOptionalSync(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); } /** @@ -291,8 +278,10 @@ Response fromOneOptionalSync(@HostParam("endpoint") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> addOperationWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.addOperation(this.getEndpoint(), - this.getServiceDeploymentVersion(), this.getApiVersion(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.addOperation(this.getEndpoint(), this.getServiceDeploymentVersion(), + this.getServiceVersion().getVersion(), accept, requestOptions, context)); } /** @@ -307,8 +296,9 @@ public Mono> addOperationWithResponseAsync(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response addOperationWithResponse(RequestOptions requestOptions) { - return service.addOperationSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), - requestOptions, Context.NONE); + final String accept = "application/json"; + return service.addOperationSync(this.getEndpoint(), this.getServiceDeploymentVersion(), + this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); } /** @@ -330,8 +320,9 @@ public Response addOperationWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromNoneWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; return FluxUtil.withContext(context -> service.fromNone(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getApiVersion(), requestOptions, context)); + this.getServiceVersion().getVersion(), accept, requestOptions, context)); } /** @@ -353,8 +344,9 @@ public Mono> fromNoneWithResponseAsync(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromNoneWithResponse(RequestOptions requestOptions) { - return service.fromNoneSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), - requestOptions, Context.NONE); + final String accept = "application/json"; + return service.fromNoneSync(this.getEndpoint(), this.getServiceDeploymentVersion(), + this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); } /** @@ -378,8 +370,10 @@ public Response fromNoneWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromOneRequiredWithResponseAsync(String parameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.fromOneRequired(this.getEndpoint(), - this.getServiceDeploymentVersion(), this.getApiVersion(), parameter, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.fromOneRequired(this.getEndpoint(), this.getServiceDeploymentVersion(), + this.getServiceVersion().getVersion(), parameter, accept, requestOptions, context)); } /** @@ -403,8 +397,9 @@ public Mono> fromOneRequiredWithResponseAsync(String parameter, R */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromOneRequiredWithResponse(String parameter, RequestOptions requestOptions) { - return service.fromOneRequiredSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), - parameter, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.fromOneRequiredSync(this.getEndpoint(), this.getServiceDeploymentVersion(), + this.getServiceVersion().getVersion(), parameter, accept, requestOptions, Context.NONE); } /** @@ -428,8 +423,10 @@ public Response fromOneRequiredWithResponse(String parameter, RequestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromOneOptionalWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.fromOneOptional(this.getEndpoint(), - this.getServiceDeploymentVersion(), this.getApiVersion(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.fromOneOptional(this.getEndpoint(), this.getServiceDeploymentVersion(), + this.getServiceVersion().getVersion(), accept, requestOptions, context)); } /** @@ -453,7 +450,8 @@ public Mono> fromOneOptionalWithResponseAsync(RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromOneOptionalWithResponse(RequestOptions requestOptions) { - return service.fromOneOptionalSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), - requestOptions, Context.NONE); + final String accept = "application/json"; + return service.fromOneOptionalSync(this.getEndpoint(), this.getServiceDeploymentVersion(), + this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/ResiliencyServiceDrivenClientBuilder.java b/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/ResiliencyServiceDrivenClientBuilder.java index 1e2ca9c103..4b851ce32d 100644 --- a/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/ResiliencyServiceDrivenClientBuilder.java +++ b/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/ResiliencyServiceDrivenClientBuilder.java @@ -213,26 +213,6 @@ public ResiliencyServiceDrivenClientBuilder serviceDeploymentVersion(String serv return this; } - /* - * Pass in 'v1'. This represents the API version of the service. Will grow up in the next deployment to be both 'v1' - * and 'v2' - */ - @Generated - private String apiVersion; - - /** - * Sets Pass in 'v1'. This represents the API version of the service. Will grow up in the next deployment to be both - * 'v1' and 'v2'. - * - * @param apiVersion the apiVersion value. - * @return the ResiliencyServiceDrivenClientBuilder. - */ - @Generated - public ResiliencyServiceDrivenClientBuilder apiVersion(String apiVersion) { - this.apiVersion = apiVersion; - return this; - } - /* * Service version */ @@ -282,7 +262,7 @@ private ResiliencyServiceDrivenClientImpl buildInnerClient() { = (serviceVersion != null) ? serviceVersion : ServiceDrivenServiceVersion.getLatest(); ResiliencyServiceDrivenClientImpl client = new ResiliencyServiceDrivenClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), - this.endpoint, this.serviceDeploymentVersion, this.apiVersion, localServiceVersion); + this.endpoint, this.serviceDeploymentVersion, localServiceVersion); return client; } @@ -292,7 +272,6 @@ private void validateClient() { // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); Objects.requireNonNull(serviceDeploymentVersion, "'serviceDeploymentVersion' cannot be null."); - Objects.requireNonNull(apiVersion, "'apiVersion' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/implementation/ResiliencyServiceDrivenClientImpl.java b/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/implementation/ResiliencyServiceDrivenClientImpl.java index dde4ef8910..e52308a2ad 100644 --- a/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/implementation/ResiliencyServiceDrivenClientImpl.java +++ b/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/implementation/ResiliencyServiceDrivenClientImpl.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; import com.azure.core.annotation.Head; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.QueryParam; @@ -73,22 +74,6 @@ public String getServiceDeploymentVersion() { return this.serviceDeploymentVersion; } - /** - * Pass in 'v1'. This represents the API version of the service. Will grow up in the next deployment to be both 'v1' - * and 'v2'. - */ - private final String apiVersion; - - /** - * Gets Pass in 'v1'. This represents the API version of the service. Will grow up in the next deployment to be both - * 'v1' and 'v2'. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - /** * Service version. */ @@ -138,15 +123,12 @@ public SerializerAdapter getSerializerAdapter() { * @param serviceDeploymentVersion Pass in either 'v1' or 'v2'. This represents a version of the service deployment * in history. 'v1' is for the deployment when the service had only one api version. 'v2' is for the deployment when * the service had api-versions 'v1' and 'v2'. - * @param apiVersion Pass in 'v1'. This represents the API version of the service. Will grow up in the next - * deployment to be both 'v1' and 'v2'. * @param serviceVersion Service version. */ - public ResiliencyServiceDrivenClientImpl(String endpoint, String serviceDeploymentVersion, String apiVersion, + public ResiliencyServiceDrivenClientImpl(String endpoint, String serviceDeploymentVersion, ServiceDrivenServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceDeploymentVersion, apiVersion, - serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceDeploymentVersion, serviceVersion); } /** @@ -157,14 +139,12 @@ public ResiliencyServiceDrivenClientImpl(String endpoint, String serviceDeployme * @param serviceDeploymentVersion Pass in either 'v1' or 'v2'. This represents a version of the service deployment * in history. 'v1' is for the deployment when the service had only one api version. 'v2' is for the deployment when * the service had api-versions 'v1' and 'v2'. - * @param apiVersion Pass in 'v1'. This represents the API version of the service. Will grow up in the next - * deployment to be both 'v1' and 'v2'. * @param serviceVersion Service version. */ public ResiliencyServiceDrivenClientImpl(HttpPipeline httpPipeline, String endpoint, - String serviceDeploymentVersion, String apiVersion, ServiceDrivenServiceVersion serviceVersion) { + String serviceDeploymentVersion, ServiceDrivenServiceVersion serviceVersion) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceDeploymentVersion, - apiVersion, serviceVersion); + serviceVersion); } /** @@ -176,18 +156,14 @@ public ResiliencyServiceDrivenClientImpl(HttpPipeline httpPipeline, String endpo * @param serviceDeploymentVersion Pass in either 'v1' or 'v2'. This represents a version of the service deployment * in history. 'v1' is for the deployment when the service had only one api version. 'v2' is for the deployment when * the service had api-versions 'v1' and 'v2'. - * @param apiVersion Pass in 'v1'. This represents the API version of the service. Will grow up in the next - * deployment to be both 'v1' and 'v2'. * @param serviceVersion Service version. */ public ResiliencyServiceDrivenClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint, String serviceDeploymentVersion, String apiVersion, - ServiceDrivenServiceVersion serviceVersion) { + String endpoint, String serviceDeploymentVersion, ServiceDrivenServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; this.serviceDeploymentVersion = serviceDeploymentVersion; - this.apiVersion = apiVersion; this.serviceVersion = serviceVersion; this.service = RestProxy.create(ResiliencyServiceDrivenClientService.class, this.httpPipeline, this.getSerializerAdapter()); @@ -208,7 +184,8 @@ public interface ResiliencyServiceDrivenClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> fromNone(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Head("/add-optional-param/from-none") @ExpectedResponses({ 204 }) @@ -218,7 +195,8 @@ Mono> fromNone(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response fromNoneSync(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/add-optional-param/from-one-required") @ExpectedResponses({ 204 }) @@ -229,7 +207,7 @@ Response fromNoneSync(@HostParam("endpoint") String endpoint, Mono> fromOneRequired(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, @HostParam("apiVersion") String apiVersion, @QueryParam("parameter") String parameter, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/add-optional-param/from-one-required") @ExpectedResponses({ 204 }) @@ -240,7 +218,7 @@ Mono> fromOneRequired(@HostParam("endpoint") String endpoint, Response fromOneRequiredSync(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, @HostParam("apiVersion") String apiVersion, @QueryParam("parameter") String parameter, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/add-optional-param/from-one-optional") @ExpectedResponses({ 204 }) @@ -250,7 +228,8 @@ Response fromOneRequiredSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> fromOneOptional(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/add-optional-param/from-one-optional") @ExpectedResponses({ 204 }) @@ -260,7 +239,8 @@ Mono> fromOneOptional(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response fromOneOptionalSync(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); } /** @@ -276,8 +256,9 @@ Response fromOneOptionalSync(@HostParam("endpoint") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromNoneWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; return FluxUtil.withContext(context -> service.fromNone(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getApiVersion(), requestOptions, context)); + this.getServiceVersion().getVersion(), accept, requestOptions, context)); } /** @@ -293,8 +274,9 @@ public Mono> fromNoneWithResponseAsync(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromNoneWithResponse(RequestOptions requestOptions) { - return service.fromNoneSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), - requestOptions, Context.NONE); + final String accept = "application/json"; + return service.fromNoneSync(this.getEndpoint(), this.getServiceDeploymentVersion(), + this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); } /** @@ -311,8 +293,10 @@ public Response fromNoneWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromOneRequiredWithResponseAsync(String parameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.fromOneRequired(this.getEndpoint(), - this.getServiceDeploymentVersion(), this.getApiVersion(), parameter, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.fromOneRequired(this.getEndpoint(), this.getServiceDeploymentVersion(), + this.getServiceVersion().getVersion(), parameter, accept, requestOptions, context)); } /** @@ -329,8 +313,9 @@ public Mono> fromOneRequiredWithResponseAsync(String parameter, R */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromOneRequiredWithResponse(String parameter, RequestOptions requestOptions) { - return service.fromOneRequiredSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), - parameter, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.fromOneRequiredSync(this.getEndpoint(), this.getServiceDeploymentVersion(), + this.getServiceVersion().getVersion(), parameter, accept, requestOptions, Context.NONE); } /** @@ -353,8 +338,10 @@ public Response fromOneRequiredWithResponse(String parameter, RequestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromOneOptionalWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.fromOneOptional(this.getEndpoint(), - this.getServiceDeploymentVersion(), this.getApiVersion(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.fromOneOptional(this.getEndpoint(), this.getServiceDeploymentVersion(), + this.getServiceVersion().getVersion(), accept, requestOptions, context)); } /** @@ -377,7 +364,8 @@ public Mono> fromOneOptionalWithResponseAsync(RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromOneOptionalWithResponse(RequestOptions requestOptions) { - return service.fromOneOptionalSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), - requestOptions, Context.NONE); + final String accept = "application/json"; + return service.fromOneOptionalSync(this.getEndpoint(), this.getServiceDeploymentVersion(), + this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/serialization/encodedname/json/implementation/PropertiesImpl.java b/typespec-tests/src/main/java/com/serialization/encodedname/json/implementation/PropertiesImpl.java index b8c236060f..4813f6bc7b 100644 --- a/typespec-tests/src/main/java/com/serialization/encodedname/json/implementation/PropertiesImpl.java +++ b/typespec-tests/src/main/java/com/serialization/encodedname/json/implementation/PropertiesImpl.java @@ -64,7 +64,7 @@ public interface PropertiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("Content-Type") String contentType, + Mono> send(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData jsonEncodedNameModel, RequestOptions requestOptions, Context context); @@ -74,7 +74,7 @@ Mono> send(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("Content-Type") String contentType, + Response sendSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData jsonEncodedNameModel, RequestOptions requestOptions, Context context); @@ -84,7 +84,7 @@ Response sendSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/serialization/encoded-name/json/property") @@ -93,7 +93,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } @@ -117,9 +117,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData jsonEncodedNameModel, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil - .withContext(context -> service.send(contentType, jsonEncodedNameModel, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.send(accept, jsonEncodedNameModel, requestOptions, context)); } /** @@ -142,8 +141,8 @@ public Mono> sendWithResponseAsync(BinaryData jsonEncodedNameMode */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData jsonEncodedNameModel, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.sendSync(contentType, jsonEncodedNameModel, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.sendSync(accept, jsonEncodedNameModel, requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/server/endpoint/notdefined/implementation/NotDefinedClientImpl.java b/typespec-tests/src/main/java/com/server/endpoint/notdefined/implementation/NotDefinedClientImpl.java index 7cce6d2572..8d282a971e 100644 --- a/typespec-tests/src/main/java/com/server/endpoint/notdefined/implementation/NotDefinedClientImpl.java +++ b/typespec-tests/src/main/java/com/server/endpoint/notdefined/implementation/NotDefinedClientImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Head; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.ReturnType; @@ -39,12 +40,12 @@ public final class NotDefinedClientImpl { private final NotDefinedClientService service; /** - * Service host. + * Server parameter. */ private final String endpoint; /** - * Gets Service host. + * Gets Server parameter. * * @return the endpoint value. */ @@ -83,7 +84,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of NotDefinedClient client. * - * @param endpoint Service host. + * @param endpoint Server parameter. */ public NotDefinedClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -94,7 +95,7 @@ public NotDefinedClientImpl(String endpoint) { * Initializes an instance of NotDefinedClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public NotDefinedClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -105,7 +106,7 @@ public NotDefinedClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Service host. + * @param endpoint Server parameter. */ public NotDefinedClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; @@ -127,8 +128,8 @@ public interface NotDefinedClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> valid(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, - Context context); + Mono> valid(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Head("/server/endpoint/not-defined/valid") @ExpectedResponses({ 200 }) @@ -136,8 +137,8 @@ Mono> valid(@HostParam("endpoint") String endpoint, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response validSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, - Context context); + Response validSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); } /** @@ -152,7 +153,8 @@ Response validSync(@HostParam("endpoint") String endpoint, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> validWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.valid(this.getEndpoint(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.valid(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -167,6 +169,7 @@ public Mono> validWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validWithResponse(RequestOptions requestOptions) { - return service.validSync(this.getEndpoint(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.validSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/server/path/multiple/MultipleClientBuilder.java b/typespec-tests/src/main/java/com/server/path/multiple/MultipleClientBuilder.java index 4ebb6b9d97..1ebc0bd08f 100644 --- a/typespec-tests/src/main/java/com/server/path/multiple/MultipleClientBuilder.java +++ b/typespec-tests/src/main/java/com/server/path/multiple/MultipleClientBuilder.java @@ -189,24 +189,6 @@ public MultipleClientBuilder endpoint(String endpoint) { return this; } - /* - * Pass in v1.0 for API version. - */ - @Generated - private String apiVersion; - - /** - * Sets Pass in v1.0 for API version. - * - * @param apiVersion the apiVersion value. - * @return the MultipleClientBuilder. - */ - @Generated - public MultipleClientBuilder apiVersion(String apiVersion) { - this.apiVersion = apiVersion; - return this; - } - /* * Service version */ @@ -255,7 +237,7 @@ private MultipleClientImpl buildInnerClient() { MultipleServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : MultipleServiceVersion.getLatest(); MultipleClientImpl client = new MultipleClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, this.apiVersion, localServiceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); return client; } @@ -264,7 +246,6 @@ private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); - Objects.requireNonNull(apiVersion, "'apiVersion' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/server/path/multiple/implementation/MultipleClientImpl.java b/typespec-tests/src/main/java/com/server/path/multiple/implementation/MultipleClientImpl.java index ba725b365e..93144cb321 100644 --- a/typespec-tests/src/main/java/com/server/path/multiple/implementation/MultipleClientImpl.java +++ b/typespec-tests/src/main/java/com/server/path/multiple/implementation/MultipleClientImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; @@ -54,20 +55,6 @@ public String getEndpoint() { return this.endpoint; } - /** - * Pass in v1.0 for API version. - */ - private final String apiVersion; - - /** - * Gets Pass in v1.0 for API version. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - /** * Service version. */ @@ -114,12 +101,11 @@ public SerializerAdapter getSerializerAdapter() { * Initializes an instance of MultipleClient client. * * @param endpoint Pass in http://localhost:3000 for endpoint. - * @param apiVersion Pass in v1.0 for API version. * @param serviceVersion Service version. */ - public MultipleClientImpl(String endpoint, String apiVersion, MultipleServiceVersion serviceVersion) { + public MultipleClientImpl(String endpoint, MultipleServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion, serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** @@ -127,12 +113,10 @@ public MultipleClientImpl(String endpoint, String apiVersion, MultipleServiceVer * * @param httpPipeline The HTTP pipeline to send requests through. * @param endpoint Pass in http://localhost:3000 for endpoint. - * @param apiVersion Pass in v1.0 for API version. * @param serviceVersion Service version. */ - public MultipleClientImpl(HttpPipeline httpPipeline, String endpoint, String apiVersion, - MultipleServiceVersion serviceVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion, serviceVersion); + public MultipleClientImpl(HttpPipeline httpPipeline, String endpoint, MultipleServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** @@ -141,15 +125,13 @@ public MultipleClientImpl(HttpPipeline httpPipeline, String endpoint, String api * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param endpoint Pass in http://localhost:3000 for endpoint. - * @param apiVersion Pass in v1.0 for API version. * @param serviceVersion Service version. */ public MultipleClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - String apiVersion, MultipleServiceVersion serviceVersion) { + MultipleServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; - this.apiVersion = apiVersion; this.serviceVersion = serviceVersion; this.service = RestProxy.create(MultipleClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -167,7 +149,8 @@ public interface MultipleClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> noOperationParams(@HostParam("endpoint") String endpoint, - @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/") @ExpectedResponses({ 204 }) @@ -176,7 +159,8 @@ Mono> noOperationParams(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response noOperationParamsSync(@HostParam("endpoint") String endpoint, - @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/{keyword}") @ExpectedResponses({ 204 }) @@ -186,7 +170,7 @@ Response noOperationParamsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withOperationPathParam(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("keyword") String keyword, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/{keyword}") @ExpectedResponses({ 204 }) @@ -196,7 +180,7 @@ Mono> withOperationPathParam(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(HttpResponseException.class) Response withOperationPathParamSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("keyword") String keyword, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -211,8 +195,9 @@ Response withOperationPathParamSync(@HostParam("endpoint") String endpoint */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> noOperationParamsWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.noOperationParams(this.getEndpoint(), this.getApiVersion(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.noOperationParams(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, requestOptions, context)); } /** @@ -227,7 +212,9 @@ public Mono> noOperationParamsWithResponseAsync(RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response noOperationParamsWithResponse(RequestOptions requestOptions) { - return service.noOperationParamsSync(this.getEndpoint(), this.getApiVersion(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.noOperationParamsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + requestOptions, Context.NONE); } /** @@ -243,8 +230,9 @@ public Response noOperationParamsWithResponse(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withOperationPathParamWithResponseAsync(String keyword, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withOperationPathParam(this.getEndpoint(), this.getApiVersion(), - keyword, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withOperationPathParam(this.getEndpoint(), + this.getServiceVersion().getVersion(), keyword, accept, requestOptions, context)); } /** @@ -260,7 +248,8 @@ public Mono> withOperationPathParamWithResponseAsync(String keywo */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withOperationPathParamWithResponse(String keyword, RequestOptions requestOptions) { - return service.withOperationPathParamSync(this.getEndpoint(), this.getApiVersion(), keyword, requestOptions, - Context.NONE); + final String accept = "application/json"; + return service.withOperationPathParamSync(this.getEndpoint(), this.getServiceVersion().getVersion(), keyword, + accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/server/path/single/implementation/SingleClientImpl.java b/typespec-tests/src/main/java/com/server/path/single/implementation/SingleClientImpl.java index 59c6962adc..bfd0a77abe 100644 --- a/typespec-tests/src/main/java/com/server/path/single/implementation/SingleClientImpl.java +++ b/typespec-tests/src/main/java/com/server/path/single/implementation/SingleClientImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Head; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.ReturnType; @@ -126,8 +127,8 @@ public interface SingleClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> myOp(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, - Context context); + Mono> myOp(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Head("/server/path/single/myOp") @ExpectedResponses({ 200 }) @@ -135,7 +136,8 @@ Mono> myOp(@HostParam("endpoint") String endpoint, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response myOpSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); + Response myOpSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); } /** @@ -150,7 +152,8 @@ Mono> myOp(@HostParam("endpoint") String endpoint, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> myOpWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.myOp(this.getEndpoint(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.myOp(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -165,6 +168,7 @@ public Mono> myOpWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response myOpWithResponse(RequestOptions requestOptions) { - return service.myOpSync(this.getEndpoint(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.myOpSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/server/versions/notversioned/implementation/NotVersionedClientImpl.java b/typespec-tests/src/main/java/com/server/versions/notversioned/implementation/NotVersionedClientImpl.java index eff9b16d95..25d41d2449 100644 --- a/typespec-tests/src/main/java/com/server/versions/notversioned/implementation/NotVersionedClientImpl.java +++ b/typespec-tests/src/main/java/com/server/versions/notversioned/implementation/NotVersionedClientImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Head; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; @@ -130,8 +131,8 @@ public interface NotVersionedClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withoutApiVersion(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, - Context context); + Mono> withoutApiVersion(@HostParam("endpoint") String endpoint, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Head("/server/versions/not-versioned/without-api-version") @ExpectedResponses({ 200 }) @@ -139,8 +140,8 @@ Mono> withoutApiVersion(@HostParam("endpoint") String endpoint, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withoutApiVersionSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, - Context context); + Response withoutApiVersionSync(@HostParam("endpoint") String endpoint, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Head("/server/versions/not-versioned/with-query-api-version") @ExpectedResponses({ 200 }) @@ -149,7 +150,8 @@ Response withoutApiVersionSync(@HostParam("endpoint") String endpoint, Req @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withQueryApiVersion(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Head("/server/versions/not-versioned/with-query-api-version") @ExpectedResponses({ 200 }) @@ -158,7 +160,8 @@ Mono> withQueryApiVersion(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response withQueryApiVersionSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Head("/server/versions/not-versioned/with-path-api-version/{apiVersion}") @ExpectedResponses({ 200 }) @@ -167,7 +170,8 @@ Response withQueryApiVersionSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withPathApiVersion(@HostParam("endpoint") String endpoint, - @PathParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); + @PathParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Head("/server/versions/not-versioned/with-path-api-version/{apiVersion}") @ExpectedResponses({ 200 }) @@ -176,7 +180,8 @@ Mono> withPathApiVersion(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response withPathApiVersionSync(@HostParam("endpoint") String endpoint, - @PathParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); + @PathParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); } /** @@ -191,7 +196,9 @@ Response withPathApiVersionSync(@HostParam("endpoint") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withoutApiVersionWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withoutApiVersion(this.getEndpoint(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.withoutApiVersion(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -206,7 +213,8 @@ public Mono> withoutApiVersionWithResponseAsync(RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withoutApiVersionWithResponse(RequestOptions requestOptions) { - return service.withoutApiVersionSync(this.getEndpoint(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withoutApiVersionSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -222,8 +230,9 @@ public Response withoutApiVersionWithResponse(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withQueryApiVersionWithResponseAsync(String apiVersion, RequestOptions requestOptions) { + final String accept = "application/json"; return FluxUtil.withContext( - context -> service.withQueryApiVersion(this.getEndpoint(), apiVersion, requestOptions, context)); + context -> service.withQueryApiVersion(this.getEndpoint(), apiVersion, accept, requestOptions, context)); } /** @@ -239,7 +248,8 @@ public Mono> withQueryApiVersionWithResponseAsync(String apiVersi */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withQueryApiVersionWithResponse(String apiVersion, RequestOptions requestOptions) { - return service.withQueryApiVersionSync(this.getEndpoint(), apiVersion, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withQueryApiVersionSync(this.getEndpoint(), apiVersion, accept, requestOptions, Context.NONE); } /** @@ -255,8 +265,9 @@ public Response withQueryApiVersionWithResponse(String apiVersion, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withPathApiVersionWithResponseAsync(String apiVersion, RequestOptions requestOptions) { + final String accept = "application/json"; return FluxUtil.withContext( - context -> service.withPathApiVersion(this.getEndpoint(), apiVersion, requestOptions, context)); + context -> service.withPathApiVersion(this.getEndpoint(), apiVersion, accept, requestOptions, context)); } /** @@ -272,6 +283,7 @@ public Mono> withPathApiVersionWithResponseAsync(String apiVersio */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withPathApiVersionWithResponse(String apiVersion, RequestOptions requestOptions) { - return service.withPathApiVersionSync(this.getEndpoint(), apiVersion, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withPathApiVersionSync(this.getEndpoint(), apiVersion, accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/server/versions/versioned/implementation/VersionedClientImpl.java b/typespec-tests/src/main/java/com/server/versions/versioned/implementation/VersionedClientImpl.java index 70b6ff082e..fae0a0f208 100644 --- a/typespec-tests/src/main/java/com/server/versions/versioned/implementation/VersionedClientImpl.java +++ b/typespec-tests/src/main/java/com/server/versions/versioned/implementation/VersionedClientImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Head; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; @@ -149,8 +150,8 @@ public interface VersionedClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withoutApiVersion(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, - Context context); + Mono> withoutApiVersion(@HostParam("endpoint") String endpoint, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Head("/server/versions/versioned/without-api-version") @ExpectedResponses({ 200 }) @@ -158,8 +159,8 @@ Mono> withoutApiVersion(@HostParam("endpoint") String endpoint, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withoutApiVersionSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, - Context context); + Response withoutApiVersionSync(@HostParam("endpoint") String endpoint, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Head("/server/versions/versioned/with-query-api-version") @ExpectedResponses({ 200 }) @@ -168,7 +169,8 @@ Response withoutApiVersionSync(@HostParam("endpoint") String endpoint, Req @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withQueryApiVersion(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Head("/server/versions/versioned/with-query-api-version") @ExpectedResponses({ 200 }) @@ -177,7 +179,8 @@ Mono> withQueryApiVersion(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response withQueryApiVersionSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Head("/server/versions/versioned/with-path-api-version/{apiVersion}") @ExpectedResponses({ 200 }) @@ -186,7 +189,8 @@ Response withQueryApiVersionSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withPathApiVersion(@HostParam("endpoint") String endpoint, - @PathParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); + @PathParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Head("/server/versions/versioned/with-path-api-version/{apiVersion}") @ExpectedResponses({ 200 }) @@ -195,7 +199,8 @@ Mono> withPathApiVersion(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response withPathApiVersionSync(@HostParam("endpoint") String endpoint, - @PathParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); + @PathParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Head("/server/versions/versioned/with-query-old-api-version") @ExpectedResponses({ 200 }) @@ -204,7 +209,8 @@ Response withPathApiVersionSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withQueryOldApiVersion(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Head("/server/versions/versioned/with-query-old-api-version") @ExpectedResponses({ 200 }) @@ -213,7 +219,8 @@ Mono> withQueryOldApiVersion(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response withQueryOldApiVersionSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); } /** @@ -228,7 +235,9 @@ Response withQueryOldApiVersionSync(@HostParam("endpoint") String endpoint */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withoutApiVersionWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withoutApiVersion(this.getEndpoint(), requestOptions, context)); + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.withoutApiVersion(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -243,7 +252,8 @@ public Mono> withoutApiVersionWithResponseAsync(RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withoutApiVersionWithResponse(RequestOptions requestOptions) { - return service.withoutApiVersionSync(this.getEndpoint(), requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withoutApiVersionSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -258,8 +268,9 @@ public Response withoutApiVersionWithResponse(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withQueryApiVersionWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; return FluxUtil.withContext(context -> service.withQueryApiVersion(this.getEndpoint(), - this.getServiceVersion().getVersion(), requestOptions, context)); + this.getServiceVersion().getVersion(), accept, requestOptions, context)); } /** @@ -274,7 +285,8 @@ public Mono> withQueryApiVersionWithResponseAsync(RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withQueryApiVersionWithResponse(RequestOptions requestOptions) { - return service.withQueryApiVersionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + final String accept = "application/json"; + return service.withQueryApiVersionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); } @@ -290,8 +302,9 @@ public Response withQueryApiVersionWithResponse(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withPathApiVersionWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; return FluxUtil.withContext(context -> service.withPathApiVersion(this.getEndpoint(), - this.getServiceVersion().getVersion(), requestOptions, context)); + this.getServiceVersion().getVersion(), accept, requestOptions, context)); } /** @@ -306,8 +319,9 @@ public Mono> withPathApiVersionWithResponseAsync(RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withPathApiVersionWithResponse(RequestOptions requestOptions) { - return service.withPathApiVersionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), requestOptions, - Context.NONE); + final String accept = "application/json"; + return service.withPathApiVersionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + requestOptions, Context.NONE); } /** @@ -322,8 +336,9 @@ public Response withPathApiVersionWithResponse(RequestOptions requestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withQueryOldApiVersionWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; return FluxUtil.withContext(context -> service.withQueryOldApiVersion(this.getEndpoint(), - this.getServiceVersion().getVersion(), requestOptions, context)); + this.getServiceVersion().getVersion(), accept, requestOptions, context)); } /** @@ -338,7 +353,8 @@ public Mono> withQueryOldApiVersionWithResponseAsync(RequestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withQueryOldApiVersionWithResponse(RequestOptions requestOptions) { - return service.withQueryOldApiVersionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + final String accept = "application/json"; + return service.withQueryOldApiVersionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/specialheaders/conditionalrequest/implementation/ConditionalRequestClientImpl.java b/typespec-tests/src/main/java/com/specialheaders/conditionalrequest/implementation/ConditionalRequestClientImpl.java index df7fa365a0..b5b4d489a0 100644 --- a/typespec-tests/src/main/java/com/specialheaders/conditionalrequest/implementation/ConditionalRequestClientImpl.java +++ b/typespec-tests/src/main/java/com/specialheaders/conditionalrequest/implementation/ConditionalRequestClientImpl.java @@ -5,6 +5,7 @@ package com.specialheaders.conditionalrequest.implementation; import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; @@ -108,7 +109,8 @@ public interface ConditionalRequestClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> postIfMatch(RequestOptions requestOptions, Context context); + Mono> postIfMatch(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Post("/special-headers/conditional-request/if-match") @ExpectedResponses({ 204 }) @@ -116,7 +118,8 @@ public interface ConditionalRequestClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postIfMatchSync(RequestOptions requestOptions, Context context); + Response postIfMatchSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Post("/special-headers/conditional-request/if-none-match") @ExpectedResponses({ 204 }) @@ -124,7 +127,8 @@ public interface ConditionalRequestClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> postIfNoneMatch(RequestOptions requestOptions, Context context); + Mono> postIfNoneMatch(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Post("/special-headers/conditional-request/if-none-match") @ExpectedResponses({ 204 }) @@ -132,7 +136,8 @@ public interface ConditionalRequestClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postIfNoneMatchSync(RequestOptions requestOptions, Context context); + Response postIfNoneMatchSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); } /** @@ -155,7 +160,8 @@ public interface ConditionalRequestClientService { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postIfMatchWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.postIfMatch(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.postIfMatch(accept, requestOptions, context)); } /** @@ -178,7 +184,8 @@ public Mono> postIfMatchWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postIfMatchWithResponse(RequestOptions requestOptions) { - return service.postIfMatchSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.postIfMatchSync(accept, requestOptions, Context.NONE); } /** @@ -201,7 +208,8 @@ public Response postIfMatchWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postIfNoneMatchWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.postIfNoneMatch(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.postIfNoneMatch(accept, requestOptions, context)); } /** @@ -224,6 +232,7 @@ public Mono> postIfNoneMatchWithResponseAsync(RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postIfNoneMatchWithResponse(RequestOptions requestOptions) { - return service.postIfNoneMatchSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.postIfNoneMatchSync(accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/specialheaders/repeatability/implementation/RepeatabilityClientImpl.java b/typespec-tests/src/main/java/com/specialheaders/repeatability/implementation/RepeatabilityClientImpl.java index 26eaa57164..e36897f8be 100644 --- a/typespec-tests/src/main/java/com/specialheaders/repeatability/implementation/RepeatabilityClientImpl.java +++ b/typespec-tests/src/main/java/com/specialheaders/repeatability/implementation/RepeatabilityClientImpl.java @@ -5,6 +5,7 @@ package com.specialheaders.repeatability.implementation; import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; @@ -112,7 +113,8 @@ public interface RepeatabilityClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> immediateSuccess(RequestOptions requestOptions, Context context); + Mono> immediateSuccess(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Post("/special-headers/repeatability/immediateSuccess") @ExpectedResponses({ 204 }) @@ -120,7 +122,8 @@ public interface RepeatabilityClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response immediateSuccessSync(RequestOptions requestOptions, Context context); + Response immediateSuccessSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); } /** @@ -144,6 +147,7 @@ public interface RepeatabilityClientService { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> immediateSuccessWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; String repeatabilityRequestId = CoreUtils.randomUuid().toString(); String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); @@ -159,7 +163,7 @@ public Mono> immediateSuccessWithResponseAsync(RequestOptions req .set(HttpHeaderName.fromString("repeatability-first-sent"), repeatabilityFirstSent); } }); - return FluxUtil.withContext(context -> service.immediateSuccess(requestOptionsLocal, context)); + return FluxUtil.withContext(context -> service.immediateSuccess(accept, requestOptionsLocal, context)); } /** @@ -183,6 +187,7 @@ public Mono> immediateSuccessWithResponseAsync(RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Response immediateSuccessWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; String repeatabilityRequestId = CoreUtils.randomUuid().toString(); String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); @@ -198,6 +203,6 @@ public Response immediateSuccessWithResponse(RequestOptions requestOptions .set(HttpHeaderName.fromString("repeatability-first-sent"), repeatabilityFirstSent); } }); - return service.immediateSuccessSync(requestOptionsLocal, Context.NONE); + return service.immediateSuccessSync(accept, requestOptionsLocal, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/specialwords/implementation/ModelPropertiesImpl.java b/typespec-tests/src/main/java/com/specialwords/implementation/ModelPropertiesImpl.java index 5cafb1140f..db9360cc23 100644 --- a/typespec-tests/src/main/java/com/specialwords/implementation/ModelPropertiesImpl.java +++ b/typespec-tests/src/main/java/com/specialwords/implementation/ModelPropertiesImpl.java @@ -63,7 +63,7 @@ public interface ModelPropertiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> sameAsModel(@HeaderParam("Content-Type") String contentType, + Mono> sameAsModel(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/model-properties/same-as-model") @@ -72,7 +72,7 @@ Mono> sameAsModel(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sameAsModelSync(@HeaderParam("Content-Type") String contentType, + Response sameAsModelSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -96,8 +96,8 @@ Response sameAsModelSync(@HeaderParam("Content-Type") String contentType, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sameAsModelWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.sameAsModel(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.sameAsModel(accept, body, requestOptions, context)); } /** @@ -120,7 +120,7 @@ public Mono> sameAsModelWithResponseAsync(BinaryData body, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sameAsModelWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.sameAsModelSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.sameAsModelSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/specialwords/implementation/ModelsImpl.java b/typespec-tests/src/main/java/com/specialwords/implementation/ModelsImpl.java index 87d74f2309..d4b6404abf 100644 --- a/typespec-tests/src/main/java/com/specialwords/implementation/ModelsImpl.java +++ b/typespec-tests/src/main/java/com/specialwords/implementation/ModelsImpl.java @@ -62,7 +62,7 @@ public interface ModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAnd(@HeaderParam("Content-Type") String contentType, + Mono> withAnd(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/and") @@ -71,8 +71,8 @@ Mono> withAnd(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAndSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withAndSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/as") @ExpectedResponses({ 204 }) @@ -80,7 +80,7 @@ Response withAndSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAs(@HeaderParam("Content-Type") String contentType, + Mono> withAs(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/as") @@ -89,8 +89,8 @@ Mono> withAs(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAsSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withAsSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/assert") @ExpectedResponses({ 204 }) @@ -98,7 +98,7 @@ Response withAsSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAssert(@HeaderParam("Content-Type") String contentType, + Mono> withAssert(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/assert") @@ -107,7 +107,7 @@ Mono> withAssert(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAssertSync(@HeaderParam("Content-Type") String contentType, + Response withAssertSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/async") @@ -116,7 +116,7 @@ Response withAssertSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAsync(@HeaderParam("Content-Type") String contentType, + Mono> withAsync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/async") @@ -125,7 +125,7 @@ Mono> withAsync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAsyncSync(@HeaderParam("Content-Type") String contentType, + Response withAsyncSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/await") @@ -134,7 +134,7 @@ Response withAsyncSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAwait(@HeaderParam("Content-Type") String contentType, + Mono> withAwait(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/await") @@ -143,7 +143,7 @@ Mono> withAwait(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAwaitSync(@HeaderParam("Content-Type") String contentType, + Response withAwaitSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/break") @@ -152,7 +152,7 @@ Response withAwaitSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withBreak(@HeaderParam("Content-Type") String contentType, + Mono> withBreak(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/break") @@ -161,7 +161,7 @@ Mono> withBreak(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withBreakSync(@HeaderParam("Content-Type") String contentType, + Response withBreakSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/class") @@ -170,7 +170,7 @@ Response withBreakSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withClass(@HeaderParam("Content-Type") String contentType, + Mono> withClass(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/class") @@ -179,7 +179,7 @@ Mono> withClass(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withClassSync(@HeaderParam("Content-Type") String contentType, + Response withClassSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/constructor") @@ -188,7 +188,7 @@ Response withClassSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withConstructor(@HeaderParam("Content-Type") String contentType, + Mono> withConstructor(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/constructor") @@ -197,7 +197,7 @@ Mono> withConstructor(@HeaderParam("Content-Type") String content @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withConstructorSync(@HeaderParam("Content-Type") String contentType, + Response withConstructorSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/continue") @@ -206,7 +206,7 @@ Response withConstructorSync(@HeaderParam("Content-Type") String contentTy @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withContinue(@HeaderParam("Content-Type") String contentType, + Mono> withContinue(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/continue") @@ -215,7 +215,7 @@ Mono> withContinue(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withContinueSync(@HeaderParam("Content-Type") String contentType, + Response withContinueSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/def") @@ -224,7 +224,7 @@ Response withContinueSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withDef(@HeaderParam("Content-Type") String contentType, + Mono> withDef(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/def") @@ -233,8 +233,8 @@ Mono> withDef(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withDefSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withDefSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/del") @ExpectedResponses({ 204 }) @@ -242,7 +242,7 @@ Response withDefSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withDel(@HeaderParam("Content-Type") String contentType, + Mono> withDel(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/del") @@ -251,8 +251,8 @@ Mono> withDel(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withDelSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withDelSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/elif") @ExpectedResponses({ 204 }) @@ -260,7 +260,7 @@ Response withDelSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withElif(@HeaderParam("Content-Type") String contentType, + Mono> withElif(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/elif") @@ -269,7 +269,7 @@ Mono> withElif(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withElifSync(@HeaderParam("Content-Type") String contentType, + Response withElifSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/else") @@ -278,7 +278,7 @@ Response withElifSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withElse(@HeaderParam("Content-Type") String contentType, + Mono> withElse(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/else") @@ -287,7 +287,7 @@ Mono> withElse(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withElseSync(@HeaderParam("Content-Type") String contentType, + Response withElseSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/except") @@ -296,7 +296,7 @@ Response withElseSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withExcept(@HeaderParam("Content-Type") String contentType, + Mono> withExcept(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/except") @@ -305,7 +305,7 @@ Mono> withExcept(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withExceptSync(@HeaderParam("Content-Type") String contentType, + Response withExceptSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/exec") @@ -314,7 +314,7 @@ Response withExceptSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withExec(@HeaderParam("Content-Type") String contentType, + Mono> withExec(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/exec") @@ -323,7 +323,7 @@ Mono> withExec(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withExecSync(@HeaderParam("Content-Type") String contentType, + Response withExecSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/finally") @@ -332,7 +332,7 @@ Response withExecSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withFinally(@HeaderParam("Content-Type") String contentType, + Mono> withFinally(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/finally") @@ -341,7 +341,7 @@ Mono> withFinally(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withFinallySync(@HeaderParam("Content-Type") String contentType, + Response withFinallySync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/for") @@ -350,7 +350,7 @@ Response withFinallySync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withFor(@HeaderParam("Content-Type") String contentType, + Mono> withFor(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/for") @@ -359,8 +359,8 @@ Mono> withFor(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withForSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withForSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/from") @ExpectedResponses({ 204 }) @@ -368,7 +368,7 @@ Response withForSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withFrom(@HeaderParam("Content-Type") String contentType, + Mono> withFrom(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/from") @@ -377,7 +377,7 @@ Mono> withFrom(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withFromSync(@HeaderParam("Content-Type") String contentType, + Response withFromSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/global") @@ -386,7 +386,7 @@ Response withFromSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withGlobal(@HeaderParam("Content-Type") String contentType, + Mono> withGlobal(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/global") @@ -395,7 +395,7 @@ Mono> withGlobal(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withGlobalSync(@HeaderParam("Content-Type") String contentType, + Response withGlobalSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/if") @@ -404,7 +404,7 @@ Response withGlobalSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withIf(@HeaderParam("Content-Type") String contentType, + Mono> withIf(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/if") @@ -413,8 +413,8 @@ Mono> withIf(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withIfSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withIfSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/import") @ExpectedResponses({ 204 }) @@ -422,7 +422,7 @@ Response withIfSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withImport(@HeaderParam("Content-Type") String contentType, + Mono> withImport(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/import") @@ -431,7 +431,7 @@ Mono> withImport(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withImportSync(@HeaderParam("Content-Type") String contentType, + Response withImportSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/in") @@ -440,7 +440,7 @@ Response withImportSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withIn(@HeaderParam("Content-Type") String contentType, + Mono> withIn(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/in") @@ -449,8 +449,8 @@ Mono> withIn(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withInSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withInSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/is") @ExpectedResponses({ 204 }) @@ -458,7 +458,7 @@ Response withInSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withIs(@HeaderParam("Content-Type") String contentType, + Mono> withIs(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/is") @@ -467,8 +467,8 @@ Mono> withIs(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withIsSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withIsSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/lambda") @ExpectedResponses({ 204 }) @@ -476,7 +476,7 @@ Response withIsSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withLambda(@HeaderParam("Content-Type") String contentType, + Mono> withLambda(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/lambda") @@ -485,7 +485,7 @@ Mono> withLambda(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withLambdaSync(@HeaderParam("Content-Type") String contentType, + Response withLambdaSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/not") @@ -494,7 +494,7 @@ Response withLambdaSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withNot(@HeaderParam("Content-Type") String contentType, + Mono> withNot(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/not") @@ -503,8 +503,8 @@ Mono> withNot(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withNotSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withNotSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/or") @ExpectedResponses({ 204 }) @@ -512,7 +512,7 @@ Response withNotSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withOr(@HeaderParam("Content-Type") String contentType, + Mono> withOr(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/or") @@ -521,8 +521,8 @@ Mono> withOr(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withOrSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withOrSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/pass") @ExpectedResponses({ 204 }) @@ -530,7 +530,7 @@ Response withOrSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withPass(@HeaderParam("Content-Type") String contentType, + Mono> withPass(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/pass") @@ -539,7 +539,7 @@ Mono> withPass(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withPassSync(@HeaderParam("Content-Type") String contentType, + Response withPassSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/raise") @@ -548,7 +548,7 @@ Response withPassSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withRaise(@HeaderParam("Content-Type") String contentType, + Mono> withRaise(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/raise") @@ -557,7 +557,7 @@ Mono> withRaise(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withRaiseSync(@HeaderParam("Content-Type") String contentType, + Response withRaiseSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/return") @@ -566,7 +566,7 @@ Response withRaiseSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withReturn(@HeaderParam("Content-Type") String contentType, + Mono> withReturn(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/return") @@ -575,7 +575,7 @@ Mono> withReturn(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withReturnSync(@HeaderParam("Content-Type") String contentType, + Response withReturnSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/try") @@ -584,7 +584,7 @@ Response withReturnSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withTry(@HeaderParam("Content-Type") String contentType, + Mono> withTry(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/try") @@ -593,8 +593,8 @@ Mono> withTry(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withTrySync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withTrySync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/while") @ExpectedResponses({ 204 }) @@ -602,7 +602,7 @@ Response withTrySync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withWhile(@HeaderParam("Content-Type") String contentType, + Mono> withWhile(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/while") @@ -611,7 +611,7 @@ Mono> withWhile(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withWhileSync(@HeaderParam("Content-Type") String contentType, + Response withWhileSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/with") @@ -620,7 +620,7 @@ Response withWhileSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withWith(@HeaderParam("Content-Type") String contentType, + Mono> withWith(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/with") @@ -629,7 +629,7 @@ Mono> withWith(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withWithSync(@HeaderParam("Content-Type") String contentType, + Response withWithSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/yield") @@ -638,7 +638,7 @@ Response withWithSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withYield(@HeaderParam("Content-Type") String contentType, + Mono> withYield(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/yield") @@ -647,7 +647,7 @@ Mono> withYield(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withYieldSync(@HeaderParam("Content-Type") String contentType, + Response withYieldSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -671,8 +671,8 @@ Response withYieldSync(@HeaderParam("Content-Type") String contentType, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAndWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withAnd(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withAnd(accept, body, requestOptions, context)); } /** @@ -695,8 +695,8 @@ public Mono> withAndWithResponseAsync(BinaryData body, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAndWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withAndSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withAndSync(accept, body, requestOptions, Context.NONE); } /** @@ -719,8 +719,8 @@ public Response withAndWithResponse(BinaryData body, RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withAs(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withAs(accept, body, requestOptions, context)); } /** @@ -743,8 +743,8 @@ public Mono> withAsWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAsWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withAsSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withAsSync(accept, body, requestOptions, Context.NONE); } /** @@ -767,8 +767,8 @@ public Response withAsWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAssertWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withAssert(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withAssert(accept, body, requestOptions, context)); } /** @@ -791,8 +791,8 @@ public Mono> withAssertWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAssertWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withAssertSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withAssertSync(accept, body, requestOptions, Context.NONE); } /** @@ -815,8 +815,8 @@ public Response withAssertWithResponse(BinaryData body, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAsyncWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withAsync(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withAsync(accept, body, requestOptions, context)); } /** @@ -839,8 +839,8 @@ public Mono> withAsyncWithResponseAsync(BinaryData body, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAsyncWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withAsyncSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withAsyncSync(accept, body, requestOptions, Context.NONE); } /** @@ -863,8 +863,8 @@ public Response withAsyncWithResponse(BinaryData body, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAwaitWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withAwait(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withAwait(accept, body, requestOptions, context)); } /** @@ -887,8 +887,8 @@ public Mono> withAwaitWithResponseAsync(BinaryData body, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAwaitWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withAwaitSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withAwaitSync(accept, body, requestOptions, Context.NONE); } /** @@ -911,8 +911,8 @@ public Response withAwaitWithResponse(BinaryData body, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withBreakWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withBreak(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withBreak(accept, body, requestOptions, context)); } /** @@ -935,8 +935,8 @@ public Mono> withBreakWithResponseAsync(BinaryData body, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withBreakWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withBreakSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withBreakSync(accept, body, requestOptions, Context.NONE); } /** @@ -959,8 +959,8 @@ public Response withBreakWithResponse(BinaryData body, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withClassWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withClass(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withClass(accept, body, requestOptions, context)); } /** @@ -983,8 +983,8 @@ public Mono> withClassWithResponseAsync(BinaryData body, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withClassWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withClassSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withClassSync(accept, body, requestOptions, Context.NONE); } /** @@ -1007,8 +1007,8 @@ public Response withClassWithResponse(BinaryData body, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withConstructorWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withConstructor(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withConstructor(accept, body, requestOptions, context)); } /** @@ -1031,8 +1031,8 @@ public Mono> withConstructorWithResponseAsync(BinaryData body, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withConstructorWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withConstructorSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withConstructorSync(accept, body, requestOptions, Context.NONE); } /** @@ -1055,8 +1055,8 @@ public Response withConstructorWithResponse(BinaryData body, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withContinueWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withContinue(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withContinue(accept, body, requestOptions, context)); } /** @@ -1079,8 +1079,8 @@ public Mono> withContinueWithResponseAsync(BinaryData body, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withContinueWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withContinueSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withContinueSync(accept, body, requestOptions, Context.NONE); } /** @@ -1103,8 +1103,8 @@ public Response withContinueWithResponse(BinaryData body, RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withDefWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withDef(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withDef(accept, body, requestOptions, context)); } /** @@ -1127,8 +1127,8 @@ public Mono> withDefWithResponseAsync(BinaryData body, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withDefWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withDefSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withDefSync(accept, body, requestOptions, Context.NONE); } /** @@ -1151,8 +1151,8 @@ public Response withDefWithResponse(BinaryData body, RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withDelWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withDel(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withDel(accept, body, requestOptions, context)); } /** @@ -1175,8 +1175,8 @@ public Mono> withDelWithResponseAsync(BinaryData body, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withDelWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withDelSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withDelSync(accept, body, requestOptions, Context.NONE); } /** @@ -1199,8 +1199,8 @@ public Response withDelWithResponse(BinaryData body, RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withElifWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withElif(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withElif(accept, body, requestOptions, context)); } /** @@ -1223,8 +1223,8 @@ public Mono> withElifWithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withElifWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withElifSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withElifSync(accept, body, requestOptions, Context.NONE); } /** @@ -1247,8 +1247,8 @@ public Response withElifWithResponse(BinaryData body, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withElseWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withElse(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withElse(accept, body, requestOptions, context)); } /** @@ -1271,8 +1271,8 @@ public Mono> withElseWithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withElseWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withElseSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withElseSync(accept, body, requestOptions, Context.NONE); } /** @@ -1295,8 +1295,8 @@ public Response withElseWithResponse(BinaryData body, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withExceptWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withExcept(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withExcept(accept, body, requestOptions, context)); } /** @@ -1319,8 +1319,8 @@ public Mono> withExceptWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withExceptWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withExceptSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withExceptSync(accept, body, requestOptions, Context.NONE); } /** @@ -1343,8 +1343,8 @@ public Response withExceptWithResponse(BinaryData body, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withExecWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withExec(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withExec(accept, body, requestOptions, context)); } /** @@ -1367,8 +1367,8 @@ public Mono> withExecWithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withExecWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withExecSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withExecSync(accept, body, requestOptions, Context.NONE); } /** @@ -1391,8 +1391,8 @@ public Response withExecWithResponse(BinaryData body, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withFinallyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withFinally(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withFinally(accept, body, requestOptions, context)); } /** @@ -1415,8 +1415,8 @@ public Mono> withFinallyWithResponseAsync(BinaryData body, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withFinallyWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withFinallySync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withFinallySync(accept, body, requestOptions, Context.NONE); } /** @@ -1439,8 +1439,8 @@ public Response withFinallyWithResponse(BinaryData body, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withForWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withFor(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withFor(accept, body, requestOptions, context)); } /** @@ -1463,8 +1463,8 @@ public Mono> withForWithResponseAsync(BinaryData body, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withForWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withForSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withForSync(accept, body, requestOptions, Context.NONE); } /** @@ -1487,8 +1487,8 @@ public Response withForWithResponse(BinaryData body, RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withFromWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withFrom(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withFrom(accept, body, requestOptions, context)); } /** @@ -1511,8 +1511,8 @@ public Mono> withFromWithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withFromWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withFromSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withFromSync(accept, body, requestOptions, Context.NONE); } /** @@ -1535,8 +1535,8 @@ public Response withFromWithResponse(BinaryData body, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withGlobalWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withGlobal(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withGlobal(accept, body, requestOptions, context)); } /** @@ -1559,8 +1559,8 @@ public Mono> withGlobalWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withGlobalWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withGlobalSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withGlobalSync(accept, body, requestOptions, Context.NONE); } /** @@ -1583,8 +1583,8 @@ public Response withGlobalWithResponse(BinaryData body, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withIfWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withIf(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withIf(accept, body, requestOptions, context)); } /** @@ -1607,8 +1607,8 @@ public Mono> withIfWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withIfWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withIfSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withIfSync(accept, body, requestOptions, Context.NONE); } /** @@ -1631,8 +1631,8 @@ public Response withIfWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withImportWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withImport(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withImport(accept, body, requestOptions, context)); } /** @@ -1655,8 +1655,8 @@ public Mono> withImportWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withImportWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withImportSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withImportSync(accept, body, requestOptions, Context.NONE); } /** @@ -1679,8 +1679,8 @@ public Response withImportWithResponse(BinaryData body, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withInWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withIn(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withIn(accept, body, requestOptions, context)); } /** @@ -1703,8 +1703,8 @@ public Mono> withInWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withInWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withInSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withInSync(accept, body, requestOptions, Context.NONE); } /** @@ -1727,8 +1727,8 @@ public Response withInWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withIsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withIs(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withIs(accept, body, requestOptions, context)); } /** @@ -1751,8 +1751,8 @@ public Mono> withIsWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withIsWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withIsSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withIsSync(accept, body, requestOptions, Context.NONE); } /** @@ -1775,8 +1775,8 @@ public Response withIsWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withLambdaWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withLambda(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withLambda(accept, body, requestOptions, context)); } /** @@ -1799,8 +1799,8 @@ public Mono> withLambdaWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withLambdaWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withLambdaSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withLambdaSync(accept, body, requestOptions, Context.NONE); } /** @@ -1823,8 +1823,8 @@ public Response withLambdaWithResponse(BinaryData body, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withNotWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withNot(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withNot(accept, body, requestOptions, context)); } /** @@ -1847,8 +1847,8 @@ public Mono> withNotWithResponseAsync(BinaryData body, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withNotWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withNotSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withNotSync(accept, body, requestOptions, Context.NONE); } /** @@ -1871,8 +1871,8 @@ public Response withNotWithResponse(BinaryData body, RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withOrWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withOr(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withOr(accept, body, requestOptions, context)); } /** @@ -1895,8 +1895,8 @@ public Mono> withOrWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withOrWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withOrSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withOrSync(accept, body, requestOptions, Context.NONE); } /** @@ -1919,8 +1919,8 @@ public Response withOrWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withPassWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withPass(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withPass(accept, body, requestOptions, context)); } /** @@ -1943,8 +1943,8 @@ public Mono> withPassWithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withPassWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withPassSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withPassSync(accept, body, requestOptions, Context.NONE); } /** @@ -1967,8 +1967,8 @@ public Response withPassWithResponse(BinaryData body, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withRaiseWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withRaise(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withRaise(accept, body, requestOptions, context)); } /** @@ -1991,8 +1991,8 @@ public Mono> withRaiseWithResponseAsync(BinaryData body, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withRaiseWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withRaiseSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withRaiseSync(accept, body, requestOptions, Context.NONE); } /** @@ -2015,8 +2015,8 @@ public Response withRaiseWithResponse(BinaryData body, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withReturnWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withReturn(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withReturn(accept, body, requestOptions, context)); } /** @@ -2039,8 +2039,8 @@ public Mono> withReturnWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withReturnWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withReturnSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withReturnSync(accept, body, requestOptions, Context.NONE); } /** @@ -2063,8 +2063,8 @@ public Response withReturnWithResponse(BinaryData body, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withTryWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withTry(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withTry(accept, body, requestOptions, context)); } /** @@ -2087,8 +2087,8 @@ public Mono> withTryWithResponseAsync(BinaryData body, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withTryWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withTrySync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withTrySync(accept, body, requestOptions, Context.NONE); } /** @@ -2111,8 +2111,8 @@ public Response withTryWithResponse(BinaryData body, RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withWhileWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withWhile(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withWhile(accept, body, requestOptions, context)); } /** @@ -2135,8 +2135,8 @@ public Mono> withWhileWithResponseAsync(BinaryData body, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withWhileWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withWhileSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withWhileSync(accept, body, requestOptions, Context.NONE); } /** @@ -2159,8 +2159,8 @@ public Response withWhileWithResponse(BinaryData body, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withWithWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withWith(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withWith(accept, body, requestOptions, context)); } /** @@ -2183,8 +2183,8 @@ public Mono> withWithWithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withWithWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withWithSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withWithSync(accept, body, requestOptions, Context.NONE); } /** @@ -2207,8 +2207,8 @@ public Response withWithWithResponse(BinaryData body, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withYieldWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withYield(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withYield(accept, body, requestOptions, context)); } /** @@ -2231,7 +2231,7 @@ public Mono> withYieldWithResponseAsync(BinaryData body, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withYieldWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withYieldSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withYieldSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/specialwords/implementation/OperationsImpl.java b/typespec-tests/src/main/java/com/specialwords/implementation/OperationsImpl.java index 56816afd4d..cbd4595300 100644 --- a/typespec-tests/src/main/java/com/specialwords/implementation/OperationsImpl.java +++ b/typespec-tests/src/main/java/com/specialwords/implementation/OperationsImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -60,7 +61,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> and(RequestOptions requestOptions, Context context); + Mono> and(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/and") @ExpectedResponses({ 204 }) @@ -68,7 +69,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response andSync(RequestOptions requestOptions, Context context); + Response andSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/as") @ExpectedResponses({ 204 }) @@ -76,7 +77,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> as(RequestOptions requestOptions, Context context); + Mono> as(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/as") @ExpectedResponses({ 204 }) @@ -84,7 +85,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response asSync(RequestOptions requestOptions, Context context); + Response asSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/assert") @ExpectedResponses({ 204 }) @@ -92,7 +93,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> assertMethod(RequestOptions requestOptions, Context context); + Mono> assertMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/assert") @ExpectedResponses({ 204 }) @@ -100,7 +102,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response assertMethodSync(RequestOptions requestOptions, Context context); + Response assertMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/async") @ExpectedResponses({ 204 }) @@ -108,7 +111,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> async(RequestOptions requestOptions, Context context); + Mono> async(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/async") @ExpectedResponses({ 204 }) @@ -116,7 +120,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response asyncSync(RequestOptions requestOptions, Context context); + Response asyncSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/await") @ExpectedResponses({ 204 }) @@ -124,7 +128,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> await(RequestOptions requestOptions, Context context); + Mono> await(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/await") @ExpectedResponses({ 204 }) @@ -132,7 +137,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response awaitSync(RequestOptions requestOptions, Context context); + Response awaitSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/break") @ExpectedResponses({ 204 }) @@ -140,7 +145,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> breakMethod(RequestOptions requestOptions, Context context); + Mono> breakMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/break") @ExpectedResponses({ 204 }) @@ -148,7 +154,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response breakMethodSync(RequestOptions requestOptions, Context context); + Response breakMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/class") @ExpectedResponses({ 204 }) @@ -156,7 +163,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> classMethod(RequestOptions requestOptions, Context context); + Mono> classMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/class") @ExpectedResponses({ 204 }) @@ -164,7 +172,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response classMethodSync(RequestOptions requestOptions, Context context); + Response classMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/constructor") @ExpectedResponses({ 204 }) @@ -172,7 +181,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> constructor(RequestOptions requestOptions, Context context); + Mono> constructor(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/constructor") @ExpectedResponses({ 204 }) @@ -180,7 +190,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response constructorSync(RequestOptions requestOptions, Context context); + Response constructorSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/continue") @ExpectedResponses({ 204 }) @@ -188,7 +199,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> continueMethod(RequestOptions requestOptions, Context context); + Mono> continueMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/continue") @ExpectedResponses({ 204 }) @@ -196,7 +208,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response continueMethodSync(RequestOptions requestOptions, Context context); + Response continueMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/def") @ExpectedResponses({ 204 }) @@ -204,7 +217,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> def(RequestOptions requestOptions, Context context); + Mono> def(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/def") @ExpectedResponses({ 204 }) @@ -212,7 +225,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defSync(RequestOptions requestOptions, Context context); + Response defSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/del") @ExpectedResponses({ 204 }) @@ -220,7 +233,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> del(RequestOptions requestOptions, Context context); + Mono> del(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/del") @ExpectedResponses({ 204 }) @@ -228,7 +241,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response delSync(RequestOptions requestOptions, Context context); + Response delSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/elif") @ExpectedResponses({ 204 }) @@ -236,7 +249,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> elif(RequestOptions requestOptions, Context context); + Mono> elif(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/elif") @ExpectedResponses({ 204 }) @@ -244,7 +257,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response elifSync(RequestOptions requestOptions, Context context); + Response elifSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/else") @ExpectedResponses({ 204 }) @@ -252,7 +265,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> elseMethod(RequestOptions requestOptions, Context context); + Mono> elseMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/else") @ExpectedResponses({ 204 }) @@ -260,7 +274,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response elseMethodSync(RequestOptions requestOptions, Context context); + Response elseMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/except") @ExpectedResponses({ 204 }) @@ -268,7 +283,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> except(RequestOptions requestOptions, Context context); + Mono> except(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/except") @ExpectedResponses({ 204 }) @@ -276,7 +292,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response exceptSync(RequestOptions requestOptions, Context context); + Response exceptSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/exec") @ExpectedResponses({ 204 }) @@ -284,7 +300,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> exec(RequestOptions requestOptions, Context context); + Mono> exec(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/exec") @ExpectedResponses({ 204 }) @@ -292,7 +308,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response execSync(RequestOptions requestOptions, Context context); + Response execSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/finally") @ExpectedResponses({ 204 }) @@ -300,7 +316,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> finallyMethod(RequestOptions requestOptions, Context context); + Mono> finallyMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/finally") @ExpectedResponses({ 204 }) @@ -308,7 +325,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response finallyMethodSync(RequestOptions requestOptions, Context context); + Response finallyMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/for") @ExpectedResponses({ 204 }) @@ -316,7 +334,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> forMethod(RequestOptions requestOptions, Context context); + Mono> forMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/for") @ExpectedResponses({ 204 }) @@ -324,7 +343,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response forMethodSync(RequestOptions requestOptions, Context context); + Response forMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/from") @ExpectedResponses({ 204 }) @@ -332,7 +352,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> from(RequestOptions requestOptions, Context context); + Mono> from(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/from") @ExpectedResponses({ 204 }) @@ -340,7 +360,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response fromSync(RequestOptions requestOptions, Context context); + Response fromSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/global") @ExpectedResponses({ 204 }) @@ -348,7 +368,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> global(RequestOptions requestOptions, Context context); + Mono> global(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/global") @ExpectedResponses({ 204 }) @@ -356,7 +377,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response globalSync(RequestOptions requestOptions, Context context); + Response globalSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/if") @ExpectedResponses({ 204 }) @@ -364,7 +385,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> ifMethod(RequestOptions requestOptions, Context context); + Mono> ifMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/if") @ExpectedResponses({ 204 }) @@ -372,7 +394,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response ifMethodSync(RequestOptions requestOptions, Context context); + Response ifMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/import") @ExpectedResponses({ 204 }) @@ -380,7 +403,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> importMethod(RequestOptions requestOptions, Context context); + Mono> importMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/import") @ExpectedResponses({ 204 }) @@ -388,7 +412,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response importMethodSync(RequestOptions requestOptions, Context context); + Response importMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/in") @ExpectedResponses({ 204 }) @@ -396,7 +421,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> in(RequestOptions requestOptions, Context context); + Mono> in(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/in") @ExpectedResponses({ 204 }) @@ -404,7 +429,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response inSync(RequestOptions requestOptions, Context context); + Response inSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/is") @ExpectedResponses({ 204 }) @@ -412,7 +437,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> is(RequestOptions requestOptions, Context context); + Mono> is(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/is") @ExpectedResponses({ 204 }) @@ -420,7 +445,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response isSync(RequestOptions requestOptions, Context context); + Response isSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/lambda") @ExpectedResponses({ 204 }) @@ -428,7 +453,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> lambda(RequestOptions requestOptions, Context context); + Mono> lambda(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/lambda") @ExpectedResponses({ 204 }) @@ -436,7 +462,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response lambdaSync(RequestOptions requestOptions, Context context); + Response lambdaSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/not") @ExpectedResponses({ 204 }) @@ -444,7 +470,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> not(RequestOptions requestOptions, Context context); + Mono> not(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/not") @ExpectedResponses({ 204 }) @@ -452,7 +478,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response notSync(RequestOptions requestOptions, Context context); + Response notSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/or") @ExpectedResponses({ 204 }) @@ -460,7 +486,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> or(RequestOptions requestOptions, Context context); + Mono> or(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/or") @ExpectedResponses({ 204 }) @@ -468,7 +494,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response orSync(RequestOptions requestOptions, Context context); + Response orSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/pass") @ExpectedResponses({ 204 }) @@ -476,7 +502,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> pass(RequestOptions requestOptions, Context context); + Mono> pass(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/pass") @ExpectedResponses({ 204 }) @@ -484,7 +510,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response passSync(RequestOptions requestOptions, Context context); + Response passSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/raise") @ExpectedResponses({ 204 }) @@ -492,7 +518,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> raise(RequestOptions requestOptions, Context context); + Mono> raise(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/raise") @ExpectedResponses({ 204 }) @@ -500,7 +527,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response raiseSync(RequestOptions requestOptions, Context context); + Response raiseSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/return") @ExpectedResponses({ 204 }) @@ -508,7 +535,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> returnMethod(RequestOptions requestOptions, Context context); + Mono> returnMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/return") @ExpectedResponses({ 204 }) @@ -516,7 +544,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response returnMethodSync(RequestOptions requestOptions, Context context); + Response returnMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/try") @ExpectedResponses({ 204 }) @@ -524,7 +553,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> tryMethod(RequestOptions requestOptions, Context context); + Mono> tryMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/try") @ExpectedResponses({ 204 }) @@ -532,7 +562,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response tryMethodSync(RequestOptions requestOptions, Context context); + Response tryMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/while") @ExpectedResponses({ 204 }) @@ -540,7 +571,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> whileMethod(RequestOptions requestOptions, Context context); + Mono> whileMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/while") @ExpectedResponses({ 204 }) @@ -548,7 +580,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response whileMethodSync(RequestOptions requestOptions, Context context); + Response whileMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/with") @ExpectedResponses({ 204 }) @@ -556,7 +589,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> with(RequestOptions requestOptions, Context context); + Mono> with(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/with") @ExpectedResponses({ 204 }) @@ -564,7 +597,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withSync(RequestOptions requestOptions, Context context); + Response withSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/operations/yield") @ExpectedResponses({ 204 }) @@ -572,7 +605,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> yield(RequestOptions requestOptions, Context context); + Mono> yield(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/yield") @ExpectedResponses({ 204 }) @@ -580,7 +614,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response yieldSync(RequestOptions requestOptions, Context context); + Response yieldSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -595,7 +629,8 @@ public interface OperationsService { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> andWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.and(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.and(accept, requestOptions, context)); } /** @@ -610,7 +645,8 @@ public Mono> andWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response andWithResponse(RequestOptions requestOptions) { - return service.andSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.andSync(accept, requestOptions, Context.NONE); } /** @@ -625,7 +661,8 @@ public Response andWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> asWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.as(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.as(accept, requestOptions, context)); } /** @@ -640,7 +677,8 @@ public Mono> asWithResponseAsync(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response asWithResponse(RequestOptions requestOptions) { - return service.asSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.asSync(accept, requestOptions, Context.NONE); } /** @@ -655,7 +693,8 @@ public Response asWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> assertMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.assertMethod(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.assertMethod(accept, requestOptions, context)); } /** @@ -670,7 +709,8 @@ public Mono> assertMethodWithResponseAsync(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response assertMethodWithResponse(RequestOptions requestOptions) { - return service.assertMethodSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.assertMethodSync(accept, requestOptions, Context.NONE); } /** @@ -685,7 +725,8 @@ public Response assertMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> asyncWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.async(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.async(accept, requestOptions, context)); } /** @@ -700,7 +741,8 @@ public Mono> asyncWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response asyncWithResponse(RequestOptions requestOptions) { - return service.asyncSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.asyncSync(accept, requestOptions, Context.NONE); } /** @@ -715,7 +757,8 @@ public Response asyncWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> awaitWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.await(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.await(accept, requestOptions, context)); } /** @@ -730,7 +773,8 @@ public Mono> awaitWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response awaitWithResponse(RequestOptions requestOptions) { - return service.awaitSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.awaitSync(accept, requestOptions, Context.NONE); } /** @@ -745,7 +789,8 @@ public Response awaitWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> breakMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.breakMethod(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.breakMethod(accept, requestOptions, context)); } /** @@ -760,7 +805,8 @@ public Mono> breakMethodWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response breakMethodWithResponse(RequestOptions requestOptions) { - return service.breakMethodSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.breakMethodSync(accept, requestOptions, Context.NONE); } /** @@ -775,7 +821,8 @@ public Response breakMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> classMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.classMethod(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.classMethod(accept, requestOptions, context)); } /** @@ -790,7 +837,8 @@ public Mono> classMethodWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response classMethodWithResponse(RequestOptions requestOptions) { - return service.classMethodSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.classMethodSync(accept, requestOptions, Context.NONE); } /** @@ -805,7 +853,8 @@ public Response classMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> constructorWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.constructor(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.constructor(accept, requestOptions, context)); } /** @@ -820,7 +869,8 @@ public Mono> constructorWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response constructorWithResponse(RequestOptions requestOptions) { - return service.constructorSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.constructorSync(accept, requestOptions, Context.NONE); } /** @@ -835,7 +885,8 @@ public Response constructorWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> continueMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.continueMethod(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.continueMethod(accept, requestOptions, context)); } /** @@ -850,7 +901,8 @@ public Mono> continueMethodWithResponseAsync(RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response continueMethodWithResponse(RequestOptions requestOptions) { - return service.continueMethodSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.continueMethodSync(accept, requestOptions, Context.NONE); } /** @@ -865,7 +917,8 @@ public Response continueMethodWithResponse(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.def(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.def(accept, requestOptions, context)); } /** @@ -880,7 +933,8 @@ public Mono> defWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defWithResponse(RequestOptions requestOptions) { - return service.defSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.defSync(accept, requestOptions, Context.NONE); } /** @@ -895,7 +949,8 @@ public Response defWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.del(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.del(accept, requestOptions, context)); } /** @@ -910,7 +965,8 @@ public Mono> delWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response delWithResponse(RequestOptions requestOptions) { - return service.delSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.delSync(accept, requestOptions, Context.NONE); } /** @@ -925,7 +981,8 @@ public Response delWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> elifWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.elif(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.elif(accept, requestOptions, context)); } /** @@ -940,7 +997,8 @@ public Mono> elifWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response elifWithResponse(RequestOptions requestOptions) { - return service.elifSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.elifSync(accept, requestOptions, Context.NONE); } /** @@ -955,7 +1013,8 @@ public Response elifWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> elseMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.elseMethod(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.elseMethod(accept, requestOptions, context)); } /** @@ -970,7 +1029,8 @@ public Mono> elseMethodWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response elseMethodWithResponse(RequestOptions requestOptions) { - return service.elseMethodSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.elseMethodSync(accept, requestOptions, Context.NONE); } /** @@ -985,7 +1045,8 @@ public Response elseMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> exceptWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.except(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.except(accept, requestOptions, context)); } /** @@ -1000,7 +1061,8 @@ public Mono> exceptWithResponseAsync(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response exceptWithResponse(RequestOptions requestOptions) { - return service.exceptSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.exceptSync(accept, requestOptions, Context.NONE); } /** @@ -1015,7 +1077,8 @@ public Response exceptWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> execWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.exec(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.exec(accept, requestOptions, context)); } /** @@ -1030,7 +1093,8 @@ public Mono> execWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response execWithResponse(RequestOptions requestOptions) { - return service.execSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.execSync(accept, requestOptions, Context.NONE); } /** @@ -1045,7 +1109,8 @@ public Response execWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> finallyMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.finallyMethod(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.finallyMethod(accept, requestOptions, context)); } /** @@ -1060,7 +1125,8 @@ public Mono> finallyMethodWithResponseAsync(RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response finallyMethodWithResponse(RequestOptions requestOptions) { - return service.finallyMethodSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.finallyMethodSync(accept, requestOptions, Context.NONE); } /** @@ -1075,7 +1141,8 @@ public Response finallyMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> forMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.forMethod(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.forMethod(accept, requestOptions, context)); } /** @@ -1090,7 +1157,8 @@ public Mono> forMethodWithResponseAsync(RequestOptions requestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response forMethodWithResponse(RequestOptions requestOptions) { - return service.forMethodSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.forMethodSync(accept, requestOptions, Context.NONE); } /** @@ -1105,7 +1173,8 @@ public Response forMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.from(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.from(accept, requestOptions, context)); } /** @@ -1120,7 +1189,8 @@ public Mono> fromWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromWithResponse(RequestOptions requestOptions) { - return service.fromSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.fromSync(accept, requestOptions, Context.NONE); } /** @@ -1135,7 +1205,8 @@ public Response fromWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> globalWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.global(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.global(accept, requestOptions, context)); } /** @@ -1150,7 +1221,8 @@ public Mono> globalWithResponseAsync(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response globalWithResponse(RequestOptions requestOptions) { - return service.globalSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.globalSync(accept, requestOptions, Context.NONE); } /** @@ -1165,7 +1237,8 @@ public Response globalWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> ifMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.ifMethod(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.ifMethod(accept, requestOptions, context)); } /** @@ -1180,7 +1253,8 @@ public Mono> ifMethodWithResponseAsync(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response ifMethodWithResponse(RequestOptions requestOptions) { - return service.ifMethodSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.ifMethodSync(accept, requestOptions, Context.NONE); } /** @@ -1195,7 +1269,8 @@ public Response ifMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> importMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.importMethod(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.importMethod(accept, requestOptions, context)); } /** @@ -1210,7 +1285,8 @@ public Mono> importMethodWithResponseAsync(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response importMethodWithResponse(RequestOptions requestOptions) { - return service.importMethodSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.importMethodSync(accept, requestOptions, Context.NONE); } /** @@ -1225,7 +1301,8 @@ public Response importMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> inWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.in(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.in(accept, requestOptions, context)); } /** @@ -1240,7 +1317,8 @@ public Mono> inWithResponseAsync(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response inWithResponse(RequestOptions requestOptions) { - return service.inSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.inSync(accept, requestOptions, Context.NONE); } /** @@ -1255,7 +1333,8 @@ public Response inWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> isWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.is(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.is(accept, requestOptions, context)); } /** @@ -1270,7 +1349,8 @@ public Mono> isWithResponseAsync(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response isWithResponse(RequestOptions requestOptions) { - return service.isSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.isSync(accept, requestOptions, Context.NONE); } /** @@ -1285,7 +1365,8 @@ public Response isWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> lambdaWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.lambda(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.lambda(accept, requestOptions, context)); } /** @@ -1300,7 +1381,8 @@ public Mono> lambdaWithResponseAsync(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response lambdaWithResponse(RequestOptions requestOptions) { - return service.lambdaSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.lambdaSync(accept, requestOptions, Context.NONE); } /** @@ -1315,7 +1397,8 @@ public Response lambdaWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> notWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.not(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.not(accept, requestOptions, context)); } /** @@ -1330,7 +1413,8 @@ public Mono> notWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response notWithResponse(RequestOptions requestOptions) { - return service.notSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.notSync(accept, requestOptions, Context.NONE); } /** @@ -1345,7 +1429,8 @@ public Response notWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> orWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.or(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.or(accept, requestOptions, context)); } /** @@ -1360,7 +1445,8 @@ public Mono> orWithResponseAsync(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response orWithResponse(RequestOptions requestOptions) { - return service.orSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.orSync(accept, requestOptions, Context.NONE); } /** @@ -1375,7 +1461,8 @@ public Response orWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> passWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.pass(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.pass(accept, requestOptions, context)); } /** @@ -1390,7 +1477,8 @@ public Mono> passWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response passWithResponse(RequestOptions requestOptions) { - return service.passSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.passSync(accept, requestOptions, Context.NONE); } /** @@ -1405,7 +1493,8 @@ public Response passWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> raiseWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.raise(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.raise(accept, requestOptions, context)); } /** @@ -1420,7 +1509,8 @@ public Mono> raiseWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response raiseWithResponse(RequestOptions requestOptions) { - return service.raiseSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.raiseSync(accept, requestOptions, Context.NONE); } /** @@ -1435,7 +1525,8 @@ public Response raiseWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> returnMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.returnMethod(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.returnMethod(accept, requestOptions, context)); } /** @@ -1450,7 +1541,8 @@ public Mono> returnMethodWithResponseAsync(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response returnMethodWithResponse(RequestOptions requestOptions) { - return service.returnMethodSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.returnMethodSync(accept, requestOptions, Context.NONE); } /** @@ -1465,7 +1557,8 @@ public Response returnMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> tryMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.tryMethod(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.tryMethod(accept, requestOptions, context)); } /** @@ -1480,7 +1573,8 @@ public Mono> tryMethodWithResponseAsync(RequestOptions requestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response tryMethodWithResponse(RequestOptions requestOptions) { - return service.tryMethodSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.tryMethodSync(accept, requestOptions, Context.NONE); } /** @@ -1495,7 +1589,8 @@ public Response tryMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> whileMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.whileMethod(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.whileMethod(accept, requestOptions, context)); } /** @@ -1510,7 +1605,8 @@ public Mono> whileMethodWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response whileMethodWithResponse(RequestOptions requestOptions) { - return service.whileMethodSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.whileMethodSync(accept, requestOptions, Context.NONE); } /** @@ -1525,7 +1621,8 @@ public Response whileMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.with(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.with(accept, requestOptions, context)); } /** @@ -1540,7 +1637,8 @@ public Mono> withWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withWithResponse(RequestOptions requestOptions) { - return service.withSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withSync(accept, requestOptions, Context.NONE); } /** @@ -1555,7 +1653,8 @@ public Response withWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> yieldWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.yield(requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.yield(accept, requestOptions, context)); } /** @@ -1570,6 +1669,7 @@ public Mono> yieldWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response yieldWithResponse(RequestOptions requestOptions) { - return service.yieldSync(requestOptions, Context.NONE); + final String accept = "application/json"; + return service.yieldSync(accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/specialwords/implementation/ParametersImpl.java b/typespec-tests/src/main/java/com/specialwords/implementation/ParametersImpl.java index b412b4d91b..40e40e0a6a 100644 --- a/typespec-tests/src/main/java/com/specialwords/implementation/ParametersImpl.java +++ b/typespec-tests/src/main/java/com/specialwords/implementation/ParametersImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -61,7 +62,8 @@ public interface ParametersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAnd(@QueryParam("and") String and, RequestOptions requestOptions, Context context); + Mono> withAnd(@QueryParam("and") String and, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/and") @ExpectedResponses({ 204 }) @@ -69,7 +71,8 @@ public interface ParametersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAndSync(@QueryParam("and") String and, RequestOptions requestOptions, Context context); + Response withAndSync(@QueryParam("and") String and, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/as") @ExpectedResponses({ 204 }) @@ -77,7 +80,8 @@ public interface ParametersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAs(@QueryParam("as") String as, RequestOptions requestOptions, Context context); + Mono> withAs(@QueryParam("as") String as, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/as") @ExpectedResponses({ 204 }) @@ -85,7 +89,8 @@ public interface ParametersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAsSync(@QueryParam("as") String as, RequestOptions requestOptions, Context context); + Response withAsSync(@QueryParam("as") String as, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/assert") @ExpectedResponses({ 204 }) @@ -93,8 +98,8 @@ public interface ParametersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAssert(@QueryParam("assert") String assertParameter, RequestOptions requestOptions, - Context context); + Mono> withAssert(@QueryParam("assert") String assertParameter, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/assert") @ExpectedResponses({ 204 }) @@ -102,8 +107,8 @@ Mono> withAssert(@QueryParam("assert") String assertParameter, Re @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAssertSync(@QueryParam("assert") String assertParameter, RequestOptions requestOptions, - Context context); + Response withAssertSync(@QueryParam("assert") String assertParameter, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/async") @ExpectedResponses({ 204 }) @@ -111,8 +116,8 @@ Response withAssertSync(@QueryParam("assert") String assertParameter, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAsync(@QueryParam("async") String async, RequestOptions requestOptions, - Context context); + Mono> withAsync(@QueryParam("async") String async, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/async") @ExpectedResponses({ 204 }) @@ -120,7 +125,8 @@ Mono> withAsync(@QueryParam("async") String async, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAsyncSync(@QueryParam("async") String async, RequestOptions requestOptions, Context context); + Response withAsyncSync(@QueryParam("async") String async, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/await") @ExpectedResponses({ 204 }) @@ -128,8 +134,8 @@ Mono> withAsync(@QueryParam("async") String async, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAwait(@QueryParam("await") String await, RequestOptions requestOptions, - Context context); + Mono> withAwait(@QueryParam("await") String await, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/await") @ExpectedResponses({ 204 }) @@ -137,7 +143,8 @@ Mono> withAwait(@QueryParam("await") String await, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAwaitSync(@QueryParam("await") String await, RequestOptions requestOptions, Context context); + Response withAwaitSync(@QueryParam("await") String await, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/break") @ExpectedResponses({ 204 }) @@ -145,8 +152,8 @@ Mono> withAwait(@QueryParam("await") String await, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withBreak(@QueryParam("break") String breakParameter, RequestOptions requestOptions, - Context context); + Mono> withBreak(@QueryParam("break") String breakParameter, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/break") @ExpectedResponses({ 204 }) @@ -154,8 +161,8 @@ Mono> withBreak(@QueryParam("break") String breakParameter, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withBreakSync(@QueryParam("break") String breakParameter, RequestOptions requestOptions, - Context context); + Response withBreakSync(@QueryParam("break") String breakParameter, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/class") @ExpectedResponses({ 204 }) @@ -163,8 +170,8 @@ Response withBreakSync(@QueryParam("break") String breakParameter, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withClass(@QueryParam("class") String classParameter, RequestOptions requestOptions, - Context context); + Mono> withClass(@QueryParam("class") String classParameter, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/class") @ExpectedResponses({ 204 }) @@ -172,8 +179,8 @@ Mono> withClass(@QueryParam("class") String classParameter, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withClassSync(@QueryParam("class") String classParameter, RequestOptions requestOptions, - Context context); + Response withClassSync(@QueryParam("class") String classParameter, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/constructor") @ExpectedResponses({ 204 }) @@ -182,7 +189,7 @@ Response withClassSync(@QueryParam("class") String classParameter, Request @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withConstructor(@QueryParam("constructor") String constructor, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/constructor") @ExpectedResponses({ 204 }) @@ -190,8 +197,8 @@ Mono> withConstructor(@QueryParam("constructor") String construct @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withConstructorSync(@QueryParam("constructor") String constructor, RequestOptions requestOptions, - Context context); + Response withConstructorSync(@QueryParam("constructor") String constructor, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/continue") @ExpectedResponses({ 204 }) @@ -200,7 +207,7 @@ Response withConstructorSync(@QueryParam("constructor") String constructor @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withContinue(@QueryParam("continue") String continueParameter, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/continue") @ExpectedResponses({ 204 }) @@ -208,8 +215,8 @@ Mono> withContinue(@QueryParam("continue") String continueParamet @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withContinueSync(@QueryParam("continue") String continueParameter, RequestOptions requestOptions, - Context context); + Response withContinueSync(@QueryParam("continue") String continueParameter, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/def") @ExpectedResponses({ 204 }) @@ -217,7 +224,8 @@ Response withContinueSync(@QueryParam("continue") String continueParameter @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withDef(@QueryParam("def") String def, RequestOptions requestOptions, Context context); + Mono> withDef(@QueryParam("def") String def, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/def") @ExpectedResponses({ 204 }) @@ -225,7 +233,8 @@ Response withContinueSync(@QueryParam("continue") String continueParameter @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withDefSync(@QueryParam("def") String def, RequestOptions requestOptions, Context context); + Response withDefSync(@QueryParam("def") String def, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/del") @ExpectedResponses({ 204 }) @@ -233,7 +242,8 @@ Response withContinueSync(@QueryParam("continue") String continueParameter @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withDel(@QueryParam("del") String del, RequestOptions requestOptions, Context context); + Mono> withDel(@QueryParam("del") String del, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/del") @ExpectedResponses({ 204 }) @@ -241,7 +251,8 @@ Response withContinueSync(@QueryParam("continue") String continueParameter @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withDelSync(@QueryParam("del") String del, RequestOptions requestOptions, Context context); + Response withDelSync(@QueryParam("del") String del, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/elif") @ExpectedResponses({ 204 }) @@ -249,7 +260,8 @@ Response withContinueSync(@QueryParam("continue") String continueParameter @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withElif(@QueryParam("elif") String elif, RequestOptions requestOptions, Context context); + Mono> withElif(@QueryParam("elif") String elif, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/elif") @ExpectedResponses({ 204 }) @@ -257,7 +269,8 @@ Response withContinueSync(@QueryParam("continue") String continueParameter @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withElifSync(@QueryParam("elif") String elif, RequestOptions requestOptions, Context context); + Response withElifSync(@QueryParam("elif") String elif, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/else") @ExpectedResponses({ 204 }) @@ -265,8 +278,8 @@ Response withContinueSync(@QueryParam("continue") String continueParameter @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withElse(@QueryParam("else") String elseParameter, RequestOptions requestOptions, - Context context); + Mono> withElse(@QueryParam("else") String elseParameter, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/else") @ExpectedResponses({ 204 }) @@ -274,8 +287,8 @@ Mono> withElse(@QueryParam("else") String elseParameter, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withElseSync(@QueryParam("else") String elseParameter, RequestOptions requestOptions, - Context context); + Response withElseSync(@QueryParam("else") String elseParameter, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/except") @ExpectedResponses({ 204 }) @@ -283,8 +296,8 @@ Response withElseSync(@QueryParam("else") String elseParameter, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withExcept(@QueryParam("except") String except, RequestOptions requestOptions, - Context context); + Mono> withExcept(@QueryParam("except") String except, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/except") @ExpectedResponses({ 204 }) @@ -292,8 +305,8 @@ Mono> withExcept(@QueryParam("except") String except, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withExceptSync(@QueryParam("except") String except, RequestOptions requestOptions, - Context context); + Response withExceptSync(@QueryParam("except") String except, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/exec") @ExpectedResponses({ 204 }) @@ -301,7 +314,8 @@ Response withExceptSync(@QueryParam("except") String except, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withExec(@QueryParam("exec") String exec, RequestOptions requestOptions, Context context); + Mono> withExec(@QueryParam("exec") String exec, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/exec") @ExpectedResponses({ 204 }) @@ -309,7 +323,8 @@ Response withExceptSync(@QueryParam("except") String except, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withExecSync(@QueryParam("exec") String exec, RequestOptions requestOptions, Context context); + Response withExecSync(@QueryParam("exec") String exec, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/finally") @ExpectedResponses({ 204 }) @@ -317,8 +332,8 @@ Response withExceptSync(@QueryParam("except") String except, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withFinally(@QueryParam("finally") String finallyParameter, RequestOptions requestOptions, - Context context); + Mono> withFinally(@QueryParam("finally") String finallyParameter, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/finally") @ExpectedResponses({ 204 }) @@ -326,8 +341,8 @@ Mono> withFinally(@QueryParam("finally") String finallyParameter, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withFinallySync(@QueryParam("finally") String finallyParameter, RequestOptions requestOptions, - Context context); + Response withFinallySync(@QueryParam("finally") String finallyParameter, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/for") @ExpectedResponses({ 204 }) @@ -335,8 +350,8 @@ Response withFinallySync(@QueryParam("finally") String finallyParameter, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withFor(@QueryParam("for") String forParameter, RequestOptions requestOptions, - Context context); + Mono> withFor(@QueryParam("for") String forParameter, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/for") @ExpectedResponses({ 204 }) @@ -344,8 +359,8 @@ Mono> withFor(@QueryParam("for") String forParameter, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withForSync(@QueryParam("for") String forParameter, RequestOptions requestOptions, - Context context); + Response withForSync(@QueryParam("for") String forParameter, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/from") @ExpectedResponses({ 204 }) @@ -353,7 +368,8 @@ Response withForSync(@QueryParam("for") String forParameter, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withFrom(@QueryParam("from") String from, RequestOptions requestOptions, Context context); + Mono> withFrom(@QueryParam("from") String from, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/from") @ExpectedResponses({ 204 }) @@ -361,7 +377,8 @@ Response withForSync(@QueryParam("for") String forParameter, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withFromSync(@QueryParam("from") String from, RequestOptions requestOptions, Context context); + Response withFromSync(@QueryParam("from") String from, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/global") @ExpectedResponses({ 204 }) @@ -369,8 +386,8 @@ Response withForSync(@QueryParam("for") String forParameter, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withGlobal(@QueryParam("global") String global, RequestOptions requestOptions, - Context context); + Mono> withGlobal(@QueryParam("global") String global, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/global") @ExpectedResponses({ 204 }) @@ -378,8 +395,8 @@ Mono> withGlobal(@QueryParam("global") String global, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withGlobalSync(@QueryParam("global") String global, RequestOptions requestOptions, - Context context); + Response withGlobalSync(@QueryParam("global") String global, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/if") @ExpectedResponses({ 204 }) @@ -387,8 +404,8 @@ Response withGlobalSync(@QueryParam("global") String global, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withIf(@QueryParam("if") String ifParameter, RequestOptions requestOptions, - Context context); + Mono> withIf(@QueryParam("if") String ifParameter, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/if") @ExpectedResponses({ 204 }) @@ -396,7 +413,8 @@ Mono> withIf(@QueryParam("if") String ifParameter, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withIfSync(@QueryParam("if") String ifParameter, RequestOptions requestOptions, Context context); + Response withIfSync(@QueryParam("if") String ifParameter, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/import") @ExpectedResponses({ 204 }) @@ -404,8 +422,8 @@ Mono> withIf(@QueryParam("if") String ifParameter, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withImport(@QueryParam("import") String importParameter, RequestOptions requestOptions, - Context context); + Mono> withImport(@QueryParam("import") String importParameter, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/import") @ExpectedResponses({ 204 }) @@ -413,8 +431,8 @@ Mono> withImport(@QueryParam("import") String importParameter, Re @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withImportSync(@QueryParam("import") String importParameter, RequestOptions requestOptions, - Context context); + Response withImportSync(@QueryParam("import") String importParameter, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/in") @ExpectedResponses({ 204 }) @@ -422,7 +440,8 @@ Response withImportSync(@QueryParam("import") String importParameter, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withIn(@QueryParam("in") String in, RequestOptions requestOptions, Context context); + Mono> withIn(@QueryParam("in") String in, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/in") @ExpectedResponses({ 204 }) @@ -430,7 +449,8 @@ Response withImportSync(@QueryParam("import") String importParameter, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withInSync(@QueryParam("in") String in, RequestOptions requestOptions, Context context); + Response withInSync(@QueryParam("in") String in, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/is") @ExpectedResponses({ 204 }) @@ -438,7 +458,8 @@ Response withImportSync(@QueryParam("import") String importParameter, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withIs(@QueryParam("is") String is, RequestOptions requestOptions, Context context); + Mono> withIs(@QueryParam("is") String is, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/is") @ExpectedResponses({ 204 }) @@ -446,7 +467,8 @@ Response withImportSync(@QueryParam("import") String importParameter, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withIsSync(@QueryParam("is") String is, RequestOptions requestOptions, Context context); + Response withIsSync(@QueryParam("is") String is, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/lambda") @ExpectedResponses({ 204 }) @@ -454,8 +476,8 @@ Response withImportSync(@QueryParam("import") String importParameter, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withLambda(@QueryParam("lambda") String lambda, RequestOptions requestOptions, - Context context); + Mono> withLambda(@QueryParam("lambda") String lambda, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/lambda") @ExpectedResponses({ 204 }) @@ -463,8 +485,8 @@ Mono> withLambda(@QueryParam("lambda") String lambda, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withLambdaSync(@QueryParam("lambda") String lambda, RequestOptions requestOptions, - Context context); + Response withLambdaSync(@QueryParam("lambda") String lambda, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/not") @ExpectedResponses({ 204 }) @@ -472,7 +494,8 @@ Response withLambdaSync(@QueryParam("lambda") String lambda, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withNot(@QueryParam("not") String not, RequestOptions requestOptions, Context context); + Mono> withNot(@QueryParam("not") String not, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/not") @ExpectedResponses({ 204 }) @@ -480,7 +503,8 @@ Response withLambdaSync(@QueryParam("lambda") String lambda, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withNotSync(@QueryParam("not") String not, RequestOptions requestOptions, Context context); + Response withNotSync(@QueryParam("not") String not, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/or") @ExpectedResponses({ 204 }) @@ -488,7 +512,8 @@ Response withLambdaSync(@QueryParam("lambda") String lambda, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withOr(@QueryParam("or") String or, RequestOptions requestOptions, Context context); + Mono> withOr(@QueryParam("or") String or, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/or") @ExpectedResponses({ 204 }) @@ -496,7 +521,8 @@ Response withLambdaSync(@QueryParam("lambda") String lambda, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withOrSync(@QueryParam("or") String or, RequestOptions requestOptions, Context context); + Response withOrSync(@QueryParam("or") String or, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/pass") @ExpectedResponses({ 204 }) @@ -504,7 +530,8 @@ Response withLambdaSync(@QueryParam("lambda") String lambda, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withPass(@QueryParam("pass") String pass, RequestOptions requestOptions, Context context); + Mono> withPass(@QueryParam("pass") String pass, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/pass") @ExpectedResponses({ 204 }) @@ -512,7 +539,8 @@ Response withLambdaSync(@QueryParam("lambda") String lambda, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withPassSync(@QueryParam("pass") String pass, RequestOptions requestOptions, Context context); + Response withPassSync(@QueryParam("pass") String pass, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/raise") @ExpectedResponses({ 204 }) @@ -520,8 +548,8 @@ Response withLambdaSync(@QueryParam("lambda") String lambda, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withRaise(@QueryParam("raise") String raise, RequestOptions requestOptions, - Context context); + Mono> withRaise(@QueryParam("raise") String raise, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/raise") @ExpectedResponses({ 204 }) @@ -529,7 +557,8 @@ Mono> withRaise(@QueryParam("raise") String raise, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withRaiseSync(@QueryParam("raise") String raise, RequestOptions requestOptions, Context context); + Response withRaiseSync(@QueryParam("raise") String raise, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/return") @ExpectedResponses({ 204 }) @@ -537,8 +566,8 @@ Mono> withRaise(@QueryParam("raise") String raise, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withReturn(@QueryParam("return") String returnParameter, RequestOptions requestOptions, - Context context); + Mono> withReturn(@QueryParam("return") String returnParameter, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/return") @ExpectedResponses({ 204 }) @@ -546,8 +575,8 @@ Mono> withReturn(@QueryParam("return") String returnParameter, Re @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withReturnSync(@QueryParam("return") String returnParameter, RequestOptions requestOptions, - Context context); + Response withReturnSync(@QueryParam("return") String returnParameter, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/try") @ExpectedResponses({ 204 }) @@ -555,8 +584,8 @@ Response withReturnSync(@QueryParam("return") String returnParameter, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withTry(@QueryParam("try") String tryParameter, RequestOptions requestOptions, - Context context); + Mono> withTry(@QueryParam("try") String tryParameter, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/try") @ExpectedResponses({ 204 }) @@ -564,8 +593,8 @@ Mono> withTry(@QueryParam("try") String tryParameter, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withTrySync(@QueryParam("try") String tryParameter, RequestOptions requestOptions, - Context context); + Response withTrySync(@QueryParam("try") String tryParameter, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/while") @ExpectedResponses({ 204 }) @@ -573,8 +602,8 @@ Response withTrySync(@QueryParam("try") String tryParameter, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withWhile(@QueryParam("while") String whileParameter, RequestOptions requestOptions, - Context context); + Mono> withWhile(@QueryParam("while") String whileParameter, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/while") @ExpectedResponses({ 204 }) @@ -582,8 +611,8 @@ Mono> withWhile(@QueryParam("while") String whileParameter, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withWhileSync(@QueryParam("while") String whileParameter, RequestOptions requestOptions, - Context context); + Response withWhileSync(@QueryParam("while") String whileParameter, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/with") @ExpectedResponses({ 204 }) @@ -591,7 +620,8 @@ Response withWhileSync(@QueryParam("while") String whileParameter, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withWith(@QueryParam("with") String with, RequestOptions requestOptions, Context context); + Mono> withWith(@QueryParam("with") String with, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/with") @ExpectedResponses({ 204 }) @@ -599,7 +629,8 @@ Response withWhileSync(@QueryParam("while") String whileParameter, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withWithSync(@QueryParam("with") String with, RequestOptions requestOptions, Context context); + Response withWithSync(@QueryParam("with") String with, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/yield") @ExpectedResponses({ 204 }) @@ -607,8 +638,8 @@ Response withWhileSync(@QueryParam("while") String whileParameter, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withYield(@QueryParam("yield") String yield, RequestOptions requestOptions, - Context context); + Mono> withYield(@QueryParam("yield") String yield, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/yield") @ExpectedResponses({ 204 }) @@ -616,7 +647,8 @@ Mono> withYield(@QueryParam("yield") String yield, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withYieldSync(@QueryParam("yield") String yield, RequestOptions requestOptions, Context context); + Response withYieldSync(@QueryParam("yield") String yield, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/cancellationToken") @ExpectedResponses({ 204 }) @@ -625,7 +657,7 @@ Mono> withYield(@QueryParam("yield") String yield, RequestOptions @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withCancellationToken(@QueryParam("cancellationToken") String cancellationToken, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/cancellationToken") @ExpectedResponses({ 204 }) @@ -634,7 +666,7 @@ Mono> withCancellationToken(@QueryParam("cancellationToken") Stri @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response withCancellationTokenSync(@QueryParam("cancellationToken") String cancellationToken, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -650,7 +682,8 @@ Response withCancellationTokenSync(@QueryParam("cancellationToken") String */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAndWithResponseAsync(String and, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withAnd(and, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withAnd(and, accept, requestOptions, context)); } /** @@ -666,7 +699,8 @@ public Mono> withAndWithResponseAsync(String and, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAndWithResponse(String and, RequestOptions requestOptions) { - return service.withAndSync(and, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withAndSync(and, accept, requestOptions, Context.NONE); } /** @@ -682,7 +716,8 @@ public Response withAndWithResponse(String and, RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAsWithResponseAsync(String as, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withAs(as, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withAs(as, accept, requestOptions, context)); } /** @@ -698,7 +733,8 @@ public Mono> withAsWithResponseAsync(String as, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAsWithResponse(String as, RequestOptions requestOptions) { - return service.withAsSync(as, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withAsSync(as, accept, requestOptions, Context.NONE); } /** @@ -714,7 +750,8 @@ public Response withAsWithResponse(String as, RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAssertWithResponseAsync(String assertParameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withAssert(assertParameter, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withAssert(assertParameter, accept, requestOptions, context)); } /** @@ -730,7 +767,8 @@ public Mono> withAssertWithResponseAsync(String assertParameter, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAssertWithResponse(String assertParameter, RequestOptions requestOptions) { - return service.withAssertSync(assertParameter, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withAssertSync(assertParameter, accept, requestOptions, Context.NONE); } /** @@ -746,7 +784,8 @@ public Response withAssertWithResponse(String assertParameter, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAsyncWithResponseAsync(String async, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withAsync(async, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withAsync(async, accept, requestOptions, context)); } /** @@ -762,7 +801,8 @@ public Mono> withAsyncWithResponseAsync(String async, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAsyncWithResponse(String async, RequestOptions requestOptions) { - return service.withAsyncSync(async, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withAsyncSync(async, accept, requestOptions, Context.NONE); } /** @@ -778,7 +818,8 @@ public Response withAsyncWithResponse(String async, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAwaitWithResponseAsync(String await, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withAwait(await, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withAwait(await, accept, requestOptions, context)); } /** @@ -794,7 +835,8 @@ public Mono> withAwaitWithResponseAsync(String await, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAwaitWithResponse(String await, RequestOptions requestOptions) { - return service.withAwaitSync(await, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withAwaitSync(await, accept, requestOptions, Context.NONE); } /** @@ -810,7 +852,8 @@ public Response withAwaitWithResponse(String await, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withBreakWithResponseAsync(String breakParameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withBreak(breakParameter, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withBreak(breakParameter, accept, requestOptions, context)); } /** @@ -826,7 +869,8 @@ public Mono> withBreakWithResponseAsync(String breakParameter, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withBreakWithResponse(String breakParameter, RequestOptions requestOptions) { - return service.withBreakSync(breakParameter, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withBreakSync(breakParameter, accept, requestOptions, Context.NONE); } /** @@ -842,7 +886,8 @@ public Response withBreakWithResponse(String breakParameter, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withClassWithResponseAsync(String classParameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withClass(classParameter, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withClass(classParameter, accept, requestOptions, context)); } /** @@ -858,7 +903,8 @@ public Mono> withClassWithResponseAsync(String classParameter, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withClassWithResponse(String classParameter, RequestOptions requestOptions) { - return service.withClassSync(classParameter, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withClassSync(classParameter, accept, requestOptions, Context.NONE); } /** @@ -874,7 +920,8 @@ public Response withClassWithResponse(String classParameter, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withConstructorWithResponseAsync(String constructor, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withConstructor(constructor, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withConstructor(constructor, accept, requestOptions, context)); } /** @@ -890,7 +937,8 @@ public Mono> withConstructorWithResponseAsync(String constructor, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withConstructorWithResponse(String constructor, RequestOptions requestOptions) { - return service.withConstructorSync(constructor, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withConstructorSync(constructor, accept, requestOptions, Context.NONE); } /** @@ -906,7 +954,9 @@ public Response withConstructorWithResponse(String constructor, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withContinueWithResponseAsync(String continueParameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withContinue(continueParameter, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.withContinue(continueParameter, accept, requestOptions, context)); } /** @@ -922,7 +972,8 @@ public Mono> withContinueWithResponseAsync(String continueParamet */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withContinueWithResponse(String continueParameter, RequestOptions requestOptions) { - return service.withContinueSync(continueParameter, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withContinueSync(continueParameter, accept, requestOptions, Context.NONE); } /** @@ -938,7 +989,8 @@ public Response withContinueWithResponse(String continueParameter, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withDefWithResponseAsync(String def, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withDef(def, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withDef(def, accept, requestOptions, context)); } /** @@ -954,7 +1006,8 @@ public Mono> withDefWithResponseAsync(String def, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withDefWithResponse(String def, RequestOptions requestOptions) { - return service.withDefSync(def, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withDefSync(def, accept, requestOptions, Context.NONE); } /** @@ -970,7 +1023,8 @@ public Response withDefWithResponse(String def, RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withDelWithResponseAsync(String del, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withDel(del, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withDel(del, accept, requestOptions, context)); } /** @@ -986,7 +1040,8 @@ public Mono> withDelWithResponseAsync(String del, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withDelWithResponse(String del, RequestOptions requestOptions) { - return service.withDelSync(del, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withDelSync(del, accept, requestOptions, Context.NONE); } /** @@ -1002,7 +1057,8 @@ public Response withDelWithResponse(String del, RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withElifWithResponseAsync(String elif, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withElif(elif, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withElif(elif, accept, requestOptions, context)); } /** @@ -1018,7 +1074,8 @@ public Mono> withElifWithResponseAsync(String elif, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withElifWithResponse(String elif, RequestOptions requestOptions) { - return service.withElifSync(elif, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withElifSync(elif, accept, requestOptions, Context.NONE); } /** @@ -1034,7 +1091,8 @@ public Response withElifWithResponse(String elif, RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withElseWithResponseAsync(String elseParameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withElse(elseParameter, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withElse(elseParameter, accept, requestOptions, context)); } /** @@ -1050,7 +1108,8 @@ public Mono> withElseWithResponseAsync(String elseParameter, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withElseWithResponse(String elseParameter, RequestOptions requestOptions) { - return service.withElseSync(elseParameter, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withElseSync(elseParameter, accept, requestOptions, Context.NONE); } /** @@ -1066,7 +1125,8 @@ public Response withElseWithResponse(String elseParameter, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withExceptWithResponseAsync(String except, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withExcept(except, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withExcept(except, accept, requestOptions, context)); } /** @@ -1082,7 +1142,8 @@ public Mono> withExceptWithResponseAsync(String except, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withExceptWithResponse(String except, RequestOptions requestOptions) { - return service.withExceptSync(except, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withExceptSync(except, accept, requestOptions, Context.NONE); } /** @@ -1098,7 +1159,8 @@ public Response withExceptWithResponse(String except, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withExecWithResponseAsync(String exec, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withExec(exec, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withExec(exec, accept, requestOptions, context)); } /** @@ -1114,7 +1176,8 @@ public Mono> withExecWithResponseAsync(String exec, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withExecWithResponse(String exec, RequestOptions requestOptions) { - return service.withExecSync(exec, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withExecSync(exec, accept, requestOptions, Context.NONE); } /** @@ -1130,7 +1193,8 @@ public Response withExecWithResponse(String exec, RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withFinallyWithResponseAsync(String finallyParameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withFinally(finallyParameter, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withFinally(finallyParameter, accept, requestOptions, context)); } /** @@ -1146,7 +1210,8 @@ public Mono> withFinallyWithResponseAsync(String finallyParameter */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withFinallyWithResponse(String finallyParameter, RequestOptions requestOptions) { - return service.withFinallySync(finallyParameter, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withFinallySync(finallyParameter, accept, requestOptions, Context.NONE); } /** @@ -1162,7 +1227,8 @@ public Response withFinallyWithResponse(String finallyParameter, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withForWithResponseAsync(String forParameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withFor(forParameter, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withFor(forParameter, accept, requestOptions, context)); } /** @@ -1178,7 +1244,8 @@ public Mono> withForWithResponseAsync(String forParameter, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withForWithResponse(String forParameter, RequestOptions requestOptions) { - return service.withForSync(forParameter, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withForSync(forParameter, accept, requestOptions, Context.NONE); } /** @@ -1194,7 +1261,8 @@ public Response withForWithResponse(String forParameter, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withFromWithResponseAsync(String from, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withFrom(from, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withFrom(from, accept, requestOptions, context)); } /** @@ -1210,7 +1278,8 @@ public Mono> withFromWithResponseAsync(String from, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withFromWithResponse(String from, RequestOptions requestOptions) { - return service.withFromSync(from, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withFromSync(from, accept, requestOptions, Context.NONE); } /** @@ -1226,7 +1295,8 @@ public Response withFromWithResponse(String from, RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withGlobalWithResponseAsync(String global, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withGlobal(global, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withGlobal(global, accept, requestOptions, context)); } /** @@ -1242,7 +1312,8 @@ public Mono> withGlobalWithResponseAsync(String global, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withGlobalWithResponse(String global, RequestOptions requestOptions) { - return service.withGlobalSync(global, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withGlobalSync(global, accept, requestOptions, Context.NONE); } /** @@ -1258,7 +1329,8 @@ public Response withGlobalWithResponse(String global, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withIfWithResponseAsync(String ifParameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withIf(ifParameter, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withIf(ifParameter, accept, requestOptions, context)); } /** @@ -1274,7 +1346,8 @@ public Mono> withIfWithResponseAsync(String ifParameter, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withIfWithResponse(String ifParameter, RequestOptions requestOptions) { - return service.withIfSync(ifParameter, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withIfSync(ifParameter, accept, requestOptions, Context.NONE); } /** @@ -1290,7 +1363,8 @@ public Response withIfWithResponse(String ifParameter, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withImportWithResponseAsync(String importParameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withImport(importParameter, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withImport(importParameter, accept, requestOptions, context)); } /** @@ -1306,7 +1380,8 @@ public Mono> withImportWithResponseAsync(String importParameter, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withImportWithResponse(String importParameter, RequestOptions requestOptions) { - return service.withImportSync(importParameter, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withImportSync(importParameter, accept, requestOptions, Context.NONE); } /** @@ -1322,7 +1397,8 @@ public Response withImportWithResponse(String importParameter, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withInWithResponseAsync(String in, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withIn(in, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withIn(in, accept, requestOptions, context)); } /** @@ -1338,7 +1414,8 @@ public Mono> withInWithResponseAsync(String in, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withInWithResponse(String in, RequestOptions requestOptions) { - return service.withInSync(in, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withInSync(in, accept, requestOptions, Context.NONE); } /** @@ -1354,7 +1431,8 @@ public Response withInWithResponse(String in, RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withIsWithResponseAsync(String is, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withIs(is, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withIs(is, accept, requestOptions, context)); } /** @@ -1370,7 +1448,8 @@ public Mono> withIsWithResponseAsync(String is, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withIsWithResponse(String is, RequestOptions requestOptions) { - return service.withIsSync(is, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withIsSync(is, accept, requestOptions, Context.NONE); } /** @@ -1386,7 +1465,8 @@ public Response withIsWithResponse(String is, RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withLambdaWithResponseAsync(String lambda, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withLambda(lambda, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withLambda(lambda, accept, requestOptions, context)); } /** @@ -1402,7 +1482,8 @@ public Mono> withLambdaWithResponseAsync(String lambda, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withLambdaWithResponse(String lambda, RequestOptions requestOptions) { - return service.withLambdaSync(lambda, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withLambdaSync(lambda, accept, requestOptions, Context.NONE); } /** @@ -1418,7 +1499,8 @@ public Response withLambdaWithResponse(String lambda, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withNotWithResponseAsync(String not, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withNot(not, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withNot(not, accept, requestOptions, context)); } /** @@ -1434,7 +1516,8 @@ public Mono> withNotWithResponseAsync(String not, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withNotWithResponse(String not, RequestOptions requestOptions) { - return service.withNotSync(not, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withNotSync(not, accept, requestOptions, Context.NONE); } /** @@ -1450,7 +1533,8 @@ public Response withNotWithResponse(String not, RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withOrWithResponseAsync(String or, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withOr(or, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withOr(or, accept, requestOptions, context)); } /** @@ -1466,7 +1550,8 @@ public Mono> withOrWithResponseAsync(String or, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withOrWithResponse(String or, RequestOptions requestOptions) { - return service.withOrSync(or, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withOrSync(or, accept, requestOptions, Context.NONE); } /** @@ -1482,7 +1567,8 @@ public Response withOrWithResponse(String or, RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withPassWithResponseAsync(String pass, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withPass(pass, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withPass(pass, accept, requestOptions, context)); } /** @@ -1498,7 +1584,8 @@ public Mono> withPassWithResponseAsync(String pass, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withPassWithResponse(String pass, RequestOptions requestOptions) { - return service.withPassSync(pass, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withPassSync(pass, accept, requestOptions, Context.NONE); } /** @@ -1514,7 +1601,8 @@ public Response withPassWithResponse(String pass, RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withRaiseWithResponseAsync(String raise, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withRaise(raise, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withRaise(raise, accept, requestOptions, context)); } /** @@ -1530,7 +1618,8 @@ public Mono> withRaiseWithResponseAsync(String raise, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withRaiseWithResponse(String raise, RequestOptions requestOptions) { - return service.withRaiseSync(raise, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withRaiseSync(raise, accept, requestOptions, Context.NONE); } /** @@ -1546,7 +1635,8 @@ public Response withRaiseWithResponse(String raise, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withReturnWithResponseAsync(String returnParameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withReturn(returnParameter, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withReturn(returnParameter, accept, requestOptions, context)); } /** @@ -1562,7 +1652,8 @@ public Mono> withReturnWithResponseAsync(String returnParameter, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withReturnWithResponse(String returnParameter, RequestOptions requestOptions) { - return service.withReturnSync(returnParameter, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withReturnSync(returnParameter, accept, requestOptions, Context.NONE); } /** @@ -1578,7 +1669,8 @@ public Response withReturnWithResponse(String returnParameter, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withTryWithResponseAsync(String tryParameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withTry(tryParameter, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withTry(tryParameter, accept, requestOptions, context)); } /** @@ -1594,7 +1686,8 @@ public Mono> withTryWithResponseAsync(String tryParameter, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withTryWithResponse(String tryParameter, RequestOptions requestOptions) { - return service.withTrySync(tryParameter, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withTrySync(tryParameter, accept, requestOptions, Context.NONE); } /** @@ -1610,7 +1703,8 @@ public Response withTryWithResponse(String tryParameter, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withWhileWithResponseAsync(String whileParameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withWhile(whileParameter, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withWhile(whileParameter, accept, requestOptions, context)); } /** @@ -1626,7 +1720,8 @@ public Mono> withWhileWithResponseAsync(String whileParameter, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withWhileWithResponse(String whileParameter, RequestOptions requestOptions) { - return service.withWhileSync(whileParameter, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withWhileSync(whileParameter, accept, requestOptions, Context.NONE); } /** @@ -1642,7 +1737,8 @@ public Response withWhileWithResponse(String whileParameter, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withWithWithResponseAsync(String with, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withWith(with, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withWith(with, accept, requestOptions, context)); } /** @@ -1658,7 +1754,8 @@ public Mono> withWithWithResponseAsync(String with, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withWithWithResponse(String with, RequestOptions requestOptions) { - return service.withWithSync(with, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withWithSync(with, accept, requestOptions, Context.NONE); } /** @@ -1674,7 +1771,8 @@ public Response withWithWithResponse(String with, RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withYieldWithResponseAsync(String yield, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withYield(yield, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.withYield(yield, accept, requestOptions, context)); } /** @@ -1690,7 +1788,8 @@ public Mono> withYieldWithResponseAsync(String yield, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withYieldWithResponse(String yield, RequestOptions requestOptions) { - return service.withYieldSync(yield, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withYieldSync(yield, accept, requestOptions, Context.NONE); } /** @@ -1707,8 +1806,9 @@ public Response withYieldWithResponse(String yield, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withCancellationTokenWithResponseAsync(String cancellationToken, RequestOptions requestOptions) { + final String accept = "application/json"; return FluxUtil - .withContext(context -> service.withCancellationToken(cancellationToken, requestOptions, context)); + .withContext(context -> service.withCancellationToken(cancellationToken, accept, requestOptions, context)); } /** @@ -1724,6 +1824,7 @@ public Mono> withCancellationTokenWithResponseAsync(String cancel */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withCancellationTokenWithResponse(String cancellationToken, RequestOptions requestOptions) { - return service.withCancellationTokenSync(cancellationToken, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.withCancellationTokenSync(cancellationToken, accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/BooleanValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/BooleanValuesImpl.java index f5491cda2e..1fe41e98f7 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/BooleanValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/BooleanValuesImpl.java @@ -64,7 +64,7 @@ public interface BooleanValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/boolean") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/boolean") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/boolean") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/DatetimeValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/DatetimeValuesImpl.java index 23fc8a8a32..bf57043843 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/DatetimeValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/DatetimeValuesImpl.java @@ -64,7 +64,7 @@ public interface DatetimeValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/datetime") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/datetime") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/datetime") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/DurationValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/DurationValuesImpl.java index 76cacdd710..2ad8d29b75 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/DurationValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/DurationValuesImpl.java @@ -64,7 +64,7 @@ public interface DurationValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/duration") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/duration") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/duration") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/Float32ValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/Float32ValuesImpl.java index f76500d8f5..9ff1844849 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/Float32ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/Float32ValuesImpl.java @@ -64,7 +64,7 @@ public interface Float32ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/float32") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/float32") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/float32") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/Int32ValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/Int32ValuesImpl.java index 7abdd7ba1f..93c087d948 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/Int32ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/Int32ValuesImpl.java @@ -64,7 +64,7 @@ public interface Int32ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/int32") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/int32") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/int32") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/Int64ValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/Int64ValuesImpl.java index 1acefeb409..5001f0f289 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/Int64ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/Int64ValuesImpl.java @@ -64,7 +64,7 @@ public interface Int64ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/int64") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/int64") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/int64") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/ModelValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/ModelValuesImpl.java index 62ea7c7061..b1e3161b47 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/ModelValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/ModelValuesImpl.java @@ -64,7 +64,7 @@ public interface ModelValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/model") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/model") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/model") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -176,8 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -205,7 +205,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/NullableBooleanValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/NullableBooleanValuesImpl.java index dbd68b10a9..568cdaf7d4 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/NullableBooleanValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/NullableBooleanValuesImpl.java @@ -64,7 +64,7 @@ public interface NullableBooleanValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/nullable-boolean") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/nullable-boolean") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/nullable-boolean") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/NullableFloatValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/NullableFloatValuesImpl.java index f8b29edffe..7ec91a5d72 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/NullableFloatValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/NullableFloatValuesImpl.java @@ -64,7 +64,7 @@ public interface NullableFloatValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/nullable-float") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/nullable-float") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/nullable-float") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/NullableInt32ValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/NullableInt32ValuesImpl.java index 0fb9ab3586..2ea543029e 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/NullableInt32ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/NullableInt32ValuesImpl.java @@ -64,7 +64,7 @@ public interface NullableInt32ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/nullable-int32") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/nullable-int32") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/nullable-int32") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/NullableModelValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/NullableModelValuesImpl.java index 76b06b3e8d..1a7aa50cb1 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/NullableModelValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/NullableModelValuesImpl.java @@ -64,7 +64,7 @@ public interface NullableModelValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/nullable-model") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/nullable-model") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/nullable-model") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -176,8 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -205,7 +205,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/NullableStringValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/NullableStringValuesImpl.java index 46748cc964..14d3526cf2 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/NullableStringValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/NullableStringValuesImpl.java @@ -64,7 +64,7 @@ public interface NullableStringValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/nullable-string") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/nullable-string") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/nullable-string") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/StringValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/StringValuesImpl.java index e8d96abd38..ef7552c5d1 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/StringValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/StringValuesImpl.java @@ -64,7 +64,7 @@ public interface StringValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/string") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/string") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/string") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/UnknownValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/UnknownValuesImpl.java index 3fb3a49567..b79b8875f7 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/UnknownValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/UnknownValuesImpl.java @@ -64,7 +64,7 @@ public interface UnknownValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/unknown") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/unknown") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/unknown") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/BooleanValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/BooleanValuesImpl.java index 54dcdb8e2d..fef9ecf811 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/BooleanValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/BooleanValuesImpl.java @@ -64,7 +64,7 @@ public interface BooleanValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/boolean") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/boolean") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/boolean") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/DatetimeValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/DatetimeValuesImpl.java index ea55d7e8af..2e7fddb5c3 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/DatetimeValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/DatetimeValuesImpl.java @@ -64,7 +64,7 @@ public interface DatetimeValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/datetime") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/datetime") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/datetime") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/DurationValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/DurationValuesImpl.java index bed505de4e..112a1695e8 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/DurationValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/DurationValuesImpl.java @@ -64,7 +64,7 @@ public interface DurationValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/duration") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/duration") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/duration") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/Float32ValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/Float32ValuesImpl.java index bdf89ed2f5..aa131f6908 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/Float32ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/Float32ValuesImpl.java @@ -64,7 +64,7 @@ public interface Float32ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/float32") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/float32") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/float32") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/Int32ValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/Int32ValuesImpl.java index a4f1e9d61c..9abf4cc57e 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/Int32ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/Int32ValuesImpl.java @@ -64,7 +64,7 @@ public interface Int32ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/int32") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/int32") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/int32") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/Int64ValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/Int64ValuesImpl.java index 168df55ef0..383b89c568 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/Int64ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/Int64ValuesImpl.java @@ -64,7 +64,7 @@ public interface Int64ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/int64") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/int64") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/int64") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/ModelValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/ModelValuesImpl.java index be1e1e900c..0a2c47ac81 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/ModelValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/ModelValuesImpl.java @@ -64,7 +64,7 @@ public interface ModelValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/model") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/model") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/model") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -176,8 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -205,7 +205,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/NullableFloatValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/NullableFloatValuesImpl.java index c9de0c5e27..c280de87dc 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/NullableFloatValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/NullableFloatValuesImpl.java @@ -64,7 +64,7 @@ public interface NullableFloatValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/nullable-float") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/nullable-float") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/nullable-float") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/RecursiveModelValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/RecursiveModelValuesImpl.java index eb9cf58a84..e2cb88c8a2 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/RecursiveModelValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/RecursiveModelValuesImpl.java @@ -64,7 +64,7 @@ public interface RecursiveModelValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/model/recursive") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/model/recursive") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/model/recursive") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -176,8 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -205,7 +205,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/StringValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/StringValuesImpl.java index 84dcefbc08..f175afc089 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/StringValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/StringValuesImpl.java @@ -64,7 +64,7 @@ public interface StringValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/string") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/string") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/string") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/UnknownValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/UnknownValuesImpl.java index 7726abff65..db4156cabc 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/UnknownValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/UnknownValuesImpl.java @@ -64,7 +64,7 @@ public interface UnknownValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/unknown") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/unknown") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/unknown") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/enums/extensible/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/enums/extensible/implementation/StringOperationsImpl.java index 1bd58d59f1..cd5194e3e2 100644 --- a/typespec-tests/src/main/java/com/type/enums/extensible/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/enums/extensible/implementation/StringOperationsImpl.java @@ -64,7 +64,7 @@ public interface StringOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getKnownValue(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getKnownValue(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/enum/extensible/string/known-value") @@ -73,7 +73,7 @@ Mono> getKnownValue(@HeaderParam("Accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getKnownValueSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getKnownValueSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/enum/extensible/string/unknown-value") @@ -82,7 +82,7 @@ Response getKnownValueSync(@HeaderParam("Accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getUnknownValue(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getUnknownValue(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/enum/extensible/string/unknown-value") @@ -91,7 +91,7 @@ Mono> getUnknownValue(@HeaderParam("Accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getUnknownValueSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getUnknownValueSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/enum/extensible/string/known-value") @@ -100,7 +100,7 @@ Response getUnknownValueSync(@HeaderParam("Accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putKnownValue(@HeaderParam("Content-Type") String contentType, + Mono> putKnownValue(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/enum/extensible/string/known-value") @@ -109,7 +109,7 @@ Mono> putKnownValue(@HeaderParam("Content-Type") String contentTy @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putKnownValueSync(@HeaderParam("Content-Type") String contentType, + Response putKnownValueSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/enum/extensible/string/unknown-value") @@ -118,7 +118,7 @@ Response putKnownValueSync(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putUnknownValue(@HeaderParam("Content-Type") String contentType, + Mono> putUnknownValue(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/enum/extensible/string/unknown-value") @@ -127,7 +127,7 @@ Mono> putUnknownValue(@HeaderParam("Content-Type") String content @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putUnknownValueSync(@HeaderParam("Content-Type") String contentType, + Response putUnknownValueSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -233,8 +233,8 @@ public Response getUnknownValueWithResponse(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putKnownValueWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putKnownValue(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putKnownValue(accept, body, requestOptions, context)); } /** @@ -255,8 +255,8 @@ public Mono> putKnownValueWithResponseAsync(BinaryData body, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putKnownValueWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putKnownValueSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putKnownValueSync(accept, body, requestOptions, Context.NONE); } /** @@ -277,8 +277,8 @@ public Response putKnownValueWithResponse(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putUnknownValueWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putUnknownValue(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putUnknownValue(accept, body, requestOptions, context)); } /** @@ -299,7 +299,7 @@ public Mono> putUnknownValueWithResponseAsync(BinaryData body, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putUnknownValueWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putUnknownValueSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putUnknownValueSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/enums/fixed/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/enums/fixed/implementation/StringOperationsImpl.java index e5b90d1241..62604da0a7 100644 --- a/typespec-tests/src/main/java/com/type/enums/fixed/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/enums/fixed/implementation/StringOperationsImpl.java @@ -64,7 +64,7 @@ public interface StringOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getKnownValue(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getKnownValue(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/enum/fixed/string/known-value") @@ -73,7 +73,7 @@ Mono> getKnownValue(@HeaderParam("Accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getKnownValueSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getKnownValueSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/enum/fixed/string/known-value") @@ -82,7 +82,7 @@ Response getKnownValueSync(@HeaderParam("Accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putKnownValue(@HeaderParam("Content-Type") String contentType, + Mono> putKnownValue(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/enum/fixed/string/known-value") @@ -91,7 +91,7 @@ Mono> putKnownValue(@HeaderParam("Content-Type") String contentTy @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putKnownValueSync(@HeaderParam("Content-Type") String contentType, + Response putKnownValueSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/enum/fixed/string/unknown-value") @@ -100,7 +100,7 @@ Response putKnownValueSync(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putUnknownValue(@HeaderParam("Content-Type") String contentType, + Mono> putUnknownValue(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/enum/fixed/string/unknown-value") @@ -109,7 +109,7 @@ Mono> putUnknownValue(@HeaderParam("Content-Type") String content @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putUnknownValueSync(@HeaderParam("Content-Type") String contentType, + Response putUnknownValueSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -173,8 +173,8 @@ public Response getKnownValueWithResponse(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putKnownValueWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putKnownValue(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putKnownValue(accept, body, requestOptions, context)); } /** @@ -195,8 +195,8 @@ public Mono> putKnownValueWithResponseAsync(BinaryData body, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putKnownValueWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putKnownValueSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putKnownValueSync(accept, body, requestOptions, Context.NONE); } /** @@ -217,8 +217,8 @@ public Response putKnownValueWithResponse(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putUnknownValueWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putUnknownValue(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putUnknownValue(accept, body, requestOptions, context)); } /** @@ -239,7 +239,7 @@ public Mono> putUnknownValueWithResponseAsync(BinaryData body, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putUnknownValueWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putUnknownValueSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putUnknownValueSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/model/empty/implementation/EmptyClientImpl.java b/typespec-tests/src/main/java/com/type/model/empty/implementation/EmptyClientImpl.java index 38edf448b7..d71e6ad6dc 100644 --- a/typespec-tests/src/main/java/com/type/model/empty/implementation/EmptyClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/empty/implementation/EmptyClientImpl.java @@ -111,7 +111,7 @@ public interface EmptyClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putEmpty(@HeaderParam("Content-Type") String contentType, + Mono> putEmpty(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/empty/alone") @@ -120,7 +120,7 @@ Mono> putEmpty(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putEmptySync(@HeaderParam("Content-Type") String contentType, + Response putEmptySync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/empty/alone") @@ -129,7 +129,7 @@ Response putEmptySync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getEmpty(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getEmpty(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/empty/alone") @@ -138,7 +138,7 @@ Mono> getEmpty(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getEmptySync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getEmptySync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/model/empty/round-trip") @@ -147,9 +147,8 @@ Response getEmptySync(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> postRoundTripEmpty(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> postRoundTripEmpty(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/type/model/empty/round-trip") @ExpectedResponses({ 200 }) @@ -157,9 +156,8 @@ Mono> postRoundTripEmpty(@HeaderParam("Content-Type") Strin @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postRoundTripEmptySync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response postRoundTripEmptySync(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -180,8 +178,8 @@ Response postRoundTripEmptySync(@HeaderParam("Content-Type") String */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putEmpty(contentType, input, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putEmpty(accept, input, requestOptions, context)); } /** @@ -202,8 +200,8 @@ public Mono> putEmptyWithResponseAsync(BinaryData input, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putEmptyWithResponse(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putEmptySync(contentType, input, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putEmptySync(accept, input, requestOptions, Context.NONE); } /** @@ -275,10 +273,8 @@ public Response getEmptyWithResponse(RequestOptions requestOptions) @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postRoundTripEmptyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.postRoundTripEmpty(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.postRoundTripEmpty(accept, body, requestOptions, context)); } /** @@ -305,8 +301,7 @@ public Mono> postRoundTripEmptyWithResponseAsync(BinaryData */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postRoundTripEmptyWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.postRoundTripEmptySync(contentType, accept, body, requestOptions, Context.NONE); + return service.postRoundTripEmptySync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/model/flatten/implementation/FlattenClientImpl.java b/typespec-tests/src/main/java/com/type/model/flatten/implementation/FlattenClientImpl.java index 78c29caa76..c3eac4fd0f 100644 --- a/typespec-tests/src/main/java/com/type/model/flatten/implementation/FlattenClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/flatten/implementation/FlattenClientImpl.java @@ -109,9 +109,8 @@ public interface FlattenClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putFlattenModel(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, - RequestOptions requestOptions, Context context); + Mono> putFlattenModel(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/flatten/flattenModel") @ExpectedResponses({ 200 }) @@ -119,9 +118,8 @@ Mono> putFlattenModel(@HeaderParam("Content-Type") String c @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putFlattenModelSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, - RequestOptions requestOptions, Context context); + Response putFlattenModelSync(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/flatten/nestedFlattenModel") @ExpectedResponses({ 200 }) @@ -129,9 +127,8 @@ Response putFlattenModelSync(@HeaderParam("Content-Type") String con @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putNestedFlattenModel(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, - RequestOptions requestOptions, Context context); + Mono> putNestedFlattenModel(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/flatten/nestedFlattenModel") @ExpectedResponses({ 200 }) @@ -139,9 +136,8 @@ Mono> putNestedFlattenModel(@HeaderParam("Content-Type") St @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putNestedFlattenModelSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, - RequestOptions requestOptions, Context context); + Response putNestedFlattenModelSync(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); } /** @@ -182,10 +178,8 @@ Response putNestedFlattenModelSync(@HeaderParam("Content-Type") Stri @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putFlattenModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putFlattenModel(contentType, accept, input, requestOptions, context)); + return FluxUtil.withContext(context -> service.putFlattenModel(accept, input, requestOptions, context)); } /** @@ -224,9 +218,8 @@ public Mono> putFlattenModelWithResponseAsync(BinaryData in */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putFlattenModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.putFlattenModelSync(contentType, accept, input, requestOptions, Context.NONE); + return service.putFlattenModelSync(accept, input, requestOptions, Context.NONE); } /** @@ -273,10 +266,8 @@ public Response putFlattenModelWithResponse(BinaryData input, Reques @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNestedFlattenModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putNestedFlattenModel(contentType, accept, input, requestOptions, context)); + return FluxUtil.withContext(context -> service.putNestedFlattenModel(accept, input, requestOptions, context)); } /** @@ -321,8 +312,7 @@ public Mono> putNestedFlattenModelWithResponseAsync(BinaryD */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putNestedFlattenModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.putNestedFlattenModelSync(contentType, accept, input, requestOptions, Context.NONE); + return service.putNestedFlattenModelSync(accept, input, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorAsyncClient.java b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorAsyncClient.java index 9220524eb4..f75a57ccab 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorAsyncClient.java @@ -105,8 +105,7 @@ public Mono> putExtensibleModelWithResponse(BinaryData input, Req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test extensible enum type for discriminator along with {@link Response} on successful completion of - * {@link Mono}. + * @return a model omitting the discriminator along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -131,8 +130,8 @@ public Mono> putExtensibleModelWithResponse(BinaryData input, Req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test extensible enum type for discriminator along with {@link Response} on successful completion of - * {@link Mono}. + * @return a model containing discriminator value never defined along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -206,8 +205,7 @@ public Mono> putFixedModelWithResponse(BinaryData input, RequestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test fixed enum type for discriminator along with {@link Response} on successful completion of - * {@link Mono}. + * @return a model omitting the discriminator along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -231,8 +229,8 @@ public Mono> getFixedModelMissingDiscriminatorWithResponse( * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test fixed enum type for discriminator along with {@link Response} on successful completion of - * {@link Mono}. + * @return a model containing discriminator value never defined along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -287,7 +285,7 @@ public Mono putExtensibleModel(Dog input) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return test extensible enum type for discriminator on successful completion of {@link Mono}. + * @return a model omitting the discriminator on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -306,7 +304,7 @@ public Mono getExtensibleModelMissingDiscriminator() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return test extensible enum type for discriminator on successful completion of {@link Mono}. + * @return a model containing discriminator value never defined on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -364,7 +362,7 @@ public Mono putFixedModel(Snake input) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return test fixed enum type for discriminator on successful completion of {@link Mono}. + * @return a model omitting the discriminator on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -383,7 +381,7 @@ public Mono getFixedModelMissingDiscriminator() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return test fixed enum type for discriminator on successful completion of {@link Mono}. + * @return a model containing discriminator value never defined on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorClient.java b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorClient.java index 3ab5802713..5ab61e86e0 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorClient.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorClient.java @@ -102,7 +102,7 @@ public Response putExtensibleModelWithResponse(BinaryData input, RequestOp * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test extensible enum type for discriminator along with {@link Response}. + * @return a model omitting the discriminator along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -126,7 +126,7 @@ public Response getExtensibleModelMissingDiscriminatorWithResponse(R * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test extensible enum type for discriminator along with {@link Response}. + * @return a model containing discriminator value never defined along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -199,7 +199,7 @@ public Response putFixedModelWithResponse(BinaryData input, RequestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test fixed enum type for discriminator along with {@link Response}. + * @return a model omitting the discriminator along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -223,7 +223,7 @@ public Response getFixedModelMissingDiscriminatorWithResponse(Reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test fixed enum type for discriminator along with {@link Response}. + * @return a model containing discriminator value never defined along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -276,7 +276,7 @@ public void putExtensibleModel(Dog input) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return test extensible enum type for discriminator. + * @return a model omitting the discriminator. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -294,7 +294,7 @@ public Dog getExtensibleModelMissingDiscriminator() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return test extensible enum type for discriminator. + * @return a model containing discriminator value never defined. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -349,7 +349,7 @@ public void putFixedModel(Snake input) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return test fixed enum type for discriminator. + * @return a model omitting the discriminator. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -367,7 +367,7 @@ public Snake getFixedModelMissingDiscriminator() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return test fixed enum type for discriminator. + * @return a model containing discriminator value never defined. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/implementation/EnumDiscriminatorClientImpl.java b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/implementation/EnumDiscriminatorClientImpl.java index a7209ae879..fd4879ceef 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/implementation/EnumDiscriminatorClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/implementation/EnumDiscriminatorClientImpl.java @@ -112,7 +112,7 @@ public interface EnumDiscriminatorClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getExtensibleModel(@HeaderParam("Accept") String accept, + Mono> getExtensibleModel(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/extensible-enum") @@ -121,7 +121,7 @@ Mono> getExtensibleModel(@HeaderParam("Accept") String acce @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getExtensibleModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getExtensibleModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-discriminator/extensible-enum") @@ -130,7 +130,7 @@ Response getExtensibleModelSync(@HeaderParam("Accept") String accept @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putExtensibleModel(@HeaderParam("Content-Type") String contentType, + Mono> putExtensibleModel(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-discriminator/extensible-enum") @@ -139,7 +139,7 @@ Mono> putExtensibleModel(@HeaderParam("Content-Type") String cont @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putExtensibleModelSync(@HeaderParam("Content-Type") String contentType, + Response putExtensibleModelSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/extensible-enum/missingdiscriminator") @@ -148,7 +148,7 @@ Response putExtensibleModelSync(@HeaderParam("Content-Type") String conten @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getExtensibleModelMissingDiscriminator(@HeaderParam("Accept") String accept, + Mono> getExtensibleModelMissingDiscriminator(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/extensible-enum/missingdiscriminator") @@ -157,7 +157,7 @@ Mono> getExtensibleModelMissingDiscriminator(@HeaderParam(" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getExtensibleModelMissingDiscriminatorSync(@HeaderParam("Accept") String accept, + Response getExtensibleModelMissingDiscriminatorSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/extensible-enum/wrongdiscriminator") @@ -166,7 +166,7 @@ Response getExtensibleModelMissingDiscriminatorSync(@HeaderParam("Ac @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getExtensibleModelWrongDiscriminator(@HeaderParam("Accept") String accept, + Mono> getExtensibleModelWrongDiscriminator(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/extensible-enum/wrongdiscriminator") @@ -175,7 +175,7 @@ Mono> getExtensibleModelWrongDiscriminator(@HeaderParam("Ac @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getExtensibleModelWrongDiscriminatorSync(@HeaderParam("Accept") String accept, + Response getExtensibleModelWrongDiscriminatorSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/fixed-enum") @@ -184,7 +184,7 @@ Response getExtensibleModelWrongDiscriminatorSync(@HeaderParam("Acce @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getFixedModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getFixedModel(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/fixed-enum") @@ -193,7 +193,7 @@ Mono> getFixedModel(@HeaderParam("Accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getFixedModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getFixedModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-discriminator/fixed-enum") @@ -202,7 +202,7 @@ Response getFixedModelSync(@HeaderParam("Accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putFixedModel(@HeaderParam("Content-Type") String contentType, + Mono> putFixedModel(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-discriminator/fixed-enum") @@ -211,7 +211,7 @@ Mono> putFixedModel(@HeaderParam("Content-Type") String contentTy @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putFixedModelSync(@HeaderParam("Content-Type") String contentType, + Response putFixedModelSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/fixed-enum/missingdiscriminator") @@ -220,7 +220,7 @@ Response putFixedModelSync(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getFixedModelMissingDiscriminator(@HeaderParam("Accept") String accept, + Mono> getFixedModelMissingDiscriminator(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/fixed-enum/missingdiscriminator") @@ -229,7 +229,7 @@ Mono> getFixedModelMissingDiscriminator(@HeaderParam("Accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getFixedModelMissingDiscriminatorSync(@HeaderParam("Accept") String accept, + Response getFixedModelMissingDiscriminatorSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/fixed-enum/wrongdiscriminator") @@ -238,7 +238,7 @@ Response getFixedModelMissingDiscriminatorSync(@HeaderParam("Accept" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getFixedModelWrongDiscriminator(@HeaderParam("Accept") String accept, + Mono> getFixedModelWrongDiscriminator(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/fixed-enum/wrongdiscriminator") @@ -247,7 +247,7 @@ Mono> getFixedModelWrongDiscriminator(@HeaderParam("Accept" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getFixedModelWrongDiscriminatorSync(@HeaderParam("Accept") String accept, + Response getFixedModelWrongDiscriminatorSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } @@ -321,8 +321,8 @@ public Response getExtensibleModelWithResponse(RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putExtensibleModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putExtensibleModel(contentType, input, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putExtensibleModel(accept, input, requestOptions, context)); } /** @@ -346,8 +346,8 @@ public Mono> putExtensibleModelWithResponseAsync(BinaryData input */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putExtensibleModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putExtensibleModelSync(contentType, input, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putExtensibleModelSync(accept, input, requestOptions, Context.NONE); } /** @@ -366,8 +366,7 @@ public Response putExtensibleModelWithResponse(BinaryData input, RequestOp * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test extensible enum type for discriminator along with {@link Response} on successful completion of - * {@link Mono}. + * @return a model omitting the discriminator along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> @@ -393,7 +392,7 @@ public Response putExtensibleModelWithResponse(BinaryData input, RequestOp * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test extensible enum type for discriminator along with {@link Response}. + * @return a model omitting the discriminator along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getExtensibleModelMissingDiscriminatorWithResponse(RequestOptions requestOptions) { @@ -417,8 +416,8 @@ public Response getExtensibleModelMissingDiscriminatorWithResponse(R * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test extensible enum type for discriminator along with {@link Response} on successful completion of - * {@link Mono}. + * @return a model containing discriminator value never defined along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> @@ -444,7 +443,7 @@ public Response getExtensibleModelMissingDiscriminatorWithResponse(R * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test extensible enum type for discriminator along with {@link Response}. + * @return a model containing discriminator value never defined along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getExtensibleModelWrongDiscriminatorWithResponse(RequestOptions requestOptions) { @@ -522,8 +521,8 @@ public Response getFixedModelWithResponse(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putFixedModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putFixedModel(contentType, input, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putFixedModel(accept, input, requestOptions, context)); } /** @@ -547,8 +546,8 @@ public Mono> putFixedModelWithResponseAsync(BinaryData input, Req */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putFixedModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putFixedModelSync(contentType, input, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putFixedModelSync(accept, input, requestOptions, Context.NONE); } /** @@ -567,8 +566,7 @@ public Response putFixedModelWithResponse(BinaryData input, RequestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test fixed enum type for discriminator along with {@link Response} on successful completion of - * {@link Mono}. + * @return a model omitting the discriminator along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> @@ -594,7 +592,7 @@ public Response putFixedModelWithResponse(BinaryData input, RequestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test fixed enum type for discriminator along with {@link Response}. + * @return a model omitting the discriminator along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getFixedModelMissingDiscriminatorWithResponse(RequestOptions requestOptions) { @@ -618,8 +616,8 @@ public Response getFixedModelMissingDiscriminatorWithResponse(Reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test fixed enum type for discriminator along with {@link Response} on successful completion of - * {@link Mono}. + * @return a model containing discriminator value never defined along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getFixedModelWrongDiscriminatorWithResponseAsync(RequestOptions requestOptions) { @@ -644,7 +642,7 @@ public Mono> getFixedModelWrongDiscriminatorWithResponseAsy * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test fixed enum type for discriminator along with {@link Response}. + * @return a model containing discriminator value never defined along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getFixedModelWrongDiscriminatorWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/enumnesteddiscriminator/implementation/EnumNestedDiscriminatorClientImpl.java b/typespec-tests/src/main/java/com/type/model/inheritance/enumnesteddiscriminator/implementation/EnumNestedDiscriminatorClientImpl.java index eec907b6e9..92fe6ffd6d 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/enumnesteddiscriminator/implementation/EnumNestedDiscriminatorClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/enumnesteddiscriminator/implementation/EnumNestedDiscriminatorClientImpl.java @@ -112,7 +112,7 @@ public interface EnumNestedDiscriminatorClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getModel(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/model") @@ -121,7 +121,7 @@ Mono> getModel(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-nested-discriminator/model") @@ -130,7 +130,7 @@ Response getModelSync(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putModel(@HeaderParam("Content-Type") String contentType, + Mono> putModel(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-nested-discriminator/model") @@ -139,7 +139,7 @@ Mono> putModel(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putModelSync(@HeaderParam("Content-Type") String contentType, + Response putModelSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/recursivemodel") @@ -148,7 +148,7 @@ Response putModelSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getRecursiveModel(@HeaderParam("Accept") String accept, + Mono> getRecursiveModel(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/recursivemodel") @@ -157,7 +157,7 @@ Mono> getRecursiveModel(@HeaderParam("Accept") String accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getRecursiveModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getRecursiveModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-nested-discriminator/recursivemodel") @@ -166,7 +166,7 @@ Response getRecursiveModelSync(@HeaderParam("Accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putRecursiveModel(@HeaderParam("Content-Type") String contentType, + Mono> putRecursiveModel(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-nested-discriminator/recursivemodel") @@ -175,7 +175,7 @@ Mono> putRecursiveModel(@HeaderParam("Content-Type") String conte @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putRecursiveModelSync(@HeaderParam("Content-Type") String contentType, + Response putRecursiveModelSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/missingdiscriminator") @@ -184,7 +184,7 @@ Response putRecursiveModelSync(@HeaderParam("Content-Type") String content @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getMissingDiscriminator(@HeaderParam("Accept") String accept, + Mono> getMissingDiscriminator(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/missingdiscriminator") @@ -193,7 +193,7 @@ Mono> getMissingDiscriminator(@HeaderParam("Accept") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getMissingDiscriminatorSync(@HeaderParam("Accept") String accept, + Response getMissingDiscriminatorSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/wrongdiscriminator") @@ -202,7 +202,7 @@ Response getMissingDiscriminatorSync(@HeaderParam("Accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getWrongDiscriminator(@HeaderParam("Accept") String accept, + Mono> getWrongDiscriminator(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/wrongdiscriminator") @@ -211,7 +211,7 @@ Mono> getWrongDiscriminator(@HeaderParam("Accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getWrongDiscriminatorSync(@HeaderParam("Accept") String accept, + Response getWrongDiscriminatorSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } @@ -286,8 +286,8 @@ public Response getModelWithResponse(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putModel(contentType, input, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putModel(accept, input, requestOptions, context)); } /** @@ -311,8 +311,8 @@ public Mono> putModelWithResponseAsync(BinaryData input, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putModelSync(contentType, input, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putModelSync(accept, input, requestOptions, Context.NONE); } /** @@ -386,8 +386,8 @@ public Response getRecursiveModelWithResponse(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putRecursiveModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putRecursiveModel(contentType, input, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putRecursiveModel(accept, input, requestOptions, context)); } /** @@ -411,8 +411,8 @@ public Mono> putRecursiveModelWithResponseAsync(BinaryData input, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putRecursiveModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putRecursiveModelSync(contentType, input, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putRecursiveModelSync(accept, input, requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/nesteddiscriminator/implementation/NestedDiscriminatorClientImpl.java b/typespec-tests/src/main/java/com/type/model/inheritance/nesteddiscriminator/implementation/NestedDiscriminatorClientImpl.java index b6b85a870f..0872049d53 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/nesteddiscriminator/implementation/NestedDiscriminatorClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/nesteddiscriminator/implementation/NestedDiscriminatorClientImpl.java @@ -112,7 +112,7 @@ public interface NestedDiscriminatorClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getModel(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/model") @@ -121,7 +121,7 @@ Mono> getModel(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/nested-discriminator/model") @@ -130,7 +130,7 @@ Response getModelSync(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putModel(@HeaderParam("Content-Type") String contentType, + Mono> putModel(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/nested-discriminator/model") @@ -139,7 +139,7 @@ Mono> putModel(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putModelSync(@HeaderParam("Content-Type") String contentType, + Response putModelSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/recursivemodel") @@ -148,7 +148,7 @@ Response putModelSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getRecursiveModel(@HeaderParam("Accept") String accept, + Mono> getRecursiveModel(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/recursivemodel") @@ -157,7 +157,7 @@ Mono> getRecursiveModel(@HeaderParam("Accept") String accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getRecursiveModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getRecursiveModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/nested-discriminator/recursivemodel") @@ -166,7 +166,7 @@ Response getRecursiveModelSync(@HeaderParam("Accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putRecursiveModel(@HeaderParam("Content-Type") String contentType, + Mono> putRecursiveModel(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/nested-discriminator/recursivemodel") @@ -175,7 +175,7 @@ Mono> putRecursiveModel(@HeaderParam("Content-Type") String conte @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putRecursiveModelSync(@HeaderParam("Content-Type") String contentType, + Response putRecursiveModelSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/missingdiscriminator") @@ -184,7 +184,7 @@ Response putRecursiveModelSync(@HeaderParam("Content-Type") String content @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getMissingDiscriminator(@HeaderParam("Accept") String accept, + Mono> getMissingDiscriminator(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/missingdiscriminator") @@ -193,7 +193,7 @@ Mono> getMissingDiscriminator(@HeaderParam("Accept") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getMissingDiscriminatorSync(@HeaderParam("Accept") String accept, + Response getMissingDiscriminatorSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/wrongdiscriminator") @@ -202,7 +202,7 @@ Response getMissingDiscriminatorSync(@HeaderParam("Accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getWrongDiscriminator(@HeaderParam("Accept") String accept, + Mono> getWrongDiscriminator(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/wrongdiscriminator") @@ -211,7 +211,7 @@ Mono> getWrongDiscriminator(@HeaderParam("Accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getWrongDiscriminatorSync(@HeaderParam("Accept") String accept, + Response getWrongDiscriminatorSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } @@ -286,8 +286,8 @@ public Response getModelWithResponse(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putModel(contentType, input, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putModel(accept, input, requestOptions, context)); } /** @@ -311,8 +311,8 @@ public Mono> putModelWithResponseAsync(BinaryData input, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putModelSync(contentType, input, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putModelSync(accept, input, requestOptions, Context.NONE); } /** @@ -386,8 +386,8 @@ public Response getRecursiveModelWithResponse(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putRecursiveModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putRecursiveModel(contentType, input, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putRecursiveModel(accept, input, requestOptions, context)); } /** @@ -411,8 +411,8 @@ public Mono> putRecursiveModelWithResponseAsync(BinaryData input, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putRecursiveModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putRecursiveModelSync(contentType, input, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putRecursiveModelSync(accept, input, requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/notdiscriminated/implementation/NotDiscriminatedClientImpl.java b/typespec-tests/src/main/java/com/type/model/inheritance/notdiscriminated/implementation/NotDiscriminatedClientImpl.java index e1917b4818..95a7d97592 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/notdiscriminated/implementation/NotDiscriminatedClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/notdiscriminated/implementation/NotDiscriminatedClientImpl.java @@ -113,7 +113,7 @@ public interface NotDiscriminatedClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> postValid(@HeaderParam("Content-Type") String contentType, + Mono> postValid(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Post("/type/model/inheritance/not-discriminated/valid") @@ -122,7 +122,7 @@ Mono> postValid(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postValidSync(@HeaderParam("Content-Type") String contentType, + Response postValidSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/not-discriminated/valid") @@ -131,7 +131,7 @@ Response postValidSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getValid(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getValid(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/not-discriminated/valid") @@ -140,7 +140,7 @@ Mono> getValid(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getValidSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getValidSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/not-discriminated/valid") @@ -149,9 +149,8 @@ Response getValidSync(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putValid(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, - RequestOptions requestOptions, Context context); + Mono> putValid(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/not-discriminated/valid") @ExpectedResponses({ 200 }) @@ -159,9 +158,8 @@ Mono> putValid(@HeaderParam("Content-Type") String contentT @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putValidSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, - RequestOptions requestOptions, Context context); + Response putValidSync(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); } /** @@ -186,8 +184,8 @@ Response putValidSync(@HeaderParam("Content-Type") String contentTyp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postValidWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.postValid(contentType, input, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.postValid(accept, input, requestOptions, context)); } /** @@ -212,8 +210,8 @@ public Mono> postValidWithResponseAsync(BinaryData input, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postValidWithResponse(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.postValidSync(contentType, input, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.postValidSync(accept, input, requestOptions, Context.NONE); } /** @@ -300,9 +298,8 @@ public Response getValidWithResponse(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(contentType, accept, input, requestOptions, context)); + return FluxUtil.withContext(context -> service.putValid(accept, input, requestOptions, context)); } /** @@ -337,8 +334,7 @@ public Mono> putValidWithResponseAsync(BinaryData input, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putValidWithResponse(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.putValidSync(contentType, accept, input, requestOptions, Context.NONE); + return service.putValidSync(accept, input, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/recursive/implementation/RecursiveClientImpl.java b/typespec-tests/src/main/java/com/type/model/inheritance/recursive/implementation/RecursiveClientImpl.java index c322a2eabe..977d2a16db 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/recursive/implementation/RecursiveClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/recursive/implementation/RecursiveClientImpl.java @@ -111,8 +111,8 @@ public interface RecursiveClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/recursive") @ExpectedResponses({ 204 }) @@ -120,8 +120,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/recursive") @ExpectedResponses({ 200 }) @@ -129,7 +129,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/recursive") @@ -138,7 +138,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } @@ -165,8 +165,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, input, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, input, requestOptions, context)); } /** @@ -192,8 +192,8 @@ public Mono> putWithResponseAsync(BinaryData input, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, input, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, input, requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/singlediscriminator/implementation/SingleDiscriminatorClientImpl.java b/typespec-tests/src/main/java/com/type/model/inheritance/singlediscriminator/implementation/SingleDiscriminatorClientImpl.java index fa7e8515da..d3b10c2328 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/singlediscriminator/implementation/SingleDiscriminatorClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/singlediscriminator/implementation/SingleDiscriminatorClientImpl.java @@ -112,7 +112,7 @@ public interface SingleDiscriminatorClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getModel(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/model") @@ -121,7 +121,7 @@ Mono> getModel(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/single-discriminator/model") @@ -130,7 +130,7 @@ Response getModelSync(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putModel(@HeaderParam("Content-Type") String contentType, + Mono> putModel(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/single-discriminator/model") @@ -139,7 +139,7 @@ Mono> putModel(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putModelSync(@HeaderParam("Content-Type") String contentType, + Response putModelSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/recursivemodel") @@ -148,7 +148,7 @@ Response putModelSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getRecursiveModel(@HeaderParam("Accept") String accept, + Mono> getRecursiveModel(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/recursivemodel") @@ -157,7 +157,7 @@ Mono> getRecursiveModel(@HeaderParam("Accept") String accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getRecursiveModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getRecursiveModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/single-discriminator/recursivemodel") @@ -166,7 +166,7 @@ Response getRecursiveModelSync(@HeaderParam("Accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putRecursiveModel(@HeaderParam("Content-Type") String contentType, + Mono> putRecursiveModel(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/single-discriminator/recursivemodel") @@ -175,7 +175,7 @@ Mono> putRecursiveModel(@HeaderParam("Content-Type") String conte @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putRecursiveModelSync(@HeaderParam("Content-Type") String contentType, + Response putRecursiveModelSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/missingdiscriminator") @@ -184,7 +184,7 @@ Response putRecursiveModelSync(@HeaderParam("Content-Type") String content @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getMissingDiscriminator(@HeaderParam("Accept") String accept, + Mono> getMissingDiscriminator(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/missingdiscriminator") @@ -193,7 +193,7 @@ Mono> getMissingDiscriminator(@HeaderParam("Accept") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getMissingDiscriminatorSync(@HeaderParam("Accept") String accept, + Response getMissingDiscriminatorSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/wrongdiscriminator") @@ -202,7 +202,7 @@ Response getMissingDiscriminatorSync(@HeaderParam("Accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getWrongDiscriminator(@HeaderParam("Accept") String accept, + Mono> getWrongDiscriminator(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/wrongdiscriminator") @@ -211,7 +211,7 @@ Mono> getWrongDiscriminator(@HeaderParam("Accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getWrongDiscriminatorSync(@HeaderParam("Accept") String accept, + Response getWrongDiscriminatorSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/legacy-model") @@ -220,7 +220,7 @@ Response getWrongDiscriminatorSync(@HeaderParam("Accept") String acc @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getLegacyModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getLegacyModel(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/legacy-model") @@ -229,7 +229,7 @@ Mono> getLegacyModel(@HeaderParam("Accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getLegacyModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getLegacyModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } @@ -304,8 +304,8 @@ public Response getModelWithResponse(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putModel(contentType, input, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putModel(accept, input, requestOptions, context)); } /** @@ -329,8 +329,8 @@ public Mono> putModelWithResponseAsync(BinaryData input, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putModelSync(contentType, input, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putModelSync(accept, input, requestOptions, Context.NONE); } /** @@ -404,8 +404,8 @@ public Response getRecursiveModelWithResponse(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putRecursiveModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putRecursiveModel(contentType, input, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putRecursiveModel(accept, input, requestOptions, context)); } /** @@ -429,8 +429,8 @@ public Mono> putRecursiveModelWithResponseAsync(BinaryData input, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putRecursiveModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putRecursiveModelSync(contentType, input, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putRecursiveModelSync(accept, input, requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/type/model/usage/implementation/UsageClientImpl.java b/typespec-tests/src/main/java/com/type/model/usage/implementation/UsageClientImpl.java index 49ac156331..033a927fc0 100644 --- a/typespec-tests/src/main/java/com/type/model/usage/implementation/UsageClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/usage/implementation/UsageClientImpl.java @@ -110,7 +110,7 @@ public interface UsageClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> input(@HeaderParam("Content-Type") String contentType, + Mono> input(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Post("/type/model/usage/input") @@ -119,8 +119,8 @@ Mono> input(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response inputSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response inputSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Get("/type/model/usage/output") @ExpectedResponses({ 200 }) @@ -128,7 +128,7 @@ Response inputSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> output(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> output(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/usage/output") @@ -137,7 +137,7 @@ Mono> output(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response outputSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response outputSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/model/usage/input-output") @@ -146,9 +146,8 @@ Response outputSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> inputAndOutput(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> inputAndOutput(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/type/model/usage/input-output") @ExpectedResponses({ 200 }) @@ -156,9 +155,8 @@ Mono> inputAndOutput(@HeaderParam("Content-Type") String co @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response inputAndOutputSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response inputAndOutputSync(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -181,8 +179,8 @@ Response inputAndOutputSync(@HeaderParam("Content-Type") String cont */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> inputWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.input(contentType, input, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.input(accept, input, requestOptions, context)); } /** @@ -205,8 +203,8 @@ public Mono> inputWithResponseAsync(BinaryData input, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response inputWithResponse(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.inputSync(contentType, input, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.inputSync(accept, input, requestOptions, Context.NONE); } /** @@ -285,10 +283,8 @@ public Response outputWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> inputAndOutputWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.inputAndOutput(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.inputAndOutput(accept, body, requestOptions, context)); } /** @@ -319,8 +315,7 @@ public Mono> inputAndOutputWithResponseAsync(BinaryData bod */ @ServiceMethod(returns = ReturnType.SINGLE) public Response inputAndOutputWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.inputAndOutputSync(contentType, accept, body, requestOptions, Context.NONE); + return service.inputAndOutputSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/model/visibility/implementation/VisibilityClientImpl.java b/typespec-tests/src/main/java/com/type/model/visibility/implementation/VisibilityClientImpl.java index f611891806..9c7fb72e81 100644 --- a/typespec-tests/src/main/java/com/type/model/visibility/implementation/VisibilityClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/visibility/implementation/VisibilityClientImpl.java @@ -115,9 +115,8 @@ public interface VisibilityClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getModel(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, - RequestOptions requestOptions, Context context); + Mono> getModel(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/visibility") @ExpectedResponses({ 200 }) @@ -125,9 +124,8 @@ Mono> getModel(@HeaderParam("Content-Type") String contentT @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getModelSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, - RequestOptions requestOptions, Context context); + Response getModelSync(@HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Head("/type/model/visibility") @ExpectedResponses({ 200 }) @@ -135,7 +133,7 @@ Response getModelSync(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> headModel(@HeaderParam("Content-Type") String contentType, + Mono> headModel(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Head("/type/model/visibility") @@ -144,7 +142,7 @@ Mono> headModel(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response headModelSync(@HeaderParam("Content-Type") String contentType, + Response headModelSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/visibility") @@ -153,7 +151,7 @@ Response headModelSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putModel(@HeaderParam("Content-Type") String contentType, + Mono> putModel(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/visibility") @@ -162,7 +160,7 @@ Mono> putModel(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putModelSync(@HeaderParam("Content-Type") String contentType, + Response putModelSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Patch("/type/model/visibility") @@ -171,7 +169,7 @@ Response putModelSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> patchModel(@HeaderParam("Content-Type") String contentType, + Mono> patchModel(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Patch("/type/model/visibility") @@ -180,7 +178,7 @@ Mono> patchModel(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response patchModelSync(@HeaderParam("Content-Type") String contentType, + Response patchModelSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Post("/type/model/visibility") @@ -189,7 +187,7 @@ Response patchModelSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> postModel(@HeaderParam("Content-Type") String contentType, + Mono> postModel(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Post("/type/model/visibility") @@ -198,7 +196,7 @@ Mono> postModel(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postModelSync(@HeaderParam("Content-Type") String contentType, + Response postModelSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Delete("/type/model/visibility") @@ -207,7 +205,7 @@ Response postModelSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteModel(@HeaderParam("Content-Type") String contentType, + Mono> deleteModel(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Delete("/type/model/visibility") @@ -216,7 +214,7 @@ Mono> deleteModel(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteModelSync(@HeaderParam("Content-Type") String contentType, + Response deleteModelSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); } @@ -265,9 +263,8 @@ Response deleteModelSync(@HeaderParam("Content-Type") String contentType, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getModel(contentType, accept, input, requestOptions, context)); + return FluxUtil.withContext(context -> service.getModel(accept, input, requestOptions, context)); } /** @@ -314,9 +311,8 @@ public Mono> getModelWithResponseAsync(BinaryData input, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.getModelSync(contentType, accept, input, requestOptions, Context.NONE); + return service.getModelSync(accept, input, requestOptions, Context.NONE); } /** @@ -347,8 +343,8 @@ public Response getModelWithResponse(BinaryData input, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> headModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.headModel(contentType, input, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.headModel(accept, input, requestOptions, context)); } /** @@ -379,8 +375,8 @@ public Mono> headModelWithResponseAsync(BinaryData input, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response headModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.headModelSync(contentType, input, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.headModelSync(accept, input, requestOptions, Context.NONE); } /** @@ -411,8 +407,8 @@ public Response headModelWithResponse(BinaryData input, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putModel(contentType, input, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putModel(accept, input, requestOptions, context)); } /** @@ -443,8 +439,8 @@ public Mono> putModelWithResponseAsync(BinaryData input, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putModelSync(contentType, input, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putModelSync(accept, input, requestOptions, Context.NONE); } /** @@ -475,8 +471,8 @@ public Response putModelWithResponse(BinaryData input, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.patchModel(contentType, input, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.patchModel(accept, input, requestOptions, context)); } /** @@ -507,8 +503,8 @@ public Mono> patchModelWithResponseAsync(BinaryData input, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response patchModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.patchModelSync(contentType, input, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.patchModelSync(accept, input, requestOptions, Context.NONE); } /** @@ -539,8 +535,8 @@ public Response patchModelWithResponse(BinaryData input, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.postModel(contentType, input, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.postModel(accept, input, requestOptions, context)); } /** @@ -571,8 +567,8 @@ public Mono> postModelWithResponseAsync(BinaryData input, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.postModelSync(contentType, input, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.postModelSync(accept, input, requestOptions, Context.NONE); } /** @@ -603,8 +599,8 @@ public Response postModelWithResponse(BinaryData input, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.deleteModel(contentType, input, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteModel(accept, input, requestOptions, context)); } /** @@ -635,7 +631,7 @@ public Mono> deleteModelWithResponseAsync(BinaryData input, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.deleteModelSync(contentType, input, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.deleteModelSync(accept, input, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatAsyncClient.java index 6bb710ebf5..0a77172f15 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatAsyncClient.java @@ -57,8 +57,7 @@ public final class ExtendsDifferentSpreadFloatAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<float32> with the different known property type - * along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -102,8 +101,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from a model that spread Record<float32> with the different known property type - * on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatClient.java index bc2422ccb7..a18b3d3fc5 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatClient.java @@ -55,8 +55,7 @@ public final class ExtendsDifferentSpreadFloatClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<float32> with the different known property type - * along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from a model that spread Record<float32> with the different known property type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayAsyncClient.java index f002e61953..8e539dc46c 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayAsyncClient.java @@ -63,8 +63,7 @@ public final class ExtendsDifferentSpreadModelArrayAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<ModelForRecord[]> with the different known - * property type along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -114,8 +113,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from a model that spread Record<ModelForRecord[]> with the different known - * property type on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayClient.java index 19967ec10b..c9341fbd75 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayClient.java @@ -61,8 +61,7 @@ public final class ExtendsDifferentSpreadModelArrayClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<ModelForRecord[]> with the different known - * property type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -112,8 +111,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from a model that spread Record<ModelForRecord[]> with the different known - * property type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelAsyncClient.java index 7bd1089729..edeaef6e63 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelAsyncClient.java @@ -59,8 +59,7 @@ public final class ExtendsDifferentSpreadModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<ModelForRecord> with the different known property - * type along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -106,8 +105,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from a model that spread Record<ModelForRecord> with the different known property - * type on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelClient.java index a4de285a70..3ef771373b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelClient.java @@ -57,8 +57,7 @@ public final class ExtendsDifferentSpreadModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<ModelForRecord> with the different known property - * type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -104,8 +103,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from a model that spread Record<ModelForRecord> with the different known property - * type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringAsyncClient.java index 714c54aed9..79c7ee9f46 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringAsyncClient.java @@ -57,8 +57,7 @@ public final class ExtendsDifferentSpreadStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<string> with the different known property type - * along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -102,8 +101,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from a model that spread Record<string> with the different known property type on - * successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringClient.java index 956a1b7d23..c110a4e66e 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringClient.java @@ -55,8 +55,7 @@ public final class ExtendsDifferentSpreadStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<string> with the different known property type - * along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from a model that spread Record<string> with the different known property type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatAsyncClient.java index f730ea2bb2..165efe0962 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatAsyncClient.java @@ -56,8 +56,7 @@ public final class ExtendsFloatAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<float32> type along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from Record<float32> type on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatClient.java index 13a6671339..2344a7bcc7 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatClient.java @@ -54,7 +54,7 @@ public final class ExtendsFloatClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<float32> type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from Record<float32> type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayAsyncClient.java index 9261fc56a2..aee6c3bdfc 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayAsyncClient.java @@ -62,8 +62,7 @@ public final class ExtendsModelArrayAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<ModelForRecord[]> type along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -112,7 +111,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from Record<ModelForRecord[]> type on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayClient.java index 9fd0bb8f8c..112640784b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayClient.java @@ -60,7 +60,7 @@ public final class ExtendsModelArrayClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<ModelForRecord[]> type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -109,7 +109,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from Record<ModelForRecord[]> type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelAsyncClient.java index 93a7496c97..3e2c8a262b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelAsyncClient.java @@ -58,8 +58,7 @@ public final class ExtendsModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<ModelForRecord> type along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -104,7 +103,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from Record<ModelForRecord> type on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelClient.java index 929d4454c8..350b125c5b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelClient.java @@ -56,7 +56,7 @@ public final class ExtendsModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<ModelForRecord> type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +101,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from Record<ModelForRecord> type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringAsyncClient.java index cd7eab90a1..631556ec37 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringAsyncClient.java @@ -56,8 +56,7 @@ public final class ExtendsStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<string> type along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from Record<string> type on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringClient.java index 5b64a375ac..18ef0b0b98 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringClient.java @@ -54,7 +54,7 @@ public final class ExtendsStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<string> type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from Record<string> type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownAsyncClient.java index 17fedcb062..a3971293d0 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownAsyncClient.java @@ -56,8 +56,7 @@ public final class ExtendsUnknownAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<unknown> type along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from Record<unknown> type on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownClient.java index 7470e09e3c..d1223a9711 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownClient.java @@ -54,7 +54,7 @@ public final class ExtendsUnknownClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<unknown> type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from Record<unknown> type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedAsyncClient.java index 62eba489a9..47555089a1 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedAsyncClient.java @@ -58,8 +58,7 @@ public final class ExtendsUnknownDerivedAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a type that extends from Record<unknown> along with {@link Response} on - * successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -104,8 +103,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from a type that extends from Record<unknown> on successful completion of - * {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedClient.java index d8a5cc01c5..a711f89a99 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedClient.java @@ -56,7 +56,7 @@ public final class ExtendsUnknownDerivedClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a type that extends from Record<unknown> along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +101,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from a type that extends from Record<unknown>. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedAsyncClient.java index 226d004e8b..2996ebdb51 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedAsyncClient.java @@ -57,8 +57,7 @@ public final class ExtendsUnknownDiscriminatedAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<unknown> with a discriminator along with {@link Response} on - * successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -102,8 +101,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from Record<unknown> with a discriminator on successful completion of - * {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedClient.java index 25288a4269..8c65533253 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedClient.java @@ -55,7 +55,7 @@ public final class ExtendsUnknownDiscriminatedClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<unknown> with a discriminator along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +99,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from Record<unknown> with a discriminator. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatAsyncClient.java index e092c6732f..f0b5bec866 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatAsyncClient.java @@ -56,8 +56,7 @@ public final class IsFloatAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<float32> type along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model is from Record<float32> type on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatClient.java index 62521ba1db..59f59264a0 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatClient.java @@ -54,7 +54,7 @@ public final class IsFloatClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<float32> type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model is from Record<float32> type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayAsyncClient.java index 0f41954adf..dc5b7a138c 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayAsyncClient.java @@ -62,8 +62,7 @@ public final class IsModelArrayAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<ModelForRecord[]> type along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -112,7 +111,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model is from Record<ModelForRecord[]> type on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayClient.java index 247008401b..ed99323bec 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayClient.java @@ -60,7 +60,7 @@ public final class IsModelArrayClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<ModelForRecord[]> type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -109,7 +109,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model is from Record<ModelForRecord[]> type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelAsyncClient.java index 25e851b3ff..245ff40887 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelAsyncClient.java @@ -58,8 +58,7 @@ public final class IsModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<ModelForRecord> type along with {@link Response} on successful completion - * of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -104,7 +103,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model is from Record<ModelForRecord> type on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelClient.java index c38f983cc6..cb9bb36ef3 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelClient.java @@ -56,7 +56,7 @@ public final class IsModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<ModelForRecord> type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +101,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model is from Record<ModelForRecord> type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringAsyncClient.java index 90ba3dc461..4388e9f9a7 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringAsyncClient.java @@ -56,8 +56,7 @@ public final class IsStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<string> type along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model is from Record<string> type on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringClient.java index 5cc8e95486..54f77899d5 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringClient.java @@ -54,7 +54,7 @@ public final class IsStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<string> type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model is from Record<string> type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownAsyncClient.java index 71a28db9ec..56fb6113f7 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownAsyncClient.java @@ -56,8 +56,7 @@ public final class IsUnknownAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<unknown> type along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model is from Record<unknown> type on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownClient.java index 0990ca7125..e5fde6da37 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownClient.java @@ -54,7 +54,7 @@ public final class IsUnknownClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<unknown> type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model is from Record<unknown> type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedAsyncClient.java index 3b65a75c16..6527d2fd23 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedAsyncClient.java @@ -58,8 +58,7 @@ public final class IsUnknownDerivedAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a type that is Record<unknown> type along with {@link Response} on - * successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -104,8 +103,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from a type that is Record<unknown> type on successful completion of - * {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedClient.java index 3fd6631f2e..ff945769c1 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedClient.java @@ -56,7 +56,7 @@ public final class IsUnknownDerivedClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a type that is Record<unknown> type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +101,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from a type that is Record<unknown> type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedAsyncClient.java index 926dac37f4..33cd143e8a 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedAsyncClient.java @@ -57,8 +57,7 @@ public final class IsUnknownDiscriminatedAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is Record<unknown> with a discriminator along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -102,7 +101,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model is Record<unknown> with a discriminator on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedClient.java index 6830a100e9..8d336689cc 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedClient.java @@ -55,7 +55,7 @@ public final class IsUnknownDiscriminatedClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is Record<unknown> with a discriminator along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +99,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model is Record<unknown> with a discriminator. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadAsyncClient.java index c922f38890..4a7f13d101 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadAsyncClient.java @@ -56,8 +56,7 @@ public final class MultipleSpreadAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string> and Record<float32> along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<string> and Record<float32> on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadClient.java index 0537e3ddcf..695adb7ab4 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadClient.java @@ -54,7 +54,7 @@ public final class MultipleSpreadClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string> and Record<float32> along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<string> and Record<float32>. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatAsyncClient.java index fb314eb760..52c264e60c 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatAsyncClient.java @@ -56,8 +56,7 @@ public final class SpreadDifferentFloatAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<float32> with the different known property type along with {@link Response} - * on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,8 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<float32> with the different known property type on successful completion of - * {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatClient.java index f88fff8d92..cf800c43fe 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatClient.java @@ -54,8 +54,7 @@ public final class SpreadDifferentFloatClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<float32> with the different known property type along with - * {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -98,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<float32> with the different known property type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayAsyncClient.java index e286ae7d94..90fbf5a45e 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayAsyncClient.java @@ -60,8 +60,7 @@ public final class SpreadDifferentModelArrayAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<ModelForRecord[]> with the different known property type along with - * {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -108,8 +107,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<ModelForRecord[]> with the different known property type on successful - * completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayClient.java index cfd2094235..75c931ef47 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayClient.java @@ -58,8 +58,7 @@ public final class SpreadDifferentModelArrayClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<ModelForRecord[]> with the different known property type along with - * {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -106,7 +105,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<ModelForRecord[]> with the different known property type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelAsyncClient.java index d587b7f673..dd78d0eafa 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelAsyncClient.java @@ -58,8 +58,7 @@ public final class SpreadDifferentModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<ModelForRecord> with the different known property type along with - * {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -104,8 +103,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<ModelForRecord> with the different known property type on successful - * completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelClient.java index 3c8399d490..2de9b57e67 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelClient.java @@ -56,8 +56,7 @@ public final class SpreadDifferentModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<ModelForRecord> with the different known property type along with - * {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -102,7 +101,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<ModelForRecord> with the different known property type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringAsyncClient.java index be6d3a5fe5..9a5b404239 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringAsyncClient.java @@ -56,8 +56,7 @@ public final class SpreadDifferentStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string> with the different known property type along with {@link Response} - * on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,8 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<string> with the different known property type on successful completion of - * {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringClient.java index 19d4ba0b53..c052f4d6b2 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringClient.java @@ -54,7 +54,7 @@ public final class SpreadDifferentStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string> with the different known property type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<string> with the different known property type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatAsyncClient.java index aea11ced99..4491b1cea4 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatAsyncClient.java @@ -56,8 +56,7 @@ public final class SpreadFloatAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<float32> with the same known property type along with {@link Response} on - * successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,8 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<float32> with the same known property type on successful completion of - * {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatClient.java index d47074a53f..844165116e 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatClient.java @@ -54,7 +54,7 @@ public final class SpreadFloatClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<float32> with the same known property type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<float32> with the same known property type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayAsyncClient.java index 21c8cb7745..bfb87faa8f 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayAsyncClient.java @@ -62,7 +62,7 @@ public final class SpreadModelArrayAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -111,7 +111,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayClient.java index 5dd8466491..d869e8b9df 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayClient.java @@ -60,7 +60,7 @@ public final class SpreadModelArrayClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -109,7 +109,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelAsyncClient.java index 8ce7cdb6c7..c1250d5eec 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelAsyncClient.java @@ -58,8 +58,7 @@ public final class SpreadModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<ModelForRecord> with the same known property type along with - * {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -104,8 +103,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<ModelForRecord> with the same known property type on successful completion - * of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelClient.java index 4c46cfe548..ed489d4347 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelClient.java @@ -56,8 +56,7 @@ public final class SpreadModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<ModelForRecord> with the same known property type along with - * {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -102,7 +101,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<ModelForRecord> with the same known property type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionAsyncClient.java index 4a8f20819b..7baae2dcb8 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionAsyncClient.java @@ -56,8 +56,7 @@ public final class SpreadRecordDiscriminatedUnionAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData> along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<WidgetData> on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionClient.java index 6e397cd71a..641f7c8498 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionClient.java @@ -54,7 +54,7 @@ public final class SpreadRecordDiscriminatedUnionClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData> along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<WidgetData>. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2AsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2AsyncClient.java index 1b655db476..25d072990b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2AsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2AsyncClient.java @@ -56,8 +56,7 @@ public final class SpreadRecordNonDiscriminatedUnion2AsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData2 | WidgetData1> along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<WidgetData2 | WidgetData1> on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2Client.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2Client.java index a6a9f04145..25af9e4463 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2Client.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2Client.java @@ -54,7 +54,7 @@ public final class SpreadRecordNonDiscriminatedUnion2Client { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData2 | WidgetData1> along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<WidgetData2 | WidgetData1>. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3AsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3AsyncClient.java index 1dbabff923..067ee6ee43 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3AsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3AsyncClient.java @@ -56,8 +56,7 @@ public final class SpreadRecordNonDiscriminatedUnion3AsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData2[] | WidgetData1> along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<WidgetData2[] | WidgetData1> on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3Client.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3Client.java index 6fac9d6a5b..d14844fa24 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3Client.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3Client.java @@ -54,7 +54,7 @@ public final class SpreadRecordNonDiscriminatedUnion3Client { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData2[] | WidgetData1> along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<WidgetData2[] | WidgetData1>. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionAsyncClient.java index 77cc859c3c..637b3d680f 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionAsyncClient.java @@ -56,8 +56,7 @@ public final class SpreadRecordNonDiscriminatedUnionAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData0 | WidgetData1> along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<WidgetData0 | WidgetData1> on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionClient.java index c8012b543b..96fda8ee04 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionClient.java @@ -54,7 +54,7 @@ public final class SpreadRecordNonDiscriminatedUnionClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData0 | WidgetData1> along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<WidgetData0 | WidgetData1>. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionAsyncClient.java index 70a66e9ed6..f59998aac8 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionAsyncClient.java @@ -56,8 +56,7 @@ public final class SpreadRecordUnionAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string | float32> along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<string | float32> on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionClient.java index 5a995d9fa3..c8eaa17b0a 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionClient.java @@ -54,7 +54,7 @@ public final class SpreadRecordUnionClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string | float32> along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<string | float32>. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringAsyncClient.java index 5336b072b3..51c27dd0e2 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringAsyncClient.java @@ -56,8 +56,7 @@ public final class SpreadStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string> with the same known property type along with {@link Response} on - * successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,8 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<string> with the same known property type on successful completion of - * {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringClient.java index cfa9d95e6a..ccd1774615 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringClient.java @@ -54,7 +54,7 @@ public final class SpreadStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string> with the same known property type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<string> with the same known property type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadFloatsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadFloatsImpl.java index 946a56caa5..6fa9cb37c8 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadFloatsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadFloatsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsDifferentSpreadFloatsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsDifferentSpreadFloat") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadFloat") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadFloat") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -114,8 +114,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<float32> with the different known property type - * along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -142,8 +141,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<float32> with the different known property type - * along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -175,8 +173,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -203,7 +201,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelArraysImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelArraysImpl.java index 2224e88ced..e8609caff6 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelArraysImpl.java @@ -64,7 +64,7 @@ public interface ExtendsDifferentSpreadModelArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsDifferentSpreadModelArray") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadModelArray") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadModelArray") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -120,8 +120,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<ModelForRecord[]> with the different known - * property type along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -154,8 +153,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<ModelForRecord[]> with the different known - * property type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -193,8 +191,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -227,7 +225,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelsImpl.java index 7df490a68a..303776b348 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsDifferentSpreadModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsDifferentSpreadModel") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadModel") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadModel") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -116,8 +116,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<ModelForRecord> with the different known property - * type along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -146,8 +145,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<ModelForRecord> with the different known property - * type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -181,8 +179,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -211,7 +209,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadStringsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadStringsImpl.java index a4e516d9f8..29f8e4e6af 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadStringsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsDifferentSpreadStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsDifferentSpreadString") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadString") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadString") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -114,8 +114,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<string> with the different known property type - * along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -142,8 +141,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<string> with the different known property type - * along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -175,8 +173,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -203,7 +201,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsFloatsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsFloatsImpl.java index 8dce92e7f6..61cc2601f4 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsFloatsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsFloatsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsFloatsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsRecordFloat") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordFloat") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordFloat") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<float32> type along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<float32> type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -171,8 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -198,7 +197,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelArraysImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelArraysImpl.java index 2afe79bda0..d4037271c3 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelArraysImpl.java @@ -64,7 +64,7 @@ public interface ExtendsModelArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsRecordModelArray") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordModelArray") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordModelArray") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -119,8 +119,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<ModelForRecord[]> type along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -152,7 +151,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<ModelForRecord[]> type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -189,8 +188,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -222,7 +221,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelsImpl.java index 1c63df2d2f..954e26e129 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsRecordModel") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordModel") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordModel") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -115,8 +115,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<ModelForRecord> type along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -144,7 +143,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<ModelForRecord> type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -177,8 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -206,7 +205,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsStringsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsStringsImpl.java index e91ac0bf9f..3d3cbbade3 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsStringsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsRecordString") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordString") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordString") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<string> type along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<string> type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -171,8 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -198,7 +197,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDerivedsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDerivedsImpl.java index ad3970029c..d4a55cf5ad 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDerivedsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDerivedsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsUnknownDerivedsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsRecordUnknownDerived") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordUnknownDerived") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordUnknownDerived") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -115,8 +115,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a type that extends from Record<unknown> along with {@link Response} on - * successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -144,7 +143,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a type that extends from Record<unknown> along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -177,8 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -206,7 +205,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDiscriminatedsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDiscriminatedsImpl.java index 287ba0ef13..96798c5a1a 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDiscriminatedsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDiscriminatedsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsUnknownDiscriminatedsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsUnknownDiscriminated") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsUnknownDiscriminated") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsUnknownDiscriminated") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -114,8 +114,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<unknown> with a discriminator along with {@link Response} on - * successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -142,7 +141,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<unknown> with a discriminator along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -174,8 +173,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -202,7 +201,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownsImpl.java index 3399b10f12..c58713b6fc 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsUnknownsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsRecordUnknown") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordUnknown") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordUnknown") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<unknown> type along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<unknown> type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -171,8 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -198,7 +197,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsFloatsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsFloatsImpl.java index a9c9d63f2d..e276967a22 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsFloatsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsFloatsImpl.java @@ -63,7 +63,7 @@ public interface IsFloatsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isRecordFloat") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordFloat") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordFloat") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -112,8 +112,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<float32> type along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +138,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<float32> type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +169,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -197,7 +196,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelArraysImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelArraysImpl.java index 98824cb300..7125390719 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelArraysImpl.java @@ -64,7 +64,7 @@ public interface IsModelArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isRecordModelArray") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordModelArray") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordModelArray") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -119,8 +119,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<ModelForRecord[]> type along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -152,7 +151,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<ModelForRecord[]> type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -189,8 +188,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -222,7 +221,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelsImpl.java index f2ca76a184..774c6d7a12 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelsImpl.java @@ -63,7 +63,7 @@ public interface IsModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isRecordModel") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordModel") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordModel") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -114,8 +114,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<ModelForRecord> type along with {@link Response} on successful completion - * of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -143,7 +142,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<ModelForRecord> type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -176,8 +175,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -205,7 +204,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsStringsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsStringsImpl.java index c47ae7c73d..fb3f27c469 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsStringsImpl.java @@ -64,7 +64,7 @@ public interface IsStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isRecordstring") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordstring") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordstring") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<string> type along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<string> type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -171,8 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -198,7 +197,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDerivedsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDerivedsImpl.java index e25c66368b..bc84462e01 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDerivedsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDerivedsImpl.java @@ -64,7 +64,7 @@ public interface IsUnknownDerivedsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isRecordUnknownDerived") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordUnknownDerived") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordUnknownDerived") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -115,8 +115,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a type that is Record<unknown> type along with {@link Response} on - * successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -144,7 +143,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a type that is Record<unknown> type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -177,8 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -206,7 +205,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDiscriminatedsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDiscriminatedsImpl.java index 03c85f799c..22e4b82f69 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDiscriminatedsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDiscriminatedsImpl.java @@ -64,7 +64,7 @@ public interface IsUnknownDiscriminatedsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isUnknownDiscriminated") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isUnknownDiscriminated") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isUnknownDiscriminated") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -114,8 +114,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is Record<unknown> with a discriminator along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -142,7 +141,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is Record<unknown> with a discriminator along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -174,8 +173,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -202,7 +201,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownsImpl.java index 01f14ff39c..785aa71b46 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownsImpl.java @@ -64,7 +64,7 @@ public interface IsUnknownsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isRecordUnknown") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordUnknown") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordUnknown") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<unknown> type along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<unknown> type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -171,8 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -198,7 +197,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/MultipleSpreadsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/MultipleSpreadsImpl.java index 2d18a071fb..dbbfe181bc 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/MultipleSpreadsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/MultipleSpreadsImpl.java @@ -64,7 +64,7 @@ public interface MultipleSpreadsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/multipleSpreadRecord") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/multipleSpreadRecord") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/multipleSpreadRecord") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string> and Record<float32> along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string> and Record<float32> along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -171,8 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -198,7 +197,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentFloatsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentFloatsImpl.java index bc2e7bdc53..656068de0d 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentFloatsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentFloatsImpl.java @@ -64,7 +64,7 @@ public interface SpreadDifferentFloatsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadDifferentRecordFloat") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordFloat") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordFloat") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<float32> with the different known property type along with {@link Response} - * on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,8 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<float32> with the different known property type along with - * {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -172,8 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -199,7 +197,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelArraysImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelArraysImpl.java index fd3e7daac7..49fc1bc88b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelArraysImpl.java @@ -64,7 +64,7 @@ public interface SpreadDifferentModelArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadDifferentRecordModelArray") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordModelArray") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordModelArray") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -117,8 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<ModelForRecord[]> with the different known property type along with - * {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -148,8 +147,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<ModelForRecord[]> with the different known property type along with - * {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -184,8 +182,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -215,7 +213,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelsImpl.java index 28515b154d..26370c64d6 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelsImpl.java @@ -64,7 +64,7 @@ public interface SpreadDifferentModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadDifferentRecordModel") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordModel") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordModel") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -115,8 +115,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<ModelForRecord> with the different known property type along with - * {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -144,8 +143,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<ModelForRecord> with the different known property type along with - * {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -178,8 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -207,7 +205,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentStringsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentStringsImpl.java index 5666b47ca9..99142402ab 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentStringsImpl.java @@ -64,7 +64,7 @@ public interface SpreadDifferentStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadDifferentRecordString") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordString") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordString") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string> with the different known property type along with {@link Response} - * on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string> with the different known property type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -171,8 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -198,7 +197,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadFloatsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadFloatsImpl.java index 01300615b0..6aabfef3d0 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadFloatsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadFloatsImpl.java @@ -64,7 +64,7 @@ public interface SpreadFloatsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordFloat") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordFloat") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordFloat") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<float32> with the same known property type along with {@link Response} on - * successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<float32> with the same known property type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -171,8 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -198,7 +197,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelArraysImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelArraysImpl.java index 2fe8d8ed8a..90f5c8d51f 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelArraysImpl.java @@ -64,7 +64,7 @@ public interface SpreadModelArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordModelArray") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordModelArray") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordModelArray") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -119,7 +119,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -151,7 +151,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -188,8 +188,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -221,7 +221,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelsImpl.java index 16f2061cba..6697295534 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelsImpl.java @@ -64,7 +64,7 @@ public interface SpreadModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordModel") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordModel") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordModel") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -115,8 +115,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<ModelForRecord> with the same known property type along with - * {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -144,8 +143,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<ModelForRecord> with the same known property type along with - * {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -178,8 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -207,7 +205,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordDiscriminatedUnionsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordDiscriminatedUnionsImpl.java index 95322abccc..eb6455fc95 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordDiscriminatedUnionsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordDiscriminatedUnionsImpl.java @@ -64,7 +64,7 @@ public interface SpreadRecordDiscriminatedUnionsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordDiscriminatedUnion") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordDiscriminatedUnion") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordDiscriminatedUnion") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData> along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData> along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -171,8 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -198,7 +197,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion2sImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion2sImpl.java index eaa2c35421..f4b04508f0 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion2sImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion2sImpl.java @@ -64,7 +64,7 @@ public interface SpreadRecordNonDiscriminatedUnion2sService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion2") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion2") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion2") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData2 | WidgetData1> along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData2 | WidgetData1> along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -171,8 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -198,7 +197,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion3sImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion3sImpl.java index 80628db295..84d395ac98 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion3sImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion3sImpl.java @@ -64,7 +64,7 @@ public interface SpreadRecordNonDiscriminatedUnion3sService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion3") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion3") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion3") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData2[] | WidgetData1> along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData2[] | WidgetData1> along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -171,8 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -198,7 +197,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnionsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnionsImpl.java index 36ac49fea4..c01713dd82 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnionsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnionsImpl.java @@ -64,7 +64,7 @@ public interface SpreadRecordNonDiscriminatedUnionsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData0 | WidgetData1> along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData0 | WidgetData1> along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -171,8 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -198,7 +197,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordUnionsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordUnionsImpl.java index 2992f99561..0ec58862d2 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordUnionsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordUnionsImpl.java @@ -64,7 +64,7 @@ public interface SpreadRecordUnionsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordUnion") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordUnion") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordUnion") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string | float32> along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string | float32> along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -171,8 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -198,7 +197,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadStringsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadStringsImpl.java index 434a600f5e..71c0892436 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadStringsImpl.java @@ -64,7 +64,7 @@ public interface SpreadStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordString") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordString") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordString") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string> with the same known property type along with {@link Response} on - * successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string> with the same known property type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -171,8 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -198,7 +197,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/BytesAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/BytesAsyncClient.java index f64a4f3790..dc15c34de7 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/BytesAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/BytesAsyncClient.java @@ -55,8 +55,8 @@ public final class BytesAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -80,8 +80,8 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -147,7 +147,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with nullable property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -166,7 +166,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with nullable property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/BytesClient.java b/typespec-tests/src/main/java/com/type/property/nullable/BytesClient.java index b49fb83f3a..d8ae75cd3b 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/BytesClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/BytesClient.java @@ -53,7 +53,7 @@ public final class BytesClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -143,7 +143,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with nullable property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public BytesProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with nullable property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteAsyncClient.java index 33c181cee0..85e397e71a 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteAsyncClient.java @@ -57,8 +57,8 @@ public final class CollectionsByteAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -84,7 +84,7 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -155,7 +155,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection bytes properties on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -174,7 +174,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection bytes properties on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteClient.java b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteClient.java index f1f918e423..058ede5f10 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteClient.java @@ -55,7 +55,7 @@ public final class CollectionsByteClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -81,7 +81,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -151,7 +151,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection bytes properties. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -169,7 +169,7 @@ public CollectionsByteProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection bytes properties. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelAsyncClient.java index 9f5b5bceaa..a0aca8862f 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelAsyncClient.java @@ -59,8 +59,8 @@ public final class CollectionsModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -88,7 +88,7 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -163,7 +163,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection models properties on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -182,7 +182,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection models properties on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelClient.java b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelClient.java index 75aa3bbe2e..ce1d4f5cc9 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelClient.java @@ -57,7 +57,7 @@ public final class CollectionsModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -85,7 +85,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -159,7 +159,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection models properties. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -177,7 +177,7 @@ public CollectionsModelProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection models properties. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringAsyncClient.java index 327312e43b..a7a9cfdb5f 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringAsyncClient.java @@ -57,8 +57,8 @@ public final class CollectionsStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection string properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -84,7 +84,7 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection string properties along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -155,7 +155,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection string properties on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -174,7 +174,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection string properties on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringClient.java b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringClient.java index 9344eb47fd..3329a9e430 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringClient.java @@ -55,7 +55,7 @@ public final class CollectionsStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection string properties along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -81,7 +81,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection string properties along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -151,7 +151,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection string properties. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -169,7 +169,7 @@ public CollectionsStringProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection string properties. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationAsyncClient.java index 2c4fe80d38..ef61ca233d 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationAsyncClient.java @@ -55,7 +55,8 @@ public final class DatetimeOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -79,7 +80,8 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -145,7 +147,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a datetime property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -164,7 +166,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a datetime property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationClient.java b/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationClient.java index fe7be8ddbb..dfeb42ff6e 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationClient.java @@ -53,7 +53,7 @@ public final class DatetimeOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -143,7 +143,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a datetime property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public DatetimeProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a datetime property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationAsyncClient.java index 45db0da472..3766704382 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationAsyncClient.java @@ -55,7 +55,8 @@ public final class DurationOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -79,7 +80,8 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -145,7 +147,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a duration property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -164,7 +166,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a duration property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationClient.java b/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationClient.java index 2ba1cc33b0..e3a7cd47fb 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationClient.java @@ -53,7 +53,7 @@ public final class DurationOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -143,7 +143,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a duration property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public DurationProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a duration property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/StringOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/StringOperationAsyncClient.java index 11befcbcb2..64cc982cfb 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/StringOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/StringOperationAsyncClient.java @@ -55,8 +55,8 @@ public final class StringOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -80,8 +80,8 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -147,7 +147,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with nullable property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -166,7 +166,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with nullable property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/StringOperationClient.java b/typespec-tests/src/main/java/com/type/property/nullable/StringOperationClient.java index cde6151b68..3ec28d6f8a 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/StringOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/StringOperationClient.java @@ -53,7 +53,7 @@ public final class StringOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -143,7 +143,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with nullable property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public StringProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with nullable property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/BytesImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/BytesImpl.java index aa8586ce95..3f437a5bda 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/BytesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/BytesImpl.java @@ -63,7 +63,7 @@ public interface BytesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getNonNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/bytes/non-null") @@ -72,7 +72,7 @@ Mono> getNonNull(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getNonNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/bytes/null") @@ -81,7 +81,7 @@ Response getNonNullSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/bytes/null") @@ -90,7 +90,7 @@ Mono> getNull(@HeaderParam("Accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/bytes/non-null") @@ -100,7 +100,8 @@ Response getNullSync(@HeaderParam("Accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/bytes/non-null") @ExpectedResponses({ 204 }) @@ -109,7 +110,8 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/bytes/null") @ExpectedResponses({ 204 }) @@ -118,7 +120,8 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/bytes/null") @ExpectedResponses({ 204 }) @@ -127,7 +130,8 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -146,8 +150,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -171,7 +175,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -195,8 +199,8 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync(RequestOptions requestOptions) { @@ -220,7 +224,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { @@ -250,7 +254,9 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.patchNonNull(contentType, accept, body, requestOptions, context)); } /** @@ -275,7 +281,8 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.patchNonNullSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -300,7 +307,8 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.patchNull(contentType, accept, body, requestOptions, context)); } /** @@ -325,6 +333,7 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNullSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.patchNullSync(contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsBytesImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsBytesImpl.java index cf1dff1bd6..22e07f33ff 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsBytesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsBytesImpl.java @@ -64,7 +64,7 @@ public interface CollectionsBytesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getNonNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/bytes/non-null") @@ -73,7 +73,7 @@ Mono> getNonNull(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getNonNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/bytes/null") @@ -82,7 +82,7 @@ Response getNonNullSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/bytes/null") @@ -91,7 +91,7 @@ Mono> getNull(@HeaderParam("Accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/bytes/non-null") @@ -101,7 +101,8 @@ Response getNullSync(@HeaderParam("Accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/bytes/non-null") @ExpectedResponses({ 204 }) @@ -110,7 +111,8 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/bytes/null") @ExpectedResponses({ 204 }) @@ -119,7 +121,8 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/bytes/null") @ExpectedResponses({ 204 }) @@ -128,7 +131,8 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -149,8 +153,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -176,7 +180,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -202,7 +206,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -229,7 +233,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { @@ -261,7 +265,9 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.patchNonNull(contentType, accept, body, requestOptions, context)); } /** @@ -288,7 +294,8 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.patchNonNullSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -315,7 +322,8 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.patchNull(contentType, accept, body, requestOptions, context)); } /** @@ -342,6 +350,7 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNullSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.patchNullSync(contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsModelsImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsModelsImpl.java index 02b4152448..1e72392d36 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsModelsImpl.java @@ -64,7 +64,7 @@ public interface CollectionsModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getNonNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/model/non-null") @@ -73,7 +73,7 @@ Mono> getNonNull(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getNonNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/model/null") @@ -82,7 +82,7 @@ Response getNonNullSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/model/null") @@ -91,7 +91,7 @@ Mono> getNull(@HeaderParam("Accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/model/non-null") @@ -101,7 +101,8 @@ Response getNullSync(@HeaderParam("Accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/model/non-null") @ExpectedResponses({ 204 }) @@ -110,7 +111,8 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/model/null") @ExpectedResponses({ 204 }) @@ -119,7 +121,8 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/model/null") @ExpectedResponses({ 204 }) @@ -128,7 +131,8 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -151,8 +155,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -180,7 +184,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -208,7 +212,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -237,7 +241,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { @@ -271,7 +275,9 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.patchNonNull(contentType, accept, body, requestOptions, context)); } /** @@ -300,7 +306,8 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.patchNonNullSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -329,7 +336,8 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.patchNull(contentType, accept, body, requestOptions, context)); } /** @@ -358,6 +366,7 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNullSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.patchNullSync(contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsStringsImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsStringsImpl.java index fcc1ad2fb4..ed96a21925 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsStringsImpl.java @@ -64,7 +64,7 @@ public interface CollectionsStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getNonNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/string/non-null") @@ -73,7 +73,7 @@ Mono> getNonNull(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getNonNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/string/null") @@ -82,7 +82,7 @@ Response getNonNullSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/string/null") @@ -91,7 +91,7 @@ Mono> getNull(@HeaderParam("Accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/string/non-null") @@ -101,7 +101,8 @@ Response getNullSync(@HeaderParam("Accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/string/non-null") @ExpectedResponses({ 204 }) @@ -110,7 +111,8 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/string/null") @ExpectedResponses({ 204 }) @@ -119,7 +121,8 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/string/null") @ExpectedResponses({ 204 }) @@ -128,7 +131,8 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -149,8 +153,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection string properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -176,7 +180,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection string properties along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -202,7 +206,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection string properties along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -229,7 +233,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection string properties along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { @@ -261,7 +265,9 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.patchNonNull(contentType, accept, body, requestOptions, context)); } /** @@ -288,7 +294,8 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.patchNonNullSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -315,7 +322,8 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.patchNull(contentType, accept, body, requestOptions, context)); } /** @@ -342,6 +350,7 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNullSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.patchNullSync(contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/DatetimeOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/DatetimeOperationsImpl.java index dd878296a1..0b112670da 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/DatetimeOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/DatetimeOperationsImpl.java @@ -64,7 +64,7 @@ public interface DatetimeOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getNonNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/datetime/non-null") @@ -73,7 +73,7 @@ Mono> getNonNull(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getNonNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/datetime/null") @@ -82,7 +82,7 @@ Response getNonNullSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/datetime/null") @@ -91,7 +91,7 @@ Mono> getNull(@HeaderParam("Accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/datetime/non-null") @@ -101,7 +101,8 @@ Response getNullSync(@HeaderParam("Accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/datetime/non-null") @ExpectedResponses({ 204 }) @@ -110,7 +111,8 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/datetime/null") @ExpectedResponses({ 204 }) @@ -119,7 +121,8 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/datetime/null") @ExpectedResponses({ 204 }) @@ -128,7 +131,8 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -147,7 +151,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -171,7 +176,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -195,7 +200,8 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync(RequestOptions requestOptions) { @@ -219,7 +225,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { @@ -249,7 +255,9 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.patchNonNull(contentType, accept, body, requestOptions, context)); } /** @@ -274,7 +282,8 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.patchNonNullSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -299,7 +308,8 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.patchNull(contentType, accept, body, requestOptions, context)); } /** @@ -324,6 +334,7 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNullSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.patchNullSync(contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/DurationOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/DurationOperationsImpl.java index e75328f6e6..7c427c03ea 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/DurationOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/DurationOperationsImpl.java @@ -64,7 +64,7 @@ public interface DurationOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getNonNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/duration/non-null") @@ -73,7 +73,7 @@ Mono> getNonNull(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getNonNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/duration/null") @@ -82,7 +82,7 @@ Response getNonNullSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/duration/null") @@ -91,7 +91,7 @@ Mono> getNull(@HeaderParam("Accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/duration/non-null") @@ -101,7 +101,8 @@ Response getNullSync(@HeaderParam("Accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/duration/non-null") @ExpectedResponses({ 204 }) @@ -110,7 +111,8 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/duration/null") @ExpectedResponses({ 204 }) @@ -119,7 +121,8 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/duration/null") @ExpectedResponses({ 204 }) @@ -128,7 +131,8 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -147,7 +151,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -171,7 +176,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -195,7 +200,8 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync(RequestOptions requestOptions) { @@ -219,7 +225,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { @@ -249,7 +255,9 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.patchNonNull(contentType, accept, body, requestOptions, context)); } /** @@ -274,7 +282,8 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.patchNonNullSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -299,7 +308,8 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.patchNull(contentType, accept, body, requestOptions, context)); } /** @@ -324,6 +334,7 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNullSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.patchNullSync(contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/StringOperationsImpl.java index ec8367b3db..34b813d183 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/StringOperationsImpl.java @@ -64,7 +64,7 @@ public interface StringOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getNonNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/string/non-null") @@ -73,7 +73,7 @@ Mono> getNonNull(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getNonNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/string/null") @@ -82,7 +82,7 @@ Response getNonNullSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/string/null") @@ -91,7 +91,7 @@ Mono> getNull(@HeaderParam("Accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/string/non-null") @@ -101,7 +101,8 @@ Response getNullSync(@HeaderParam("Accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/string/non-null") @ExpectedResponses({ 204 }) @@ -110,7 +111,8 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/string/null") @ExpectedResponses({ 204 }) @@ -119,7 +121,8 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/string/null") @ExpectedResponses({ 204 }) @@ -128,7 +131,8 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -147,8 +151,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -172,7 +176,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -196,8 +200,8 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync(RequestOptions requestOptions) { @@ -221,7 +225,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { @@ -251,7 +255,9 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.patchNonNull(contentType, accept, body, requestOptions, context)); } /** @@ -276,7 +282,8 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.patchNonNullSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -301,7 +308,8 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.patchNull(contentType, accept, body, requestOptions, context)); } /** @@ -326,6 +334,7 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNullSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.patchNullSync(contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralAsyncClient.java index 8534963817..1b744de174 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralAsyncClient.java @@ -53,7 +53,8 @@ public final class BooleanLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with boolean literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -76,7 +77,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with boolean literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -140,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with boolean literal property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -159,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with boolean literal property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralClient.java index 74914b4234..aedbc41fb2 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralClient.java @@ -51,7 +51,7 @@ public final class BooleanLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with boolean literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with boolean literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with boolean literal property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public BooleanLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with boolean literal property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/BytesAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/BytesAsyncClient.java index 77463eb8d0..ff4076bdd3 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/BytesAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/BytesAsyncClient.java @@ -53,8 +53,8 @@ public final class BytesAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,8 +77,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with optional property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with optional property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/BytesClient.java b/typespec-tests/src/main/java/com/type/property/optional/BytesClient.java index 3f1d304a49..e9a0400de8 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/BytesClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/BytesClient.java @@ -51,7 +51,7 @@ public final class BytesClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with optional property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public BytesProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with optional property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteAsyncClient.java index 9e103e5ff0..82c01f6a28 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteAsyncClient.java @@ -55,8 +55,8 @@ public final class CollectionsByteAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -81,7 +81,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -150,7 +150,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection bytes properties on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -169,7 +169,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection bytes properties on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteClient.java b/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteClient.java index 4014a913d2..082eef861c 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteClient.java @@ -53,7 +53,7 @@ public final class CollectionsByteClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -78,7 +78,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -146,7 +146,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection bytes properties. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -164,7 +164,7 @@ public CollectionsByteProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection bytes properties. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelAsyncClient.java index 3d18da19c9..baf2f7a094 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelAsyncClient.java @@ -57,8 +57,8 @@ public final class CollectionsModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -85,7 +85,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -158,7 +158,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection models properties on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -177,7 +177,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection models properties on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelClient.java b/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelClient.java index e87c26318c..4a2f838215 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelClient.java @@ -55,7 +55,7 @@ public final class CollectionsModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -82,7 +82,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -154,7 +154,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection models properties. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -172,7 +172,7 @@ public CollectionsModelProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection models properties. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationAsyncClient.java index 5f9bf2a733..76b0916466 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationAsyncClient.java @@ -53,7 +53,8 @@ public final class DatetimeOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -76,7 +77,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -140,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a datetime property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -159,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a datetime property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationClient.java b/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationClient.java index 885825653d..7707ac2dd6 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationClient.java @@ -51,7 +51,7 @@ public final class DatetimeOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a datetime property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public DatetimeProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a datetime property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/DurationOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/DurationOperationAsyncClient.java index f4fd693b7e..2e0543ca46 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/DurationOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/DurationOperationAsyncClient.java @@ -53,7 +53,8 @@ public final class DurationOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -76,7 +77,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -140,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a duration property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -159,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a duration property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/DurationOperationClient.java b/typespec-tests/src/main/java/com/type/property/optional/DurationOperationClient.java index efd15214f2..276c91e42c 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/DurationOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/DurationOperationClient.java @@ -51,7 +51,7 @@ public final class DurationOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a duration property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public DurationProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a duration property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralAsyncClient.java index 61d6a2a257..a2a5e7e831 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralAsyncClient.java @@ -53,7 +53,8 @@ public final class FloatLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with float literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -76,7 +77,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with float literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -140,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with float literal property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -159,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with float literal property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralClient.java index 4233398ad7..55497ed2ce 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralClient.java @@ -51,7 +51,7 @@ public final class FloatLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with float literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with float literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with float literal property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public FloatLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with float literal property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/IntLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/IntLiteralAsyncClient.java index 3873765e2f..9054c2ff21 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/IntLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/IntLiteralAsyncClient.java @@ -53,7 +53,8 @@ public final class IntLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with int literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -76,7 +77,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with int literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -140,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with int literal property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -159,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with int literal property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/IntLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/IntLiteralClient.java index cb552f3f0d..9df5a7c453 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/IntLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/IntLiteralClient.java @@ -51,7 +51,7 @@ public final class IntLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with int literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with int literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with int literal property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public IntLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with int literal property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalAsyncClient.java index 5fee690f7d..9f9d8c40f4 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalAsyncClient.java @@ -54,8 +54,8 @@ public final class RequiredAndOptionalAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with required and optional properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -79,8 +79,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with required and optional properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return only the required properties along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -146,7 +146,7 @@ public Mono> putRequiredOnlyWithResponse(BinaryData body, Request * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with required and optional properties on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -165,7 +165,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with required and optional properties on successful completion of {@link Mono}. + * @return models that will return only the required properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalClient.java b/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalClient.java index 50a64367b6..f617bed9c6 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalClient.java @@ -52,7 +52,7 @@ public final class RequiredAndOptionalClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with required and optional properties along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -76,7 +76,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with required and optional properties along with {@link Response}. + * @return models that will return only the required properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +142,7 @@ public Response putRequiredOnlyWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with required and optional properties. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -160,7 +160,7 @@ public RequiredAndOptionalProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with required and optional properties. + * @return models that will return only the required properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/StringLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/StringLiteralAsyncClient.java index 2c08498887..8738ca2114 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/StringLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/StringLiteralAsyncClient.java @@ -53,7 +53,8 @@ public final class StringLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with string literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -76,7 +77,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with string literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -140,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with string literal property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -159,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with string literal property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/StringLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/StringLiteralClient.java index 20eed2ab15..9d9edb2a08 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/StringLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/StringLiteralClient.java @@ -51,7 +51,7 @@ public final class StringLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with string literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with string literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with string literal property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public StringLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with string literal property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/StringOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/StringOperationAsyncClient.java index 83834191d0..ccb6ab14d8 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/StringOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/StringOperationAsyncClient.java @@ -53,8 +53,8 @@ public final class StringOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,8 +77,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with optional property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with optional property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/StringOperationClient.java b/typespec-tests/src/main/java/com/type/property/optional/StringOperationClient.java index a7bdf1b616..f5a89b6b7c 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/StringOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/StringOperationClient.java @@ -51,7 +51,7 @@ public final class StringOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with optional property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public StringProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with optional property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralAsyncClient.java index 62f49dcf5b..c1a677f4f3 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralAsyncClient.java @@ -53,8 +53,8 @@ public final class UnionFloatLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of float literal property along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of float literal property along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -142,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with union of float literal property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with union of float literal property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralClient.java index 20952bd2d5..d73101ed7b 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralClient.java @@ -51,7 +51,7 @@ public final class UnionFloatLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of float literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of float literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with union of float literal property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public UnionFloatLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with union of float literal property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralAsyncClient.java index f64106a9af..0d026ff1c4 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralAsyncClient.java @@ -53,8 +53,8 @@ public final class UnionIntLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of int literal property along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of int literal property along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -142,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with union of int literal property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with union of int literal property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralClient.java index 41c429f898..0e32a129ab 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralClient.java @@ -51,7 +51,7 @@ public final class UnionIntLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of int literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of int literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with union of int literal property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public UnionIntLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with union of int literal property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralAsyncClient.java index 743b330b69..34e9fd00fa 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralAsyncClient.java @@ -53,8 +53,8 @@ public final class UnionStringLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of string literal property along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of string literal property along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -142,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with union of string literal property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with union of string literal property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralClient.java index 21f0905b88..c2965da697 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralClient.java @@ -51,7 +51,7 @@ public final class UnionStringLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of string literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of string literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with union of string literal property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public UnionStringLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with union of string literal property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/BooleanLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/BooleanLiteralsImpl.java index 143140fb62..e72269c7a3 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/BooleanLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/BooleanLiteralsImpl.java @@ -64,7 +64,7 @@ public interface BooleanLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/boolean/literal/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/boolean/literal/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/boolean/literal/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/boolean/literal/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, + Mono> putAll(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/boolean/literal/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/boolean/literal/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, + Mono> putDefault(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/boolean/literal/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, + Response putDefaultSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,7 +146,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with boolean literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -169,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with boolean literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -192,7 +193,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with boolean literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -215,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with boolean literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -243,8 +245,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); } /** @@ -267,8 +269,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putAllSync(accept, body, requestOptions, Context.NONE); } /** @@ -291,8 +293,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); } /** @@ -315,7 +317,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putDefaultSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/BytesImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/BytesImpl.java index 313b3ebeca..7cfd63358e 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/BytesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/BytesImpl.java @@ -63,7 +63,7 @@ public interface BytesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/bytes/all") @@ -72,7 +72,7 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/bytes/default") @@ -81,7 +81,7 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/bytes/default") @@ -90,7 +90,7 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/bytes/all") @@ -99,7 +99,7 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, + Mono> putAll(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/bytes/all") @@ -108,8 +108,8 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/bytes/default") @ExpectedResponses({ 204 }) @@ -117,7 +117,7 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, + Mono> putDefault(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/bytes/default") @@ -126,7 +126,7 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, + Response putDefaultSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -145,8 +145,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -169,7 +169,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -192,8 +192,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -216,7 +216,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -244,8 +244,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); } /** @@ -268,8 +268,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putAllSync(accept, body, requestOptions, Context.NONE); } /** @@ -292,8 +292,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); } /** @@ -316,7 +316,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putDefaultSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsBytesImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsBytesImpl.java index f91daebff6..2e9533b065 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsBytesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsBytesImpl.java @@ -64,7 +64,7 @@ public interface CollectionsBytesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/collections/bytes/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/collections/bytes/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/collections/bytes/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/bytes/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, + Mono> putAll(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/bytes/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/bytes/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, + Mono> putDefault(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/bytes/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, + Response putDefaultSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -148,8 +148,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -174,7 +174,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -199,7 +199,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -225,7 +225,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -255,8 +255,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); } /** @@ -281,8 +281,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putAllSync(accept, body, requestOptions, Context.NONE); } /** @@ -307,8 +307,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); } /** @@ -333,7 +333,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putDefaultSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsModelsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsModelsImpl.java index 5ed7dfb397..d85f5175ea 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsModelsImpl.java @@ -64,7 +64,7 @@ public interface CollectionsModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/collections/model/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/collections/model/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/collections/model/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/model/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, + Mono> putAll(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/model/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/model/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, + Mono> putDefault(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/model/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, + Response putDefaultSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -150,8 +150,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -178,7 +178,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -205,7 +205,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -233,7 +233,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -265,8 +265,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); } /** @@ -293,8 +293,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putAllSync(accept, body, requestOptions, Context.NONE); } /** @@ -321,8 +321,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); } /** @@ -349,7 +349,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putDefaultSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/DatetimeOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/DatetimeOperationsImpl.java index 17e8959364..320cafafdf 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/DatetimeOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/DatetimeOperationsImpl.java @@ -64,7 +64,7 @@ public interface DatetimeOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/datetime/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/datetime/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/datetime/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/datetime/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, + Mono> putAll(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/datetime/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/datetime/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, + Mono> putDefault(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/datetime/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, + Response putDefaultSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,7 +146,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -169,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -192,7 +193,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -215,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -243,8 +245,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); } /** @@ -267,8 +269,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putAllSync(accept, body, requestOptions, Context.NONE); } /** @@ -291,8 +293,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); } /** @@ -315,7 +317,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putDefaultSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/DurationOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/DurationOperationsImpl.java index 8442600b73..226ab461ae 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/DurationOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/DurationOperationsImpl.java @@ -64,7 +64,7 @@ public interface DurationOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/duration/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/duration/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/duration/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/duration/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, + Mono> putAll(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/duration/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/duration/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, + Mono> putDefault(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/duration/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, + Response putDefaultSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,7 +146,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -169,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -192,7 +193,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -215,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -243,8 +245,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); } /** @@ -267,8 +269,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putAllSync(accept, body, requestOptions, Context.NONE); } /** @@ -291,8 +293,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); } /** @@ -315,7 +317,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putDefaultSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/FloatLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/FloatLiteralsImpl.java index cf21e52173..0a8453db4e 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/FloatLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/FloatLiteralsImpl.java @@ -64,7 +64,7 @@ public interface FloatLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/float/literal/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/float/literal/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/float/literal/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/float/literal/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, + Mono> putAll(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/float/literal/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/float/literal/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, + Mono> putDefault(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/float/literal/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, + Response putDefaultSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,7 +146,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with float literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -169,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with float literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -192,7 +193,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with float literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -215,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with float literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -243,8 +245,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); } /** @@ -267,8 +269,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putAllSync(accept, body, requestOptions, Context.NONE); } /** @@ -291,8 +293,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); } /** @@ -315,7 +317,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putDefaultSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/IntLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/IntLiteralsImpl.java index 806ab7b2db..8597087a7e 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/IntLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/IntLiteralsImpl.java @@ -64,7 +64,7 @@ public interface IntLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/int/literal/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/int/literal/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/int/literal/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/int/literal/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, + Mono> putAll(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/int/literal/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/int/literal/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, + Mono> putDefault(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/int/literal/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, + Response putDefaultSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,7 +146,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with int literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -169,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with int literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -192,7 +193,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with int literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -215,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with int literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -243,8 +245,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); } /** @@ -267,8 +269,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putAllSync(accept, body, requestOptions, Context.NONE); } /** @@ -291,8 +293,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); } /** @@ -315,7 +317,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putDefaultSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/RequiredAndOptionalsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/RequiredAndOptionalsImpl.java index f52f9ee63f..4e41231942 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/RequiredAndOptionalsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/RequiredAndOptionalsImpl.java @@ -64,7 +64,7 @@ public interface RequiredAndOptionalsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/requiredAndOptional/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/requiredAndOptional/requiredOnly") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getRequiredOnly(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getRequiredOnly(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/requiredAndOptional/requiredOnly") @@ -91,7 +91,7 @@ Mono> getRequiredOnly(@HeaderParam("Accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getRequiredOnlySync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getRequiredOnlySync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/requiredAndOptional/all") @@ -100,7 +100,7 @@ Response getRequiredOnlySync(@HeaderParam("Accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, + Mono> putAll(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/requiredAndOptional/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/requiredAndOptional/requiredOnly") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putRequiredOnly(@HeaderParam("Content-Type") String contentType, + Mono> putRequiredOnly(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/requiredAndOptional/requiredOnly") @@ -127,7 +127,7 @@ Mono> putRequiredOnly(@HeaderParam("Content-Type") String content @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putRequiredOnlySync(@HeaderParam("Content-Type") String contentType, + Response putRequiredOnlySync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -147,8 +147,8 @@ Response putRequiredOnlySync(@HeaderParam("Content-Type") String contentTy * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with required and optional properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -172,7 +172,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with required and optional properties along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -196,8 +196,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with required and optional properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return only the required properties along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getRequiredOnlyWithResponseAsync(RequestOptions requestOptions) { @@ -221,7 +221,7 @@ public Mono> getRequiredOnlyWithResponseAsync(RequestOption * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with required and optional properties along with {@link Response}. + * @return models that will return only the required properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getRequiredOnlyWithResponse(RequestOptions requestOptions) { @@ -250,8 +250,8 @@ public Response getRequiredOnlyWithResponse(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); } /** @@ -275,8 +275,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putAllSync(accept, body, requestOptions, Context.NONE); } /** @@ -300,8 +300,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putRequiredOnlyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putRequiredOnly(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putRequiredOnly(accept, body, requestOptions, context)); } /** @@ -325,7 +325,7 @@ public Mono> putRequiredOnlyWithResponseAsync(BinaryData body, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putRequiredOnlyWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putRequiredOnlySync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putRequiredOnlySync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/StringLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/StringLiteralsImpl.java index ec3e600a90..7dbf99b700 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/StringLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/StringLiteralsImpl.java @@ -64,7 +64,7 @@ public interface StringLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/string/literal/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/string/literal/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/string/literal/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/literal/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, + Mono> putAll(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/literal/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/literal/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, + Mono> putDefault(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/literal/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, + Response putDefaultSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,7 +146,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with string literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -169,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with string literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -192,7 +193,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with string literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -215,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with string literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -243,8 +245,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); } /** @@ -267,8 +269,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putAllSync(accept, body, requestOptions, Context.NONE); } /** @@ -291,8 +293,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); } /** @@ -315,7 +317,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putDefaultSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/StringOperationsImpl.java index 7bacd8c514..77f6591e40 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/StringOperationsImpl.java @@ -64,7 +64,7 @@ public interface StringOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/string/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/string/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/string/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, + Mono> putAll(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, + Mono> putDefault(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, + Response putDefaultSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,8 +193,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -217,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +245,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); } /** @@ -269,8 +269,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putAllSync(accept, body, requestOptions, Context.NONE); } /** @@ -293,8 +293,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); } /** @@ -317,7 +317,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putDefaultSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionFloatLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionFloatLiteralsImpl.java index f379ffee75..4decf810ac 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionFloatLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionFloatLiteralsImpl.java @@ -64,7 +64,7 @@ public interface UnionFloatLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/float/literal/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/float/literal/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/float/literal/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/float/literal/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, + Mono> putAll(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/float/literal/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/float/literal/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, + Mono> putDefault(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/float/literal/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, + Response putDefaultSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of float literal property along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of float literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,7 +193,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of float literal property along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -217,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of float literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +245,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); } /** @@ -269,8 +269,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putAllSync(accept, body, requestOptions, Context.NONE); } /** @@ -293,8 +293,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); } /** @@ -317,7 +317,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putDefaultSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionIntLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionIntLiteralsImpl.java index 1c00e0d2de..791550d174 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionIntLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionIntLiteralsImpl.java @@ -64,7 +64,7 @@ public interface UnionIntLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/int/literal/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/int/literal/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/int/literal/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/int/literal/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, + Mono> putAll(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/int/literal/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/int/literal/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, + Mono> putDefault(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/int/literal/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, + Response putDefaultSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of int literal property along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of int literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,7 +193,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of int literal property along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -217,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of int literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +245,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); } /** @@ -269,8 +269,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putAllSync(accept, body, requestOptions, Context.NONE); } /** @@ -293,8 +293,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); } /** @@ -317,7 +317,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putDefaultSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionStringLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionStringLiteralsImpl.java index 720046c77e..08636166f8 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionStringLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionStringLiteralsImpl.java @@ -64,7 +64,7 @@ public interface UnionStringLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/string/literal/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/string/literal/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/string/literal/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/string/literal/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, + Mono> putAll(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/string/literal/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/string/literal/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, + Mono> putDefault(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/string/literal/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, + Response putDefaultSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of string literal property along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of string literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,7 +193,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of string literal property along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -217,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of string literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +245,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); } /** @@ -269,8 +269,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putAllSync(accept, body, requestOptions, Context.NONE); } /** @@ -293,8 +293,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); } /** @@ -317,7 +317,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putDefaultSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralAsyncClient.java index 7ea1a5c8a1..b6af04d1cb 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralAsyncClient.java @@ -53,8 +53,7 @@ public final class BooleanLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a boolean literal property along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -94,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a boolean literal property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralClient.java index b53578427c..6b0a528a29 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralClient.java @@ -51,7 +51,7 @@ public final class BooleanLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a boolean literal property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a boolean literal property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationAsyncClient.java index 54561c7fd1..ab3775f865 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationAsyncClient.java @@ -53,7 +53,7 @@ public final class BooleanOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a boolean property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a boolean property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationClient.java index ecc3bc534a..d4e7f5dd02 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationClient.java @@ -51,7 +51,7 @@ public final class BooleanOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a boolean property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a boolean property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/BytesAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/BytesAsyncClient.java index 86659fd345..dd79a17a7b 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/BytesAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/BytesAsyncClient.java @@ -53,7 +53,7 @@ public final class BytesAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a bytes property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a bytes property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/BytesClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/BytesClient.java index 7cab3afc83..d3615f65a8 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/BytesClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/BytesClient.java @@ -51,7 +51,7 @@ public final class BytesClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a bytes property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a bytes property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntAsyncClient.java index 3dec4784d4..2828e55a22 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntAsyncClient.java @@ -55,8 +55,7 @@ public final class CollectionsIntAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection int properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -98,7 +97,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection int properties on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntClient.java index 1bed50f153..0d3b0442ec 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntClient.java @@ -53,7 +53,7 @@ public final class CollectionsIntClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection int properties along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -95,7 +95,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection int properties. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelAsyncClient.java index a7da97ea3a..b193658be3 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelAsyncClient.java @@ -57,8 +57,7 @@ public final class CollectionsModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection model properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -102,7 +101,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection model properties on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelClient.java index a986c997f8..5ba3a996dc 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelClient.java @@ -55,7 +55,7 @@ public final class CollectionsModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection model properties along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +99,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection model properties. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringAsyncClient.java index a9d54433db..c4d33d5d27 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringAsyncClient.java @@ -55,8 +55,7 @@ public final class CollectionsStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection string properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -98,7 +97,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection string properties on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringClient.java index 4a487152c9..18405b33ee 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringClient.java @@ -53,7 +53,7 @@ public final class CollectionsStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection string properties along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -95,7 +95,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection string properties. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationAsyncClient.java index 1f8bfa429b..421c87f118 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationAsyncClient.java @@ -53,7 +53,7 @@ public final class DatetimeOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a datetime property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationClient.java index 277b42911d..4c2c29ea5e 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationClient.java @@ -51,7 +51,7 @@ public final class DatetimeOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a datetime property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128AsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128AsyncClient.java index 94daa62ddb..bbb25640c2 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128AsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128AsyncClient.java @@ -53,7 +53,7 @@ public final class Decimal128AsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a decimal128 property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a decimal128 property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128Client.java b/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128Client.java index 0ac47c1ded..6b2e7e0b79 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128Client.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128Client.java @@ -51,7 +51,7 @@ public final class Decimal128Client { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a decimal128 property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a decimal128 property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalAsyncClient.java index f253962734..10495283a2 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalAsyncClient.java @@ -53,7 +53,7 @@ public final class DecimalAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a decimal property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a decimal property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalClient.java index e4aa41eeb3..f3f2223231 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalClient.java @@ -51,7 +51,7 @@ public final class DecimalClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a decimal property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a decimal property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringAsyncClient.java index 5a6e624202..b776f2e001 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringAsyncClient.java @@ -55,8 +55,7 @@ public final class DictionaryStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with dictionary string properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -98,7 +97,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with dictionary string properties on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringClient.java index 7f2e2591bf..0b7e9ca739 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringClient.java @@ -53,7 +53,7 @@ public final class DictionaryStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with dictionary string properties along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -95,7 +95,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with dictionary string properties. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationAsyncClient.java index 24c091cfe9..bf23710596 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationAsyncClient.java @@ -53,7 +53,7 @@ public final class DurationOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a duration property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationClient.java index e8fa93f4a6..f8452ab301 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationClient.java @@ -51,7 +51,7 @@ public final class DurationOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a duration property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/EnumAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/EnumAsyncClient.java index 46fc873bd9..6c8d1e4a54 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/EnumAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/EnumAsyncClient.java @@ -53,7 +53,7 @@ public final class EnumAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with enum properties along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with enum properties on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/EnumClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/EnumClient.java index a78d401355..a80ef76bef 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/EnumClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/EnumClient.java @@ -51,7 +51,7 @@ public final class EnumClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with enum properties along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with enum properties. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumAsyncClient.java index ba6d0b4e22..f7dec5b955 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumAsyncClient.java @@ -53,8 +53,7 @@ public final class ExtensibleEnumAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with extensible enum properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -94,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with extensible enum properties on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumClient.java index 01f24dea69..d5085c2041 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumClient.java @@ -51,7 +51,7 @@ public final class ExtensibleEnumClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with extensible enum properties along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with extensible enum properties. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralAsyncClient.java index a12cb1ed4d..8079183e5b 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralAsyncClient.java @@ -53,7 +53,7 @@ public final class FloatLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a float literal property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a float literal property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralClient.java index e907cf285d..2ff74c5840 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralClient.java @@ -51,7 +51,7 @@ public final class FloatLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a float literal property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a float literal property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationAsyncClient.java index 41b46e42ac..a2ce50e823 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationAsyncClient.java @@ -53,7 +53,7 @@ public final class FloatOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a float property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a float property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationClient.java index 09e4aae6e0..fb2acae468 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationClient.java @@ -51,7 +51,7 @@ public final class FloatOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a float property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a float property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/IntAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/IntAsyncClient.java index 4c2a143444..58bfa7d20b 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/IntAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/IntAsyncClient.java @@ -53,7 +53,7 @@ public final class IntAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a int property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a int property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/IntClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/IntClient.java index 7f48765be2..5af2cc2da9 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/IntClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/IntClient.java @@ -51,7 +51,7 @@ public final class IntClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a int property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a int property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralAsyncClient.java index b1f73f525a..5e47bc9325 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralAsyncClient.java @@ -53,7 +53,7 @@ public final class IntLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a int literal property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a int literal property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralClient.java index 5b62bfb073..60d67a57bf 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralClient.java @@ -51,7 +51,7 @@ public final class IntLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a int literal property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a int literal property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/ModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/ModelAsyncClient.java index 1f3d71a101..c75310c16e 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/ModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/ModelAsyncClient.java @@ -55,7 +55,7 @@ public final class ModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with model properties along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with model properties on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/ModelClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/ModelClient.java index 33482c584f..9e9cba4588 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/ModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/ModelClient.java @@ -53,7 +53,7 @@ public final class ModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with model properties along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -95,7 +95,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with model properties. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/NeverAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/NeverAsyncClient.java index f2d32f8de0..a2dfced927 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/NeverAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/NeverAsyncClient.java @@ -51,7 +51,7 @@ public final class NeverAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property never along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -89,7 +89,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a property never on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/NeverClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/NeverClient.java index f10cb31915..27bb34204f 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/NeverClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/NeverClient.java @@ -49,7 +49,7 @@ public final class NeverClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property never along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -87,7 +87,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a property never. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralAsyncClient.java index c1c31f6ace..89e6d85cc4 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralAsyncClient.java @@ -53,8 +53,7 @@ public final class StringLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a string literal property along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -94,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a string literal property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralClient.java index b8a866bf31..6e7d29ce62 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralClient.java @@ -51,7 +51,7 @@ public final class StringLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a string literal property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a string literal property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationAsyncClient.java index 7bfda94e60..f1208deeb2 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationAsyncClient.java @@ -53,7 +53,7 @@ public final class StringOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a string property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a string property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationClient.java index 973bd04706..a11dfddc54 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationClient.java @@ -51,7 +51,7 @@ public final class StringOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a string property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a string property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueAsyncClient.java index d1d37dc0e3..52d1903389 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueAsyncClient.java @@ -53,8 +53,7 @@ public final class UnionEnumValueAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with specific properties along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -94,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with specific properties on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueClient.java index 4359412b99..a1503da5fc 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueClient.java @@ -51,7 +51,7 @@ public final class UnionEnumValueClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with specific properties along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with specific properties. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralAsyncClient.java index fafbea83e6..160e23a08e 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralAsyncClient.java @@ -53,8 +53,7 @@ public final class UnionFloatLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a union of float literal as property along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -94,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a union of float literal as property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralClient.java index bf3e7c9f76..5ce4c1c405 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralClient.java @@ -51,7 +51,7 @@ public final class UnionFloatLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a union of float literal as property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a union of float literal as property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralAsyncClient.java index 44058432f4..4855784b53 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralAsyncClient.java @@ -53,8 +53,7 @@ public final class UnionIntLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a union of int literal as property along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -94,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a union of int literal as property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralClient.java index bcd8faac8d..d570a5aa5e 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralClient.java @@ -51,7 +51,7 @@ public final class UnionIntLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a union of int literal as property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a union of int literal as property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralAsyncClient.java index d2536e8fd3..e64dcb9244 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralAsyncClient.java @@ -53,8 +53,7 @@ public final class UnionStringLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a union of string literal as property along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -94,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a union of string literal as property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralClient.java index f866ff1935..933d39b0bd 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralClient.java @@ -51,7 +51,7 @@ public final class UnionStringLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a union of string literal as property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a union of string literal as property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayAsyncClient.java index 81777dc7a3..770b3d5ee5 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayAsyncClient.java @@ -53,8 +53,7 @@ public final class UnknownArrayAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is an array along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -94,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a property unknown, and the data is an array on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayClient.java index ffea6edef3..a085998120 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayClient.java @@ -51,7 +51,7 @@ public final class UnknownArrayClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is an array along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a property unknown, and the data is an array. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictAsyncClient.java index 33aa735c73..9460b676df 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictAsyncClient.java @@ -53,8 +53,7 @@ public final class UnknownDictAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is a dictionnary along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -94,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a property unknown, and the data is a dictionnary on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictClient.java index 9bd638e063..754d29a11e 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictClient.java @@ -51,7 +51,7 @@ public final class UnknownDictClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is a dictionnary along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a property unknown, and the data is a dictionnary. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntAsyncClient.java index 9188e43b98..6dab5dae36 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntAsyncClient.java @@ -53,8 +53,7 @@ public final class UnknownIntAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is a int32 along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -94,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a property unknown, and the data is a int32 on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntClient.java index fbfec46200..1e8e38cbd0 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntClient.java @@ -51,7 +51,7 @@ public final class UnknownIntClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is a int32 along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a property unknown, and the data is a int32. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringAsyncClient.java index bde5f700b1..e8a87af736 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringAsyncClient.java @@ -53,8 +53,7 @@ public final class UnknownStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is a string along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -94,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a property unknown, and the data is a string on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringClient.java index 9e3cdf893d..f4f9faf52f 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringClient.java @@ -51,7 +51,7 @@ public final class UnknownStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is a string along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a property unknown, and the data is a string. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanLiteralsImpl.java index cee9d8137b..f044a6712f 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanLiteralsImpl.java @@ -64,7 +64,7 @@ public interface BooleanLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/boolean/literal") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/boolean/literal") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/boolean/literal") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -110,8 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a boolean literal property along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -134,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a boolean literal property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -162,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -186,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanOperationsImpl.java index 0ce856b063..7bc544aa60 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanOperationsImpl.java @@ -64,7 +64,7 @@ public interface BooleanOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/boolean") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/boolean") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/boolean") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a boolean property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a boolean property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BytesImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BytesImpl.java index b353b6ca1f..97617c9762 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BytesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BytesImpl.java @@ -63,7 +63,7 @@ public interface BytesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/bytes") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/bytes") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/bytes") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -109,7 +109,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a bytes property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -132,7 +132,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a bytes property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -160,8 +160,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -184,7 +184,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsIntsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsIntsImpl.java index 71d5e18e86..8b66c952ac 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsIntsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsIntsImpl.java @@ -64,7 +64,7 @@ public interface CollectionsIntsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/collections/int") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/collections/int") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/collections/int") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -112,8 +112,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection int properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -138,7 +137,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection int properties along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -168,8 +167,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -194,7 +193,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsModelsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsModelsImpl.java index be7b84a2e9..a37cc3bed6 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsModelsImpl.java @@ -64,7 +64,7 @@ public interface CollectionsModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/collections/model") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/collections/model") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/collections/model") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -114,8 +114,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection model properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -142,7 +141,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection model properties along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -174,8 +173,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -202,7 +201,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsStringsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsStringsImpl.java index 64e85967d3..a762c83dd6 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsStringsImpl.java @@ -64,7 +64,7 @@ public interface CollectionsStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/collections/string") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/collections/string") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/collections/string") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -112,8 +112,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection string properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -138,7 +137,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection string properties along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -168,8 +167,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -194,7 +193,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DatetimeOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DatetimeOperationsImpl.java index 79029e9a84..d8e9cd6481 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DatetimeOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DatetimeOperationsImpl.java @@ -64,7 +64,7 @@ public interface DatetimeOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/datetime") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/datetime") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/datetime") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/Decimal128sImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/Decimal128sImpl.java index 05e75e74bd..2e5bb88c9d 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/Decimal128sImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/Decimal128sImpl.java @@ -64,7 +64,7 @@ public interface Decimal128sService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/decimal128") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/decimal128") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/decimal128") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a decimal128 property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a decimal128 property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DecimalsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DecimalsImpl.java index f285e90d4c..ed97eb861f 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DecimalsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DecimalsImpl.java @@ -63,7 +63,7 @@ public interface DecimalsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/decimal") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/decimal") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/decimal") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -109,7 +109,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a decimal property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -132,7 +132,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a decimal property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -160,8 +160,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -184,7 +184,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DictionaryStringsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DictionaryStringsImpl.java index 7e3d7a3d41..ba0e9667f8 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DictionaryStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DictionaryStringsImpl.java @@ -64,7 +64,7 @@ public interface DictionaryStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/dictionary/string") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/dictionary/string") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/dictionary/string") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -112,8 +112,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with dictionary string properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -138,7 +137,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with dictionary string properties along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -168,8 +167,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -194,7 +193,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DurationOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DurationOperationsImpl.java index ab3c63609b..1103d13826 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DurationOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DurationOperationsImpl.java @@ -64,7 +64,7 @@ public interface DurationOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/duration") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/duration") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/duration") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/EnumsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/EnumsImpl.java index 9ba8a4c9aa..d46ce8bb8c 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/EnumsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/EnumsImpl.java @@ -63,7 +63,7 @@ public interface EnumsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/enum") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/enum") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/enum") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -109,7 +109,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with enum properties along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -132,7 +132,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with enum properties along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -160,8 +160,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -184,7 +184,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ExtensibleEnumsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ExtensibleEnumsImpl.java index 6551f029e0..9c571604fa 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ExtensibleEnumsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ExtensibleEnumsImpl.java @@ -64,7 +64,7 @@ public interface ExtensibleEnumsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/extensible-enum") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/extensible-enum") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/extensible-enum") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -110,8 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with extensible enum properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -134,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with extensible enum properties along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -162,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -186,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatLiteralsImpl.java index f436f4672c..f7774bca94 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatLiteralsImpl.java @@ -64,7 +64,7 @@ public interface FloatLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/float/literal") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/float/literal") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/float/literal") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a float literal property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a float literal property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatOperationsImpl.java index 696c4d14e2..d0706e6297 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatOperationsImpl.java @@ -64,7 +64,7 @@ public interface FloatOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/float") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/float") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/float") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a float property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a float property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntLiteralsImpl.java index ce4f6e5349..0b47e87d0f 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntLiteralsImpl.java @@ -64,7 +64,7 @@ public interface IntLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/int/literal") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/int/literal") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/int/literal") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a int literal property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a int literal property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntsImpl.java index ae53179952..b74d365f10 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntsImpl.java @@ -63,7 +63,7 @@ public interface IntsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/int") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/int") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/int") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -109,7 +109,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a int property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -132,7 +132,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a int property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -160,8 +160,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -184,7 +184,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ModelsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ModelsImpl.java index fcfd26085f..475388e54f 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ModelsImpl.java @@ -63,7 +63,7 @@ public interface ModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/model") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/model") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/model") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -111,7 +111,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with model properties along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -136,7 +136,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with model properties along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -166,8 +166,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -192,7 +192,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/NeversImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/NeversImpl.java index 8a65c8dfaf..0ee5812b2a 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/NeversImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/NeversImpl.java @@ -63,7 +63,7 @@ public interface NeversService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/never") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/never") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/never") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -107,7 +107,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property never along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -128,7 +128,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property never along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -154,8 +154,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -176,7 +176,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringLiteralsImpl.java index 601e00a543..925cfbc34b 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringLiteralsImpl.java @@ -64,7 +64,7 @@ public interface StringLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/string/literal") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/string/literal") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/string/literal") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -110,8 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a string literal property along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -134,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a string literal property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -162,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -186,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringOperationsImpl.java index 8d4b4f8d66..0a14991592 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringOperationsImpl.java @@ -64,7 +64,7 @@ public interface StringOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/string") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/string") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/string") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a string property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a string property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionEnumValuesImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionEnumValuesImpl.java index a9f141ae34..d134e37823 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionEnumValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionEnumValuesImpl.java @@ -64,7 +64,7 @@ public interface UnionEnumValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/union-enum-value") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union-enum-value") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union-enum-value") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -110,8 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with specific properties along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -134,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with specific properties along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -162,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -186,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionFloatLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionFloatLiteralsImpl.java index 6c300f3fa4..2ef0c1534b 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionFloatLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionFloatLiteralsImpl.java @@ -64,7 +64,7 @@ public interface UnionFloatLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/union/float/literal") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union/float/literal") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union/float/literal") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -110,8 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a union of float literal as property along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -134,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a union of float literal as property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -162,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -186,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionIntLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionIntLiteralsImpl.java index 177386cc3d..d624ac99a0 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionIntLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionIntLiteralsImpl.java @@ -64,7 +64,7 @@ public interface UnionIntLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/union/int/literal") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union/int/literal") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union/int/literal") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -110,8 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a union of int literal as property along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -134,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a union of int literal as property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -162,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -186,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionStringLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionStringLiteralsImpl.java index 3e64d4b24a..e30da4628a 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionStringLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionStringLiteralsImpl.java @@ -64,7 +64,7 @@ public interface UnionStringLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/union/string/literal") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union/string/literal") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union/string/literal") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -110,8 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a union of string literal as property along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -134,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a union of string literal as property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -162,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -186,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownArraysImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownArraysImpl.java index 878b12995e..62b57490e1 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownArraysImpl.java @@ -64,7 +64,7 @@ public interface UnknownArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/unknown/array") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/array") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/array") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -110,8 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is an array along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -134,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is an array along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -162,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -186,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownDictsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownDictsImpl.java index d4a64ff56b..c13ddac04c 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownDictsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownDictsImpl.java @@ -64,7 +64,7 @@ public interface UnknownDictsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/unknown/dict") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/dict") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/dict") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -110,8 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is a dictionnary along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -134,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is a dictionnary along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -162,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -186,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownIntsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownIntsImpl.java index 26ae4cdf1d..18af3c5879 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownIntsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownIntsImpl.java @@ -64,7 +64,7 @@ public interface UnknownIntsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/unknown/int") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/int") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/int") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -110,8 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is a int32 along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -134,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is a int32 along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -162,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -186,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownStringsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownStringsImpl.java index 4e3dc3355c..cc8277e2f2 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownStringsImpl.java @@ -64,7 +64,7 @@ public interface UnknownStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/unknown/string") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/string") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/string") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -110,8 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is a string along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -134,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is a string along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -162,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -186,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/BooleanOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/scalar/BooleanOperationAsyncClient.java index a972f827b1..d5d00b8319 100644 --- a/typespec-tests/src/main/java/com/type/scalar/BooleanOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/scalar/BooleanOperationAsyncClient.java @@ -50,8 +50,7 @@ public final class BooleanOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return boolean with `true` and `false` values along with {@link Response} on successful completion of - * {@link Mono}. + * @return boolean value along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -89,7 +88,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return boolean with `true` and `false` values on successful completion of {@link Mono}. + * @return boolean value on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/scalar/BooleanOperationClient.java b/typespec-tests/src/main/java/com/type/scalar/BooleanOperationClient.java index 58777e320d..b3765fc21e 100644 --- a/typespec-tests/src/main/java/com/type/scalar/BooleanOperationClient.java +++ b/typespec-tests/src/main/java/com/type/scalar/BooleanOperationClient.java @@ -48,7 +48,7 @@ public final class BooleanOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return boolean with `true` and `false` values along with {@link Response}. + * @return boolean value along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -86,7 +86,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return boolean with `true` and `false` values. + * @return boolean value. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/scalar/StringOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/scalar/StringOperationAsyncClient.java index b0bcf6b3c5..a08bd9dfcd 100644 --- a/typespec-tests/src/main/java/com/type/scalar/StringOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/scalar/StringOperationAsyncClient.java @@ -50,7 +50,7 @@ public final class StringOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a sequence of textual characters along with {@link Response} on successful completion of {@link Mono}. + * @return string value along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -88,7 +88,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a sequence of textual characters on successful completion of {@link Mono}. + * @return string value on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/scalar/StringOperationClient.java b/typespec-tests/src/main/java/com/type/scalar/StringOperationClient.java index a79d03671f..f3b4f77150 100644 --- a/typespec-tests/src/main/java/com/type/scalar/StringOperationClient.java +++ b/typespec-tests/src/main/java/com/type/scalar/StringOperationClient.java @@ -48,7 +48,7 @@ public final class StringOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a sequence of textual characters along with {@link Response}. + * @return string value along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -86,7 +86,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a sequence of textual characters. + * @return string value. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/scalar/UnknownAsyncClient.java b/typespec-tests/src/main/java/com/type/scalar/UnknownAsyncClient.java index 4628e26fd2..1a0c97e690 100644 --- a/typespec-tests/src/main/java/com/type/scalar/UnknownAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/scalar/UnknownAsyncClient.java @@ -50,7 +50,7 @@ public final class UnknownAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return anything along with {@link Response} on successful completion of {@link Mono}. + * @return unknown value along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -88,7 +88,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return anything on successful completion of {@link Mono}. + * @return unknown value on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/scalar/UnknownClient.java b/typespec-tests/src/main/java/com/type/scalar/UnknownClient.java index 1df551ca87..6a09092ec3 100644 --- a/typespec-tests/src/main/java/com/type/scalar/UnknownClient.java +++ b/typespec-tests/src/main/java/com/type/scalar/UnknownClient.java @@ -48,7 +48,7 @@ public final class UnknownClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return anything along with {@link Response}. + * @return unknown value along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -86,7 +86,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return anything. + * @return unknown value. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/BooleanOperationsImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/BooleanOperationsImpl.java index 0b93ca47a7..85a5e4540d 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/BooleanOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/BooleanOperationsImpl.java @@ -64,7 +64,7 @@ public interface BooleanOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/boolean") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/scalar/boolean") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/scalar/boolean") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -108,8 +108,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return boolean with `true` and `false` values along with {@link Response} on successful completion of - * {@link Mono}. + * @return boolean value along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -130,7 +129,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return boolean with `true` and `false` values along with {@link Response}. + * @return boolean value along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -156,8 +155,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -178,7 +177,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128TypesImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128TypesImpl.java index ead3edeadf..7888d3acb3 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128TypesImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128TypesImpl.java @@ -66,7 +66,7 @@ public interface Decimal128TypesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> responseBody(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> responseBody(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal128/response_body") @@ -75,7 +75,7 @@ Mono> responseBody(@HeaderParam("Accept") String accept, Re @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response responseBodySync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response responseBodySync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/scalar/decimal128/resquest_body") @@ -84,7 +84,7 @@ Response responseBodySync(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> requestBody(@HeaderParam("Content-Type") String contentType, + Mono> requestBody(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/scalar/decimal128/resquest_body") @@ -93,7 +93,7 @@ Mono> requestBody(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requestBodySync(@HeaderParam("Content-Type") String contentType, + Response requestBodySync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal128/request_parameter") @@ -102,8 +102,8 @@ Response requestBodySync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> requestParameter(@QueryParam("value") BigDecimal value, RequestOptions requestOptions, - Context context); + Mono> requestParameter(@QueryParam("value") BigDecimal value, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal128/request_parameter") @ExpectedResponses({ 204 }) @@ -111,8 +111,8 @@ Mono> requestParameter(@QueryParam("value") BigDecimal value, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requestParameterSync(@QueryParam("value") BigDecimal value, RequestOptions requestOptions, - Context context); + Response requestParameterSync(@QueryParam("value") BigDecimal value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); } /** @@ -175,8 +175,8 @@ public Response responseBodyWithResponse(RequestOptions requestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> requestBodyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.requestBody(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.requestBody(accept, body, requestOptions, context)); } /** @@ -197,8 +197,8 @@ public Mono> requestBodyWithResponseAsync(BinaryData body, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response requestBodyWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.requestBodySync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.requestBodySync(accept, body, requestOptions, Context.NONE); } /** @@ -214,7 +214,8 @@ public Response requestBodyWithResponse(BinaryData body, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> requestParameterWithResponseAsync(BigDecimal value, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.requestParameter(value, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.requestParameter(value, accept, requestOptions, context)); } /** @@ -230,6 +231,7 @@ public Mono> requestParameterWithResponseAsync(BigDecimal value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response requestParameterWithResponse(BigDecimal value, RequestOptions requestOptions) { - return service.requestParameterSync(value, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.requestParameterSync(value, accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128VerifiesImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128VerifiesImpl.java index 873e28ba4e..9ab59d8665 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128VerifiesImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128VerifiesImpl.java @@ -64,7 +64,7 @@ public interface Decimal128VerifiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> prepareVerify(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> prepareVerify(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal128/prepare_verify") @@ -73,7 +73,7 @@ Mono> prepareVerify(@HeaderParam("Accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response prepareVerifySync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response prepareVerifySync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/scalar/decimal128/verify") @@ -82,7 +82,7 @@ Response prepareVerifySync(@HeaderParam("Accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> verify(@HeaderParam("Content-Type") String contentType, + Mono> verify(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/type/scalar/decimal128/verify") @@ -91,8 +91,8 @@ Mono> verify(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response verifySync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response verifySync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -159,8 +159,8 @@ public Response prepareVerifyWithResponse(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> verifyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.verify(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.verify(accept, body, requestOptions, context)); } /** @@ -181,7 +181,7 @@ public Mono> verifyWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response verifyWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.verifySync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.verifySync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalTypesImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalTypesImpl.java index 5773f7981d..e44f5908ad 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalTypesImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalTypesImpl.java @@ -66,7 +66,7 @@ public interface DecimalTypesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> responseBody(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> responseBody(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal/response_body") @@ -75,7 +75,7 @@ Mono> responseBody(@HeaderParam("Accept") String accept, Re @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response responseBodySync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response responseBodySync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/scalar/decimal/resquest_body") @@ -84,7 +84,7 @@ Response responseBodySync(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> requestBody(@HeaderParam("Content-Type") String contentType, + Mono> requestBody(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/scalar/decimal/resquest_body") @@ -93,7 +93,7 @@ Mono> requestBody(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requestBodySync(@HeaderParam("Content-Type") String contentType, + Response requestBodySync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal/request_parameter") @@ -102,8 +102,8 @@ Response requestBodySync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> requestParameter(@QueryParam("value") BigDecimal value, RequestOptions requestOptions, - Context context); + Mono> requestParameter(@QueryParam("value") BigDecimal value, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal/request_parameter") @ExpectedResponses({ 204 }) @@ -111,8 +111,8 @@ Mono> requestParameter(@QueryParam("value") BigDecimal value, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requestParameterSync(@QueryParam("value") BigDecimal value, RequestOptions requestOptions, - Context context); + Response requestParameterSync(@QueryParam("value") BigDecimal value, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); } /** @@ -176,8 +176,8 @@ public Response responseBodyWithResponse(RequestOptions requestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> requestBodyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.requestBody(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.requestBody(accept, body, requestOptions, context)); } /** @@ -198,8 +198,8 @@ public Mono> requestBodyWithResponseAsync(BinaryData body, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response requestBodyWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.requestBodySync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.requestBodySync(accept, body, requestOptions, Context.NONE); } /** @@ -215,7 +215,8 @@ public Response requestBodyWithResponse(BinaryData body, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> requestParameterWithResponseAsync(BigDecimal value, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.requestParameter(value, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.requestParameter(value, accept, requestOptions, context)); } /** @@ -231,6 +232,7 @@ public Mono> requestParameterWithResponseAsync(BigDecimal value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response requestParameterWithResponse(BigDecimal value, RequestOptions requestOptions) { - return service.requestParameterSync(value, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.requestParameterSync(value, accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalVerifiesImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalVerifiesImpl.java index c1981b7463..4917636063 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalVerifiesImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalVerifiesImpl.java @@ -64,7 +64,7 @@ public interface DecimalVerifiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> prepareVerify(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> prepareVerify(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal/prepare_verify") @@ -73,7 +73,7 @@ Mono> prepareVerify(@HeaderParam("Accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response prepareVerifySync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response prepareVerifySync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/scalar/decimal/verify") @@ -82,7 +82,7 @@ Response prepareVerifySync(@HeaderParam("Accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> verify(@HeaderParam("Content-Type") String contentType, + Mono> verify(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/type/scalar/decimal/verify") @@ -91,8 +91,8 @@ Mono> verify(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response verifySync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response verifySync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -159,8 +159,8 @@ public Response prepareVerifyWithResponse(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> verifyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.verify(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.verify(accept, body, requestOptions, context)); } /** @@ -181,7 +181,7 @@ public Mono> verifyWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response verifyWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.verifySync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.verifySync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/StringOperationsImpl.java index 08ecfcdc44..577df014e4 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/StringOperationsImpl.java @@ -64,7 +64,7 @@ public interface StringOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/string") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/scalar/string") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/scalar/string") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -108,7 +108,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a sequence of textual characters along with {@link Response} on successful completion of {@link Mono}. + * @return string value along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -129,7 +129,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a sequence of textual characters along with {@link Response}. + * @return string value along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -155,8 +155,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -177,7 +177,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/UnknownsImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/UnknownsImpl.java index a58950e0b2..fdd5fea491 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/UnknownsImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/UnknownsImpl.java @@ -63,7 +63,7 @@ public interface UnknownsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/unknown") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/scalar/unknown") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/scalar/unknown") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -107,7 +107,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return anything along with {@link Response} on successful completion of {@link Mono}. + * @return unknown value along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -128,7 +128,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return anything along with {@link Response}. + * @return unknown value along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -154,8 +154,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); } /** @@ -176,7 +176,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.putSync(accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/EnumsOnliesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/EnumsOnliesImpl.java index b212091519..1e77334931 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/EnumsOnliesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/EnumsOnliesImpl.java @@ -64,7 +64,7 @@ public interface EnumsOnliesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/enums-only") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/enums-only") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("Content-Type") String contentType, + Mono> send(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData sendRequest3, RequestOptions requestOptions, Context context); @Post("/type/union/enums-only") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("Content-Type") String contentType, + Response sendSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData sendRequest3, RequestOptions requestOptions, Context context); } @@ -170,8 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest3, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.send(contentType, sendRequest3, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.send(accept, sendRequest3, requestOptions, context)); } /** @@ -197,7 +197,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest3, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest3, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.sendSync(contentType, sendRequest3, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.sendSync(accept, sendRequest3, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/FloatsOnliesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/FloatsOnliesImpl.java index a59bb71ea2..0d38239585 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/FloatsOnliesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/FloatsOnliesImpl.java @@ -64,7 +64,7 @@ public interface FloatsOnliesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/floats-only") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/floats-only") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("Content-Type") String contentType, + Mono> send(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData sendRequest5, RequestOptions requestOptions, Context context); @Post("/type/union/floats-only") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("Content-Type") String contentType, + Response sendSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData sendRequest5, RequestOptions requestOptions, Context context); } @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest5, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.send(contentType, sendRequest5, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.send(accept, sendRequest5, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest5, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest5, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.sendSync(contentType, sendRequest5, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.sendSync(accept, sendRequest5, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/IntsOnliesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/IntsOnliesImpl.java index 99d90d9646..a83f054fc6 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/IntsOnliesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/IntsOnliesImpl.java @@ -64,7 +64,7 @@ public interface IntsOnliesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/ints-only") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/ints-only") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("Content-Type") String contentType, + Mono> send(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData sendRequest6, RequestOptions requestOptions, Context context); @Post("/type/union/ints-only") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("Content-Type") String contentType, + Response sendSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData sendRequest6, RequestOptions requestOptions, Context context); } @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest6, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.send(contentType, sendRequest6, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.send(accept, sendRequest6, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest6, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest6, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.sendSync(contentType, sendRequest6, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.sendSync(accept, sendRequest6, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/MixedLiteralsImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/MixedLiteralsImpl.java index 24bff76dff..0009929c23 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/MixedLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/MixedLiteralsImpl.java @@ -64,7 +64,7 @@ public interface MixedLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/mixed-literals") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/mixed-literals") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("Content-Type") String contentType, + Mono> send(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData sendRequest1, RequestOptions requestOptions, Context context); @Post("/type/union/mixed-literals") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("Content-Type") String contentType, + Response sendSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData sendRequest1, RequestOptions requestOptions, Context context); } @@ -176,8 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest1, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.send(contentType, sendRequest1, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.send(accept, sendRequest1, requestOptions, context)); } /** @@ -205,7 +205,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest1, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest1, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.sendSync(contentType, sendRequest1, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.sendSync(accept, sendRequest1, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/MixedTypesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/MixedTypesImpl.java index aafe11c1b4..cfa98f8b9f 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/MixedTypesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/MixedTypesImpl.java @@ -64,7 +64,7 @@ public interface MixedTypesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/mixed-types") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/mixed-types") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("Content-Type") String contentType, + Mono> send(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData sendRequest, RequestOptions requestOptions, Context context); @Post("/type/union/mixed-types") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("Content-Type") String contentType, + Response sendSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData sendRequest, RequestOptions requestOptions, Context context); } @@ -185,8 +185,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.send(contentType, sendRequest, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.send(accept, sendRequest, requestOptions, context)); } /** @@ -217,7 +217,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.sendSync(contentType, sendRequest, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.sendSync(accept, sendRequest, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/ModelsOnliesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/ModelsOnliesImpl.java index 769705e92e..b4e16f01c6 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/ModelsOnliesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/ModelsOnliesImpl.java @@ -64,7 +64,7 @@ public interface ModelsOnliesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/models-only") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/models-only") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("Content-Type") String contentType, + Mono> send(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData sendRequest4, RequestOptions requestOptions, Context context); @Post("/type/union/models-only") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("Content-Type") String contentType, + Response sendSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData sendRequest4, RequestOptions requestOptions, Context context); } @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest4, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.send(contentType, sendRequest4, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.send(accept, sendRequest4, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest4, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest4, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.sendSync(contentType, sendRequest4, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.sendSync(accept, sendRequest4, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/StringAndArraysImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/StringAndArraysImpl.java index 72ad57f6c0..82db1f931b 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/StringAndArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/StringAndArraysImpl.java @@ -64,7 +64,7 @@ public interface StringAndArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/string-and-array") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/string-and-array") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("Content-Type") String contentType, + Mono> send(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData sendRequest2, RequestOptions requestOptions, Context context); @Post("/type/union/string-and-array") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("Content-Type") String contentType, + Response sendSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData sendRequest2, RequestOptions requestOptions, Context context); } @@ -170,8 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest2, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.send(contentType, sendRequest2, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.send(accept, sendRequest2, requestOptions, context)); } /** @@ -197,7 +197,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest2, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest2, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.sendSync(contentType, sendRequest2, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.sendSync(accept, sendRequest2, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/StringExtensibleNamedsImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/StringExtensibleNamedsImpl.java index b52c1fd016..8066f73f79 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/StringExtensibleNamedsImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/StringExtensibleNamedsImpl.java @@ -64,7 +64,7 @@ public interface StringExtensibleNamedsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/string-extensible-named") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/string-extensible-named") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("Content-Type") String contentType, + Mono> send(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData sendRequest7, RequestOptions requestOptions, Context context); @Post("/type/union/string-extensible-named") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("Content-Type") String contentType, + Response sendSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData sendRequest7, RequestOptions requestOptions, Context context); } @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest7, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.send(contentType, sendRequest7, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.send(accept, sendRequest7, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest7, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest7, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.sendSync(contentType, sendRequest7, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.sendSync(accept, sendRequest7, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/StringExtensiblesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/StringExtensiblesImpl.java index 91d254d8b4..ed83e7409a 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/StringExtensiblesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/StringExtensiblesImpl.java @@ -64,7 +64,7 @@ public interface StringExtensiblesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/string-extensible") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/string-extensible") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("Content-Type") String contentType, + Mono> send(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData sendRequest8, RequestOptions requestOptions, Context context); @Post("/type/union/string-extensible") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("Content-Type") String contentType, + Response sendSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData sendRequest8, RequestOptions requestOptions, Context context); } @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest8, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.send(contentType, sendRequest8, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.send(accept, sendRequest8, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest8, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest8, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.sendSync(contentType, sendRequest8, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.sendSync(accept, sendRequest8, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/StringsOnliesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/StringsOnliesImpl.java index a1f5912b78..58d503544e 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/StringsOnliesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/StringsOnliesImpl.java @@ -64,7 +64,7 @@ public interface StringsOnliesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/strings-only") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/strings-only") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("Content-Type") String contentType, + Mono> send(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData sendRequest9, RequestOptions requestOptions, Context context); @Post("/type/union/strings-only") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("Content-Type") String contentType, + Response sendSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData sendRequest9, RequestOptions requestOptions, Context context); } @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest9, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.send(contentType, sendRequest9, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.send(accept, sendRequest9, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest9, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest9, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.sendSync(contentType, sendRequest9, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.sendSync(accept, sendRequest9, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/versioning/added/implementation/AddedClientImpl.java b/typespec-tests/src/main/java/com/versioning/added/implementation/AddedClientImpl.java index 76f0d27904..ea3c2305cd 100644 --- a/typespec-tests/src/main/java/com/versioning/added/implementation/AddedClientImpl.java +++ b/typespec-tests/src/main/java/com/versioning/added/implementation/AddedClientImpl.java @@ -184,9 +184,8 @@ public interface AddedClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> v1(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("header-v2") String headerV2, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("header-v2") String headerV2, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/v1") @ExpectedResponses({ 200 }) @@ -195,9 +194,8 @@ Mono> v1(@HostParam("endpoint") String endpoint, @HostParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response v1Sync(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("header-v2") String headerV2, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("header-v2") String headerV2, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/v2") @ExpectedResponses({ 200 }) @@ -206,8 +204,8 @@ Response v1Sync(@HostParam("endpoint") String endpoint, @HostParam(" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> v2(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/v2") @ExpectedResponses({ 200 }) @@ -216,8 +214,8 @@ Mono> v2(@HostParam("endpoint") String endpoint, @HostParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response v2Sync(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -254,10 +252,9 @@ Response v2Sync(@HostParam("endpoint") String endpoint, @HostParam(" @ServiceMethod(returns = ReturnType.SINGLE) public Mono> v1WithResponseAsync(String headerV2, BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.v1(this.getEndpoint(), this.getVersion(), headerV2, contentType, - accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.v1(this.getEndpoint(), this.getVersion(), headerV2, accept, body, + requestOptions, context)); } /** @@ -293,10 +290,9 @@ public Mono> v1WithResponseAsync(String headerV2, BinaryDat */ @ServiceMethod(returns = ReturnType.SINGLE) public Response v1WithResponse(String headerV2, BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.v1Sync(this.getEndpoint(), this.getVersion(), headerV2, contentType, accept, body, - requestOptions, Context.NONE); + return service.v1Sync(this.getEndpoint(), this.getVersion(), headerV2, accept, body, requestOptions, + Context.NONE); } /** @@ -331,10 +327,9 @@ public Response v1WithResponse(String headerV2, BinaryData body, Req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> v2WithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.v2(this.getEndpoint(), this.getVersion(), contentType, accept, - body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.v2(this.getEndpoint(), this.getVersion(), accept, body, requestOptions, context)); } /** @@ -369,9 +364,7 @@ public Mono> v2WithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response v2WithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.v2Sync(this.getEndpoint(), this.getVersion(), contentType, accept, body, requestOptions, - Context.NONE); + return service.v2Sync(this.getEndpoint(), this.getVersion(), accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/versioning/added/implementation/InterfaceV2sImpl.java b/typespec-tests/src/main/java/com/versioning/added/implementation/InterfaceV2sImpl.java index a032c93597..31d6ad0d3c 100644 --- a/typespec-tests/src/main/java/com/versioning/added/implementation/InterfaceV2sImpl.java +++ b/typespec-tests/src/main/java/com/versioning/added/implementation/InterfaceV2sImpl.java @@ -75,9 +75,8 @@ public interface InterfaceV2sService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> v2InInterface(@HostParam("endpoint") String endpoint, - @HostParam("version") String version, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HostParam("version") String version, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/interface-v2/v2") @ExpectedResponses({ 200 }) @@ -86,9 +85,8 @@ Mono> v2InInterface(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response v2InInterfaceSync(@HostParam("endpoint") String endpoint, - @HostParam("version") String version, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HostParam("version") String version, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -123,10 +121,9 @@ Response v2InInterfaceSync(@HostParam("endpoint") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> v2InInterfaceWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.v2InInterface(this.client.getEndpoint(), - this.client.getVersion(), contentType, accept, body, requestOptions, context)); + this.client.getVersion(), accept, body, requestOptions, context)); } /** @@ -161,9 +158,8 @@ public Mono> v2InInterfaceWithResponseAsync(BinaryData body */ @ServiceMethod(returns = ReturnType.SINGLE) public Response v2InInterfaceWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.v2InInterfaceSync(this.client.getEndpoint(), this.client.getVersion(), contentType, accept, body, + return service.v2InInterfaceSync(this.client.getEndpoint(), this.client.getVersion(), accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/versioning/madeoptional/implementation/MadeOptionalClientImpl.java b/typespec-tests/src/main/java/com/versioning/madeoptional/implementation/MadeOptionalClientImpl.java index fc57f6064f..11b87890d5 100644 --- a/typespec-tests/src/main/java/com/versioning/madeoptional/implementation/MadeOptionalClientImpl.java +++ b/typespec-tests/src/main/java/com/versioning/madeoptional/implementation/MadeOptionalClientImpl.java @@ -171,8 +171,8 @@ public interface MadeOptionalClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> test(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/test") @ExpectedResponses({ 200 }) @@ -181,8 +181,8 @@ Mono> test(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response testSync(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -222,10 +222,9 @@ Response testSync(@HostParam("endpoint") String endpoint, @HostParam */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> testWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.test(this.getEndpoint(), this.getVersion(), contentType, accept, - body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.test(this.getEndpoint(), this.getVersion(), accept, body, requestOptions, context)); } /** @@ -265,9 +264,7 @@ public Mono> testWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response testWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.testSync(this.getEndpoint(), this.getVersion(), contentType, accept, body, requestOptions, - Context.NONE); + return service.testSync(this.getEndpoint(), this.getVersion(), accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/versioning/removed/implementation/RemovedClientImpl.java b/typespec-tests/src/main/java/com/versioning/removed/implementation/RemovedClientImpl.java index 74936454ac..75be98281d 100644 --- a/typespec-tests/src/main/java/com/versioning/removed/implementation/RemovedClientImpl.java +++ b/typespec-tests/src/main/java/com/versioning/removed/implementation/RemovedClientImpl.java @@ -169,8 +169,8 @@ public interface RemovedClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> v2(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/v2") @ExpectedResponses({ 200 }) @@ -179,8 +179,8 @@ Mono> v2(@HostParam("endpoint") String endpoint, @HostParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response v2Sync(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -215,10 +215,9 @@ Response v2Sync(@HostParam("endpoint") String endpoint, @HostParam(" */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> v2WithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.v2(this.getEndpoint(), this.getVersion(), contentType, accept, - body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.v2(this.getEndpoint(), this.getVersion(), accept, body, requestOptions, context)); } /** @@ -253,9 +252,7 @@ public Mono> v2WithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response v2WithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.v2Sync(this.getEndpoint(), this.getVersion(), contentType, accept, body, requestOptions, - Context.NONE); + return service.v2Sync(this.getEndpoint(), this.getVersion(), accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/versioning/renamedfrom/implementation/NewInterfacesImpl.java b/typespec-tests/src/main/java/com/versioning/renamedfrom/implementation/NewInterfacesImpl.java index 4f6dd02c68..3efaf2c5a5 100644 --- a/typespec-tests/src/main/java/com/versioning/renamedfrom/implementation/NewInterfacesImpl.java +++ b/typespec-tests/src/main/java/com/versioning/renamedfrom/implementation/NewInterfacesImpl.java @@ -75,9 +75,8 @@ public interface NewInterfacesService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> newOpInNewInterface(@HostParam("endpoint") String endpoint, - @HostParam("version") String version, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HostParam("version") String version, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/interface/test") @ExpectedResponses({ 200 }) @@ -86,9 +85,8 @@ Mono> newOpInNewInterface(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response newOpInNewInterfaceSync(@HostParam("endpoint") String endpoint, - @HostParam("version") String version, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HostParam("version") String version, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -124,10 +122,9 @@ Response newOpInNewInterfaceSync(@HostParam("endpoint") String endpo @ServiceMethod(returns = ReturnType.SINGLE) public Mono> newOpInNewInterfaceWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.newOpInNewInterface(this.client.getEndpoint(), - this.client.getVersion(), contentType, accept, body, requestOptions, context)); + this.client.getVersion(), accept, body, requestOptions, context)); } /** @@ -162,9 +159,8 @@ public Mono> newOpInNewInterfaceWithResponseAsync(BinaryDat */ @ServiceMethod(returns = ReturnType.SINGLE) public Response newOpInNewInterfaceWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.newOpInNewInterfaceSync(this.client.getEndpoint(), this.client.getVersion(), contentType, accept, - body, requestOptions, Context.NONE); + return service.newOpInNewInterfaceSync(this.client.getEndpoint(), this.client.getVersion(), accept, body, + requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/versioning/renamedfrom/implementation/RenamedFromClientImpl.java b/typespec-tests/src/main/java/com/versioning/renamedfrom/implementation/RenamedFromClientImpl.java index 4b3e777ef4..8cb793c44a 100644 --- a/typespec-tests/src/main/java/com/versioning/renamedfrom/implementation/RenamedFromClientImpl.java +++ b/typespec-tests/src/main/java/com/versioning/renamedfrom/implementation/RenamedFromClientImpl.java @@ -186,9 +186,8 @@ public interface RenamedFromClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> newOp(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @QueryParam("newQuery") String newQuery, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @QueryParam("newQuery") String newQuery, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/test") @ExpectedResponses({ 200 }) @@ -197,9 +196,8 @@ Mono> newOp(@HostParam("endpoint") String endpoint, @HostPa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response newOpSync(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @QueryParam("newQuery") String newQuery, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @QueryParam("newQuery") String newQuery, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -236,10 +234,9 @@ Response newOpSync(@HostParam("endpoint") String endpoint, @HostPara @ServiceMethod(returns = ReturnType.SINGLE) public Mono> newOpWithResponseAsync(String newQuery, BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.newOp(this.getEndpoint(), this.getVersion(), newQuery, - contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.newOp(this.getEndpoint(), this.getVersion(), newQuery, accept, + body, requestOptions, context)); } /** @@ -275,9 +272,8 @@ public Mono> newOpWithResponseAsync(String newQuery, Binary */ @ServiceMethod(returns = ReturnType.SINGLE) public Response newOpWithResponse(String newQuery, BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.newOpSync(this.getEndpoint(), this.getVersion(), newQuery, contentType, accept, body, - requestOptions, Context.NONE); + return service.newOpSync(this.getEndpoint(), this.getVersion(), newQuery, accept, body, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/versioning/returntypechangedfrom/implementation/ReturnTypeChangedFromClientImpl.java b/typespec-tests/src/main/java/com/versioning/returntypechangedfrom/implementation/ReturnTypeChangedFromClientImpl.java index ac32c99f2e..58e80a8662 100644 --- a/typespec-tests/src/main/java/com/versioning/returntypechangedfrom/implementation/ReturnTypeChangedFromClientImpl.java +++ b/typespec-tests/src/main/java/com/versioning/returntypechangedfrom/implementation/ReturnTypeChangedFromClientImpl.java @@ -172,8 +172,8 @@ public interface ReturnTypeChangedFromClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> test(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/test") @ExpectedResponses({ 200 }) @@ -182,8 +182,8 @@ Mono> test(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response testSync(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -210,10 +210,9 @@ Response testSync(@HostParam("endpoint") String endpoint, @HostParam */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> testWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.test(this.getEndpoint(), this.getVersion(), contentType, accept, - body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.test(this.getEndpoint(), this.getVersion(), accept, body, requestOptions, context)); } /** @@ -240,9 +239,7 @@ public Mono> testWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response testWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.testSync(this.getEndpoint(), this.getVersion(), contentType, accept, body, requestOptions, - Context.NONE); + return service.testSync(this.getEndpoint(), this.getVersion(), accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/versioning/typechangedfrom/implementation/TypeChangedFromClientImpl.java b/typespec-tests/src/main/java/com/versioning/typechangedfrom/implementation/TypeChangedFromClientImpl.java index 76874be3a0..b11f99fc16 100644 --- a/typespec-tests/src/main/java/com/versioning/typechangedfrom/implementation/TypeChangedFromClientImpl.java +++ b/typespec-tests/src/main/java/com/versioning/typechangedfrom/implementation/TypeChangedFromClientImpl.java @@ -172,9 +172,8 @@ public interface TypeChangedFromClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> test(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @QueryParam("param") String param, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @QueryParam("param") String param, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/test") @ExpectedResponses({ 200 }) @@ -183,9 +182,8 @@ Mono> test(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response testSync(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @QueryParam("param") String param, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @QueryParam("param") String param, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -220,10 +218,9 @@ Response testSync(@HostParam("endpoint") String endpoint, @HostParam @ServiceMethod(returns = ReturnType.SINGLE) public Mono> testWithResponseAsync(String param, BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.test(this.getEndpoint(), this.getVersion(), param, contentType, - accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.test(this.getEndpoint(), this.getVersion(), param, accept, body, + requestOptions, context)); } /** @@ -257,9 +254,8 @@ public Mono> testWithResponseAsync(String param, BinaryData */ @ServiceMethod(returns = ReturnType.SINGLE) public Response testWithResponse(String param, BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; - return service.testSync(this.getEndpoint(), this.getVersion(), param, contentType, accept, body, requestOptions, + return service.testSync(this.getEndpoint(), this.getVersion(), param, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/resources/cadl-optional.properties b/typespec-tests/src/main/resources/cadl-optional.properties new file mode 100644 index 0000000000..ca812989b4 --- /dev/null +++ b/typespec-tests/src/main/resources/cadl-optional.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSend.java b/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSend.java index 19756261ce..09da2fd8f4 100644 --- a/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSend.java +++ b/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSend.java @@ -7,13 +7,21 @@ import com.azure.core.util.Configuration; import com.cadl.flatten.FlattenClient; import com.cadl.flatten.FlattenClientBuilder; +<<<<<<< HEAD +======= +import com.cadl.flatten.models.User; +>>>>>>> parent of 07a773fbfd7 (regen) public class FlattenOpSend { public static void main(String[] args) { FlattenClient flattenClient = new FlattenClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")).buildClient(); // BEGIN:com.cadl.flatten.generated.send.flattenopsend +<<<<<<< HEAD flattenClient.send("myRequiredId", null, null); +======= + flattenClient.send("myRequiredId", "myRequiredInput", new User("myOptionalUser")); +>>>>>>> parent of 07a773fbfd7 (regen) // END:com.cadl.flatten.generated.send.flattenopsend } } diff --git a/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSendLong.java b/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSendLong.java new file mode 100644 index 0000000000..4a373d51f4 --- /dev/null +++ b/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSendLong.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.cadl.flatten.generated; + +import com.azure.core.util.Configuration; +import com.cadl.flatten.FlattenClient; +import com.cadl.flatten.FlattenClientBuilder; +import com.cadl.flatten.models.SendLongOptions; +import com.cadl.flatten.models.TodoItemStatus; +import com.cadl.flatten.models.User; + +public class FlattenOpSendLong { + public static void main(String[] args) { + FlattenClient flattenClient + = new FlattenClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")).buildClient(); + // BEGIN:com.cadl.flatten.generated.sendlong.flattenopsendlong + flattenClient + .sendLong(new SendLongOptions("myRequiredId", "myRequiredInput", 11, "title", TodoItemStatus.NOT_STARTED) + .setFilter("name=myName") + .setUser(new User("myOptionalUser")) + .setDataIntOptional(12) + .setDataLong(13L) + .setDataFloat(14.0D) + .setDescription("description")); + // END:com.cadl.flatten.generated.sendlong.flattenopsendlong + } +} diff --git a/typespec-tests/src/test/java/com/cadl/server/generated/HttpbinClientTestBase.java b/typespec-tests/src/test/java/com/cadl/server/generated/HttpbinClientTestBase.java index ff715afeaf..133ae7c4f3 100644 --- a/typespec-tests/src/test/java/com/cadl/server/generated/HttpbinClientTestBase.java +++ b/typespec-tests/src/test/java/com/cadl/server/generated/HttpbinClientTestBase.java @@ -29,7 +29,6 @@ protected void beforeTest() { HttpbinClientBuilder httpbinClientbuilder = new HttpbinClientBuilder().domain(Configuration.getGlobalConfiguration().get("DOMAIN", "domain")) .tld(Configuration.getGlobalConfiguration().get("TLD", "tld")) - .relativePath(Configuration.getGlobalConfiguration().get("RELATIVEPATH", "relativepath")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -41,7 +40,6 @@ protected void beforeTest() { ContosoClientBuilder contosoClientbuilder = new ContosoClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .apiVersion(Configuration.getGlobalConfiguration().get("APIVERSION", "apiversion")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/client/structure/service/generated/ServiceClientClientTestBase.java b/typespec-tests/src/test/java/com/client/structure/service/generated/ServiceClientClientTestBase.java index ee84ef8e23..bd22590dab 100644 --- a/typespec-tests/src/test/java/com/client/structure/service/generated/ServiceClientClientTestBase.java +++ b/typespec-tests/src/test/java/com/client/structure/service/generated/ServiceClientClientTestBase.java @@ -15,8 +15,9 @@ import com.azure.core.test.TestProxyTestBase; import com.azure.core.util.Configuration; import com.client.structure.service.BarClient; -import com.client.structure.service.BazClient; +import com.client.structure.service.BazFooClient; import com.client.structure.service.FooClient; +import com.client.structure.service.QuxBarClient; import com.client.structure.service.QuxClient; import com.client.structure.service.ServiceClientClient; import com.client.structure.service.ServiceClientClientBuilder; @@ -24,13 +25,11 @@ class ServiceClientClientTestBase extends TestProxyTestBase { protected ServiceClientClient serviceClientClient; - protected BazClient bazClient; - - protected FooClient fooClient; + protected BazFooClient bazFooClient; protected QuxClient quxClient; - protected BarClient barClient; + protected QuxBarClient quxBarClient; protected FooClient fooClient; @@ -50,29 +49,17 @@ protected void beforeTest() { } serviceClientClient = serviceClientClientbuilder.buildClient(); - ServiceClientClientBuilder bazClientbuilder = new ServiceClientClientBuilder() + ServiceClientClientBuilder bazFooClientbuilder = new ServiceClientClientBuilder() .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) .client(Configuration.getGlobalConfiguration().get("CLIENT", "client")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { - bazClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + bazFooClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { - bazClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + bazFooClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); } - bazClient = bazClientbuilder.buildBazClient(); - - ServiceClientClientBuilder fooClientbuilder = new ServiceClientClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .client(Configuration.getGlobalConfiguration().get("CLIENT", "client")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.PLAYBACK) { - fooClientbuilder.httpClient(interceptorManager.getPlaybackClient()); - } else if (getTestMode() == TestMode.RECORD) { - fooClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); - } - fooClient = fooClientbuilder.buildFooClient(); + bazFooClient = bazFooClientbuilder.buildBazFooClient(); ServiceClientClientBuilder quxClientbuilder = new ServiceClientClientBuilder() .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) @@ -86,17 +73,17 @@ protected void beforeTest() { } quxClient = quxClientbuilder.buildQuxClient(); - ServiceClientClientBuilder barClientbuilder = new ServiceClientClientBuilder() + ServiceClientClientBuilder quxBarClientbuilder = new ServiceClientClientBuilder() .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) .client(Configuration.getGlobalConfiguration().get("CLIENT", "client")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { - barClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + quxBarClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { - barClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + quxBarClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); } - barClient = barClientbuilder.buildBarClient(); + quxBarClient = quxBarClientbuilder.buildQuxBarClient(); ServiceClientClientBuilder fooClientbuilder = new ServiceClientClientBuilder() .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) diff --git a/typespec-tests/src/test/java/com/resiliency/servicedriven/generated/ResiliencyServiceDrivenClientTestBase.java b/typespec-tests/src/test/java/com/resiliency/servicedriven/generated/ResiliencyServiceDrivenClientTestBase.java index 085cfca3e4..b42cd18d88 100644 --- a/typespec-tests/src/test/java/com/resiliency/servicedriven/generated/ResiliencyServiceDrivenClientTestBase.java +++ b/typespec-tests/src/test/java/com/resiliency/servicedriven/generated/ResiliencyServiceDrivenClientTestBase.java @@ -27,7 +27,6 @@ protected void beforeTest() { .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) .serviceDeploymentVersion( Configuration.getGlobalConfiguration().get("SERVICEDEPLOYMENTVERSION", "servicedeploymentversion")) - .apiVersion(Configuration.getGlobalConfiguration().get("APIVERSION", "apiversion")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/resiliency/servicedriven/v1/generated/ResiliencyServiceDrivenClientTestBase.java b/typespec-tests/src/test/java/com/resiliency/servicedriven/v1/generated/ResiliencyServiceDrivenClientTestBase.java index c4d1be8a6a..eec959eb94 100644 --- a/typespec-tests/src/test/java/com/resiliency/servicedriven/v1/generated/ResiliencyServiceDrivenClientTestBase.java +++ b/typespec-tests/src/test/java/com/resiliency/servicedriven/v1/generated/ResiliencyServiceDrivenClientTestBase.java @@ -27,7 +27,6 @@ protected void beforeTest() { .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) .serviceDeploymentVersion( Configuration.getGlobalConfiguration().get("SERVICEDEPLOYMENTVERSION", "servicedeploymentversion")) - .apiVersion(Configuration.getGlobalConfiguration().get("APIVERSION", "apiversion")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/server/path/multiple/generated/MultipleClientTestBase.java b/typespec-tests/src/test/java/com/server/path/multiple/generated/MultipleClientTestBase.java index 09b7923b1f..a1e5597656 100644 --- a/typespec-tests/src/test/java/com/server/path/multiple/generated/MultipleClientTestBase.java +++ b/typespec-tests/src/test/java/com/server/path/multiple/generated/MultipleClientTestBase.java @@ -24,7 +24,6 @@ class MultipleClientTestBase extends TestProxyTestBase { protected void beforeTest() { MultipleClientBuilder multipleClientbuilder = new MultipleClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .apiVersion(Configuration.getGlobalConfiguration().get("APIVERSION", "apiversion")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { From ca85d01428051f3b463f194467b169ab7c2fd7fe Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 1 Jul 2024 11:23:06 +0800 Subject: [PATCH 11/90] solve conflict --- .../java/com/cadl/flatten/generated/FlattenOpSend.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSend.java b/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSend.java index 09da2fd8f4..19756261ce 100644 --- a/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSend.java +++ b/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSend.java @@ -7,21 +7,13 @@ import com.azure.core.util.Configuration; import com.cadl.flatten.FlattenClient; import com.cadl.flatten.FlattenClientBuilder; -<<<<<<< HEAD -======= -import com.cadl.flatten.models.User; ->>>>>>> parent of 07a773fbfd7 (regen) public class FlattenOpSend { public static void main(String[] args) { FlattenClient flattenClient = new FlattenClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")).buildClient(); // BEGIN:com.cadl.flatten.generated.send.flattenopsend -<<<<<<< HEAD flattenClient.send("myRequiredId", null, null); -======= - flattenClient.send("myRequiredId", "myRequiredInput", new User("myOptionalUser")); ->>>>>>> parent of 07a773fbfd7 (regen) // END:com.cadl.flatten.generated.send.flattenopsend } } From de594bcafd5d605a0e9491ed38a5db1e61c1d5dd Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Tue, 2 Jul 2024 14:52:32 +0800 Subject: [PATCH 12/90] replace logics for operationIs helpers --- typespec-extension/src/code-model-builder.ts | 1027 +++++++++--------- typespec-extension/src/operation-utils.ts | 64 +- 2 files changed, 550 insertions(+), 541 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 822c588c5d..aba8952146 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -44,53 +44,38 @@ import { KnownMediaType } from "@azure-tools/codegen"; import { getLroMetadata, getPagedResult, isPollingLocation } from "@azure-tools/typespec-azure-core"; import { SdkArrayType, - SdkBodyParameter, SdkBuiltInType, - SdkClient, SdkClientType, SdkConstantType, SdkContext, SdkDateTimeType, SdkDictionaryType, SdkDurationType, - SdkEndpointParameter, SdkEnumType, SdkEnumValueType, SdkHeaderParameter, SdkHttpOperation, SdkHttpResponse, - SdkInitializationType, SdkLroPagingServiceMethod, SdkLroServiceMethod, - SdkMethod, SdkModelPropertyType, SdkModelType, - SdkPackage, - SdkParameter, SdkPathParameter, SdkQueryParameter, SdkServiceMethod, - SdkServiceOperation, SdkType, SdkUnionType, createSdkContext, getAllModels, getClientNameOverride, getClientType, - getCrossLanguageDefinitionId, - getDefaultApiVersion, - getSdkModelPropertyType, - getSdkModelPropertyTypeBase, getWireName, isApiVersion, isInternal, isSdkBuiltInKind, isSdkIntKind, - listClients, - listOperationGroups, - listOperationsInOperationGroup, shouldGenerateConvenient, - shouldGenerateProtocol, + shouldGenerateProtocol } from "@azure-tools/typespec-client-generator-core"; import { EmitContext, @@ -104,41 +89,32 @@ import { Union, getDoc, getEffectiveModelType, - getEncode, getFriendlyName, getNamespaceFullName, getOverloadedOperation, getProjectedName, getSummary, getVisibility, - ignoreDiagnostics, isArrayModelType, isErrorModel, isRecordModelType, - isVoidType, - listServices, + listServices } from "@typespec/compiler"; import { Authentication, HttpOperation, HttpOperationBody, HttpOperationMultipartBody, - HttpOperationParameter, HttpOperationResponse, HttpServer, HttpStatusCodeRange, HttpStatusCodesEntry, Visibility, getAuthentication, - getHeaderFieldOptions, - getHttpOperation, - getQueryParamOptions, - getServers, - getStatusCodeDescription, - isPathParam, + getStatusCodeDescription } from "@typespec/http"; -import { getResourceOperation, getSegment } from "@typespec/rest"; -import { Version, getAddedOnVersions, getVersion } from "@typespec/versioning"; +import { getSegment } from "@typespec/rest"; +import { Version, getAddedOnVersions } from "@typespec/versioning"; import { fail } from "assert"; import pkg from "lodash"; import { Client as CodeModelClient, ObjectScheme } from "./common/client.js"; @@ -162,9 +138,9 @@ import { isLroNewPollingStrategy, isPayloadProperty, loadExamples, - operationIsJsonMergePatch, - operationIsMultipart, - operationIsMultipleContentTypes, + sdkHttpOperationIsJsonMergePatch, + sdkHttpOperationIsMultipart, + sdkHttpOperationIsMultipleContentTypes, } from "./operation-utils.js"; import { PreNamer } from "./prenamer/prenamer.js"; import { @@ -174,13 +150,9 @@ import { getNonNullSdkType, getUnionDescription, getUsage, - hasScalarAsBase, - isArmCommonType, - isModelReferredInTemplate, - isNullableType, isStable, modelIs, - pushDistinct, + pushDistinct } from "./type-utils.js"; import { getJavaNamespace, @@ -297,68 +269,68 @@ export class CodeModelBuilder { return this.codeModel; } - private processHost(server: HttpServer | undefined): Parameter[] { - const hostParameters: Parameter[] = []; - if (server && !this.isArmSynthesizedServer(server)) { - server.parameters.forEach((it) => { - let parameter; - - if (isApiVersion(this.sdkContext, it)) { - parameter = this.createApiVersionParameter(it.name, ParameterLocation.Uri); - } else { - const sdkType = getClientType(this.sdkContext, it.type); - const schema = this.processSchemaFromSdkType(sdkType, it.name); - this.trackSchemaUsage(schema, { - usage: [SchemaContext.Input, SchemaContext.Output /*SchemaContext.Public*/], - }); - parameter = new Parameter(this.getName(it), this.getDoc(it), schema, { - implementation: ImplementationLocation.Client, - origin: "modelerfour:synthesized/host", - required: !it.optional, - protocol: { - http: new HttpParameter(ParameterLocation.Uri), - }, - language: { - default: { - serializedName: it.name, - }, - }, - extensions: { - "x-ms-skip-url-encoding": schema instanceof UriSchema, - }, - // // make the logic same as TCGC, which takes the server-side default of host as client-side default - // clientDefaultValue: getDefaultValue(it.defaultValue), - }); - } + // private processHost(server: HttpServer | undefined): Parameter[] { + // const hostParameters: Parameter[] = []; + // if (server && !this.isArmSynthesizedServer(server)) { + // server.parameters.forEach((it) => { + // let parameter; + + // if (isApiVersion(this.sdkContext, it)) { + // parameter = this.createApiVersionParameter(it.name, ParameterLocation.Uri); + // } else { + // const sdkType = getClientType(this.sdkContext, it.type); + // const schema = this.processSchemaFromSdkType(sdkType, it.name); + // this.trackSchemaUsage(schema, { + // usage: [SchemaContext.Input, SchemaContext.Output /*SchemaContext.Public*/], + // }); + // parameter = new Parameter(this.getName(it), this.getDoc(it), schema, { + // implementation: ImplementationLocation.Client, + // origin: "modelerfour:synthesized/host", + // required: !it.optional, + // protocol: { + // http: new HttpParameter(ParameterLocation.Uri), + // }, + // language: { + // default: { + // serializedName: it.name, + // }, + // }, + // extensions: { + // "x-ms-skip-url-encoding": schema instanceof UriSchema, + // }, + // // // make the logic same as TCGC, which takes the server-side default of host as client-side default + // // clientDefaultValue: getDefaultValue(it.defaultValue), + // }); + // } - hostParameters.push(this.codeModel.addGlobalParameter(parameter)); - }); - return hostParameters; - } else { - // use "endpoint" - hostParameters.push( - this.codeModel.addGlobalParameter( - new Parameter("endpoint", "Server parameter", this.stringSchema, { - implementation: ImplementationLocation.Client, - origin: "modelerfour:synthesized/host", - required: true, - protocol: { - http: new HttpParameter(ParameterLocation.Uri), - }, - language: { - default: { - serializedName: "endpoint", - }, - }, - extensions: { - "x-ms-skip-url-encoding": true, - }, - }), - ), - ); - return hostParameters; - } - } + // hostParameters.push(this.codeModel.addGlobalParameter(parameter)); + // }); + // return hostParameters; + // } else { + // // use "endpoint" + // hostParameters.push( + // this.codeModel.addGlobalParameter( + // new Parameter("endpoint", "Server parameter", this.stringSchema, { + // implementation: ImplementationLocation.Client, + // origin: "modelerfour:synthesized/host", + // required: true, + // protocol: { + // http: new HttpParameter(ParameterLocation.Uri), + // }, + // language: { + // default: { + // serializedName: "endpoint", + // }, + // }, + // extensions: { + // "x-ms-skip-url-encoding": true, + // }, + // }), + // ), + // ); + // return hostParameters; + // } + // } private processHostParametersFromSdkType(sdkPathParameters: SdkPathParameter[]): Parameter[] { const hostParameters: Parameter[] = []; @@ -640,6 +612,7 @@ export class CodeModelBuilder { const serviceMethods = this.listServiceMethodsUnderClient(subClient, true); // operation group with no operation is skipped if (serviceMethods.length > 0) { + // TODO: haoling get name from group path // const groupPath = subClient..groupPath.split("."); // let operationGroupName: string; // if (groupPath.length > 1) { @@ -728,131 +701,131 @@ export class CodeModelBuilder { return methods; } - private processClients(): SdkClient[] { - const sdkPackage = this.sdkContext.experimental_sdkPackage; - const clients = listClients(this.sdkContext); - // preprocess group-etag-headers - this.options["group-etag-headers"] = this.options["group-etag-headers"] ?? true; + // private processClients(): SdkClient[] { + // const sdkPackage = this.sdkContext.experimental_sdkPackage; + // const clients = listClients(this.sdkContext); + // // preprocess group-etag-headers + // this.options["group-etag-headers"] = this.options["group-etag-headers"] ?? true; - for (const client of clients) { - const codeModelClient = new CodeModelClient(client.name, this.getDoc(client.type), { - summary: this.getSummary(client.type), + // for (const client of clients) { + // const codeModelClient = new CodeModelClient(client.name, this.getDoc(client.type), { + // summary: this.getSummary(client.type), - // at present, use global security definition - security: this.codeModel.security, - }); - codeModelClient.crossLanguageDefinitionId = client.crossLanguageDefinitionId; - - // versioning - const versioning = getVersion(this.program, client.service); - if (versioning && versioning.getVersions()) { - // @versioned in versioning - if (!this.sdkContext.apiVersion || ["all", "latest"].includes(this.sdkContext.apiVersion)) { - this.apiVersion = getDefaultApiVersion(this.sdkContext, client.service); - } else { - this.apiVersion = versioning.getVersions().find((it: Version) => it.value === this.sdkContext.apiVersion); - if (!this.apiVersion) { - throw new Error("Unrecognized api-version: " + this.sdkContext.apiVersion); - } - } - - codeModelClient.apiVersions = []; - for (const version of this.getFilteredApiVersions(this.apiVersion, versioning.getVersions())) { - const apiVersion = new ApiVersion(); - apiVersion.version = version.value; - codeModelClient.apiVersions.push(apiVersion); - } - } - - // server - let baseUri = "{endpoint}"; - const servers = getServers(this.program, client.service); - if (servers && servers.length === 1 && !this.isArmSynthesizedServer(servers[0])) { - baseUri = servers[0].url; - } - const hostParameters = this.processHost(servers?.length === 1 ? servers[0] : undefined); - codeModelClient.addGlobalParameters(hostParameters); - const clientContext = new ClientContext( - baseUri, - hostParameters, - codeModelClient.globalParameters!, - codeModelClient.apiVersions, - ); - clientContext.preProcessOperations(this.sdkContext, client); + // // at present, use global security definition + // security: this.codeModel.security, + // }); + // codeModelClient.crossLanguageDefinitionId = client.crossLanguageDefinitionId; + + // // versioning + // const versioning = getVersion(this.program, client.service); + // if (versioning && versioning.getVersions()) { + // // @versioned in versioning + // if (!this.sdkContext.apiVersion || ["all", "latest"].includes(this.sdkContext.apiVersion)) { + // this.apiVersion = getDefaultApiVersion(this.sdkContext, client.service); + // } else { + // this.apiVersion = versioning.getVersions().find((it: Version) => it.value === this.sdkContext.apiVersion); + // if (!this.apiVersion) { + // throw new Error("Unrecognized api-version: " + this.sdkContext.apiVersion); + // } + // } - const operationGroups = listOperationGroups(this.sdkContext, client, true); + // codeModelClient.apiVersions = []; + // for (const version of this.getFilteredApiVersions(this.apiVersion, versioning.getVersions())) { + // const apiVersion = new ApiVersion(); + // apiVersion.version = version.value; + // codeModelClient.apiVersions.push(apiVersion); + // } + // } - const operationWithoutGroup = listOperationsInOperationGroup(this.sdkContext, client); - let codeModelGroup = new OperationGroup(""); - for (const operation of operationWithoutGroup) { - if (!this.needToSkipProcessingOperation(operation, clientContext)) { - codeModelGroup.addOperation(this.processOperation("", operation, clientContext)); - } - } - if (codeModelGroup.operations?.length > 0) { - codeModelClient.operationGroups.push(codeModelGroup); - } + // // server + // let baseUri = "{endpoint}"; + // const servers = getServers(this.program, client.service); + // if (servers && servers.length === 1 && !this.isArmSynthesizedServer(servers[0])) { + // baseUri = servers[0].url; + // } + // const hostParameters = this.processHost(servers?.length === 1 ? servers[0] : undefined); + // codeModelClient.addGlobalParameters(hostParameters); + // const clientContext = new ClientContext( + // baseUri, + // hostParameters, + // codeModelClient.globalParameters!, + // codeModelClient.apiVersions, + // ); + // clientContext.preProcessOperations(this.sdkContext, client); + + // const operationGroups = listOperationGroups(this.sdkContext, client, true); + + // const operationWithoutGroup = listOperationsInOperationGroup(this.sdkContext, client); + // let codeModelGroup = new OperationGroup(""); + // for (const operation of operationWithoutGroup) { + // if (!this.needToSkipProcessingOperation(operation, clientContext)) { + // codeModelGroup.addOperation(this.processOperation("", operation, clientContext)); + // } + // } + // if (codeModelGroup.operations?.length > 0) { + // codeModelClient.operationGroups.push(codeModelGroup); + // } - for (const operationGroup of operationGroups) { - const operations = listOperationsInOperationGroup(this.sdkContext, operationGroup); - // operation group with no operation is skipped - if (operations.length > 0) { - const groupPath = operationGroup.groupPath.split("."); - let operationGroupName: string; - if (groupPath.length > 1) { - // groupPath should be in format of "OpenAIClient.Chat.Completions" - operationGroupName = groupPath.slice(1).join(""); - } else { - // protection - operationGroupName = operationGroup.type.name; - } - codeModelGroup = new OperationGroup(operationGroupName); - for (const operation of operations) { - if (!this.needToSkipProcessingOperation(operation, clientContext)) { - codeModelGroup.addOperation(this.processOperation(operationGroupName, operation, clientContext)); - } - } - codeModelClient.operationGroups.push(codeModelGroup); - } - } + // for (const operationGroup of operationGroups) { + // const operations = listOperationsInOperationGroup(this.sdkContext, operationGroup); + // // operation group with no operation is skipped + // if (operations.length > 0) { + // const groupPath = operationGroup.groupPath.split("."); + // let operationGroupName: string; + // if (groupPath.length > 1) { + // // groupPath should be in format of "OpenAIClient.Chat.Completions" + // operationGroupName = groupPath.slice(1).join(""); + // } else { + // // protection + // operationGroupName = operationGroup.type.name; + // } + // codeModelGroup = new OperationGroup(operationGroupName); + // for (const operation of operations) { + // if (!this.needToSkipProcessingOperation(operation, clientContext)) { + // codeModelGroup.addOperation(this.processOperation(operationGroupName, operation, clientContext)); + // } + // } + // codeModelClient.operationGroups.push(codeModelGroup); + // } + // } - this.codeModel.clients.push(codeModelClient); - } + // this.codeModel.clients.push(codeModelClient); + // } - // postprocess for ServiceVersion - let apiVersionSameForAllClients = true; - let sharedApiVersions = undefined; - for (const client of this.codeModel.clients) { - const apiVersions = client.apiVersions; - if (!apiVersions) { - // client does not have apiVersions - apiVersionSameForAllClients = false; - } else if (!sharedApiVersions) { - // first client, set it to sharedApiVersions - sharedApiVersions = apiVersions; - } else { - apiVersionSameForAllClients = isEqual(sharedApiVersions, apiVersions); - } - if (!apiVersionSameForAllClients) { - break; - } - } - if (apiVersionSameForAllClients) { - const serviceVersion = getServiceVersion(this.codeModel); - for (const client of this.codeModel.clients) { - client.serviceVersion = serviceVersion; - } - } else { - for (const client of this.codeModel.clients) { - const apiVersions = client.apiVersions; - if (apiVersions) { - client.serviceVersion = getServiceVersion(client); - } - } - } + // // postprocess for ServiceVersion + // let apiVersionSameForAllClients = true; + // let sharedApiVersions = undefined; + // for (const client of this.codeModel.clients) { + // const apiVersions = client.apiVersions; + // if (!apiVersions) { + // // client does not have apiVersions + // apiVersionSameForAllClients = false; + // } else if (!sharedApiVersions) { + // // first client, set it to sharedApiVersions + // sharedApiVersions = apiVersions; + // } else { + // apiVersionSameForAllClients = isEqual(sharedApiVersions, apiVersions); + // } + // if (!apiVersionSameForAllClients) { + // break; + // } + // } + // if (apiVersionSameForAllClients) { + // const serviceVersion = getServiceVersion(this.codeModel); + // for (const client of this.codeModel.clients) { + // client.serviceVersion = serviceVersion; + // } + // } else { + // for (const client of this.codeModel.clients) { + // const apiVersions = client.apiVersions; + // if (apiVersions) { + // client.serviceVersion = getServiceVersion(client); + // } + // } + // } - return clients; - } + // return clients; + // } /** * Filter api-versions for "ServiceVersion". @@ -971,18 +944,18 @@ export class CodeModelBuilder { let apiComment: string | undefined = undefined; if (generateConvenienceApi) { // check if the convenience API need to be disabled for some special cases - if (operationIsMultipart(httpOperation.__raw)) { + if (sdkHttpOperationIsMultipart(httpOperation)) { // do not generate protocol method for multipart/form-data, as it be very hard for user to prepare the request body as BinaryData generateProtocolApi = false; apiComment = `Protocol API requires serialization of parts with content-disposition and data, as operation '${operationName}' is 'multipart/form-data'`; this.logWarning(apiComment); - } else if (operationIsMultipleContentTypes(httpOperation.__raw)) { + } else if (sdkHttpOperationIsMultipleContentTypes(httpOperation)) { // and multiple content types // issue link: https://github.com/Azure/autorest.java/issues/1958#issuecomment-1562558219 generateConvenienceApi = false; apiComment = `Convenience API is not generated, as operation '${operationName}' is multiple content-type`; this.logWarning(apiComment); - } else if (operationIsJsonMergePatch(httpOperation.__raw) && this.options["stream-style-serialization"] === false) { + } else if (sdkHttpOperationIsJsonMergePatch(httpOperation) && this.options["stream-style-serialization"] === false) { // do not generate convenient method for json merge patch operation if stream-style-serialization is not enabled generateConvenienceApi = false; apiComment = `Convenience API is not generated, as operation '${operationName}' is 'application/merge-patch+json' and stream-style-serialization is not enabled`; @@ -1049,7 +1022,7 @@ export class CodeModelBuilder { // } // } // this.processParameterBody(codeModelOperation, httpOperation.__raw, bodyType.__raw as Model | ModelProperty); - this.processParameterBodyFromSdkType(codeModelOperation, httpOperation.__raw, httpOperation.bodyParam); + this.processParameterBodyFromSdkType(codeModelOperation, httpOperation.__raw, httpOperation, httpOperation.bodyParam); // } } @@ -1061,12 +1034,10 @@ export class CodeModelBuilder { // lro metadata let lroMetadata = new LongRunningMetadata(false); if (sdkMethod.kind === "lro" || sdkMethod.kind === "lropaging") { - this.processLroMetadataFromSdkType(codeModelOperation, sdkMethod); + lroMetadata = this.processLroMetadataFromSdkType(codeModelOperation, sdkMethod); } // responses - // this.processResponseFromSdkType(codeModelOperation, sdkMethod.operation.responses, lroMetadata.longRunning); - for (const [code, response] of sdkMethod.operation.responses) { this.processResponseFromSdkType(codeModelOperation, code, response, lroMetadata.longRunning, false); } @@ -1079,6 +1050,7 @@ export class CodeModelBuilder { // check for paged this.processRouteForPaged(codeModelOperation, sdkMethod.operation.__raw.responses); + // check for long-running operation if (sdkMethod.__raw) { this.processRouteForLongRunning(codeModelOperation, sdkMethod.__raw, sdkMethod.operation.__raw.responses, lroMetadata); @@ -1089,145 +1061,145 @@ export class CodeModelBuilder { return codeModelOperation; } - private processOperation(groupName: string, operation: Operation, clientContext: ClientContext): CodeModelOperation { - const op = ignoreDiagnostics(getHttpOperation(this.program, operation)); - - const operationGroup = this.codeModel.getOperationGroup(groupName); - const operationName = this.getName(operation); - const opId = groupName ? `${groupName}_${operationName}` : `${operationName}`; - - const operationExample = this.getOperationExample(operation); - - const codeModelOperation = new CodeModelOperation(operationName, this.getDoc(operation), { - operationId: opId, - summary: this.getSummary(operation), - extensions: { - "x-ms-examples": operationExample - ? { [operationExample.title ?? operationExample.operationId ?? operation.name]: operationExample } - : undefined, - }, - }); - - codeModelOperation.crossLanguageDefinitionId = getCrossLanguageDefinitionId(this.sdkContext, operation); - codeModelOperation.internalApi = this.isInternal(this.sdkContext, operation); - - const convenienceApiName = this.getConvenienceApiName(operation); - let generateConvenienceApi: boolean = Boolean(convenienceApiName); - let generateProtocolApi: boolean = shouldGenerateProtocol(this.sdkContext, operation); - - let apiComment: string | undefined = undefined; - if (generateConvenienceApi) { - // check if the convenience API need to be disabled for some special cases - if (operationIsMultipart(op)) { - // do not generate protocol method for multipart/form-data, as it be very hard for user to prepare the request body as BinaryData - generateProtocolApi = false; - apiComment = `Protocol API requires serialization of parts with content-disposition and data, as operation '${op.operation.name}' is 'multipart/form-data'`; - this.logWarning(apiComment); - } else if (operationIsMultipleContentTypes(op)) { - // and multiple content types - // issue link: https://github.com/Azure/autorest.java/issues/1958#issuecomment-1562558219 - generateConvenienceApi = false; - apiComment = `Convenience API is not generated, as operation '${op.operation.name}' is multiple content-type`; - this.logWarning(apiComment); - } else if (operationIsJsonMergePatch(op) && this.options["stream-style-serialization"] === false) { - // do not generate convenient method for json merge patch operation if stream-style-serialization is not enabled - generateConvenienceApi = false; - apiComment = `Convenience API is not generated, as operation '${op.operation.name}' is 'application/merge-patch+json' and stream-style-serialization is not enabled`; - this.logWarning(apiComment); - } - // else { - // const union = operationRefersUnion(this.program, op, this.typeUnionRefCache); - // if (union) { - // // and Union - // generateConvenienceApi = false; - // apiComment = `Convenience API is not generated, as operation '${ - // op.operation.name - // }' refers Union '${getUnionDescription(union, this.typeNameOptions)}'`; - // this.logWarning(apiComment); - // } - // } - } - if (generateConvenienceApi && convenienceApiName) { - codeModelOperation.convenienceApi = new ConvenienceApi(convenienceApiName); - } - if (apiComment) { - codeModelOperation.language.java = new Language(); - codeModelOperation.language.java.comment = apiComment; - } - - // check for generating protocol api or not - codeModelOperation.generateProtocolApi = generateProtocolApi && !codeModelOperation.internalApi; - - codeModelOperation.addRequest( - new Request({ - protocol: { - http: { - path: op.path, - method: op.verb, - uri: clientContext.baseUri, - }, - }, - }), - ); + // private processOperation(groupName: string, operation: Operation, clientContext: ClientContext): CodeModelOperation { + // const op = ignoreDiagnostics(getHttpOperation(this.program, operation)); + + // const operationGroup = this.codeModel.getOperationGroup(groupName); + // const operationName = this.getName(operation); + // const opId = groupName ? `${groupName}_${operationName}` : `${operationName}`; + + // const operationExample = this.getOperationExample(operation); + + // const codeModelOperation = new CodeModelOperation(operationName, this.getDoc(operation), { + // operationId: opId, + // summary: this.getSummary(operation), + // extensions: { + // "x-ms-examples": operationExample + // ? { [operationExample.title ?? operationExample.operationId ?? operation.name]: operationExample } + // : undefined, + // }, + // }); + + // codeModelOperation.crossLanguageDefinitionId = getCrossLanguageDefinitionId(this.sdkContext, operation); + // codeModelOperation.internalApi = this.isInternal(this.sdkContext, operation); + + // const convenienceApiName = this.getConvenienceApiName(operation); + // let generateConvenienceApi: boolean = Boolean(convenienceApiName); + // let generateProtocolApi: boolean = shouldGenerateProtocol(this.sdkContext, operation); + + // let apiComment: string | undefined = undefined; + // if (generateConvenienceApi) { + // // check if the convenience API need to be disabled for some special cases + // if (operationIsMultipart(op)) { + // // do not generate protocol method for multipart/form-data, as it be very hard for user to prepare the request body as BinaryData + // generateProtocolApi = false; + // apiComment = `Protocol API requires serialization of parts with content-disposition and data, as operation '${op.operation.name}' is 'multipart/form-data'`; + // this.logWarning(apiComment); + // } else if (operationIsMultipleContentTypes(op)) { + // // and multiple content types + // // issue link: https://github.com/Azure/autorest.java/issues/1958#issuecomment-1562558219 + // generateConvenienceApi = false; + // apiComment = `Convenience API is not generated, as operation '${op.operation.name}' is multiple content-type`; + // this.logWarning(apiComment); + // } else if (operationIsJsonMergePatch(op) && this.options["stream-style-serialization"] === false) { + // // do not generate convenient method for json merge patch operation if stream-style-serialization is not enabled + // generateConvenienceApi = false; + // apiComment = `Convenience API is not generated, as operation '${op.operation.name}' is 'application/merge-patch+json' and stream-style-serialization is not enabled`; + // this.logWarning(apiComment); + // } + // // else { + // // const union = operationRefersUnion(this.program, op, this.typeUnionRefCache); + // // if (union) { + // // // and Union + // // generateConvenienceApi = false; + // // apiComment = `Convenience API is not generated, as operation '${ + // // op.operation.name + // // }' refers Union '${getUnionDescription(union, this.typeNameOptions)}'`; + // // this.logWarning(apiComment); + // // } + // // } + // } + // if (generateConvenienceApi && convenienceApiName) { + // codeModelOperation.convenienceApi = new ConvenienceApi(convenienceApiName); + // } + // if (apiComment) { + // codeModelOperation.language.java = new Language(); + // codeModelOperation.language.java.comment = apiComment; + // } - // host - clientContext.hostParameters.forEach((it) => codeModelOperation.addParameter(it)); - // parameters - op.parameters.parameters.map((it) => { - const sdkParamType = ignoreDiagnostics(getSdkModelPropertyType(this.sdkContext, it.param, operation)) as SdkHeaderParameter | SdkQueryParameter | SdkPathParameter; - this.processParameterFromSdkType(codeModelOperation, sdkParamType, clientContext); - }); - // "accept" header - this.addAcceptHeaderParameter(codeModelOperation, op.responses); - // body - if (op.parameters.body) { - if (op.parameters.body.property) { - if (!isVoidType(op.parameters.body.property.type)) { - this.processParameterBody(codeModelOperation, op, op.parameters.body.property); - } - } else if (op.parameters.body.type) { - let bodyType = this.getEffectiveSchemaType(op.parameters.body.type); + // // check for generating protocol api or not + // codeModelOperation.generateProtocolApi = generateProtocolApi && !codeModelOperation.internalApi; - if (bodyType.kind === "Model") { - // try use resource type as round-trip model - const resourceType = getResourceOperation(this.program, operation)?.resourceType; - if (resourceType && op.responses && op.responses.length > 0) { - const resp = op.responses[0]; - if (resp.responses && resp.responses.length > 0 && resp.responses[0].body) { - const responseBody = resp.responses[0].body; - const bodyTypeInResponse = this.findResponseBody(responseBody.type); - // response body type is resource type, and request body type (if templated) contains resource type - if (bodyTypeInResponse === resourceType && isModelReferredInTemplate(bodyType, resourceType)) { - bodyType = resourceType; - } - } - } + // codeModelOperation.addRequest( + // new Request({ + // protocol: { + // http: { + // path: op.path, + // method: op.verb, + // uri: clientContext.baseUri, + // }, + // }, + // }), + // ); + + // // host + // clientContext.hostParameters.forEach((it) => codeModelOperation.addParameter(it)); + // // parameters + // op.parameters.parameters.map((it) => { + // const sdkParamType = ignoreDiagnostics(getSdkModelPropertyType(this.sdkContext, it.param, operation)) as SdkHeaderParameter | SdkQueryParameter | SdkPathParameter; + // this.processParameterFromSdkType(codeModelOperation, sdkParamType, clientContext); + // }); + // // "accept" header + // this.addAcceptHeaderParameter(codeModelOperation, op.responses); + // // body + // if (op.parameters.body) { + // if (op.parameters.body.property) { + // if (!isVoidType(op.parameters.body.property.type)) { + // this.processParameterBody(codeModelOperation, op, op.parameters.body.property); + // } + // } else if (op.parameters.body.type) { + // let bodyType = this.getEffectiveSchemaType(op.parameters.body.type); + + // if (bodyType.kind === "Model") { + // // try use resource type as round-trip model + // const resourceType = getResourceOperation(this.program, operation)?.resourceType; + // if (resourceType && op.responses && op.responses.length > 0) { + // const resp = op.responses[0]; + // if (resp.responses && resp.responses.length > 0 && resp.responses[0].body) { + // const responseBody = resp.responses[0].body; + // const bodyTypeInResponse = this.findResponseBody(responseBody.type); + // // response body type is resource type, and request body type (if templated) contains resource type + // if (bodyTypeInResponse === resourceType && isModelReferredInTemplate(bodyType, resourceType)) { + // bodyType = resourceType; + // } + // } + // } - this.processParameterBody(codeModelOperation, op, bodyType); - } - } - } + // this.processParameterBody(codeModelOperation, op, bodyType); + // } + // } + // } - // group ETag header parameters, if exists - if (this.options["group-etag-headers"]) { - this.processEtagHeaderParameters(codeModelOperation, op); - } + // // group ETag header parameters, if exists + // if (this.options["group-etag-headers"]) { + // this.processEtagHeaderParameters(codeModelOperation, op); + // } - // lro metadata - const lroMetadata = this.processLroMetadata(codeModelOperation, op); + // // lro metadata + // const lroMetadata = this.processLroMetadata(codeModelOperation, op); - // responses - op.responses.map((it) => this.processResponse(codeModelOperation, it, lroMetadata.longRunning)); + // // responses + // op.responses.map((it) => this.processResponse(codeModelOperation, it, lroMetadata.longRunning)); - // check for paged - this.processRouteForPaged(codeModelOperation, op.responses); - // check for long-running operation - this.processRouteForLongRunning(codeModelOperation, operation, op.responses, lroMetadata); + // // check for paged + // this.processRouteForPaged(codeModelOperation, op.responses); + // // check for long-running operation + // this.processRouteForLongRunning(codeModelOperation, operation, op.responses, lroMetadata); - operationGroup.addOperation(codeModelOperation); + // operationGroup.addOperation(codeModelOperation); - return codeModelOperation; - } + // return codeModelOperation; + // } private processRouteForPaged(op: CodeModelOperation, responses: HttpOperationResponse[]) { for (const response of responses) { @@ -1501,7 +1473,7 @@ export class CodeModelBuilder { } } else { // schema - const sdkType = param.type; + const sdkType = getNonNullSdkType(param.type); const schema = this.processSchemaFromSdkType(sdkType, param.name); // skip-url-encoding @@ -2124,8 +2096,11 @@ export class CodeModelBuilder { } } - private processParameterBodyFromSdkType(op: CodeModelOperation, httpOperation: HttpOperation, sdkBody: SdkModelPropertyType) { - const parameters = httpOperation.operation.parameters; + private processParameterBodyFromSdkType(op: CodeModelOperation, rawHttpOperation: HttpOperation, sdkHttpOperation: SdkHttpOperation, sdkBody: SdkModelPropertyType) { + // set contentTypes to mediaTypes + op.requests![0].protocol.http!.mediaTypes = rawHttpOperation.parameters.body!.contentTypes; + + const parameters = rawHttpOperation.operation.parameters; const unknownRequestBody = op.requests![0].protocol.http!.mediaTypes && @@ -2161,10 +2136,10 @@ export class CodeModelBuilder { this.trackSchemaUsage(schema, { usage: [op.internalApi ? SchemaContext.Internal : SchemaContext.Public] }); } - if (operationIsJsonMergePatch(httpOperation)) { + if (sdkHttpOperationIsJsonMergePatch(sdkHttpOperation)) { this.trackSchemaUsage(schema, { usage: [SchemaContext.JsonMergePatch] }); } - if (op.convenienceApi && operationIsMultipart(httpOperation)) { + if (op.convenienceApi && sdkHttpOperationIsMultipart(sdkHttpOperation)){ this.trackSchemaUsage(schema, { serializationFormats: [KnownMediaType.Multipart] }); } @@ -2179,12 +2154,12 @@ export class CodeModelBuilder { parameter.language.default.name = "request"; } - if (operationIsJsonMergePatch(httpOperation)) { + if (sdkHttpOperationIsJsonMergePatch(sdkHttpOperation)) { // skip model flatten, if "application/merge-patch+json" schema.language.default.name = pascalCase(op.language.default.name) + "PatchRequest"; return; } - + this.trackSchemaUsage(schema, { usage: [SchemaContext.Anonymous] }); if (op.convenienceApi && op.parameters) { @@ -2242,7 +2217,7 @@ export class CodeModelBuilder { if (request.signatureParameters.length > 6) { // create an option bag const name = op.language.default.name + "Options"; - const namespace = getNamespace(httpOperation.operation); + const namespace = getNamespace(rawHttpOperation.operation); // option bag schema const optionBagSchema = this.codeModel.schemas.add( new GroupSchema(name, `Options for ${op.language.default.name} API`, { @@ -2297,185 +2272,185 @@ export class CodeModelBuilder { } - private processParameterBody(op: CodeModelOperation, httpOperation: HttpOperation, body: ModelProperty | Model) { - // set contentTypes to mediaTypes - op.requests![0].protocol.http!.mediaTypes = httpOperation.parameters.body!.contentTypes; + // private processParameterBody(op: CodeModelOperation, httpOperation: HttpOperation, body: ModelProperty | Model) { + // // set contentTypes to mediaTypes + // op.requests![0].protocol.http!.mediaTypes = httpOperation.parameters.body!.contentTypes; - const parameters = httpOperation.operation.parameters; + // const parameters = httpOperation.operation.parameters; - const unknownRequestBody = - op.requests![0].protocol.http!.mediaTypes && - op.requests![0].protocol.http!.mediaTypes.length > 0 && - !isKnownContentType(op.requests![0].protocol.http!.mediaTypes); - - const sdkType: SdkType = getClientType(this.sdkContext, body, httpOperation.operation); + // const unknownRequestBody = + // op.requests![0].protocol.http!.mediaTypes && + // op.requests![0].protocol.http!.mediaTypes.length > 0 && + // !isKnownContentType(op.requests![0].protocol.http!.mediaTypes); - let schema: Schema; - if ( - unknownRequestBody && - body.kind === "ModelProperty" && - body.type.kind === "Scalar" && - body.type.name === "bytes" - ) { - // handle binary request body - schema = this.processBinarySchema(body.type); - } else { - schema = this.processSchemaFromSdkType(sdkType, body.name); - } + // const sdkType: SdkType = getClientType(this.sdkContext, body, httpOperation.operation); - const isAnonymousModel = sdkType.kind === "model" && sdkType.isGeneratedName === true; - const parameterName = body.kind === "Model" ? (sdkType.kind === "model" ? sdkType.name : "") : this.getName(body); - const parameter = new Parameter(parameterName, this.getDoc(body), schema, { - summary: this.getSummary(body), - implementation: ImplementationLocation.Method, - required: body.kind === "Model" || !body.optional, - protocol: { - http: new HttpParameter(ParameterLocation.Body), - }, - }); - op.addParameter(parameter); - - this.trackSchemaUsage(schema, { usage: [SchemaContext.Input] }); - - if (op.convenienceApi) { - // model/schema does not need to be Public or Internal, if it is not to be used in convenience API - this.trackSchemaUsage(schema, { usage: [op.internalApi ? SchemaContext.Internal : SchemaContext.Public] }); - } - - if (operationIsJsonMergePatch(httpOperation)) { - this.trackSchemaUsage(schema, { usage: [SchemaContext.JsonMergePatch] }); - } - if (op.convenienceApi && operationIsMultipart(httpOperation)) { - this.trackSchemaUsage(schema, { serializationFormats: [KnownMediaType.Multipart] }); - } - - if (schema instanceof ObjectSchema && isAnonymousModel) { - // anonymous model - - // name the schema for documentation - schema.language.default.name = pascalCase(op.language.default.name) + "Request"; + // let schema: Schema; + // if ( + // unknownRequestBody && + // body.kind === "ModelProperty" && + // body.type.kind === "Scalar" && + // body.type.name === "bytes" + // ) { + // // handle binary request body + // schema = this.processBinarySchema(body.type); + // } else { + // schema = this.processSchemaFromSdkType(sdkType, body.name); + // } - if (!parameter.language.default.name) { - // name the parameter for documentation - parameter.language.default.name = "request"; - } + // const isAnonymousModel = sdkType.kind === "model" && sdkType.isGeneratedName === true; + // const parameterName = body.kind === "Model" ? (sdkType.kind === "model" ? sdkType.name : "") : this.getName(body); + // const parameter = new Parameter(parameterName, this.getDoc(body), schema, { + // summary: this.getSummary(body), + // implementation: ImplementationLocation.Method, + // required: body.kind === "Model" || !body.optional, + // protocol: { + // http: new HttpParameter(ParameterLocation.Body), + // }, + // }); + // op.addParameter(parameter); + + // this.trackSchemaUsage(schema, { usage: [SchemaContext.Input] }); + + // if (op.convenienceApi) { + // // model/schema does not need to be Public or Internal, if it is not to be used in convenience API + // this.trackSchemaUsage(schema, { usage: [op.internalApi ? SchemaContext.Internal : SchemaContext.Public] }); + // } - if (operationIsJsonMergePatch(httpOperation)) { - // skip model flatten, if "application/merge-patch+json" - schema.language.default.name = pascalCase(op.language.default.name) + "PatchRequest"; - return; - } + // if (operationIsJsonMergePatch(httpOperation)) { + // this.trackSchemaUsage(schema, { usage: [SchemaContext.JsonMergePatch] }); + // } + // if (op.convenienceApi && operationIsMultipart(httpOperation)) { + // this.trackSchemaUsage(schema, { serializationFormats: [KnownMediaType.Multipart] }); + // } - this.trackSchemaUsage(schema, { usage: [SchemaContext.Anonymous] }); + // if (schema instanceof ObjectSchema && isAnonymousModel) { + // // anonymous model - if (op.convenienceApi && op.parameters) { - op.convenienceApi.requests = []; - const request = new Request({ - protocol: op.requests![0].protocol, - }); - request.parameters = []; - op.convenienceApi.requests.push(request); + // // name the schema for documentation + // schema.language.default.name = pascalCase(op.language.default.name) + "Request"; - for (const [_, opParameter] of parameters.properties) { - const serializedName = this.getSerializedName(opParameter); - const existParameter = op.parameters.find((it) => it.language.default.serializedName === serializedName); - if (existParameter) { - // parameter - if ( - existParameter.implementation === ImplementationLocation.Method && - (existParameter.origin?.startsWith("modelerfour:synthesized/") ?? true) - ) { - request.parameters.push(cloneOperationParameter(existParameter)); - } - } else { - // property from anonymous model - const existBodyProperty = schema.properties?.find((it) => it.serializedName === serializedName); - if ( - existBodyProperty && - !existBodyProperty.readOnly && - !(existBodyProperty.schema instanceof ConstantSchema) - ) { - request.parameters.push( - new VirtualParameter( - existBodyProperty.language.default.name, - existBodyProperty.language.default.description, - existBodyProperty.schema, - { - originalParameter: parameter, - targetProperty: existBodyProperty, - language: { - default: { - serializedName: existBodyProperty.serializedName, - }, - }, - summary: existBodyProperty.summary, - implementation: ImplementationLocation.Method, - required: existBodyProperty.required, - nullable: existBodyProperty.nullable, - }, - ), - ); - } - } - } - request.signatureParameters = request.parameters; + // if (!parameter.language.default.name) { + // // name the parameter for documentation + // parameter.language.default.name = "request"; + // } - if (request.signatureParameters.length > 6) { - // create an option bag - const name = op.language.default.name + "Options"; - const namespace = getNamespace(httpOperation.operation); - // option bag schema - const optionBagSchema = this.codeModel.schemas.add( - new GroupSchema(name, `Options for ${op.language.default.name} API`, { - language: { - default: { - namespace: namespace, - }, - java: { - namespace: getJavaNamespace(namespace), - }, - }, - }), - ); - request.parameters.forEach((it) => { - optionBagSchema.add( - new GroupProperty(it.language.default.name, it.language.default.description, it.schema, { - originalParameter: [it], - summary: it.summary, - required: it.required, - nullable: it.nullable, - readOnly: false, - serializedName: it.language.default.serializedName, - }), - ); - }); + // if (operationIsJsonMergePatch(httpOperation)) { + // // skip model flatten, if "application/merge-patch+json" + // schema.language.default.name = pascalCase(op.language.default.name) + "PatchRequest"; + // return; + // } - this.trackSchemaUsage(optionBagSchema, { usage: [SchemaContext.Input] }); - if (op.convenienceApi) { - this.trackSchemaUsage(optionBagSchema, { - usage: [op.internalApi ? SchemaContext.Internal : SchemaContext.Public], - }); - } + // this.trackSchemaUsage(schema, { usage: [SchemaContext.Anonymous] }); + + // if (op.convenienceApi && op.parameters) { + // op.convenienceApi.requests = []; + // const request = new Request({ + // protocol: op.requests![0].protocol, + // }); + // request.parameters = []; + // op.convenienceApi.requests.push(request); + + // for (const [_, opParameter] of parameters.properties) { + // const serializedName = this.getSerializedName(opParameter); + // const existParameter = op.parameters.find((it) => it.language.default.serializedName === serializedName); + // if (existParameter) { + // // parameter + // if ( + // existParameter.implementation === ImplementationLocation.Method && + // (existParameter.origin?.startsWith("modelerfour:synthesized/") ?? true) + // ) { + // request.parameters.push(cloneOperationParameter(existParameter)); + // } + // } else { + // // property from anonymous model + // const existBodyProperty = schema.properties?.find((it) => it.serializedName === serializedName); + // if ( + // existBodyProperty && + // !existBodyProperty.readOnly && + // !(existBodyProperty.schema instanceof ConstantSchema) + // ) { + // request.parameters.push( + // new VirtualParameter( + // existBodyProperty.language.default.name, + // existBodyProperty.language.default.description, + // existBodyProperty.schema, + // { + // originalParameter: parameter, + // targetProperty: existBodyProperty, + // language: { + // default: { + // serializedName: existBodyProperty.serializedName, + // }, + // }, + // summary: existBodyProperty.summary, + // implementation: ImplementationLocation.Method, + // required: existBodyProperty.required, + // nullable: existBodyProperty.nullable, + // }, + // ), + // ); + // } + // } + // } + // request.signatureParameters = request.parameters; + + // if (request.signatureParameters.length > 6) { + // // create an option bag + // const name = op.language.default.name + "Options"; + // const namespace = getNamespace(httpOperation.operation); + // // option bag schema + // const optionBagSchema = this.codeModel.schemas.add( + // new GroupSchema(name, `Options for ${op.language.default.name} API`, { + // language: { + // default: { + // namespace: namespace, + // }, + // java: { + // namespace: getJavaNamespace(namespace), + // }, + // }, + // }), + // ); + // request.parameters.forEach((it) => { + // optionBagSchema.add( + // new GroupProperty(it.language.default.name, it.language.default.description, it.schema, { + // originalParameter: [it], + // summary: it.summary, + // required: it.required, + // nullable: it.nullable, + // readOnly: false, + // serializedName: it.language.default.serializedName, + // }), + // ); + // }); + + // this.trackSchemaUsage(optionBagSchema, { usage: [SchemaContext.Input] }); + // if (op.convenienceApi) { + // this.trackSchemaUsage(optionBagSchema, { + // usage: [op.internalApi ? SchemaContext.Internal : SchemaContext.Public], + // }); + // } - // option bag parameter - const optionBagParameter = new Parameter( - "options", - optionBagSchema.language.default.description, - optionBagSchema, - { - implementation: ImplementationLocation.Method, - required: true, - nullable: false, - }, - ); + // // option bag parameter + // const optionBagParameter = new Parameter( + // "options", + // optionBagSchema.language.default.description, + // optionBagSchema, + // { + // implementation: ImplementationLocation.Method, + // required: true, + // nullable: false, + // }, + // ); - request.signatureParameters = [optionBagParameter]; - request.parameters.forEach((it) => (it.groupedBy = optionBagParameter)); - request.parameters.push(optionBagParameter); - } - } - } - } + // request.signatureParameters = [optionBagParameter]; + // request.parameters.forEach((it) => (it.groupedBy = optionBagParameter)); + // request.parameters.push(optionBagParameter); + // } + // } + // } + // } private findResponseBody(bodyType: Type): Type { // find a type that possibly without http metadata like @statusCode diff --git a/typespec-extension/src/operation-utils.ts b/typespec-extension/src/operation-utils.ts index 8633ba126f..c094330e6c 100644 --- a/typespec-extension/src/operation-utils.ts +++ b/typespec-extension/src/operation-utils.ts @@ -26,7 +26,7 @@ import { CodeModel } from "./common/code-model.js"; import { EmitterOptions } from "./emitter.js"; import { getNamespace, logWarning, pascalCase } from "./utils.js"; import { modelIs, unionReferredByType } from "./type-utils.js"; -import { SdkContext, getDefaultApiVersion } from "@azure-tools/typespec-client-generator-core"; +import { SdkContext, SdkHttpOperation, getDefaultApiVersion } from "@azure-tools/typespec-client-generator-core"; import { pathToFileURL } from "url"; export const SPECIAL_HEADER_NAMES = new Set([ @@ -173,18 +173,52 @@ function pascalCaseForOperationId(name: string) { .join("_"); } -export function operationIsJsonMergePatch(op: HttpOperation): boolean { - return operationIsContentType(op, "application/merge-patch+json"); +// export function operationIsJsonMergePatch(op: HttpOperation): boolean { +// return operationIsContentType(op, "application/merge-patch+json"); +// } + +// export function operationIsMultipart(op: HttpOperation): boolean { +// return operationIsContentType(op, "multipart/form-data"); +// } + +// function operationIsContentType(op: HttpOperation, contentType: string): boolean { +// for (const param of op.parameters.parameters) { +// if (param.type === "header" && param.name.toLowerCase() === CONTENT_TYPE_KEY) { +// if (param.param.type.kind === "String" && param.param.type.value === contentType) { +// return true; +// } +// } +// } +// return false; +// } + +// export function operationIsMultipleContentTypes(op: HttpOperation): boolean { +// if ( +// op.parameters.parameters && +// op.parameters.parameters.some( +// (parameter) => +// parameter?.type === "header" && +// parameter?.name?.toLowerCase() === CONTENT_TYPE_KEY && +// parameter?.param?.type?.kind === "Union", +// ) +// ) { +// return true; +// } +// return false; +// } + +export function sdkHttpOperationIsJsonMergePatch(op: SdkHttpOperation): boolean { + return sdkHttpOperationIsContentType(op, "application/merge-patch+json"); } -export function operationIsMultipart(op: HttpOperation): boolean { - return operationIsContentType(op, "multipart/form-data"); +export function sdkHttpOperationIsMultipart(op: SdkHttpOperation): boolean { + return sdkHttpOperationIsContentType(op, "multipart/form-data"); } -function operationIsContentType(op: HttpOperation, contentType: string): boolean { - for (const param of op.parameters.parameters) { - if (param.type === "header" && param.name.toLowerCase() === CONTENT_TYPE_KEY) { - if (param.param.type.kind === "String" && param.param.type.value === contentType) { +function sdkHttpOperationIsContentType(op: SdkHttpOperation, contentType: string): boolean { + for (const param of op.parameters) { + if (param.kind === "header" && param.serializedName.toLowerCase() === CONTENT_TYPE_KEY) { + if (param.type.kind === "constant" && param.type.value === contentType) { return true; } } @@ -192,14 +226,14 @@ function operationIsContentType(op: HttpOperation, contentType: string): boolean return false; } -export function operationIsMultipleContentTypes(op: HttpOperation): boolean { +export function sdkHttpOperationIsMultipleContentTypes(op: SdkHttpOperation): boolean { if ( - op.parameters.parameters && - op.parameters.parameters.some( + op.parameters && + op.parameters.some( (parameter) => - parameter?.type === "header" && - parameter?.name?.toLowerCase() === CONTENT_TYPE_KEY && - parameter?.param?.type?.kind === "Union", + parameter.kind === "header" && + parameter.serializedName.toLowerCase() === CONTENT_TYPE_KEY && + parameter.type.kind === "enum", ) ) { return true; From b7c09c016b75241d01d414ceab675156a497fd8d Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Tue, 2 Jul 2024 17:48:28 +0800 Subject: [PATCH 13/90] fixed flatten case's example --- typespec-extension/src/code-model-builder.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index aba8952146..1675fb8742 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -2118,7 +2118,7 @@ export class CodeModelBuilder { } const isAnonymousModel = sdkType.kind === "model" && sdkType.isGeneratedName === true; - const parameterName = sdkBody.name; + const parameterName = isAnonymousModel ? "" : sdkBody.name; // not use TCGC's anonymous model's name, as we want to overwrite the name in below logics const parameter = new Parameter(parameterName, sdkBody.description ?? "", schema, { summary: sdkBody.details, implementation: ImplementationLocation.Method, From f78adfae40e0e8ed245e62ea95aa262c7303d543 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Wed, 10 Jul 2024 14:57:54 +0800 Subject: [PATCH 14/90] convert more functions from using raw to tcgc types --- typespec-extension/src/code-model-builder.ts | 159 ++++++++----------- 1 file changed, 62 insertions(+), 97 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 250d4008c5..4a168f56d2 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -58,6 +58,7 @@ import { SdkHttpResponse, SdkLroPagingServiceMethod, SdkLroServiceMethod, + SdkMethod, SdkModelPropertyType, SdkModelType, SdkPathParameter, @@ -1005,12 +1006,18 @@ export class CodeModelBuilder { // host clientContext.hostParameters.forEach((it) => codeModelOperation.addParameter(it)); // path/query/header parameters - httpOperation.parameters.map((it) => { - this.processParameterFromSdkType(codeModelOperation, it, clientContext); - }); + for (let param of httpOperation.parameters) { + // if it's paged operation with request body, remove content-type header added by TCGC, as next link call should not have content type header + if ((sdkMethod.kind === "paging" || sdkMethod.kind === "lropaging") && httpOperation.bodyParam) { + if (param.serializedName.toLocaleLowerCase() === "content-type") { + continue; + } + } + this.processParameterFromSdkType(codeModelOperation, param, clientContext); + } // "accept" header // this.addAcceptHeaderParameterFromSdkType(codeModelOperation, httpOperation.responses); - // // body + // body if (httpOperation.bodyParam && httpOperation.__raw && sdkMethod.__raw && httpOperation.bodyParam.type.__raw) { // let bodyType = httpOperation.bodyParam.type; // if (bodyType.kind === "model" && bodyType.__raw) { @@ -1055,13 +1062,12 @@ export class CodeModelBuilder { // check for paged - this.processRouteForPaged(codeModelOperation, sdkMethod.operation.__raw.responses); - + // this.processRouteForPaged(codeModelOperation, sdkMethod.operation.__raw.responses); + this.processRouteForPagedFromSdkType(codeModelOperation, sdkMethod.operation.responses, sdkMethod); + // check for long-running operation - if (sdkMethod.__raw) { - this.processRouteForLongRunning(codeModelOperation, sdkMethod.__raw, sdkMethod.operation.__raw.responses, lroMetadata); - } - + this.processRouteForLongRunningFromSdkType(codeModelOperation, sdkMethod.operation.responses, lroMetadata); + operationGroup.addOperation(codeModelOperation); return codeModelOperation; @@ -1234,96 +1240,29 @@ export class CodeModelBuilder { } } - private processLroMetadata(op: CodeModelOperation, httpOperation: HttpOperation): LongRunningMetadata { - const operation = httpOperation.operation; - - const trackConvenienceApi: boolean = Boolean(op.convenienceApi); - - const lroMetadata = getLroMetadata(this.program, operation); - // needs lroMetadata.statusMonitorStep, as getLroMetadata would return for @pollingOperation operation - if (lroMetadata && lroMetadata.pollingInfo && lroMetadata.statusMonitorStep) { - let pollingSchema = undefined; - let finalSchema = undefined; - - let pollingStrategy: Metadata | undefined = undefined; - let finalResultPropertySerializedName: string | undefined = undefined; - - const verb = httpOperation.verb; - const useNewPollStrategy = isLroNewPollingStrategy(httpOperation, lroMetadata); - if (useNewPollStrategy) { - // use OperationLocationPollingStrategy - pollingStrategy = new Metadata({ - language: { - java: { - name: "OperationLocationPollingStrategy", - namespace: getJavaNamespace(this.namespace) + ".implementation", - }, - }, - }); - } - - // pollingSchema - if (modelIs(lroMetadata.pollingInfo.responseModel, "OperationStatus", "Azure.Core.Foundations")) { - pollingSchema = this.pollResultSchema; - } else { - const pollType = this.findResponseBody(lroMetadata.pollingInfo.responseModel); - const sdkType = getClientType(this.sdkContext, pollType); - pollingSchema = this.processSchemaFromSdkType(sdkType, "pollResult"); - } - - // finalSchema - if ( - verb !== "delete" && - lroMetadata.finalResult && - lroMetadata.finalEnvelopeResult && - lroMetadata.finalResult !== "void" && - lroMetadata.finalEnvelopeResult !== "void" - ) { - const finalResult = useNewPollStrategy ? lroMetadata.finalResult : lroMetadata.finalEnvelopeResult; - const finalType = this.findResponseBody(finalResult); - const sdkType = getClientType(this.sdkContext, finalType); - finalSchema = this.processSchemaFromSdkType(sdkType, "finalResult"); - - if ( - useNewPollStrategy && - lroMetadata.finalStep && - lroMetadata.finalStep.kind === "pollingSuccessProperty" && - lroMetadata.finalStep.target - ) { - // final result is the value in lroMetadata.finalStep.target - finalResultPropertySerializedName = this.getSerializedName(lroMetadata.finalStep.target); - } - } + private processRouteForPagedFromSdkType(op: CodeModelOperation, responses: Map, sdkMethod: SdkMethod) { + if (sdkMethod.kind === "paging" || sdkMethod.kind === "lropaging") { + for (const [code, response] of responses) { + let bodyType = response.type; + if (bodyType && bodyType.kind === "model") { + const pagedResult = sdkMethod.__raw_paged_metadata; + if (pagedResult) { + op.extensions = op.extensions ?? {}; + op.extensions["x-ms-pageable"] = { + itemName: pagedResult.itemsProperty?.name, + nextLinkName: pagedResult.nextLinkProperty?.name, + }; - // track usage - if (pollingSchema) { - this.trackSchemaUsage(pollingSchema, { usage: [SchemaContext.Output] }); - if (trackConvenienceApi) { - this.trackSchemaUsage(pollingSchema, { - usage: [op.internalApi ? SchemaContext.Internal : SchemaContext.Public], - }); - } - } - if (finalSchema) { - this.trackSchemaUsage(finalSchema, { usage: [SchemaContext.Output] }); - if (trackConvenienceApi) { - this.trackSchemaUsage(finalSchema, { - usage: [op.internalApi ? SchemaContext.Internal : SchemaContext.Public], - }); + op.responses?.forEach((r) => { + if (r instanceof SchemaResponse) { + this.trackSchemaUsage(r.schema, { usage: [SchemaContext.Paged] }); + } + }); + break; + } } } - - op.lroMetadata = new LongRunningMetadata( - true, - pollingSchema, - finalSchema, - pollingStrategy, - finalResultPropertySerializedName, - ); - return op.lroMetadata; } - - return new LongRunningMetadata(false); } private processLroMetadataFromSdkType(op: CodeModelOperation, sdkMethod: SdkLroServiceMethod | SdkLroPagingServiceMethod): LongRunningMetadata { @@ -1442,6 +1381,31 @@ export class CodeModelBuilder { } } + private processRouteForLongRunningFromSdkType( + op: CodeModelOperation, + responses: Map, + lroMetadata: LongRunningMetadata, + ) { + if (lroMetadata.longRunning) { + op.extensions = op.extensions ?? {}; + op.extensions["x-ms-long-running-operation"] = true; + return; + } + + for (const [code, response] of responses) { + if (response.headers) { + for (const header of response.headers) { + if (isPollingLocation(this.program, header.__raw)) { + op.extensions = op.extensions ?? {}; + op.extensions["x-ms-long-running-operation"] = true; + + break; + } + } + } + } + } + private _armApiVersionParameter?: Parameter; private processParameterFromSdkType(op: CodeModelOperation, param: SdkQueryParameter | SdkPathParameter | SdkHeaderParameter, clientContext: ClientContext) { @@ -2124,7 +2088,8 @@ export class CodeModelBuilder { } const isAnonymousModel = sdkType.kind === "model" && sdkType.isGeneratedName === true; - const parameterName = isAnonymousModel ? "" : sdkBody.name; // not use TCGC's anonymous model's name, as we want to overwrite the name in below logics + const parameterName = sdkBody.name; + const parameter = new Parameter(parameterName, sdkBody.description ?? "", schema, { summary: sdkBody.details, implementation: ImplementationLocation.Method, From 80b9d9251d42af99cbe5a403076f4e597c582bd3 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Wed, 10 Jul 2024 14:59:03 +0800 Subject: [PATCH 15/90] update test --- typespec-tests/tsp/internal.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typespec-tests/tsp/internal.tsp b/typespec-tests/tsp/internal.tsp index 2da6ff253e..6efe8711a5 100644 --- a/typespec-tests/tsp/internal.tsp +++ b/typespec-tests/tsp/internal.tsp @@ -94,7 +94,7 @@ model ProtocolInternalModel { interface InternalOp { // test ApiRequest with Access.public @access(Access.public, "python") - @access(Access.internal, "client") + @access(Access.internal, "java") @post postInternal(@body body: ApiRequest): ResponseInternal; From 9f35c405589c44c9dae28ca69b12292e558f3da4 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Thu, 11 Jul 2024 07:38:12 +0800 Subject: [PATCH 16/90] update logic to judge if bodyParameterFlatten --- typespec-extension/src/code-model-builder.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 748f462013..d86784a78c 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -66,6 +66,7 @@ import { SdkServiceMethod, SdkType, SdkUnionType, + UsageFlags, createSdkContext, getAllModels, getClientNameOverride, @@ -2088,10 +2089,8 @@ export class CodeModelBuilder { } - // Explicit body parameter @body or @bodyRoot would result to body.kind === "ModelProperty" - // Implicit body parameter would result to body.kind === "Model" - // see https://typespec.io/docs/libraries/http/cheat-sheet#data-types - const bodyParameterFlatten = sdkType.kind === "model" && !this.isArm(); + // Implicit body parameter would have usage flag: UsageFlags.Spread, for this case we need to do body parameter flatten + const bodyParameterFlatten = sdkType.kind === "model" && (sdkType.usage & UsageFlags.Spread) && !this.isArm(); const parameterName = sdkBody.name; const parameter = new Parameter(parameterName, sdkBody.description ?? "", schema, { From 5e605763664d03b7e751bb170cbaf5879df150fa Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 15 Jul 2024 14:58:41 +0800 Subject: [PATCH 17/90] update logics on spread param --- typespec-extension/src/code-model-builder.ts | 109 +++++++++++-------- 1 file changed, 62 insertions(+), 47 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index c9ff67d88a..457258c2b8 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -44,6 +44,8 @@ import { KnownMediaType } from "@azure-tools/codegen"; import { getLroMetadata, getPagedResult, isPollingLocation } from "@azure-tools/typespec-azure-core"; import { SdkArrayType, + SdkBodyModelPropertyType, + SdkBodyParameter, SdkBuiltInType, SdkClientType, SdkConstantType, @@ -2071,8 +2073,6 @@ export class CodeModelBuilder { // set contentTypes to mediaTypes op.requests![0].protocol.http!.mediaTypes = rawHttpOperation.parameters.body!.contentTypes; - const parameters = rawHttpOperation.operation.parameters; - const unknownRequestBody = op.requests![0].protocol.http!.mediaTypes && op.requests![0].protocol.http!.mediaTypes.length > 0 && @@ -2088,10 +2088,6 @@ export class CodeModelBuilder { schema = this.processSchemaFromSdkType(getNonNullSdkType(sdkType), sdkBody.name); } - - // Implicit body parameter would have usage flag: UsageFlags.Spread, for this case we need to do body parameter flatten - const bodyParameterFlatten = sdkType.kind === "model" && (sdkType.usage & UsageFlags.Spread) && !this.isArm(); - const parameterName = sdkBody.name; const parameter = new Parameter(parameterName, sdkBody.description ?? "", schema, { summary: sdkBody.details, @@ -2117,9 +2113,13 @@ export class CodeModelBuilder { this.trackSchemaUsage(schema, { serializationFormats: [KnownMediaType.Multipart] }); } + // Implicit body parameter would have usage flag: UsageFlags.Spread, for this case we need to do body parameter flatten + const bodyParameterFlatten = sdkType.kind === "model" && (sdkType.usage & UsageFlags.Spread) && !this.isArm(); + if (schema instanceof ObjectSchema && bodyParameterFlatten) { // flatten body parameter - + const parameters = sdkHttpOperation.parameters; + const bodyParameter = sdkHttpOperation.bodyParam; // name the schema for documentation schema.language.default.name = pascalCase(op.language.default.name) + "Request"; @@ -2144,46 +2144,17 @@ export class CodeModelBuilder { request.parameters = []; op.convenienceApi.requests.push(request); - for (const [_, opParameter] of parameters.properties) { - const serializedName = this.getSerializedName(opParameter); - const existParameter = op.parameters.find((it) => it.language.default.serializedName === serializedName); - if (existParameter) { - // parameter - if ( - existParameter.implementation === ImplementationLocation.Method && - (existParameter.origin?.startsWith("modelerfour:synthesized/") ?? true) && - !(existParameter.schema instanceof ConstantSchema) - ) { - request.parameters.push(cloneOperationParameter(existParameter)); - } - } else { - // property from anonymous model - const existBodyProperty = schema.properties?.find((it) => it.serializedName === serializedName); - if ( - existBodyProperty && - !existBodyProperty.readOnly && - !(existBodyProperty.schema instanceof ConstantSchema) - ) { - request.parameters.push( - new VirtualParameter( - existBodyProperty.language.default.name, - existBodyProperty.language.default.description, - existBodyProperty.schema, - { - originalParameter: parameter, - targetProperty: existBodyProperty, - language: { - default: { - serializedName: existBodyProperty.serializedName, - }, - }, - summary: existBodyProperty.summary, - implementation: ImplementationLocation.Method, - required: existBodyProperty.required, - nullable: existBodyProperty.nullable, - }, - ), - ); + // header/query/path params + for (const opParameter of parameters) { + this.addParameterOrBodyToCodeModelRequest(opParameter, op, request, schema, parameter); + } + // body param + if (bodyParameter) { + if (bodyParameter.type.kind === "model") { + for (const bodyParam of bodyParameter.type.properties) { + if (bodyParam.kind === "property") { + this.addParameterOrBodyToCodeModelRequest(bodyParam, op, request, schema, parameter) + } } } } @@ -2244,7 +2215,51 @@ export class CodeModelBuilder { } } } + } + private addParameterOrBodyToCodeModelRequest(opParameter: SdkPathParameter | SdkHeaderParameter | SdkQueryParameter | SdkBodyModelPropertyType, op: CodeModelOperation, request: Request, schema: ObjectSchema, originalParameter: Parameter) { + const serializedName = opParameter.serializedName; + const existParameter = op.parameters?.find((it) => it.language.default.serializedName === serializedName); + request.parameters = request.parameters ?? []; + if (existParameter) { + // parameter + if ( + existParameter.implementation === ImplementationLocation.Method && + (existParameter.origin?.startsWith("modelerfour:synthesized/") ?? true) && + !(existParameter.schema instanceof ConstantSchema) + ) { + request.parameters.push(cloneOperationParameter(existParameter)); + } + } else { + // property from anonymous model + const existBodyProperty = schema.properties?.find((it) => it.serializedName === serializedName); + if ( + existBodyProperty && + !existBodyProperty.readOnly && + !(existBodyProperty.schema instanceof ConstantSchema) + ) { + request.parameters.push( + new VirtualParameter( + existBodyProperty.language.default.name, + existBodyProperty.language.default.description, + existBodyProperty.schema, + { + originalParameter: originalParameter, + targetProperty: existBodyProperty, + language: { + default: { + serializedName: existBodyProperty.serializedName, + }, + }, + summary: existBodyProperty.summary, + implementation: ImplementationLocation.Method, + required: existBodyProperty.required, + nullable: existBodyProperty.nullable, + }, + ), + ); + } + } } // private processParameterBody(op: CodeModelOperation, httpOperation: HttpOperation, body: ModelProperty | Model) { From 7a5479dd75c522a9b02dad7d4ab072d112548b82 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 15 Jul 2024 16:33:02 +0800 Subject: [PATCH 18/90] regen --- .../InternalOperationsImpl.java | 12 +- .../implementation/PublicOperationsImpl.java | 8 +- .../RelativeModelInOperationsImpl.java | 8 +- .../SharedModelInOperationsImpl.java | 8 +- .../implementation/ModelInOperationsImpl.java | 33 +- .../azure/core/basic/BasicAsyncClient.java | 36 +- .../basic/TwoModelsAsPageItemAsyncClient.java | 12 +- .../basic/implementation/BasicClientImpl.java | 77 +-- .../TwoModelsAsPageItemsImpl.java | 28 +- .../lro/rpc/implementation/RpcClientImpl.java | 18 +- .../implementation/StandardClientImpl.java | 24 +- .../azure/core/model/ModelAsyncClient.java | 4 +- .../_specs_/azure/core/model/ModelClient.java | 4 +- .../AzureCoreEmbeddingVectorsImpl.java | 40 +- .../azure/core/scalar/ScalarAsyncClient.java | 6 +- .../azure/core/scalar/ScalarClient.java | 4 +- .../AzureLocationScalarsImpl.java | 67 ++- .../azure/core/traits/TraitsAsyncClient.java | 7 +- .../azure/core/traits/TraitsClient.java | 6 +- .../implementation/TraitsClientImpl.java | 24 +- .../implementation/ApiKeyClientImpl.java | 15 +- .../implementation/CustomClientImpl.java | 15 +- .../implementation/OAuth2ClientImpl.java | 15 +- .../union/implementation/UnionClientImpl.java | 25 +- .../models/resources/ResourcesManager.java | 1 - .../fluent/NestedProxyResourcesClient.java | 4 +- .../resources/fluent/ResourcesClient.java | 7 - .../TopLevelTrackedResourcesClient.java | 5 +- .../NestedProxyResourcesClientImpl.java | 159 +++---- .../ResourcesClientBuilder.java | 18 +- .../implementation/ResourcesClientImpl.java | 18 +- .../TopLevelTrackedResourcesClientImpl.java | 197 +++----- .../models/NestedProxyResources.java | 8 +- .../models/TopLevelTrackedResources.java | 11 +- .../XmsClientRequestIdAsyncClient.java | 5 +- .../XmsClientRequestIdClient.java | 2 +- .../XmsClientRequestIdClientImpl.java | 16 +- .../ArmResourceProviderManager.java | 1 - .../fluent/ArmResourceProviderClient.java | 7 - ...hildExtensionResourceInterfacesClient.java | 4 +- .../ChildResourcesInterfacesClient.java | 4 +- .../TopLevelArmResourceInterfacesClient.java | 5 +- .../ArmResourceProviderClientBuilder.java | 18 +- .../ArmResourceProviderClientImpl.java | 18 +- ...ExtensionResourceInterfacesClientImpl.java | 153 +++--- .../ChildResourcesInterfacesClientImpl.java | 191 +++----- ...mTemplateResourceInterfacesClientImpl.java | 64 +-- .../implementation/OperationsClientImpl.java | 39 +- ...pLevelArmResourceInterfacesClientImpl.java | 219 ++++----- .../ChildExtensionResourceInterfaces.java | 8 +- .../models/ChildResourcesInterfaces.java | 8 +- .../models/TopLevelArmResourceInterfaces.java | 11 +- .../ArmStreamStyleSerializationManager.java | 1 - .../ArmStreamStyleSerializationClient.java | 7 - ...StreamStyleSerializationClientBuilder.java | 18 +- ...ArmStreamStyleSerializationClientImpl.java | 18 +- .../implementation/FishesClientImpl.java | 37 +- .../TopLevelArmResourcesClientImpl.java | 31 +- .../implementation/BuiltinClientImpl.java | 10 +- .../implementation/BuiltinOpsImpl.java | 24 +- .../implementation/EnumServiceClientImpl.java | 70 +-- .../implementation/ErrorModelClientImpl.java | 10 +- .../implementation/ErrorOpsImpl.java | 4 +- .../implementation/FlattenClientImpl.java | 80 ++-- .../implementation/InternalClientImpl.java | 10 +- .../implementation/InternalOpsImpl.java | 36 +- .../implementation/LiteralOpsImpl.java | 19 +- .../LiteralServiceClientImpl.java | 10 +- .../implementation/LongRunningClientImpl.java | 47 +- .../model/implementation/ModelClientImpl.java | 10 +- .../model/implementation/ModelOpsImpl.java | 48 +- .../MultiContentTypesClientImpl.java | 27 +- .../MultipleContentTypesOnRequestsImpl.java | 54 +-- .../SingleContentTypesImpl.java | 20 +- .../implementation/MultipartClientImpl.java | 24 +- .../implementation/FirstClientImpl.java | 14 +- .../NoApiVersionClientImpl.java | 25 +- .../implementation/SecondClientImpl.java | 14 +- .../implementation/NamingClientImpl.java | 10 +- .../naming/implementation/NamingOpsImpl.java | 21 +- .../cadl/optional/OptionalAsyncClient.java | 2 - .../com/cadl/optional/OptionalClient.java | 2 - .../implementation/OptionalClientImpl.java | 10 +- .../implementation/OptionalOpsImpl.java | 21 +- .../PartialUpdateClientImpl.java | 14 +- .../patch/implementation/PatchClientImpl.java | 10 +- .../patch/implementation/PatchesImpl.java | 12 +- .../ProtocolAndConvenientAsyncClient.java | 6 +- .../ProtocolAndConvenienceOpsImpl.java | 98 ++-- .../ProtocolAndConvenientClientImpl.java | 10 +- .../cadl/response/ResponseAsyncClient.java | 12 +- .../implementation/ResponseClientImpl.java | 97 ++-- .../com/cadl/server/ContosoClientBuilder.java | 21 +- .../com/cadl/server/HttpbinClientBuilder.java | 1 + .../implementation/ContosoClientImpl.java | 45 +- .../implementation/HttpbinClientImpl.java | 15 +- .../implementation/BuiltinOpsImpl.java | 15 +- .../SpecialCharsClientImpl.java | 10 +- .../EtagHeadersAsyncClient.java | 6 +- .../EtagHeadersOptionalBodyAsyncClient.java | 2 - .../EtagHeadersOptionalBodyClient.java | 2 - .../implementation/EtagHeadersImpl.java | 32 +- .../EtagHeadersOptionalBodiesImpl.java | 22 +- .../RepeatabilityHeadersImpl.java | 31 +- .../SkipSpecialHeadersImpl.java | 4 +- .../SpecialHeadersClientImpl.java | 10 +- .../union/implementation/UnionClientImpl.java | 9 +- .../implementation/UnionFlattenOpsImpl.java | 45 +- .../versioning/VersioningAsyncClient.java | 12 +- .../implementation/VersioningClientImpl.java | 10 +- .../implementation/VersioningOpsImpl.java | 31 +- .../implementation/VisibilityClientImpl.java | 56 ++- .../implementation/VisibilityReadsImpl.java | 4 +- .../implementation/VisibilityWritesImpl.java | 14 +- .../implementation/WireTypeClientImpl.java | 10 +- .../implementation/WireTypeOpsImpl.java | 51 +- ...AsyncClient.java => ModelAsyncClient.java} | 10 +- ...lientModelClient.java => ModelClient.java} | 10 +- .../client/naming/NamingClientBuilder.java | 20 +- ...{ClientModelsImpl.java => ModelsImpl.java} | 47 +- .../implementation/NamingClientImpl.java | 104 ++--- .../naming/implementation/UnionEnumsImpl.java | 24 +- .../bytes/implementation/HeadersImpl.java | 54 +-- .../bytes/implementation/PropertiesImpl.java | 66 ++- .../bytes/implementation/QueriesImpl.java | 55 +-- .../implementation/RequestBodiesImpl.java | 64 ++- .../implementation/ResponseBodiesImpl.java | 20 +- .../datetime/implementation/HeadersImpl.java | 71 ++- .../implementation/PropertiesImpl.java | 83 ++-- .../datetime/implementation/QueriesImpl.java | 72 ++- .../implementation/ResponseHeadersImpl.java | 49 +- .../duration/implementation/HeadersImpl.java | 88 ++-- .../implementation/PropertiesImpl.java | 101 ++-- .../duration/implementation/QueriesImpl.java | 85 ++-- .../implementation/ExplicitBodiesImpl.java | 14 +- .../implementation/ImplicitBodiesImpl.java | 12 +- .../OptionalExplicitAsyncClient.java | 16 - .../OptionalExplicitClient.java | 16 - .../BodyOptionalityClientImpl.java | 26 +- .../implementation/OptionalExplicitsImpl.java | 60 +-- .../implementation/HeadersImpl.java | 12 +- .../implementation/QueriesImpl.java | 59 +-- .../spread/implementation/AliasImpl.java | 38 +- .../spread/implementation/ModelsImpl.java | 62 ++- .../JsonMergePatchClientImpl.java | 25 +- .../implementation/StringBodiesImpl.java | 32 +- .../implementation/FormDatasImpl.java | 102 ++-- .../payload/pageable/PageableAsyncClient.java | 6 +- .../implementation/PageableClientImpl.java | 12 +- .../ResiliencyServiceDrivenClientBuilder.java | 21 +- .../ResiliencyServiceDrivenClientImpl.java | 94 ++-- .../ResiliencyServiceDrivenClientBuilder.java | 23 +- .../ResiliencyServiceDrivenClientImpl.java | 82 ++-- .../json/implementation/PropertiesImpl.java | 20 +- .../implementation/NotDefinedClientImpl.java | 25 +- .../path/multiple/MultipleClientBuilder.java | 21 +- .../implementation/MultipleClientImpl.java | 59 ++- .../implementation/SingleClientImpl.java | 14 +- .../NotVersionedClientImpl.java | 40 +- .../implementation/VersionedClientImpl.java | 54 +-- .../ConditionalRequestClientImpl.java | 25 +- .../RepeatabilityClientImpl.java | 13 +- .../implementation/ModelPropertiesImpl.java | 12 +- .../implementation/ModelsImpl.java | 418 ++++++++--------- .../implementation/OperationsImpl.java | 364 ++++++--------- .../implementation/ParametersImpl.java | 439 +++++++----------- .../implementation/BooleanValuesImpl.java | 20 +- .../implementation/DatetimeValuesImpl.java | 20 +- .../implementation/DurationValuesImpl.java | 20 +- .../implementation/Float32ValuesImpl.java | 20 +- .../array/implementation/Int32ValuesImpl.java | 20 +- .../array/implementation/Int64ValuesImpl.java | 20 +- .../array/implementation/ModelValuesImpl.java | 20 +- .../NullableBooleanValuesImpl.java | 20 +- .../NullableFloatValuesImpl.java | 20 +- .../NullableInt32ValuesImpl.java | 20 +- .../NullableModelValuesImpl.java | 20 +- .../NullableStringValuesImpl.java | 20 +- .../implementation/StringValuesImpl.java | 20 +- .../implementation/UnknownValuesImpl.java | 20 +- .../implementation/BooleanValuesImpl.java | 20 +- .../implementation/DatetimeValuesImpl.java | 20 +- .../implementation/DurationValuesImpl.java | 20 +- .../implementation/Float32ValuesImpl.java | 20 +- .../implementation/Int32ValuesImpl.java | 20 +- .../implementation/Int64ValuesImpl.java | 20 +- .../implementation/ModelValuesImpl.java | 20 +- .../NullableFloatValuesImpl.java | 20 +- .../RecursiveModelValuesImpl.java | 20 +- .../implementation/StringValuesImpl.java | 20 +- .../implementation/UnknownValuesImpl.java | 20 +- .../implementation/StringOperationsImpl.java | 32 +- .../implementation/StringOperationsImpl.java | 28 +- .../empty/implementation/EmptyClientImpl.java | 33 +- .../implementation/FlattenClientImpl.java | 34 +- .../EnumDiscriminatorAsyncClient.java | 22 +- .../EnumDiscriminatorClient.java | 16 +- .../EnumDiscriminatorClientImpl.java | 70 +-- .../EnumNestedDiscriminatorClientImpl.java | 40 +- .../NestedDiscriminatorClientImpl.java | 40 +- .../NotDiscriminatedClientImpl.java | 32 +- .../implementation/RecursiveClientImpl.java | 20 +- .../SingleDiscriminatorClientImpl.java | 44 +- .../usage/implementation/UsageClientImpl.java | 35 +- .../implementation/VisibilityClientImpl.java | 76 +-- ...xtendsDifferentSpreadFloatAsyncClient.java | 6 +- .../ExtendsDifferentSpreadFloatClient.java | 5 +- ...sDifferentSpreadModelArrayAsyncClient.java | 6 +- ...xtendsDifferentSpreadModelArrayClient.java | 6 +- ...xtendsDifferentSpreadModelAsyncClient.java | 6 +- .../ExtendsDifferentSpreadModelClient.java | 6 +- ...tendsDifferentSpreadStringAsyncClient.java | 6 +- .../ExtendsDifferentSpreadStringClient.java | 5 +- .../ExtendsFloatAsyncClient.java | 5 +- .../ExtendsFloatClient.java | 4 +- .../ExtendsModelArrayAsyncClient.java | 5 +- .../ExtendsModelArrayClient.java | 4 +- .../ExtendsModelAsyncClient.java | 5 +- .../ExtendsModelClient.java | 4 +- .../ExtendsStringAsyncClient.java | 5 +- .../ExtendsStringClient.java | 4 +- .../ExtendsUnknownAsyncClient.java | 5 +- .../ExtendsUnknownClient.java | 4 +- .../ExtendsUnknownDerivedAsyncClient.java | 6 +- .../ExtendsUnknownDerivedClient.java | 4 +- ...xtendsUnknownDiscriminatedAsyncClient.java | 6 +- .../ExtendsUnknownDiscriminatedClient.java | 4 +- .../IsFloatAsyncClient.java | 5 +- .../additionalproperties/IsFloatClient.java | 4 +- .../IsModelArrayAsyncClient.java | 5 +- .../IsModelArrayClient.java | 4 +- .../IsModelAsyncClient.java | 5 +- .../additionalproperties/IsModelClient.java | 4 +- .../IsStringAsyncClient.java | 5 +- .../additionalproperties/IsStringClient.java | 4 +- .../IsUnknownAsyncClient.java | 5 +- .../additionalproperties/IsUnknownClient.java | 4 +- .../IsUnknownDerivedAsyncClient.java | 6 +- .../IsUnknownDerivedClient.java | 4 +- .../IsUnknownDiscriminatedAsyncClient.java | 5 +- .../IsUnknownDiscriminatedClient.java | 4 +- .../MultipleSpreadAsyncClient.java | 5 +- .../MultipleSpreadClient.java | 4 +- .../SpreadDifferentFloatAsyncClient.java | 6 +- .../SpreadDifferentFloatClient.java | 5 +- .../SpreadDifferentModelArrayAsyncClient.java | 6 +- .../SpreadDifferentModelArrayClient.java | 5 +- .../SpreadDifferentModelAsyncClient.java | 6 +- .../SpreadDifferentModelClient.java | 5 +- .../SpreadDifferentStringAsyncClient.java | 6 +- .../SpreadDifferentStringClient.java | 4 +- .../SpreadFloatAsyncClient.java | 6 +- .../SpreadFloatClient.java | 4 +- .../SpreadModelArrayAsyncClient.java | 4 +- .../SpreadModelArrayClient.java | 4 +- .../SpreadModelAsyncClient.java | 6 +- .../SpreadModelClient.java | 5 +- ...adRecordDiscriminatedUnionAsyncClient.java | 5 +- .../SpreadRecordDiscriminatedUnionClient.java | 4 +- ...cordNonDiscriminatedUnion2AsyncClient.java | 5 +- ...eadRecordNonDiscriminatedUnion2Client.java | 4 +- ...cordNonDiscriminatedUnion3AsyncClient.java | 5 +- ...eadRecordNonDiscriminatedUnion3Client.java | 4 +- ...ecordNonDiscriminatedUnionAsyncClient.java | 5 +- ...readRecordNonDiscriminatedUnionClient.java | 4 +- .../SpreadRecordUnionAsyncClient.java | 5 +- .../SpreadRecordUnionClient.java | 4 +- .../SpreadStringAsyncClient.java | 6 +- .../SpreadStringClient.java | 4 +- .../ExtendsDifferentSpreadFloatsImpl.java | 26 +- ...ExtendsDifferentSpreadModelArraysImpl.java | 26 +- .../ExtendsDifferentSpreadModelsImpl.java | 26 +- .../ExtendsDifferentSpreadStringsImpl.java | 26 +- .../implementation/ExtendsFloatsImpl.java | 25 +- .../ExtendsModelArraysImpl.java | 25 +- .../implementation/ExtendsModelsImpl.java | 25 +- .../implementation/ExtendsStringsImpl.java | 25 +- .../ExtendsUnknownDerivedsImpl.java | 25 +- .../ExtendsUnknownDiscriminatedsImpl.java | 25 +- .../implementation/ExtendsUnknownsImpl.java | 25 +- .../implementation/IsFloatsImpl.java | 25 +- .../implementation/IsModelArraysImpl.java | 25 +- .../implementation/IsModelsImpl.java | 25 +- .../implementation/IsStringsImpl.java | 25 +- .../implementation/IsUnknownDerivedsImpl.java | 25 +- .../IsUnknownDiscriminatedsImpl.java | 25 +- .../implementation/IsUnknownsImpl.java | 25 +- .../implementation/MultipleSpreadsImpl.java | 25 +- .../SpreadDifferentFloatsImpl.java | 26 +- .../SpreadDifferentModelArraysImpl.java | 26 +- .../SpreadDifferentModelsImpl.java | 26 +- .../SpreadDifferentStringsImpl.java | 25 +- .../implementation/SpreadFloatsImpl.java | 25 +- .../implementation/SpreadModelArraysImpl.java | 24 +- .../implementation/SpreadModelsImpl.java | 26 +- .../SpreadRecordDiscriminatedUnionsImpl.java | 25 +- ...readRecordNonDiscriminatedUnion2sImpl.java | 25 +- ...readRecordNonDiscriminatedUnion3sImpl.java | 25 +- ...preadRecordNonDiscriminatedUnionsImpl.java | 25 +- .../SpreadRecordUnionsImpl.java | 25 +- .../implementation/SpreadStringsImpl.java | 25 +- .../property/nullable/BytesAsyncClient.java | 12 +- .../type/property/nullable/BytesClient.java | 8 +- .../nullable/CollectionsByteAsyncClient.java | 10 +- .../nullable/CollectionsByteClient.java | 8 +- .../nullable/CollectionsModelAsyncClient.java | 10 +- .../nullable/CollectionsModelClient.java | 8 +- .../CollectionsStringAsyncClient.java | 10 +- .../nullable/CollectionsStringClient.java | 8 +- .../DatetimeOperationAsyncClient.java | 10 +- .../nullable/DatetimeOperationClient.java | 8 +- .../DurationOperationAsyncClient.java | 10 +- .../nullable/DurationOperationClient.java | 8 +- .../nullable/StringOperationAsyncClient.java | 12 +- .../nullable/StringOperationClient.java | 8 +- .../nullable/implementation/BytesImpl.java | 45 +- .../implementation/CollectionsBytesImpl.java | 43 +- .../implementation/CollectionsModelsImpl.java | 43 +- .../CollectionsStringsImpl.java | 43 +- .../DatetimeOperationsImpl.java | 43 +- .../DurationOperationsImpl.java | 43 +- .../implementation/StringOperationsImpl.java | 45 +- .../optional/BooleanLiteralAsyncClient.java | 10 +- .../optional/BooleanLiteralClient.java | 8 +- .../property/optional/BytesAsyncClient.java | 12 +- .../type/property/optional/BytesClient.java | 8 +- .../optional/CollectionsByteAsyncClient.java | 10 +- .../optional/CollectionsByteClient.java | 8 +- .../optional/CollectionsModelAsyncClient.java | 10 +- .../optional/CollectionsModelClient.java | 8 +- .../DatetimeOperationAsyncClient.java | 10 +- .../optional/DatetimeOperationClient.java | 8 +- .../DurationOperationAsyncClient.java | 10 +- .../optional/DurationOperationClient.java | 8 +- .../optional/FloatLiteralAsyncClient.java | 10 +- .../property/optional/FloatLiteralClient.java | 8 +- .../optional/IntLiteralAsyncClient.java | 10 +- .../property/optional/IntLiteralClient.java | 8 +- .../RequiredAndOptionalAsyncClient.java | 12 +- .../optional/RequiredAndOptionalClient.java | 8 +- .../optional/StringLiteralAsyncClient.java | 10 +- .../optional/StringLiteralClient.java | 8 +- .../optional/StringOperationAsyncClient.java | 12 +- .../optional/StringOperationClient.java | 8 +- .../UnionFloatLiteralAsyncClient.java | 10 +- .../optional/UnionFloatLiteralClient.java | 8 +- .../optional/UnionIntLiteralAsyncClient.java | 10 +- .../optional/UnionIntLiteralClient.java | 8 +- .../UnionStringLiteralAsyncClient.java | 10 +- .../optional/UnionStringLiteralClient.java | 8 +- .../implementation/BooleanLiteralsImpl.java | 44 +- .../optional/implementation/BytesImpl.java | 46 +- .../implementation/CollectionsBytesImpl.java | 44 +- .../implementation/CollectionsModelsImpl.java | 44 +- .../DatetimeOperationsImpl.java | 44 +- .../DurationOperationsImpl.java | 44 +- .../implementation/FloatLiteralsImpl.java | 44 +- .../implementation/IntLiteralsImpl.java | 44 +- .../RequiredAndOptionalsImpl.java | 46 +- .../implementation/StringLiteralsImpl.java | 44 +- .../implementation/StringOperationsImpl.java | 46 +- .../UnionFloatLiteralsImpl.java | 44 +- .../implementation/UnionIntLiteralsImpl.java | 44 +- .../UnionStringLiteralsImpl.java | 44 +- .../valuetypes/BooleanLiteralAsyncClient.java | 5 +- .../valuetypes/BooleanLiteralClient.java | 4 +- .../BooleanOperationAsyncClient.java | 4 +- .../valuetypes/BooleanOperationClient.java | 4 +- .../property/valuetypes/BytesAsyncClient.java | 4 +- .../type/property/valuetypes/BytesClient.java | 4 +- .../valuetypes/CollectionsIntAsyncClient.java | 5 +- .../valuetypes/CollectionsIntClient.java | 4 +- .../CollectionsModelAsyncClient.java | 5 +- .../valuetypes/CollectionsModelClient.java | 4 +- .../CollectionsStringAsyncClient.java | 5 +- .../valuetypes/CollectionsStringClient.java | 4 +- .../DatetimeOperationAsyncClient.java | 4 +- .../valuetypes/DatetimeOperationClient.java | 4 +- .../valuetypes/Decimal128AsyncClient.java | 4 +- .../property/valuetypes/Decimal128Client.java | 4 +- .../valuetypes/DecimalAsyncClient.java | 4 +- .../property/valuetypes/DecimalClient.java | 4 +- .../DictionaryStringAsyncClient.java | 5 +- .../valuetypes/DictionaryStringClient.java | 4 +- .../DurationOperationAsyncClient.java | 4 +- .../valuetypes/DurationOperationClient.java | 4 +- .../property/valuetypes/EnumAsyncClient.java | 4 +- .../type/property/valuetypes/EnumClient.java | 4 +- .../valuetypes/ExtensibleEnumAsyncClient.java | 5 +- .../valuetypes/ExtensibleEnumClient.java | 4 +- .../valuetypes/FloatLiteralAsyncClient.java | 4 +- .../valuetypes/FloatLiteralClient.java | 4 +- .../valuetypes/FloatOperationAsyncClient.java | 4 +- .../valuetypes/FloatOperationClient.java | 4 +- .../property/valuetypes/IntAsyncClient.java | 4 +- .../type/property/valuetypes/IntClient.java | 4 +- .../valuetypes/IntLiteralAsyncClient.java | 4 +- .../property/valuetypes/IntLiteralClient.java | 4 +- .../property/valuetypes/ModelAsyncClient.java | 4 +- .../type/property/valuetypes/ModelClient.java | 4 +- .../property/valuetypes/NeverAsyncClient.java | 4 +- .../type/property/valuetypes/NeverClient.java | 4 +- .../valuetypes/StringLiteralAsyncClient.java | 5 +- .../valuetypes/StringLiteralClient.java | 4 +- .../StringOperationAsyncClient.java | 4 +- .../valuetypes/StringOperationClient.java | 4 +- .../valuetypes/UnionEnumValueAsyncClient.java | 5 +- .../valuetypes/UnionEnumValueClient.java | 4 +- .../UnionFloatLiteralAsyncClient.java | 5 +- .../valuetypes/UnionFloatLiteralClient.java | 4 +- .../UnionIntLiteralAsyncClient.java | 5 +- .../valuetypes/UnionIntLiteralClient.java | 4 +- .../UnionStringLiteralAsyncClient.java | 5 +- .../valuetypes/UnionStringLiteralClient.java | 4 +- .../valuetypes/UnknownArrayAsyncClient.java | 5 +- .../valuetypes/UnknownArrayClient.java | 4 +- .../valuetypes/UnknownDictAsyncClient.java | 5 +- .../valuetypes/UnknownDictClient.java | 4 +- .../valuetypes/UnknownIntAsyncClient.java | 5 +- .../property/valuetypes/UnknownIntClient.java | 4 +- .../valuetypes/UnknownStringAsyncClient.java | 5 +- .../valuetypes/UnknownStringClient.java | 4 +- .../implementation/BooleanLiteralsImpl.java | 25 +- .../implementation/BooleanOperationsImpl.java | 24 +- .../valuetypes/implementation/BytesImpl.java | 24 +- .../implementation/CollectionsIntsImpl.java | 25 +- .../implementation/CollectionsModelsImpl.java | 25 +- .../CollectionsStringsImpl.java | 25 +- .../DatetimeOperationsImpl.java | 24 +- .../implementation/Decimal128sImpl.java | 24 +- .../implementation/DecimalsImpl.java | 24 +- .../implementation/DictionaryStringsImpl.java | 25 +- .../DurationOperationsImpl.java | 24 +- .../valuetypes/implementation/EnumsImpl.java | 24 +- .../implementation/ExtensibleEnumsImpl.java | 25 +- .../implementation/FloatLiteralsImpl.java | 24 +- .../implementation/FloatOperationsImpl.java | 24 +- .../implementation/IntLiteralsImpl.java | 24 +- .../valuetypes/implementation/IntsImpl.java | 24 +- .../valuetypes/implementation/ModelsImpl.java | 24 +- .../valuetypes/implementation/NeversImpl.java | 24 +- .../implementation/StringLiteralsImpl.java | 25 +- .../implementation/StringOperationsImpl.java | 24 +- .../implementation/UnionEnumValuesImpl.java | 25 +- .../UnionFloatLiteralsImpl.java | 25 +- .../implementation/UnionIntLiteralsImpl.java | 25 +- .../UnionStringLiteralsImpl.java | 25 +- .../implementation/UnknownArraysImpl.java | 25 +- .../implementation/UnknownDictsImpl.java | 25 +- .../implementation/UnknownIntsImpl.java | 25 +- .../implementation/UnknownStringsImpl.java | 25 +- .../scalar/BooleanOperationAsyncClient.java | 5 +- .../type/scalar/BooleanOperationClient.java | 4 +- .../scalar/StringOperationAsyncClient.java | 4 +- .../type/scalar/StringOperationClient.java | 4 +- .../com/type/scalar/UnknownAsyncClient.java | 4 +- .../java/com/type/scalar/UnknownClient.java | 4 +- .../implementation/BooleanOperationsImpl.java | 25 +- .../implementation/Decimal128TypesImpl.java | 30 +- .../Decimal128VerifiesImpl.java | 18 +- .../implementation/DecimalTypesImpl.java | 30 +- .../implementation/DecimalVerifiesImpl.java | 18 +- .../implementation/StringOperationsImpl.java | 24 +- .../scalar/implementation/UnknownsImpl.java | 24 +- .../union/implementation/EnumsOnliesImpl.java | 16 +- .../implementation/FloatsOnliesImpl.java | 16 +- .../union/implementation/IntsOnliesImpl.java | 16 +- .../implementation/MixedLiteralsImpl.java | 16 +- .../union/implementation/MixedTypesImpl.java | 16 +- .../implementation/ModelsOnliesImpl.java | 16 +- .../implementation/StringAndArraysImpl.java | 16 +- .../StringExtensibleNamedsImpl.java | 16 +- .../implementation/StringExtensiblesImpl.java | 16 +- .../implementation/StringsOnliesImpl.java | 16 +- .../added/implementation/AddedClientImpl.java | 37 +- .../implementation/InterfaceV2sImpl.java | 16 +- .../MadeOptionalClientImpl.java | 17 +- .../implementation/RemovedClientImpl.java | 17 +- .../implementation/NewInterfacesImpl.java | 18 +- .../implementation/RenamedFromClientImpl.java | 20 +- .../ReturnTypeChangedFromClientImpl.java | 17 +- .../TypeChangedFromClientImpl.java | 18 +- .../cadl/flatten/generated/FlattenOpSend.java | 3 +- .../generated/HttpbinClientTestBase.java | 2 + .../java/com/client/naming/NamingTests.java | 2 +- .../generated/NamingClientTestBase.java | 12 +- ...ResiliencyServiceDrivenClientTestBase.java | 1 + ...ResiliencyServiceDrivenClientTestBase.java | 1 + .../generated/MultipleClientTestBase.java | 1 + 489 files changed, 5393 insertions(+), 5943 deletions(-) rename typespec-tests/src/main/java/com/client/naming/{ClientModelAsyncClient.java => ModelAsyncClient.java} (95%) rename typespec-tests/src/main/java/com/client/naming/{ClientModelClient.java => ModelClient.java} (95%) rename typespec-tests/src/main/java/com/client/naming/implementation/{ClientModelsImpl.java => ModelsImpl.java} (83%) diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/InternalOperationsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/InternalOperationsImpl.java index 1f546b3b79..f0b3990416 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/InternalOperationsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/InternalOperationsImpl.java @@ -64,7 +64,7 @@ public interface InternalOperationsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> noDecoratorInInternal(@QueryParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/internalOperation/noDecoratorInInternal") @ExpectedResponses({ 200 }) @@ -73,7 +73,7 @@ Mono> noDecoratorInInternal(@QueryParam("name") String name @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response noDecoratorInInternalSync(@QueryParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/internalOperation/internalDecoratorInInternal") @ExpectedResponses({ 200 }) @@ -82,7 +82,7 @@ Response noDecoratorInInternalSync(@QueryParam("name") String name, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> internalDecoratorInInternal(@QueryParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/internalOperation/internalDecoratorInInternal") @ExpectedResponses({ 200 }) @@ -91,7 +91,7 @@ Mono> internalDecoratorInInternal(@QueryParam("name") Strin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response internalDecoratorInInternalSync(@QueryParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/internalOperation/publicDecoratorInInternal") @ExpectedResponses({ 200 }) @@ -100,7 +100,7 @@ Response internalDecoratorInInternalSync(@QueryParam("name") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> publicDecoratorInInternal(@QueryParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/internalOperation/publicDecoratorInInternal") @ExpectedResponses({ 200 }) @@ -109,7 +109,7 @@ Mono> publicDecoratorInInternal(@QueryParam("name") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response publicDecoratorInInternalSync(@QueryParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/PublicOperationsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/PublicOperationsImpl.java index 3c5b2aec41..d50ff927b4 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/PublicOperationsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/PublicOperationsImpl.java @@ -64,7 +64,7 @@ public interface PublicOperationsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> noDecoratorInPublic(@QueryParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/publicOperation/noDecoratorInPublic") @ExpectedResponses({ 200 }) @@ -73,7 +73,7 @@ Mono> noDecoratorInPublic(@QueryParam("name") String name, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response noDecoratorInPublicSync(@QueryParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/publicOperation/publicDecoratorInPublic") @ExpectedResponses({ 200 }) @@ -82,7 +82,7 @@ Response noDecoratorInPublicSync(@QueryParam("name") String name, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> publicDecoratorInPublic(@QueryParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/publicOperation/publicDecoratorInPublic") @ExpectedResponses({ 200 }) @@ -91,7 +91,7 @@ Mono> publicDecoratorInPublic(@QueryParam("name") String na @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response publicDecoratorInPublicSync(@QueryParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/RelativeModelInOperationsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/RelativeModelInOperationsImpl.java index ecd6b80784..a475dde8cc 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/RelativeModelInOperationsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/RelativeModelInOperationsImpl.java @@ -63,7 +63,7 @@ public interface RelativeModelInOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> operation(@QueryParam("name") String name, @HeaderParam("accept") String accept, + Mono> operation(@QueryParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/relativeModelInOperation/operation") @@ -72,7 +72,7 @@ Mono> operation(@QueryParam("name") String name, @HeaderPar @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response operationSync(@QueryParam("name") String name, @HeaderParam("accept") String accept, + Response operationSync(@QueryParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/relativeModelInOperation/discriminator") @@ -81,7 +81,7 @@ Response operationSync(@QueryParam("name") String name, @HeaderParam @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> discriminator(@QueryParam("kind") String kind, @HeaderParam("accept") String accept, + Mono> discriminator(@QueryParam("kind") String kind, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/relativeModelInOperation/discriminator") @@ -90,7 +90,7 @@ Mono> discriminator(@QueryParam("kind") String kind, @Heade @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response discriminatorSync(@QueryParam("kind") String kind, @HeaderParam("accept") String accept, + Response discriminatorSync(@QueryParam("kind") String kind, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/SharedModelInOperationsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/SharedModelInOperationsImpl.java index cd3684b45b..ba5e9df97d 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/SharedModelInOperationsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/SharedModelInOperationsImpl.java @@ -63,7 +63,7 @@ public interface SharedModelInOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> publicMethod(@QueryParam("name") String name, @HeaderParam("accept") String accept, + Mono> publicMethod(@QueryParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/sharedModelInOperation/public") @@ -72,7 +72,7 @@ Mono> publicMethod(@QueryParam("name") String name, @Header @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response publicMethodSync(@QueryParam("name") String name, @HeaderParam("accept") String accept, + Response publicMethodSync(@QueryParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/sharedModelInOperation/internal") @@ -81,7 +81,7 @@ Response publicMethodSync(@QueryParam("name") String name, @HeaderPa @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> internal(@QueryParam("name") String name, @HeaderParam("accept") String accept, + Mono> internal(@QueryParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/sharedModelInOperation/internal") @@ -90,7 +90,7 @@ Mono> internal(@QueryParam("name") String name, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response internalSync(@QueryParam("name") String name, @HeaderParam("accept") String accept, + Response internalSync(@QueryParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/implementation/ModelInOperationsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/implementation/ModelInOperationsImpl.java index fd5a97122f..45f193c3c1 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/implementation/ModelInOperationsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/implementation/ModelInOperationsImpl.java @@ -65,7 +65,7 @@ public interface ModelInOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> inputToInputOutput(@HeaderParam("accept") String accept, + Mono> inputToInputOutput(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/azure/client-generator-core/usage/inputToInputOutput") @@ -74,7 +74,7 @@ Mono> inputToInputOutput(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response inputToInputOutputSync(@HeaderParam("accept") String accept, + Response inputToInputOutputSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/usage/outputToInputOutput") @@ -83,7 +83,7 @@ Response inputToInputOutputSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> outputToInputOutput(@HeaderParam("accept") String accept, + Mono> outputToInputOutput(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/usage/outputToInputOutput") @@ -92,7 +92,7 @@ Mono> outputToInputOutput(@HeaderParam("accept") String acc @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response outputToInputOutputSync(@HeaderParam("accept") String accept, + Response outputToInputOutputSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/azure/client-generator-core/usage/modelInReadOnlyProperty") @@ -101,8 +101,9 @@ Response outputToInputOutputSync(@HeaderParam("accept") String accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> modelInReadOnlyProperty(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> modelInReadOnlyProperty(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/azure/client-generator-core/usage/modelInReadOnlyProperty") @ExpectedResponses({ 200 }) @@ -110,8 +111,9 @@ Mono> modelInReadOnlyProperty(@HeaderParam("accept") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response modelInReadOnlyPropertySync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response modelInReadOnlyPropertySync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -139,8 +141,8 @@ Response modelInReadOnlyPropertySync(@HeaderParam("accept") String a */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> inputToInputOutputWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.inputToInputOutput(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.inputToInputOutput(contentType, body, requestOptions, context)); } /** @@ -168,8 +170,8 @@ public Mono> inputToInputOutputWithResponseAsync(BinaryData body, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response inputToInputOutputWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.inputToInputOutputSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.inputToInputOutputSync(contentType, body, requestOptions, Context.NONE); } /** @@ -274,8 +276,10 @@ public Response outputToInputOutputWithResponse(RequestOptions reque @ServiceMethod(returns = ReturnType.SINGLE) public Mono> modelInReadOnlyPropertyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.modelInReadOnlyProperty(accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.modelInReadOnlyProperty(contentType, accept, body, requestOptions, context)); } /** @@ -323,7 +327,8 @@ public Mono> modelInReadOnlyPropertyWithResponseAsync(Binar */ @ServiceMethod(returns = ReturnType.SINGLE) public Response modelInReadOnlyPropertyWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.modelInReadOnlyPropertySync(accept, body, requestOptions, Context.NONE); + return service.modelInReadOnlyPropertySync(contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/BasicAsyncClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/BasicAsyncClient.java index 0bac5bba4f..df0a5187a0 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/BasicAsyncClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/BasicAsyncClient.java @@ -541,10 +541,10 @@ public PagedFlux list(Integer top, Integer skip, List orderBy, Str } } PagedFlux pagedFluxResponse = list(requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) + return PagedFlux.create(() -> (continuationToken, pageSize) -> { + Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); + : pagedFluxResponse.byPage(continuationToken).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -573,10 +573,10 @@ public PagedFlux list() { // Generated convenience method for list RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = list(requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) + return PagedFlux.create(() -> (continuationToken, pageSize) -> { + Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); + : pagedFluxResponse.byPage(continuationToken).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -603,10 +603,10 @@ public PagedFlux listWithPage() { // Generated convenience method for listWithPage RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = listWithPage(requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) + return PagedFlux.create(() -> (continuationToken, pageSize) -> { + Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); + : pagedFluxResponse.byPage(continuationToken).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -639,10 +639,10 @@ public PagedFlux listWithParameters(ListItemInputBody bodyInput, ListItemI requestOptions.addQueryParam("another", another.toString(), false); } PagedFlux pagedFluxResponse = listWithParameters(BinaryData.fromObject(bodyInput), requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) + return PagedFlux.create(() -> (continuationToken, pageSize) -> { + Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); + : pagedFluxResponse.byPage(continuationToken).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -671,10 +671,10 @@ public PagedFlux listWithParameters(ListItemInputBody bodyInput) { // Generated convenience method for listWithParameters RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = listWithParameters(BinaryData.fromObject(bodyInput), requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) + return PagedFlux.create(() -> (continuationToken, pageSize) -> { + Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); + : pagedFluxResponse.byPage(continuationToken).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -701,10 +701,10 @@ public PagedFlux listWithCustomPageModel() { // Generated convenience method for listWithCustomPageModel RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = listWithCustomPageModel(requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) + return PagedFlux.create(() -> (continuationToken, pageSize) -> { + Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); + : pagedFluxResponse.byPage(continuationToken).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/TwoModelsAsPageItemAsyncClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/TwoModelsAsPageItemAsyncClient.java index 3727c9aa92..1cf52d0326 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/TwoModelsAsPageItemAsyncClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/TwoModelsAsPageItemAsyncClient.java @@ -106,10 +106,10 @@ public PagedFlux listFirstItem() { // Generated convenience method for listFirstItem RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = listFirstItem(requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) + return PagedFlux.create(() -> (continuationToken, pageSize) -> { + Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); + : pagedFluxResponse.byPage(continuationToken).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -137,10 +137,10 @@ public PagedFlux listSecondItem() { // Generated convenience method for listSecondItem RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = listSecondItem(requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) + return PagedFlux.create(() -> (continuationToken, pageSize) -> { + Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); + : pagedFluxResponse.byPage(continuationToken).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java index 01fdba4193..26c2bada24 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java @@ -160,7 +160,7 @@ public interface BasicClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrUpdate(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -171,7 +171,7 @@ Mono> createOrUpdate(@QueryParam("api-version") String apiV @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrUpdateSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -182,8 +182,9 @@ Response createOrUpdateSync(@QueryParam("api-version") String apiVer @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrReplace(@QueryParam("api-version") String apiVersion, - @PathParam("id") int id, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); + @PathParam("id") int id, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData resource, + RequestOptions requestOptions, Context context); @Put("/azure/core/basic/users/{id}") @ExpectedResponses({ 200, 201 }) @@ -192,8 +193,8 @@ Mono> createOrReplace(@QueryParam("api-version") String api @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrReplaceSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/users/{id}") @ExpectedResponses({ 200 }) @@ -202,7 +203,7 @@ Response createOrReplaceSync(@QueryParam("api-version") String apiVe @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> get(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/users/{id}") @ExpectedResponses({ 200 }) @@ -211,7 +212,7 @@ Mono> get(@QueryParam("api-version") String apiVersion, @Pa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/users") @ExpectedResponses({ 200 }) @@ -220,7 +221,7 @@ Response getSync(@QueryParam("api-version") String apiVersion, @Path @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> list(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/users") @ExpectedResponses({ 200 }) @@ -229,7 +230,7 @@ Mono> list(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/page") @ExpectedResponses({ 200 }) @@ -238,7 +239,7 @@ Response listSync(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithPage(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/page") @ExpectedResponses({ 200 }) @@ -247,7 +248,7 @@ Mono> listWithPage(@QueryParam("api-version") String apiVer @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithPageSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/parameters") @ExpectedResponses({ 200 }) @@ -256,7 +257,7 @@ Response listWithPageSync(@QueryParam("api-version") String apiVersi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithParameters(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData bodyInput, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData bodyInput, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/parameters") @@ -266,7 +267,7 @@ Mono> listWithParameters(@QueryParam("api-version") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithParametersSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData bodyInput, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData bodyInput, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/custom-page") @@ -276,7 +277,7 @@ Response listWithParametersSync(@QueryParam("api-version") String ap @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithCustomPageModel(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/custom-page") @ExpectedResponses({ 200 }) @@ -285,7 +286,7 @@ Mono> listWithCustomPageModel(@QueryParam("api-version") St @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithCustomPageModelSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/azure/core/basic/users/{id}") @ExpectedResponses({ 204 }) @@ -294,7 +295,7 @@ Response listWithCustomPageModelSync(@QueryParam("api-version") Stri @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> delete(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/azure/core/basic/users/{id}") @ExpectedResponses({ 204 }) @@ -303,7 +304,7 @@ Mono> delete(@QueryParam("api-version") String apiVersion, @PathP @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/azure/core/basic/users/{id}:export") @ExpectedResponses({ 200 }) @@ -312,7 +313,7 @@ Response deleteSync(@QueryParam("api-version") String apiVersion, @PathPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> export(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @QueryParam("format") String format, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @QueryParam("format") String format, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/azure/core/basic/users/{id}:export") @@ -322,7 +323,7 @@ Mono> export(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response exportSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @QueryParam("format") String format, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @QueryParam("format") String format, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -332,7 +333,7 @@ Response exportSync(@QueryParam("api-version") String apiVersion, @P @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -341,7 +342,7 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = tru @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -350,7 +351,7 @@ Response listNextSync(@PathParam(value = "nextLink", encoded = true) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithPageNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -359,7 +360,7 @@ Mono> listWithPageNext(@PathParam(value = "nextLink", encod @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithPageNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -368,7 +369,7 @@ Response listWithPageNextSync(@PathParam(value = "nextLink", encoded @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithParametersNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("accept") String accept, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -378,7 +379,7 @@ Mono> listWithParametersNext( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithParametersNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -387,7 +388,7 @@ Response listWithParametersNextSync(@PathParam(value = "nextLink", e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithCustomPageModelNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("accept") String accept, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -397,7 +398,7 @@ Mono> listWithCustomPageModelNext( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithCustomPageModelNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("accept") String accept, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -562,9 +563,10 @@ public Response createOrUpdateWithResponse(int id, BinaryData resour @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createOrReplaceWithResponseAsync(int id, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.createOrReplace(this.getServiceVersion().getVersion(), id, - accept, resource, requestOptions, context)); + contentType, accept, resource, requestOptions, context)); } /** @@ -617,9 +619,10 @@ public Mono> createOrReplaceWithResponseAsync(int id, Binar @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrReplaceWithResponse(int id, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrReplaceSync(this.getServiceVersion().getVersion(), id, accept, resource, requestOptions, - Context.NONE); + return service.createOrReplaceSync(this.getServiceVersion().getVersion(), id, contentType, accept, resource, + requestOptions, Context.NONE); } /** @@ -1627,6 +1630,8 @@ private PagedResponse listNextSinglePage(String nextLink, RequestOpt } /** + * List with Azure.Core.Page<>. + * * Get the next page of items. *

Response Body Schema

* @@ -1663,6 +1668,8 @@ private Mono> listWithPageNextSinglePageAsync(String n } /** + * List with Azure.Core.Page<>. + * * Get the next page of items. *

Response Body Schema

* @@ -1698,6 +1705,8 @@ private PagedResponse listWithPageNextSinglePage(String nextLink, Re } /** + * List with extensible enum parameter Azure.Core.Page<>. + * * Get the next page of items. *

Response Body Schema

* @@ -1735,6 +1744,8 @@ private Mono> listWithParametersNextSinglePageAsync(St } /** + * List with extensible enum parameter Azure.Core.Page<>. + * * Get the next page of items. *

Response Body Schema

* @@ -1770,6 +1781,8 @@ private PagedResponse listWithParametersNextSinglePage(String nextLi } /** + * List with custom page model. + * * Get the next page of items. *

Response Body Schema

* @@ -1807,6 +1820,8 @@ private Mono> listWithCustomPageModelNextSinglePageAsy } /** + * List with custom page model. + * * Get the next page of items. *

Response Body Schema

* diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/TwoModelsAsPageItemsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/TwoModelsAsPageItemsImpl.java index cb380a6b93..677f55c324 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/TwoModelsAsPageItemsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/TwoModelsAsPageItemsImpl.java @@ -82,7 +82,7 @@ public interface TwoModelsAsPageItemsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listFirstItem(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/first-item") @ExpectedResponses({ 200 }) @@ -91,7 +91,7 @@ Mono> listFirstItem(@QueryParam("api-version") String apiVe @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listFirstItemSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/second-item") @ExpectedResponses({ 200 }) @@ -100,7 +100,7 @@ Response listFirstItemSync(@QueryParam("api-version") String apiVers @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listSecondItem(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/second-item") @ExpectedResponses({ 200 }) @@ -109,7 +109,7 @@ Mono> listSecondItem(@QueryParam("api-version") String apiV @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listSecondItemSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -118,7 +118,7 @@ Response listSecondItemSync(@QueryParam("api-version") String apiVer @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listFirstItemNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -127,7 +127,7 @@ Mono> listFirstItemNext(@PathParam(value = "nextLink", enco @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listFirstItemNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -136,7 +136,7 @@ Response listFirstItemNextSync(@PathParam(value = "nextLink", encode @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listSecondItemNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -145,7 +145,7 @@ Mono> listSecondItemNext(@PathParam(value = "nextLink", enc @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listSecondItemNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -369,6 +369,9 @@ public PagedIterable listSecondItem(RequestOptions requestOptions) { } /** + * Two operations with two different page item types should be successfully generated. Should generate model for + * FirstItem. + * * Get the next page of items. *

Response Body Schema

* @@ -397,6 +400,9 @@ private Mono> listFirstItemNextSinglePageAsync(String } /** + * Two operations with two different page item types should be successfully generated. Should generate model for + * FirstItem. + * * Get the next page of items. *

Response Body Schema

* @@ -423,6 +429,9 @@ private PagedResponse listFirstItemNextSinglePage(String nextLink, R } /** + * Two operations with two different page item types should be successfully generated. Should generate model for + * SecondItem. + * * Get the next page of items. *

Response Body Schema

* @@ -451,6 +460,9 @@ private Mono> listSecondItemNextSinglePageAsync(String } /** + * Two operations with two different page item types should be successfully generated. Should generate model for + * SecondItem. + * * Get the next page of items. *

Response Body Schema

* diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/implementation/RpcClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/implementation/RpcClientImpl.java index f45eb321ed..996c4a46a3 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/implementation/RpcClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/implementation/RpcClientImpl.java @@ -139,8 +139,8 @@ public interface RpcClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> longRunningRpc(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/azure/core/lro/rpc/generations:submit") @ExpectedResponses({ 202 }) @@ -149,8 +149,8 @@ Mono> longRunningRpc(@QueryParam("api-version") String apiV @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response longRunningRpcSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -194,9 +194,10 @@ Response longRunningRpcSync(@QueryParam("api-version") String apiVer */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> longRunningRpcWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.longRunningRpc(this.getServiceVersion().getVersion(), accept, - body, requestOptions, context)); + return FluxUtil.withContext(context -> service.longRunningRpc(this.getServiceVersion().getVersion(), + contentType, accept, body, requestOptions, context)); } /** @@ -239,9 +240,10 @@ private Mono> longRunningRpcWithResponseAsync(BinaryData bo */ @ServiceMethod(returns = ReturnType.SINGLE) private Response longRunningRpcWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.longRunningRpcSync(this.getServiceVersion().getVersion(), accept, body, requestOptions, - Context.NONE); + return service.longRunningRpcSync(this.getServiceVersion().getVersion(), contentType, accept, body, + requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/implementation/StandardClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/implementation/StandardClientImpl.java index f66dfb0fe8..2e2ff4667f 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/implementation/StandardClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/implementation/StandardClientImpl.java @@ -143,8 +143,9 @@ public interface StandardClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrReplace(@QueryParam("api-version") String apiVersion, - @PathParam("name") String name, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData resource, + RequestOptions requestOptions, Context context); @Put("/azure/core/lro/standard/users/{name}") @ExpectedResponses({ 200, 201 }) @@ -153,8 +154,9 @@ Mono> createOrReplace(@QueryParam("api-version") String api @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrReplaceSync(@QueryParam("api-version") String apiVersion, - @PathParam("name") String name, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData resource, + RequestOptions requestOptions, Context context); @Delete("/azure/core/lro/standard/users/{name}") @ExpectedResponses({ 202 }) @@ -163,7 +165,7 @@ Response createOrReplaceSync(@QueryParam("api-version") String apiVe @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> delete(@QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/azure/core/lro/standard/users/{name}") @ExpectedResponses({ 202 }) @@ -172,7 +174,7 @@ Mono> delete(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteSync(@QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/azure/core/lro/standard/users/{name}:export") @ExpectedResponses({ 202 }) @@ -181,7 +183,7 @@ Response deleteSync(@QueryParam("api-version") String apiVersion, @P @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> export(@QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @QueryParam("format") String format, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @QueryParam("format") String format, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/azure/core/lro/standard/users/{name}:export") @@ -191,7 +193,7 @@ Mono> export(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response exportSync(@QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @QueryParam("format") String format, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @QueryParam("format") String format, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -229,9 +231,10 @@ Response exportSync(@QueryParam("api-version") String apiVersion, @P @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrReplaceWithResponseAsync(String name, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.createOrReplace(this.getServiceVersion().getVersion(), name, - accept, resource, requestOptions, context)); + contentType, accept, resource, requestOptions, context)); } /** @@ -268,8 +271,9 @@ private Mono> createOrReplaceWithResponseAsync(String name, @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrReplaceWithResponse(String name, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrReplaceSync(this.getServiceVersion().getVersion(), name, accept, resource, + return service.createOrReplaceSync(this.getServiceVersion().getVersion(), name, contentType, accept, resource, requestOptions, Context.NONE); } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/model/ModelAsyncClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/model/ModelAsyncClient.java index 1f518dac04..30f35000cc 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/model/ModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/model/ModelAsyncClient.java @@ -55,7 +55,7 @@ public final class ModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return an embedding vector along with {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -131,7 +131,7 @@ public Mono> postWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an embedding vector on successful completion of {@link Mono}. + * @return the response body on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/model/ModelClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/model/ModelClient.java index 170aadb44c..fcb1dd933c 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/model/ModelClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/model/ModelClient.java @@ -53,7 +53,7 @@ public final class ModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return an embedding vector along with {@link Response}. + * @return the response body along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -129,7 +129,7 @@ public Response postWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an embedding vector. + * @return the response. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/model/implementation/AzureCoreEmbeddingVectorsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/model/implementation/AzureCoreEmbeddingVectorsImpl.java index 1d5e9da27b..e28bb5970b 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/model/implementation/AzureCoreEmbeddingVectorsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/model/implementation/AzureCoreEmbeddingVectorsImpl.java @@ -75,7 +75,7 @@ public interface AzureCoreEmbeddingVectorsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/model/embeddingVector") @@ -84,7 +84,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/azure/core/model/embeddingVector") @@ -93,8 +93,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/azure/core/model/embeddingVector") @ExpectedResponses({ 204 }) @@ -102,8 +102,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/azure/core/model/embeddingVector") @ExpectedResponses({ 200 }) @@ -111,8 +111,9 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> post(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> post(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/azure/core/model/embeddingVector") @ExpectedResponses({ 200 }) @@ -120,8 +121,9 @@ Mono> post(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response postSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -139,7 +141,7 @@ Response postSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return an embedding vector along with {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -162,7 +164,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return an embedding vector along with {@link Response}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -190,8 +192,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -214,8 +216,8 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } /** @@ -250,8 +252,9 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.post(accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.post(contentType, accept, body, requestOptions, context)); } /** @@ -286,7 +289,8 @@ public Mono> postWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.postSync(accept, body, requestOptions, Context.NONE); + return service.postSync(contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarAsyncClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarAsyncClient.java index a7cb562f8e..01d5fd9490 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarAsyncClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarAsyncClient.java @@ -51,7 +51,8 @@ public final class ScalarAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return azureLocation value along with {@link Response} on successful completion of {@link Mono}. + * @return represents an Azure geography region where supported resource providers live along with {@link Response} + * on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -155,7 +156,8 @@ public Mono> queryWithResponse(String region, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azureLocation value on successful completion of {@link Mono}. + * @return represents an Azure geography region where supported resource providers live on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarClient.java index 593f5fd1ea..5361d1c5eb 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarClient.java @@ -49,7 +49,7 @@ public final class ScalarClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return azureLocation value along with {@link Response}. + * @return represents an Azure geography region where supported resource providers live along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -153,7 +153,7 @@ public Response queryWithResponse(String region, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azureLocation value. + * @return represents an Azure geography region where supported resource providers live. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/implementation/AzureLocationScalarsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/implementation/AzureLocationScalarsImpl.java index 8ff921c07c..d53a790ae7 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/implementation/AzureLocationScalarsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/implementation/AzureLocationScalarsImpl.java @@ -76,7 +76,7 @@ public interface AzureLocationScalarsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/scalar/azureLocation") @@ -85,7 +85,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/azure/core/scalar/azureLocation") @@ -94,8 +94,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/azure/core/scalar/azureLocation") @ExpectedResponses({ 204 }) @@ -103,8 +103,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/azure/core/scalar/azureLocation") @ExpectedResponses({ 200 }) @@ -112,8 +112,9 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> post(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> post(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/azure/core/scalar/azureLocation") @ExpectedResponses({ 200 }) @@ -121,8 +122,9 @@ Mono> post(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response postSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/azure/core/scalar/azureLocation/header") @ExpectedResponses({ 204 }) @@ -130,8 +132,8 @@ Response postSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> headerMethod(@HeaderParam("region") String region, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> headerMethod(@HeaderParam("region") String region, RequestOptions requestOptions, + Context context); @Post("/azure/core/scalar/azureLocation/header") @ExpectedResponses({ 204 }) @@ -139,8 +141,8 @@ Mono> headerMethod(@HeaderParam("region") String region, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response headerMethodSync(@HeaderParam("region") String region, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response headerMethodSync(@HeaderParam("region") String region, RequestOptions requestOptions, + Context context); @Post("/azure/core/scalar/azureLocation/query") @ExpectedResponses({ 204 }) @@ -148,8 +150,7 @@ Response headerMethodSync(@HeaderParam("region") String region, @HeaderPar @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> query(@QueryParam("region") String region, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> query(@QueryParam("region") String region, RequestOptions requestOptions, Context context); @Post("/azure/core/scalar/azureLocation/query") @ExpectedResponses({ 204 }) @@ -157,8 +158,7 @@ Mono> query(@QueryParam("region") String region, @HeaderParam("ac @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response querySync(@QueryParam("region") String region, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response querySync(@QueryParam("region") String region, RequestOptions requestOptions, Context context); } /** @@ -174,7 +174,8 @@ Response querySync(@QueryParam("region") String region, @HeaderParam("acce * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return azureLocation value along with {@link Response} on successful completion of {@link Mono}. + * @return represents an Azure geography region where supported resource providers live along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -195,7 +196,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return azureLocation value along with {@link Response}. + * @return represents an Azure geography region where supported resource providers live along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -221,8 +222,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -243,8 +244,8 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } /** @@ -275,8 +276,9 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.post(accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.post(contentType, accept, body, requestOptions, context)); } /** @@ -307,8 +309,9 @@ public Mono> postWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.postSync(accept, body, requestOptions, Context.NONE); + return service.postSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -324,8 +327,7 @@ public Response postWithResponse(BinaryData body, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> headerMethodWithResponseAsync(String region, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.headerMethod(region, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.headerMethod(region, requestOptions, context)); } /** @@ -341,8 +343,7 @@ public Mono> headerMethodWithResponseAsync(String region, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response headerMethodWithResponse(String region, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.headerMethodSync(region, accept, requestOptions, Context.NONE); + return service.headerMethodSync(region, requestOptions, Context.NONE); } /** @@ -358,8 +359,7 @@ public Response headerMethodWithResponse(String region, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> queryWithResponseAsync(String region, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.query(region, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.query(region, requestOptions, context)); } /** @@ -375,7 +375,6 @@ public Mono> queryWithResponseAsync(String region, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response queryWithResponse(String region, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.querySync(region, accept, requestOptions, Context.NONE); + return service.querySync(region, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsAsyncClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsAsyncClient.java index 68f22bd50e..2bd5b4d778 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsAsyncClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsAsyncClient.java @@ -76,8 +76,7 @@ public final class TraitsAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a resource, sending and receiving headers along with {@link Response} on successful completion of - * {@link Mono}. + * @return sample Model along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -140,7 +139,7 @@ public Mono> repeatableActionWithResponse(int id, BinaryDat * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource, sending and receiving headers on successful completion of {@link Mono}. + * @return sample Model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -180,7 +179,7 @@ public Mono smokeTest(int id, String foo, RequestConditions requestConditi * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource, sending and receiving headers on successful completion of {@link Mono}. + * @return sample Model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsClient.java index ef9927aafb..f4ab2a4d75 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsClient.java @@ -74,7 +74,7 @@ public final class TraitsClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a resource, sending and receiving headers along with {@link Response}. + * @return sample Model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -136,7 +136,7 @@ public Response repeatableActionWithResponse(int id, BinaryData body * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource, sending and receiving headers. + * @return sample Model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -175,7 +175,7 @@ public User smokeTest(int id, String foo, RequestConditions requestConditions) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource, sending and receiving headers. + * @return sample Model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/implementation/TraitsClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/implementation/TraitsClientImpl.java index b551a4fe00..cfc6be6f60 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/implementation/TraitsClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/implementation/TraitsClientImpl.java @@ -138,7 +138,7 @@ public interface TraitsClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> smokeTest(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("foo") String foo, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HeaderParam("foo") String foo, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/traits/user/{id}") @@ -148,7 +148,7 @@ Mono> smokeTest(@QueryParam("api-version") String apiVersio @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response smokeTestSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("foo") String foo, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HeaderParam("foo") String foo, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/azure/core/traits/user/{id}:repeatableAction") @@ -158,8 +158,9 @@ Response smokeTestSync(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> repeatableAction(@QueryParam("api-version") String apiVersion, - @PathParam("id") int id, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @PathParam("id") int id, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/azure/core/traits/user/{id}:repeatableAction") @ExpectedResponses({ 200 }) @@ -168,8 +169,8 @@ Mono> repeatableAction(@QueryParam("api-version") String ap @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response repeatableActionSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -204,8 +205,7 @@ Response repeatableActionSync(@QueryParam("api-version") String apiV * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a resource, sending and receiving headers along with {@link Response} on successful completion of - * {@link Mono}. + * @return sample Model along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> smokeTestWithResponseAsync(int id, String foo, RequestOptions requestOptions) { @@ -246,7 +246,7 @@ public Mono> smokeTestWithResponseAsync(int id, String foo, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a resource, sending and receiving headers along with {@link Response}. + * @return sample Model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response smokeTestWithResponse(int id, String foo, RequestOptions requestOptions) { @@ -294,6 +294,7 @@ public Response smokeTestWithResponse(int id, String foo, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> repeatableActionWithResponseAsync(int id, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { @@ -310,7 +311,7 @@ public Mono> repeatableActionWithResponseAsync(int id, Bina } }); return FluxUtil.withContext(context -> service.repeatableAction(this.getServiceVersion().getVersion(), id, - accept, body, requestOptionsLocal, context)); + contentType, accept, body, requestOptionsLocal, context)); } /** @@ -351,6 +352,7 @@ public Mono> repeatableActionWithResponseAsync(int id, Bina */ @ServiceMethod(returns = ReturnType.SINGLE) public Response repeatableActionWithResponse(int id, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { @@ -366,7 +368,7 @@ public Response repeatableActionWithResponse(int id, BinaryData body DateTimeRfc1123.toRfc1123String(OffsetDateTime.now())); } }); - return service.repeatableActionSync(this.getServiceVersion().getVersion(), id, accept, body, + return service.repeatableActionSync(this.getServiceVersion().getVersion(), id, contentType, accept, body, requestOptionsLocal, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/authentication/apikey/implementation/ApiKeyClientImpl.java b/typespec-tests/src/main/java/com/authentication/apikey/implementation/ApiKeyClientImpl.java index e0b97150e8..12cfe4eaf4 100644 --- a/typespec-tests/src/main/java/com/authentication/apikey/implementation/ApiKeyClientImpl.java +++ b/typespec-tests/src/main/java/com/authentication/apikey/implementation/ApiKeyClientImpl.java @@ -107,8 +107,7 @@ public interface ApiKeyClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> valid(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> valid(RequestOptions requestOptions, Context context); @Get("/authentication/api-key/valid") @ExpectedResponses({ 204 }) @@ -116,7 +115,7 @@ Mono> valid(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response validSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response validSync(RequestOptions requestOptions, Context context); @Get("/authentication/api-key/invalid") @ExpectedResponses({ 204 }) @@ -124,7 +123,7 @@ Mono> valid(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> invalid(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> invalid(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/authentication/api-key/invalid") @@ -133,7 +132,7 @@ Mono> invalid(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response invalidSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response invalidSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -149,8 +148,7 @@ Response invalidSync(@HeaderParam("accept") String accept, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> validWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.valid(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.valid(requestOptions, context)); } /** @@ -165,8 +163,7 @@ public Mono> validWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.validSync(accept, requestOptions, Context.NONE); + return service.validSync(requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/authentication/http/custom/implementation/CustomClientImpl.java b/typespec-tests/src/main/java/com/authentication/http/custom/implementation/CustomClientImpl.java index a1249585f5..b6657d5c58 100644 --- a/typespec-tests/src/main/java/com/authentication/http/custom/implementation/CustomClientImpl.java +++ b/typespec-tests/src/main/java/com/authentication/http/custom/implementation/CustomClientImpl.java @@ -107,8 +107,7 @@ public interface CustomClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> valid(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> valid(RequestOptions requestOptions, Context context); @Get("/authentication/http/custom/valid") @ExpectedResponses({ 204 }) @@ -116,7 +115,7 @@ Mono> valid(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response validSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response validSync(RequestOptions requestOptions, Context context); @Get("/authentication/http/custom/invalid") @ExpectedResponses({ 204 }) @@ -124,7 +123,7 @@ Mono> valid(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> invalid(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> invalid(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/authentication/http/custom/invalid") @@ -133,7 +132,7 @@ Mono> invalid(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response invalidSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response invalidSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -149,8 +148,7 @@ Response invalidSync(@HeaderParam("accept") String accept, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> validWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.valid(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.valid(requestOptions, context)); } /** @@ -165,8 +163,7 @@ public Mono> validWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.validSync(accept, requestOptions, Context.NONE); + return service.validSync(requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/authentication/oauth2/implementation/OAuth2ClientImpl.java b/typespec-tests/src/main/java/com/authentication/oauth2/implementation/OAuth2ClientImpl.java index 6b58a78ce2..3cc7d5a24f 100644 --- a/typespec-tests/src/main/java/com/authentication/oauth2/implementation/OAuth2ClientImpl.java +++ b/typespec-tests/src/main/java/com/authentication/oauth2/implementation/OAuth2ClientImpl.java @@ -107,8 +107,7 @@ public interface OAuth2ClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> valid(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> valid(RequestOptions requestOptions, Context context); @Get("/authentication/oauth2/valid") @ExpectedResponses({ 204 }) @@ -116,7 +115,7 @@ Mono> valid(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response validSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response validSync(RequestOptions requestOptions, Context context); @Get("/authentication/oauth2/invalid") @ExpectedResponses({ 204 }) @@ -124,7 +123,7 @@ Mono> valid(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> invalid(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> invalid(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/authentication/oauth2/invalid") @@ -133,7 +132,7 @@ Mono> invalid(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response invalidSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response invalidSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -149,8 +148,7 @@ Response invalidSync(@HeaderParam("accept") String accept, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> validWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.valid(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.valid(requestOptions, context)); } /** @@ -165,8 +163,7 @@ public Mono> validWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.validSync(accept, requestOptions, Context.NONE); + return service.validSync(requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/authentication/union/implementation/UnionClientImpl.java b/typespec-tests/src/main/java/com/authentication/union/implementation/UnionClientImpl.java index e0b863d25e..4c601b975a 100644 --- a/typespec-tests/src/main/java/com/authentication/union/implementation/UnionClientImpl.java +++ b/typespec-tests/src/main/java/com/authentication/union/implementation/UnionClientImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -107,8 +106,7 @@ public interface UnionClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> validKey(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> validKey(RequestOptions requestOptions, Context context); @Get("/authentication/union/validkey") @ExpectedResponses({ 204 }) @@ -116,8 +114,7 @@ Mono> validKey(@HeaderParam("accept") String accept, RequestOptio @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response validKeySync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response validKeySync(RequestOptions requestOptions, Context context); @Get("/authentication/union/validtoken") @ExpectedResponses({ 204 }) @@ -125,8 +122,7 @@ Response validKeySync(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> validToken(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> validToken(RequestOptions requestOptions, Context context); @Get("/authentication/union/validtoken") @ExpectedResponses({ 204 }) @@ -134,8 +130,7 @@ Mono> validToken(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response validTokenSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response validTokenSync(RequestOptions requestOptions, Context context); } /** @@ -150,8 +145,7 @@ Response validTokenSync(@HeaderParam("accept") String accept, RequestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> validKeyWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.validKey(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.validKey(requestOptions, context)); } /** @@ -166,8 +160,7 @@ public Mono> validKeyWithResponseAsync(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validKeyWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.validKeySync(accept, requestOptions, Context.NONE); + return service.validKeySync(requestOptions, Context.NONE); } /** @@ -182,8 +175,7 @@ public Response validKeyWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> validTokenWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.validToken(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.validToken(requestOptions, context)); } /** @@ -198,7 +190,6 @@ public Mono> validTokenWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validTokenWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.validTokenSync(accept, requestOptions, Context.NONE); + return service.validTokenSync(requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/ResourcesManager.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/ResourcesManager.java index 8b3adc0289..a96212bb57 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/ResourcesManager.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/ResourcesManager.java @@ -51,7 +51,6 @@ private ResourcesManager(HttpPipeline httpPipeline, AzureProfile profile, Durati Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); this.clientObject = new ResourcesClientBuilder().pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) .buildClient(); diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/NestedProxyResourcesClient.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/NestedProxyResourcesClient.java index 68f8c8f214..3102223c85 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/NestedProxyResourcesClient.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/NestedProxyResourcesClient.java @@ -28,7 +28,7 @@ public interface NestedProxyResourcesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource along with {@link Response}. + * @return nested child of Top Level Tracked Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String resourceGroupName, String topLevelTrackedResourceName, @@ -43,7 +43,7 @@ Response getWithResponse(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource. + * @return nested child of Top Level Tracked Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) NestedProxyResourceInner get(String resourceGroupName, String topLevelTrackedResourceName, diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/ResourcesClient.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/ResourcesClient.java index 39a2825d08..760d7eeaf2 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/ResourcesClient.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/ResourcesClient.java @@ -11,13 +11,6 @@ * The interface for ResourcesClient class. */ public interface ResourcesClient { - /** - * Gets Server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - /** * Gets Version parameter. * diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/TopLevelTrackedResourcesClient.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/TopLevelTrackedResourcesClient.java index 37fe038bae..9c19a013b2 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/TopLevelTrackedResourcesClient.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/TopLevelTrackedResourcesClient.java @@ -27,7 +27,8 @@ public interface TopLevelTrackedResourcesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse(String resourceGroupName, @@ -41,7 +42,7 @@ Response getByResourceGroupWithResponse(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. */ @ServiceMethod(returns = ReturnType.SINGLE) TopLevelTrackedResourceInner getByResourceGroup(String resourceGroupName, String topLevelTrackedResourceName); diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/NestedProxyResourcesClientImpl.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/NestedProxyResourcesClientImpl.java index 92be03618c..e0c7c9c9ec 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/NestedProxyResourcesClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/NestedProxyResourcesClientImpl.java @@ -11,7 +11,6 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; @@ -69,51 +68,51 @@ public final class NestedProxyResourcesClientImpl implements NestedProxyResource * The interface defining all the services for ResourcesClientNestedProxyResources to be used by the proxy service * to perform REST calls. */ - @Host("{endpoint}") + @Host("https://management.azure.com") @ServiceInterface(name = "ResourcesClientNeste") public interface NestedProxyResourcesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}/nestedProxyResources/{nextedProxyResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> get(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("accept") String accept, + @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}/nestedProxyResources/{nextedProxyResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrReplace(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrReplace(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("accept") String accept, + @PathParam("nextedProxyResourceName") String nextedProxyResourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") NestedProxyResourceInner resource, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}/nestedProxyResources/{nextedProxyResourceName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("accept") String accept, + @PathParam("nextedProxyResourceName") String nextedProxyResourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") NestedProxyResourceUpdate properties, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}/nestedProxyResources/{nextedProxyResourceName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("accept") String accept, + @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -121,19 +120,18 @@ Mono>> delete(@HostParam("endpoint") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTopLevelTrackedResource( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTopLevelTrackedResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, + Context context); } /** @@ -145,15 +143,12 @@ Mono> listByTopLevelTrackedResourceNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource along with {@link Response} on successful completion of {@link Mono}. + * @return nested child of Top Level Tracked Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -172,9 +167,8 @@ private Mono> getWithResponseAsync(String res } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, - nextedProxyResourceName, accept, context)) + .withContext(context -> service.get(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -188,15 +182,12 @@ private Mono> getWithResponseAsync(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource along with {@link Response} on successful completion of {@link Mono}. + * @return nested child of Top Level Tracked Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -215,8 +206,8 @@ private Mono> getWithResponseAsync(String res } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, accept, context); + return service.get(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelTrackedResourceName, nextedProxyResourceName, accept, context); } /** @@ -228,7 +219,7 @@ private Mono> getWithResponseAsync(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource on successful completion of {@link Mono}. + * @return nested child of Top Level Tracked Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String topLevelTrackedResourceName, @@ -247,7 +238,7 @@ private Mono getAsync(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource along with {@link Response}. + * @return nested child of Top Level Tracked Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, @@ -265,7 +256,7 @@ public Response getWithResponse(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource. + * @return nested child of Top Level Tracked Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) public NestedProxyResourceInner get(String resourceGroupName, String topLevelTrackedResourceName, @@ -290,10 +281,6 @@ public NestedProxyResourceInner get(String resourceGroupName, String topLevelTra @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, NestedProxyResourceInner resource) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -315,11 +302,12 @@ private Mono>> createOrReplaceWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.createOrReplace(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, - nextedProxyResourceName, accept, resource, context)) + nextedProxyResourceName, contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -341,10 +329,6 @@ private Mono>> createOrReplaceWithResponseAsync(String private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, NestedProxyResourceInner resource, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -366,11 +350,11 @@ private Mono>> createOrReplaceWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, - accept, resource, context); + return service.createOrReplace(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelTrackedResourceName, nextedProxyResourceName, contentType, accept, resource, context); } /** @@ -560,10 +544,6 @@ public NestedProxyResourceInner createOrReplace(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, NestedProxyResourceUpdate properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -585,11 +565,12 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, - nextedProxyResourceName, accept, properties, context)) + .withContext(context -> service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, contentType, accept, + properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -611,10 +592,6 @@ private Mono>> updateWithResponseAsync(String resource private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, NestedProxyResourceUpdate properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -636,10 +613,11 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, accept, properties, context); + return service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelTrackedResourceName, nextedProxyResourceName, contentType, accept, properties, context); } /** @@ -825,10 +803,6 @@ public NestedProxyResourceInner update(String resourceGroupName, String topLevel @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -847,9 +821,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, - nextedProxyResourceName, accept, context)) + .withContext(context -> service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -868,10 +841,6 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -890,8 +859,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, accept, context); + return service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelTrackedResourceName, nextedProxyResourceName, accept, context); } /** @@ -1056,10 +1025,6 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelTrackedResourceSinglePageAsync(String resourceGroupName, String topLevelTrackedResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1074,9 +1039,8 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByTopLevelTrackedResource(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context)) + .withContext(context -> service.listByTopLevelTrackedResource(this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1097,10 +1061,6 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelTrackedResourceSinglePageAsync( String resourceGroupName, String topLevelTrackedResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1116,8 +1076,8 @@ private Mono> listByTopLevelTrackedResou final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByTopLevelTrackedResource(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context) + .listByTopLevelTrackedResource(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1194,6 +1154,8 @@ public PagedIterable listByTopLevelTrackedResource(Str } /** + * List NestedProxyResource resources by TopLevelTrackedResource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1209,19 +1171,16 @@ public PagedIterable listByTopLevelTrackedResource(Str if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listByTopLevelTrackedResourceNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listByTopLevelTrackedResourceNext(nextLink, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** + * List NestedProxyResource resources by TopLevelTrackedResource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1238,13 +1197,9 @@ public PagedIterable listByTopLevelTrackedResource(Str if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByTopLevelTrackedResourceNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listByTopLevelTrackedResourceNext(nextLink, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/ResourcesClientBuilder.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/ResourcesClientBuilder.java index cf7d091351..9079e8642f 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/ResourcesClientBuilder.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/ResourcesClientBuilder.java @@ -19,22 +19,6 @@ */ @ServiceClientBuilder(serviceClients = { ResourcesClientImpl.class }) public final class ResourcesClientBuilder { - /* - * Server parameter - */ - private String endpoint; - - /** - * Sets Server parameter. - * - * @param endpoint the endpoint value. - * @return the ResourcesClientBuilder. - */ - public ResourcesClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - /* * The ID of the target subscription. The value must be an UUID. */ @@ -131,7 +115,7 @@ public ResourcesClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); ResourcesClientImpl client = new ResourcesClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId); + localDefaultPollInterval, localEnvironment, this.subscriptionId); return client; } } diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/ResourcesClientImpl.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/ResourcesClientImpl.java index 2d864ad3f2..6db6b25389 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/ResourcesClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/ResourcesClientImpl.java @@ -40,20 +40,6 @@ */ @ServiceClient(builder = ResourcesClientBuilder.class) public final class ResourcesClientImpl implements ResourcesClient { - /** - * Server parameter. - */ - private final String endpoint; - - /** - * Gets Server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - /** * Version parameter. */ @@ -159,15 +145,13 @@ public NestedProxyResourcesClient getNestedProxyResources() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param endpoint Server parameter. * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ ResourcesClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, - AzureEnvironment environment, String endpoint, String subscriptionId) { + AzureEnvironment environment, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.endpoint = endpoint; this.subscriptionId = subscriptionId; this.apiVersion = "2023-12-01-preview"; this.topLevelTrackedResources = new TopLevelTrackedResourcesClientImpl(this); diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java index 21a83a7436..654fef55b5 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java @@ -11,7 +11,6 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; @@ -69,83 +68,80 @@ public final class TopLevelTrackedResourcesClientImpl implements TopLevelTracked * The interface defining all the services for ResourcesClientTopLevelTrackedResources to be used by the proxy * service to perform REST calls. */ - @Host("{endpoint}") + @Host("https://management.azure.com") @ServiceInterface(name = "ResourcesClientTopLe") public interface TopLevelTrackedResourcesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrReplace(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrReplace(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @HeaderParam("accept") String accept, @BodyParam("application/json") TopLevelTrackedResourceInner resource, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") TopLevelTrackedResourceInner resource, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") TopLevelTrackedResourceUpdate properties, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + Mono> listByResourceGroup( @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("accept") String accept, Context context); + Mono> list(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, + Context context); } /** @@ -156,15 +152,12 @@ Mono> listBySubscriptionNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource along with {@link Response} on successful completion of {@link Mono}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -179,7 +172,7 @@ private Mono> getByResourceGroupWithRespo } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.getByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -193,15 +186,12 @@ private Mono> getByResourceGroupWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource along with {@link Response} on successful completion of {@link Mono}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -216,8 +206,8 @@ private Mono> getByResourceGroupWithRespo } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context); + return service.getByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, accept, context); } /** @@ -228,7 +218,8 @@ private Mono> getByResourceGroupWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource on successful completion of {@link Mono}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, @@ -246,7 +237,8 @@ private Mono getByResourceGroupAsync(String resour * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, @@ -262,7 +254,7 @@ public Response getByResourceGroupWithResponse(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. */ @ServiceMethod(returns = ReturnType.SINGLE) public TopLevelTrackedResourceInner getByResourceGroup(String resourceGroupName, @@ -285,10 +277,6 @@ public TopLevelTrackedResourceInner getByResourceGroup(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, TopLevelTrackedResourceInner resource) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -306,11 +294,12 @@ private Mono>> createOrReplaceWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, resource, - context)) + .withContext( + context -> service.createOrReplace(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -330,10 +319,6 @@ private Mono>> createOrReplaceWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, TopLevelTrackedResourceInner resource, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -351,10 +336,11 @@ private Mono>> createOrReplaceWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, resource, context); + return service.createOrReplace(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelTrackedResourceName, contentType, accept, resource, context); } /** @@ -533,10 +519,6 @@ public TopLevelTrackedResourceInner createOrReplace(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, TopLevelTrackedResourceUpdate properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -554,11 +536,11 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, properties, - context)) + .withContext(context -> service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, contentType, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -578,10 +560,6 @@ private Mono>> updateWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, TopLevelTrackedResourceUpdate properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -599,10 +577,11 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, accept, properties, context); + return service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelTrackedResourceName, contentType, accept, properties, context); } /** @@ -778,10 +757,6 @@ public TopLevelTrackedResourceInner update(String resourceGroupName, String topL @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -796,8 +771,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context)) + .withContext(context -> service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -815,10 +790,6 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -833,8 +804,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, accept, context); + return service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelTrackedResourceName, accept, context); } /** @@ -984,10 +955,6 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -998,7 +965,7 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.listByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -1019,10 +986,6 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1034,8 +997,8 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accept, context) + .listByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1113,18 +1076,14 @@ public PagedIterable listByResourceGroup(String re */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) + .withContext( + context -> service.list(this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1142,19 +1101,13 @@ private Mono> listSinglePageAsync() */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, - context) + return service.list(this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1216,6 +1169,8 @@ public PagedIterable list(Context context) { } /** + * List TopLevelTrackedResource resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1230,20 +1185,16 @@ private Mono> listByResourceGroupNex if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listByResourceGroupNext(nextLink, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** + * List TopLevelTrackedResource resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1260,18 +1211,16 @@ private Mono> listByResourceGroupNex if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listByResourceGroupNext(nextLink, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** + * List TopLevelTrackedResource resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1286,20 +1235,16 @@ private Mono> listBySubscriptionNext if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listBySubscriptionNext(nextLink, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** + * List TopLevelTrackedResource resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1316,13 +1261,9 @@ private Mono> listBySubscriptionNext if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listBySubscriptionNext(nextLink, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/models/NestedProxyResources.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/models/NestedProxyResources.java index 36603839d6..c3e0edda4d 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/models/NestedProxyResources.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/models/NestedProxyResources.java @@ -22,7 +22,7 @@ public interface NestedProxyResources { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource along with {@link Response}. + * @return nested child of Top Level Tracked Resource along with {@link Response}. */ Response getWithResponse(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, Context context); @@ -36,7 +36,7 @@ Response getWithResponse(String resourceGroupName, String t * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource. + * @return nested child of Top Level Tracked Resource. */ NestedProxyResource get(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName); @@ -101,7 +101,7 @@ PagedIterable listByTopLevelTrackedResource(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource along with {@link Response}. + * @return nested child of Top Level Tracked Resource along with {@link Response}. */ NestedProxyResource getById(String id); @@ -113,7 +113,7 @@ PagedIterable listByTopLevelTrackedResource(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource along with {@link Response}. + * @return nested child of Top Level Tracked Resource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/models/TopLevelTrackedResources.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/models/TopLevelTrackedResources.java index e251c82128..2b92f8a61a 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/models/TopLevelTrackedResources.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/models/TopLevelTrackedResources.java @@ -21,7 +21,8 @@ public interface TopLevelTrackedResources { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ Response getByResourceGroupWithResponse(String resourceGroupName, String topLevelTrackedResourceName, Context context); @@ -34,7 +35,7 @@ Response getByResourceGroupWithResponse(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. */ TopLevelTrackedResource getByResourceGroup(String resourceGroupName, String topLevelTrackedResourceName); @@ -115,7 +116,8 @@ Response getByResourceGroupWithResponse(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ TopLevelTrackedResource getById(String id); @@ -127,7 +129,8 @@ Response getByResourceGroupWithResponse(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdAsyncClient.java b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdAsyncClient.java index e67c748929..3c6de2a5b3 100644 --- a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdAsyncClient.java +++ b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdAsyncClient.java @@ -44,8 +44,7 @@ public final class XmsClientRequestIdAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return operation with azure `x-ms-client-request-id` header along with {@link Response} on successful completion - * of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -61,7 +60,7 @@ public Mono> getWithResponse(RequestOptions requestOptions) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation with azure `x-ms-client-request-id` header on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClient.java b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClient.java index b5db477c0b..fdb5f059c3 100644 --- a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClient.java +++ b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClient.java @@ -42,7 +42,7 @@ public final class XmsClientRequestIdClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return operation with azure `x-ms-client-request-id` header along with {@link Response}. + * @return the {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/implementation/XmsClientRequestIdClientImpl.java b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/implementation/XmsClientRequestIdClientImpl.java index bb1d550f97..011ed0df41 100644 --- a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/implementation/XmsClientRequestIdClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/implementation/XmsClientRequestIdClientImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -109,7 +108,7 @@ public interface XmsClientRequestIdClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> get(RequestOptions requestOptions, Context context); @Get("/azure/special-headers/x-ms-client-request-id") @ExpectedResponses({ 204 }) @@ -117,7 +116,7 @@ public interface XmsClientRequestIdClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response getSync(RequestOptions requestOptions, Context context); } /** @@ -128,13 +127,11 @@ public interface XmsClientRequestIdClientService { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return operation with azure `x-ms-client-request-id` header along with {@link Response} on successful completion - * of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(requestOptions, context)); } /** @@ -145,11 +142,10 @@ public Mono> getWithResponseAsync(RequestOptions requestOptions) * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return operation with azure `x-ms-client-request-id` header along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/ArmResourceProviderManager.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/ArmResourceProviderManager.java index f8f5fc8810..6fbd69c3a4 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/ArmResourceProviderManager.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/ArmResourceProviderManager.java @@ -63,7 +63,6 @@ private ArmResourceProviderManager(HttpPipeline httpPipeline, AzureProfile profi Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); this.clientObject = new ArmResourceProviderClientBuilder().pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) .buildClient(); diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ArmResourceProviderClient.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ArmResourceProviderClient.java index 3bd6f9112f..d3263fbdfe 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ArmResourceProviderClient.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ArmResourceProviderClient.java @@ -11,13 +11,6 @@ * The interface for ArmResourceProviderClient class. */ public interface ArmResourceProviderClient { - /** - * Gets Server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - /** * Gets Version parameter. * diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildExtensionResourceInterfacesClient.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildExtensionResourceInterfacesClient.java index c4d676e38e..9c15298ed8 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildExtensionResourceInterfacesClient.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildExtensionResourceInterfacesClient.java @@ -27,7 +27,7 @@ public interface ChildExtensionResourceInterfacesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource along with {@link Response}. + * @return extensionResource of Top Level Arm Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String resourceUri, String topLevelArmResourceName, @@ -42,7 +42,7 @@ Response getWithResponse(String resourceUri, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource. + * @return extensionResource of Top Level Arm Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) ChildExtensionResourceInner get(String resourceUri, String topLevelArmResourceName, diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildResourcesInterfacesClient.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildResourcesInterfacesClient.java index c06553db4f..7b0b515c17 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildResourcesInterfacesClient.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildResourcesInterfacesClient.java @@ -28,7 +28,7 @@ public interface ChildResourcesInterfacesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource along with {@link Response}. + * @return subresource of Top Level Arm Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String resourceGroupName, String topLevelArmResourceName, @@ -43,7 +43,7 @@ Response getWithResponse(String resourceGroupName, String to * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource. + * @return subresource of Top Level Arm Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) ChildResourceInner get(String resourceGroupName, String topLevelArmResourceName, String childResourceName); diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java index 96977bf126..ddc0e6c51a 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java @@ -28,7 +28,8 @@ public interface TopLevelArmResourceInterfacesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelArmResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse(String resourceGroupName, @@ -42,7 +43,7 @@ Response getByResourceGroupWithResponse(String resourc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelArmResource. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. */ @ServiceMethod(returns = ReturnType.SINGLE) TopLevelArmResourceInner getByResourceGroup(String resourceGroupName, String topLevelArmResourceName); diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientBuilder.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientBuilder.java index 2b36c77e05..f014b39355 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientBuilder.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientBuilder.java @@ -19,22 +19,6 @@ */ @ServiceClientBuilder(serviceClients = { ArmResourceProviderClientImpl.class }) public final class ArmResourceProviderClientBuilder { - /* - * Server parameter - */ - private String endpoint; - - /** - * Sets Server parameter. - * - * @param endpoint the endpoint value. - * @return the ArmResourceProviderClientBuilder. - */ - public ArmResourceProviderClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - /* * The ID of the target subscription. The value must be an UUID. */ @@ -131,7 +115,7 @@ public ArmResourceProviderClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); ArmResourceProviderClientImpl client = new ArmResourceProviderClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId); + localDefaultPollInterval, localEnvironment, this.subscriptionId); return client; } } diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientImpl.java index 4e9ca21142..aa9d985f39 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientImpl.java @@ -43,20 +43,6 @@ */ @ServiceClient(builder = ArmResourceProviderClientBuilder.class) public final class ArmResourceProviderClientImpl implements ArmResourceProviderClient { - /** - * Server parameter. - */ - private final String endpoint; - - /** - * Gets Server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - /** * Version parameter. */ @@ -204,15 +190,13 @@ public ChildExtensionResourceInterfacesClient getChildExtensionResourceInterface * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param endpoint Server parameter. * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ ArmResourceProviderClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.endpoint = endpoint; this.subscriptionId = subscriptionId; this.apiVersion = "2023-11-01"; this.childResourcesInterfaces = new ChildResourcesInterfacesClientImpl(this); diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildExtensionResourceInterfacesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildExtensionResourceInterfacesClientImpl.java index b5767faa1e..a20d4c9cb7 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildExtensionResourceInterfacesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildExtensionResourceInterfacesClientImpl.java @@ -11,7 +11,6 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; @@ -68,58 +67,56 @@ public final class ChildExtensionResourceInterfacesClientImpl implements ChildEx * The interface defining all the services for ArmResourceProviderClientChildExtensionResourceInterfaces to be used * by the proxy service to perform REST calls. */ - @Host("{endpoint}") + @Host("https://management.azure.com") @ServiceInterface(name = "ArmResourceProviderC") public interface ChildExtensionResourceInterfacesService { @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childExtensionResources/{childExtensionResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, + Mono> get(@QueryParam("api-version") String apiVersion, + @PathParam("resourceUri") String resourceUri, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @PathParam("childExtensionResourceName") String childExtensionResourceName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/{resourceUri}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childExtensionResources/{childExtensionResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, + Mono>> createOrUpdate(@QueryParam("api-version") String apiVersion, + @PathParam("resourceUri") String resourceUri, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @PathParam("childExtensionResourceName") String childExtensionResourceName, - @HeaderParam("accept") String accept, @BodyParam("application/json") ChildExtensionResourceInner resource, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ChildExtensionResourceInner resource, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/{resourceUri}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childExtensionResources/{childExtensionResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, + Mono> update(@QueryParam("api-version") String apiVersion, + @PathParam("resourceUri") String resourceUri, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @PathParam("childExtensionResourceName") String childExtensionResourceName, - @HeaderParam("accept") String accept, @BodyParam("application/json") Object properties, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") Object properties, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/{resourceUri}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childExtensionResources/{childExtensionResourceName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, + Mono>> delete(@QueryParam("api-version") String apiVersion, + @PathParam("resourceUri") String resourceUri, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @PathParam("childExtensionResourceName") String childExtensionResourceName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childExtensionResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTopLevelArmResource( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("resourceUri") String resourceUri, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -127,8 +124,8 @@ Mono> listByTopLevelArmResource( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTopLevelArmResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, + Context context); } /** @@ -140,15 +137,12 @@ Mono> listByTopLevelArmResourceNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource along with {@link Response} on successful completion of {@link Mono}. + * @return extensionResource of Top Level Arm Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -162,8 +156,8 @@ private Mono> getWithResponseAsync(String } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - topLevelArmResourceName, childExtensionResourceName, accept, context)) + .withContext(context -> service.get(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, + childExtensionResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -177,15 +171,12 @@ private Mono> getWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource along with {@link Response} on successful completion of {@link Mono}. + * @return extensionResource of Top Level Arm Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -199,7 +190,7 @@ private Mono> getWithResponseAsync(String } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, topLevelArmResourceName, + return service.get(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, childExtensionResourceName, accept, context); } @@ -212,7 +203,7 @@ private Mono> getWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource on successful completion of {@link Mono}. + * @return extensionResource of Top Level Arm Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceUri, String topLevelArmResourceName, @@ -231,7 +222,7 @@ private Mono getAsync(String resourceUri, String to * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource along with {@link Response}. + * @return extensionResource of Top Level Arm Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceUri, String topLevelArmResourceName, @@ -248,7 +239,7 @@ public Response getWithResponse(String resourceUri, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource. + * @return extensionResource of Top Level Arm Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) public ChildExtensionResourceInner get(String resourceUri, String topLevelArmResourceName, @@ -273,10 +264,6 @@ public ChildExtensionResourceInner get(String resourceUri, String topLevelArmRes @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, ChildExtensionResourceInner resource) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -293,10 +280,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - resourceUri, topLevelArmResourceName, childExtensionResourceName, accept, resource, context)) + .withContext(context -> service.createOrUpdate(this.client.getApiVersion(), resourceUri, + topLevelArmResourceName, childExtensionResourceName, contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -318,10 +306,6 @@ private Mono>> createOrUpdateWithResponseAsync(String private Mono>> createOrUpdateWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, ChildExtensionResourceInner resource, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -338,10 +322,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - topLevelArmResourceName, childExtensionResourceName, accept, resource, context); + return service.createOrUpdate(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, + childExtensionResourceName, contentType, accept, resource, context); } /** @@ -529,10 +514,6 @@ public ChildExtensionResourceInner createOrUpdate(String resourceUri, String top @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, Object properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -547,10 +528,11 @@ private Mono> updateWithResponseAsync(Stri if (properties == null) { return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - topLevelArmResourceName, childExtensionResourceName, accept, properties, context)) + .withContext(context -> service.update(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, + childExtensionResourceName, contentType, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -571,10 +553,6 @@ private Mono> updateWithResponseAsync(Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, Object properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -589,10 +567,11 @@ private Mono> updateWithResponseAsync(Stri if (properties == null) { return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - topLevelArmResourceName, childExtensionResourceName, accept, properties, context); + return service.update(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, + childExtensionResourceName, contentType, accept, properties, context); } /** @@ -667,10 +646,6 @@ public ChildExtensionResourceInner update(String resourceUri, String topLevelArm @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -684,8 +659,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - topLevelArmResourceName, childExtensionResourceName, accept, context)) + .withContext(context -> service.delete(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, + childExtensionResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -704,10 +679,6 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -721,8 +692,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - topLevelArmResourceName, childExtensionResourceName, accept, context); + return service.delete(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, + childExtensionResourceName, accept, context); } /** @@ -886,10 +857,6 @@ public void delete(String resourceUri, String topLevelArmResourceName, String ch @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelArmResourceSinglePageAsync(String resourceUri, String topLevelArmResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -899,8 +866,8 @@ public void delete(String resourceUri, String topLevelArmResourceName, String ch } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByTopLevelArmResource(this.client.getEndpoint(), - this.client.getApiVersion(), resourceUri, topLevelArmResourceName, accept, context)) + .withContext(context -> service.listByTopLevelArmResource(this.client.getApiVersion(), resourceUri, + topLevelArmResourceName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -921,10 +888,6 @@ public void delete(String resourceUri, String topLevelArmResourceName, String ch @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelArmResourceSinglePageAsync(String resourceUri, String topLevelArmResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -935,8 +898,8 @@ public void delete(String resourceUri, String topLevelArmResourceName, String ch final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByTopLevelArmResource(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - topLevelArmResourceName, accept, context) + .listByTopLevelArmResource(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, accept, + context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1011,6 +974,8 @@ public PagedIterable listByTopLevelArmResource(Stri } /** + * List ChildExtensionResource resources by TopLevelArmResource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1026,20 +991,16 @@ public PagedIterable listByTopLevelArmResource(Stri if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByTopLevelArmResourceNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listByTopLevelArmResourceNext(nextLink, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** + * List ChildExtensionResource resources by TopLevelArmResource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1056,13 +1017,9 @@ public PagedIterable listByTopLevelArmResource(Stri if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByTopLevelArmResourceNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listByTopLevelArmResourceNext(nextLink, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java index ecbd02657b..33b394e831 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java @@ -11,7 +11,6 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Post; @@ -70,72 +69,72 @@ public final class ChildResourcesInterfacesClientImpl implements ChildResourcesI * The interface defining all the services for ArmResourceProviderClientChildResourcesInterfaces to be used by the * proxy service to perform REST calls. */ - @Host("{endpoint}") + @Host("https://management.azure.com") @ServiceInterface(name = "ArmResourceProviderC") public interface ChildResourcesInterfacesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources/{childResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> get(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("accept") String accept, + @PathParam("childResourceName") String childResourceName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources/{childResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("accept") String accept, - @BodyParam("application/json") ChildResourceInner resource, Context context); + @PathParam("childResourceName") String childResourceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ChildResourceInner resource, + Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources/{childResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> update(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("accept") String accept, - @BodyParam("application/json") ChildResourceUpdate properties, Context context); + @PathParam("childResourceName") String childResourceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ChildResourceUpdate properties, + Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources/{childResourceName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("accept") String accept, + @PathParam("childResourceName") String childResourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByTopLevelArmResource(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> listByTopLevelArmResource(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources/{childResourceName}/actionWithoutBody") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> actionWithoutBody(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> actionWithoutBody(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("accept") String accept, + @PathParam("childResourceName") String childResourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -143,8 +142,8 @@ Mono>> actionWithoutBody(@HostParam("endpoint") String @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTopLevelArmResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, + Context context); } /** @@ -156,15 +155,12 @@ Mono> listByTopLevelArmResourceNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource along with {@link Response} on successful completion of {@link Mono}. + * @return subresource of Top Level Arm Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -183,9 +179,8 @@ private Mono> getWithResponseAsync(String resourceG } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, - context)) + .withContext(context -> service.get(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, childResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -199,15 +194,12 @@ private Mono> getWithResponseAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource along with {@link Response} on successful completion of {@link Mono}. + * @return subresource of Top Level Arm Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -226,8 +218,8 @@ private Mono> getWithResponseAsync(String resourceG } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, childResourceName, accept, context); + return service.get(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, childResourceName, accept, context); } /** @@ -239,7 +231,7 @@ private Mono> getWithResponseAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource on successful completion of {@link Mono}. + * @return subresource of Top Level Arm Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String topLevelArmResourceName, @@ -258,7 +250,7 @@ private Mono getAsync(String resourceGroupName, String topLe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource along with {@link Response}. + * @return subresource of Top Level Arm Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String topLevelArmResourceName, @@ -275,7 +267,7 @@ public Response getWithResponse(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource. + * @return subresource of Top Level Arm Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) public ChildResourceInner get(String resourceGroupName, String topLevelArmResourceName, String childResourceName) { @@ -298,10 +290,6 @@ public ChildResourceInner get(String resourceGroupName, String topLevelArmResour @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, ChildResourceInner resource) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -323,11 +311,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, - resource, context)) + .withContext(context -> service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, childResourceName, contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -348,10 +336,6 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, ChildResourceInner resource, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -373,11 +357,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, - resource, context); + return service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, childResourceName, contentType, accept, resource, context); } /** @@ -559,10 +543,6 @@ public ChildResourceInner createOrUpdate(String resourceGroupName, String topLev @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, ChildResourceUpdate properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -584,11 +564,12 @@ private Mono> updateWithResponseAsync(String resour } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, - properties, context)) + .withContext(context -> service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, childResourceName, contentType, accept, properties, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -609,10 +590,6 @@ private Mono> updateWithResponseAsync(String resour @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, ChildResourceUpdate properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -634,10 +611,11 @@ private Mono> updateWithResponseAsync(String resour } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, childResourceName, accept, properties, context); + return service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, childResourceName, contentType, accept, properties, context); } /** @@ -712,10 +690,6 @@ public ChildResourceInner update(String resourceGroupName, String topLevelArmRes @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -734,9 +708,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, - context)) + .withContext(context -> service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, childResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -755,10 +728,6 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -777,8 +746,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, childResourceName, accept, context); + return service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, childResourceName, accept, context); } /** @@ -941,10 +910,6 @@ public void delete(String resourceGroupName, String topLevelArmResourceName, Str @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelArmResourceSinglePageAsync(String resourceGroupName, String topLevelArmResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -959,9 +924,8 @@ private Mono> listByTopLevelArmResourceSingleP } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByTopLevelArmResource(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context)) + .withContext(context -> service.listByTopLevelArmResource(this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -982,10 +946,6 @@ private Mono> listByTopLevelArmResourceSingleP @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelArmResourceSinglePageAsync(String resourceGroupName, String topLevelArmResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1001,8 +961,8 @@ private Mono> listByTopLevelArmResourceSingleP final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByTopLevelArmResource(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context) + .listByTopLevelArmResource(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1091,10 +1051,6 @@ public PagedIterable listByTopLevelArmResource(String resour @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> actionWithoutBodyWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1113,9 +1069,9 @@ private Mono>> actionWithoutBodyWithResponseAsync(Stri } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.actionWithoutBody(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, - context)) + .withContext( + context -> service.actionWithoutBody(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, childResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1134,10 +1090,6 @@ private Mono>> actionWithoutBodyWithResponseAsync(Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> actionWithoutBodyWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1156,9 +1108,8 @@ private Mono>> actionWithoutBodyWithResponseAsync(Stri } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.actionWithoutBody(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, - context); + return service.actionWithoutBody(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, childResourceName, accept, context); } /** @@ -1311,6 +1262,8 @@ public void actionWithoutBody(String resourceGroupName, String topLevelArmResour } /** + * List ChildResource resources by TopLevelArmResource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1325,20 +1278,16 @@ private Mono> listByTopLevelArmResourceNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByTopLevelArmResourceNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listByTopLevelArmResourceNext(nextLink, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** + * List ChildResource resources by TopLevelArmResource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1355,13 +1304,9 @@ private Mono> listByTopLevelArmResourceNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByTopLevelArmResourceNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listByTopLevelArmResourceNext(nextLink, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/CustomTemplateResourceInterfacesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/CustomTemplateResourceInterfacesClientImpl.java index f7e3bf336b..39dd40eb5f 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/CustomTemplateResourceInterfacesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/CustomTemplateResourceInterfacesClientImpl.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; @@ -62,31 +60,29 @@ public final class CustomTemplateResourceInterfacesClientImpl implements CustomT * The interface defining all the services for ArmResourceProviderClientCustomTemplateResourceInterfaces to be used * by the proxy service to perform REST calls. */ - @Host("{endpoint}") + @Host("https://management.azure.com") @ServiceInterface(name = "ArmResourceProviderC") public interface CustomTemplateResourceInterfacesService { - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/customTemplateResources/{customTemplateResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @PathParam("customTemplateResourceName") String customTemplateResourceName, - @HeaderParam("accept") String accept, @BodyParam("application/json") CustomTemplateResourceInner resource, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CustomTemplateResourceInner resource, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/customTemplateResources/{customTemplateResourceName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateLongRunning(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> updateLongRunning(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("customTemplateResourceName") String customTemplateResourceName, - @HeaderParam("accept") String accept, @BodyParam("application/json") CustomTemplateResourcePatch properties, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CustomTemplateResourcePatch properties, Context context); } /** @@ -106,10 +102,6 @@ Mono>> updateLongRunning(@HostParam("endpoint") String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String customTemplateResourceName, CustomTemplateResourceInner resource, String ifMatch, String ifNoneMatch) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -127,11 +119,12 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, ifMatch, ifNoneMatch, customTemplateResourceName, - accept, resource, context)) + .withContext(context -> service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, ifMatch, ifNoneMatch, customTemplateResourceName, contentType, accept, resource, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -154,10 +147,6 @@ private Mono>> createOrUpdateWithResponseAsync(String private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String customTemplateResourceName, CustomTemplateResourceInner resource, String ifMatch, String ifNoneMatch, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -175,11 +164,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, ifMatch, ifNoneMatch, customTemplateResourceName, - accept, resource, context); + return service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + ifMatch, ifNoneMatch, customTemplateResourceName, contentType, accept, resource, context); } /** @@ -428,10 +417,6 @@ public CustomTemplateResourceInner createOrUpdate(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateLongRunningWithResponseAsync(String resourceGroupName, String customTemplateResourceName, CustomTemplateResourcePatch properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -449,11 +434,12 @@ private Mono>> updateLongRunningWithResponseAsync(Stri } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.updateLongRunning(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, customTemplateResourceName, accept, properties, - context)) + .withContext( + context -> service.updateLongRunning(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, customTemplateResourceName, contentType, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -473,10 +459,6 @@ private Mono>> updateLongRunningWithResponseAsync(Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateLongRunningWithResponseAsync(String resourceGroupName, String customTemplateResourceName, CustomTemplateResourcePatch properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -494,11 +476,11 @@ private Mono>> updateLongRunningWithResponseAsync(Stri } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.updateLongRunning(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, customTemplateResourceName, accept, properties, - context); + return service.updateLongRunning(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, customTemplateResourceName, contentType, accept, properties, context); } /** diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/OperationsClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/OperationsClientImpl.java index a41589074e..617d380ddd 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/OperationsClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/OperationsClientImpl.java @@ -9,7 +9,6 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -59,22 +58,22 @@ public final class OperationsClientImpl implements OperationsClient { * The interface defining all the services for ArmResourceProviderClientOperations to be used by the proxy service * to perform REST calls. */ - @Host("{endpoint}") + @Host("https://management.azure.com") @ServiceInterface(name = "ArmResourceProviderC") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Cadl.ArmResourceProvider/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, Context context); + Mono> list(@QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** @@ -87,14 +86,8 @@ Mono> listNext(@PathParam(value = "nextLink", enco */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + return FluxUtil.withContext(context -> service.list(this.client.getApiVersion(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -112,13 +105,9 @@ private Mono> listSinglePageAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + return service.list(this.client.getApiVersion(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -181,6 +170,8 @@ public PagedIterable list(Context context) { } /** + * List the operations for the provider + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -195,18 +186,16 @@ private Mono> listNextSinglePageAsync(String nextL if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listNext(nextLink, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** + * List the operations for the provider + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -222,13 +211,9 @@ private Mono> listNextSinglePageAsync(String nextL if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listNext(nextLink, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java index e1ebb896ef..602ccd66dd 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java @@ -11,7 +11,6 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Post; @@ -71,74 +70,73 @@ public final class TopLevelArmResourceInterfacesClientImpl implements TopLevelAr * The interface defining all the services for ArmResourceProviderClientTopLevelArmResourceInterfaces to be used by * the proxy service to perform REST calls. */ - @Host("{endpoint}") + @Host("https://management.azure.com") @ServiceInterface(name = "ArmResourceProviderC") public interface TopLevelArmResourceInterfacesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") TopLevelArmResourceInner resource, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> update(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") TopLevelArmResourceUpdate properties, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("accept") String accept, + Mono> listByResourceGroup(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Cadl.ArmResourceProvider/topLevelArmResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("accept") String accept, Context context); + Mono> list(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/action") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> action(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> action(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -146,16 +144,16 @@ Mono>> action(@HostParam("endpoint") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, + Context context); } /** @@ -166,15 +164,12 @@ Mono> listBySubscriptionNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelArmResource along with {@link Response} on successful completion of {@link Mono}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String topLevelArmResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -189,7 +184,7 @@ private Mono> getByResourceGroupWithResponseA } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.getByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -203,15 +198,12 @@ private Mono> getByResourceGroupWithResponseA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelArmResource along with {@link Response} on successful completion of {@link Mono}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -226,8 +218,8 @@ private Mono> getByResourceGroupWithResponseA } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context); + return service.getByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, accept, context); } /** @@ -238,7 +230,8 @@ private Mono> getByResourceGroupWithResponseA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelArmResource on successful completion of {@link Mono}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, @@ -256,7 +249,8 @@ private Mono getByResourceGroupAsync(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelArmResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, @@ -272,7 +266,7 @@ public Response getByResourceGroupWithResponse(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelArmResource. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. */ @ServiceMethod(returns = ReturnType.SINGLE) public TopLevelArmResourceInner getByResourceGroup(String resourceGroupName, String topLevelArmResourceName) { @@ -294,10 +288,6 @@ public TopLevelArmResourceInner getByResourceGroup(String resourceGroupName, Str @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, TopLevelArmResourceInner resource) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -315,10 +305,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, resource, context)) + .withContext(context -> service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -338,10 +329,6 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, TopLevelArmResourceInner resource, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -359,10 +346,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, resource, context); + return service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, contentType, accept, resource, context); } /** @@ -537,10 +525,6 @@ public TopLevelArmResourceInner createOrUpdate(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, TopLevelArmResourceUpdate properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -558,9 +542,11 @@ private Mono> updateWithResponseAsync(String } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, properties, context)) + return FluxUtil + .withContext(context -> service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, contentType, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -580,10 +566,6 @@ private Mono> updateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, TopLevelArmResourceUpdate properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -601,10 +583,11 @@ private Mono> updateWithResponseAsync(String } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, accept, properties, context); + return service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, contentType, accept, properties, context); } /** @@ -675,10 +658,6 @@ public TopLevelArmResourceInner update(String resourceGroupName, String topLevel @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelArmResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -693,8 +672,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context)) + .withContext(context -> service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -712,10 +691,6 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -730,8 +705,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, accept, context); + return service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, accept, context); } /** @@ -879,10 +854,6 @@ public void delete(String resourceGroupName, String topLevelArmResourceName, Con */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -893,7 +864,7 @@ private Mono> listByResourceGroupSingleP } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.listByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -914,10 +885,6 @@ private Mono> listByResourceGroupSingleP @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -929,8 +896,8 @@ private Mono> listByResourceGroupSingleP final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accept, context) + .listByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1005,18 +972,14 @@ public PagedIterable listByResourceGroup(String resour */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) + .withContext( + context -> service.list(this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1034,19 +997,13 @@ private Mono> listSinglePageAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, - context) + return service.list(this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1118,10 +1075,6 @@ public PagedIterable list(Context context) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> actionWithResponseAsync(String resourceGroupName, String topLevelArmResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1136,8 +1089,8 @@ private Mono>> actionWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.action(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context)) + .withContext(context -> service.action(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1155,10 +1108,6 @@ private Mono>> actionWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> actionWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1173,8 +1122,8 @@ private Mono>> actionWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.action(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, accept, context); + return service.action(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, accept, context); } /** @@ -1314,6 +1263,8 @@ public ResultInner action(String resourceGroupName, String topLevelArmResourceNa } /** + * List TopLevelArmResource resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1328,20 +1279,16 @@ private Mono> listByResourceGroupNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listByResourceGroupNext(nextLink, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** + * List TopLevelArmResource resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1358,18 +1305,16 @@ private Mono> listByResourceGroupNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listByResourceGroupNext(nextLink, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** + * List TopLevelArmResource resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1384,20 +1329,16 @@ private Mono> listBySubscriptionNextSing if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listBySubscriptionNext(nextLink, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** + * List TopLevelArmResource resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1414,13 +1355,9 @@ private Mono> listBySubscriptionNextSing if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listBySubscriptionNext(nextLink, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildExtensionResourceInterfaces.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildExtensionResourceInterfaces.java index 6a967a0cc1..cbc5a6d658 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildExtensionResourceInterfaces.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildExtensionResourceInterfaces.java @@ -22,7 +22,7 @@ public interface ChildExtensionResourceInterfaces { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource along with {@link Response}. + * @return extensionResource of Top Level Arm Resource along with {@link Response}. */ Response getWithResponse(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, Context context); @@ -36,7 +36,7 @@ Response getWithResponse(String resourceUri, String topL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource. + * @return extensionResource of Top Level Arm Resource. */ ChildExtensionResource get(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName); @@ -129,7 +129,7 @@ PagedIterable listByTopLevelArmResource(String resourceU * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource along with {@link Response}. + * @return extensionResource of Top Level Arm Resource along with {@link Response}. */ ChildExtensionResource getById(String id); @@ -141,7 +141,7 @@ PagedIterable listByTopLevelArmResource(String resourceU * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource along with {@link Response}. + * @return extensionResource of Top Level Arm Resource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildResourcesInterfaces.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildResourcesInterfaces.java index 36c43f5666..fa14eee2a4 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildResourcesInterfaces.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildResourcesInterfaces.java @@ -22,7 +22,7 @@ public interface ChildResourcesInterfaces { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource along with {@link Response}. + * @return subresource of Top Level Arm Resource along with {@link Response}. */ Response getWithResponse(String resourceGroupName, String topLevelArmResourceName, String childResourceName, Context context); @@ -36,7 +36,7 @@ Response getWithResponse(String resourceGroupName, String topLeve * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource. + * @return subresource of Top Level Arm Resource. */ ChildResource get(String resourceGroupName, String topLevelArmResourceName, String childResourceName); @@ -124,7 +124,7 @@ void actionWithoutBody(String resourceGroupName, String topLevelArmResourceName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource along with {@link Response}. + * @return subresource of Top Level Arm Resource along with {@link Response}. */ ChildResource getById(String id); @@ -136,7 +136,7 @@ void actionWithoutBody(String resourceGroupName, String topLevelArmResourceName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource along with {@link Response}. + * @return subresource of Top Level Arm Resource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/TopLevelArmResourceInterfaces.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/TopLevelArmResourceInterfaces.java index b084c3eed9..abcb77f43c 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/TopLevelArmResourceInterfaces.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/TopLevelArmResourceInterfaces.java @@ -21,7 +21,8 @@ public interface TopLevelArmResourceInterfaces { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelArmResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ Response getByResourceGroupWithResponse(String resourceGroupName, String topLevelArmResourceName, Context context); @@ -34,7 +35,7 @@ Response getByResourceGroupWithResponse(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelArmResource. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. */ TopLevelArmResource getByResourceGroup(String resourceGroupName, String topLevelArmResourceName); @@ -136,7 +137,8 @@ Response getByResourceGroupWithResponse(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelArmResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ TopLevelArmResource getById(String id); @@ -148,7 +150,8 @@ Response getByResourceGroupWithResponse(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelArmResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/ArmStreamStyleSerializationManager.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/ArmStreamStyleSerializationManager.java index 7b24317712..eb39c36857 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/ArmStreamStyleSerializationManager.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/ArmStreamStyleSerializationManager.java @@ -52,7 +52,6 @@ private ArmStreamStyleSerializationManager(HttpPipeline httpPipeline, AzureProfi Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); this.clientObject = new ArmStreamStyleSerializationClientBuilder().pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) .buildClient(); diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/ArmStreamStyleSerializationClient.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/ArmStreamStyleSerializationClient.java index ce27e1bede..6c2dc1e0da 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/ArmStreamStyleSerializationClient.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/ArmStreamStyleSerializationClient.java @@ -11,13 +11,6 @@ * The interface for ArmStreamStyleSerializationClient class. */ public interface ArmStreamStyleSerializationClient { - /** - * Gets Server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - /** * Gets Version parameter. * diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientBuilder.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientBuilder.java index 9b10cf2326..d0659bf1b5 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientBuilder.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientBuilder.java @@ -19,22 +19,6 @@ */ @ServiceClientBuilder(serviceClients = { ArmStreamStyleSerializationClientImpl.class }) public final class ArmStreamStyleSerializationClientBuilder { - /* - * Server parameter - */ - private String endpoint; - - /** - * Sets Server parameter. - * - * @param endpoint the endpoint value. - * @return the ArmStreamStyleSerializationClientBuilder. - */ - public ArmStreamStyleSerializationClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - /* * The ID of the target subscription. The value must be an UUID. */ @@ -131,7 +115,7 @@ public ArmStreamStyleSerializationClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); ArmStreamStyleSerializationClientImpl client = new ArmStreamStyleSerializationClientImpl(localPipeline, - localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId); + localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId); return client; } } diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientImpl.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientImpl.java index 29c56c88aa..306a0a1e3b 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientImpl.java @@ -40,20 +40,6 @@ */ @ServiceClient(builder = ArmStreamStyleSerializationClientBuilder.class) public final class ArmStreamStyleSerializationClientImpl implements ArmStreamStyleSerializationClient { - /** - * Server parameter. - */ - private final String endpoint; - - /** - * Gets Server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - /** * Version parameter. */ @@ -159,15 +145,13 @@ public TopLevelArmResourcesClient getTopLevelArmResources() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param endpoint Server parameter. * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ ArmStreamStyleSerializationClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.endpoint = endpoint; this.subscriptionId = subscriptionId; this.apiVersion = "2023-12-01-preview"; this.fishes = new FishesClientImpl(this); diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java index 86f1103f2e..e62b2f2549 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java @@ -10,7 +10,6 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -53,22 +52,20 @@ public final class FishesClientImpl implements FishesClient { * The interface defining all the services for ArmStreamStyleSerializationClientFishes to be used by the proxy * service to perform REST calls. */ - @Host("{endpoint}") + @Host("https://management.azure.com") @ServiceInterface(name = "ArmStreamStyleSerial") public interface FishesService { @Headers({ "Content-Type: application/json" }) @Get("/model") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getModel(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - Context context); + Mono> getModel(@HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/model") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> putModel(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - @BodyParam("application/json") FishInner fish, Context context); + Mono> putModel(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") FishInner fish, Context context); } /** @@ -81,12 +78,8 @@ Mono> putModel(@HostParam("endpoint") String endpoint, @Head */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getModelWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getModel(this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.getModel(accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -102,13 +95,9 @@ private Mono> getModelWithResponseAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getModelWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getModel(this.client.getEndpoint(), accept, context); + return service.getModel(accept, context); } /** @@ -163,17 +152,14 @@ public FishInner getModel() { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> putModelWithResponseAsync(FishInner fish) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (fish == null) { return Mono.error(new IllegalArgumentException("Parameter fish is required and cannot be null.")); } else { fish.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putModel(this.client.getEndpoint(), accept, fish, context)) + return FluxUtil.withContext(context -> service.putModel(contentType, accept, fish, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -190,18 +176,15 @@ private Mono> putModelWithResponseAsync(FishInner fish) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> putModelWithResponseAsync(FishInner fish, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (fish == null) { return Mono.error(new IllegalArgumentException("Parameter fish is required and cannot be null.")); } else { fish.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.putModel(this.client.getEndpoint(), accept, fish, context); + return service.putModel(contentType, accept, fish, context); } /** diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/TopLevelArmResourcesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/TopLevelArmResourcesClientImpl.java index 7088f30ffd..32ab73105b 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/TopLevelArmResourcesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/TopLevelArmResourcesClientImpl.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.QueryParam; @@ -61,17 +59,17 @@ public final class TopLevelArmResourcesClientImpl implements TopLevelArmResource * The interface defining all the services for ArmStreamStyleSerializationClientTopLevelArmResources to be used by * the proxy service to perform REST calls. */ - @Host("{endpoint}") + @Host("https://management.azure.com") @ServiceInterface(name = "ArmStreamStyleSerial") public interface TopLevelArmResourcesService { - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmStreamStyleSerialization/topLevelArmResources/{topLevelArmResourceName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") TopLevelArmResourceTagsUpdate properties, Context context); } @@ -90,10 +88,6 @@ Mono>> update(@HostParam("endpoint") String endpoint, @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, TopLevelArmResourceTagsUpdate properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -111,9 +105,11 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, properties, context)) + return FluxUtil + .withContext(context -> service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, contentType, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -133,10 +129,6 @@ private Mono>> updateWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, TopLevelArmResourceTagsUpdate properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -154,10 +146,11 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, accept, properties, context); + return service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, contentType, accept, properties, context); } /** diff --git a/typespec-tests/src/main/java/com/cadl/builtin/implementation/BuiltinClientImpl.java b/typespec-tests/src/main/java/com/cadl/builtin/implementation/BuiltinClientImpl.java index 169d20a90e..5bfa379806 100644 --- a/typespec-tests/src/main/java/com/cadl/builtin/implementation/BuiltinClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/builtin/implementation/BuiltinClientImpl.java @@ -16,12 +16,12 @@ */ public final class BuiltinClientImpl { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public BuiltinOpsImpl getBuiltinOps() { /** * Initializes an instance of BuiltinClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public BuiltinClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public BuiltinClientImpl(String endpoint) { * Initializes an instance of BuiltinClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public BuiltinClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public BuiltinClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public BuiltinClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/builtin/implementation/BuiltinOpsImpl.java b/typespec-tests/src/main/java/com/cadl/builtin/implementation/BuiltinOpsImpl.java index f16cba11b6..7ea2c40fd9 100644 --- a/typespec-tests/src/main/java/com/cadl/builtin/implementation/BuiltinOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/builtin/implementation/BuiltinOpsImpl.java @@ -68,7 +68,7 @@ public interface BuiltinOpsService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> read(@HostParam("endpoint") String endpoint, @QueryParam("query") String queryParam, @QueryParam(value = "query-encoded", encoded = true) String queryParamEncoded, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/builtin") @ExpectedResponses({ 200 }) @@ -78,7 +78,7 @@ Mono> read(@HostParam("endpoint") String endpoint, @QueryPa @UnexpectedResponseExceptionType(HttpResponseException.class) Response readSync(@HostParam("endpoint") String endpoint, @QueryParam("query") String queryParam, @QueryParam(value = "query-encoded", encoded = true) String queryParamEncoded, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/builtin") @ExpectedResponses({ 200 }) @@ -86,8 +86,9 @@ Response readSync(@HostParam("endpoint") String endpoint, @QueryPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> write(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> write(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/builtin") @ExpectedResponses({ 200 }) @@ -95,8 +96,9 @@ Mono> write(@HostParam("endpoint") String endpoint, @HeaderParam( @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response writeSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response writeSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -295,9 +297,9 @@ public Response readWithResponse(String queryParam, String queryPara */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> writeWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.write(this.client.getEndpoint(), accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext( + context -> service.write(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -350,7 +352,7 @@ public Mono> writeWithResponseAsync(BinaryData body, RequestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Response writeWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.writeSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.writeSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/enumservice/implementation/EnumServiceClientImpl.java b/typespec-tests/src/main/java/com/cadl/enumservice/implementation/EnumServiceClientImpl.java index 23979b9a52..12b6c27112 100644 --- a/typespec-tests/src/main/java/com/cadl/enumservice/implementation/EnumServiceClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/enumservice/implementation/EnumServiceClientImpl.java @@ -47,12 +47,12 @@ public final class EnumServiceClientImpl { private final EnumServiceClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -91,7 +91,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of EnumServiceClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public EnumServiceClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -102,7 +102,7 @@ public EnumServiceClientImpl(String endpoint) { * Initializes an instance of EnumServiceClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public EnumServiceClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -113,7 +113,7 @@ public EnumServiceClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public EnumServiceClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; @@ -136,7 +136,7 @@ public interface EnumServiceClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getColor(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/enum/color") @ExpectedResponses({ 200 }) @@ -144,7 +144,7 @@ Mono> getColor(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getColorSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response getColorSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/enum/colormodel") @@ -154,7 +154,7 @@ Response getColorSync(@HostParam("endpoint") String endpoint, @Heade @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getColorModel(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/enum/colormodel") @ExpectedResponses({ 200 }) @@ -163,7 +163,7 @@ Mono> getColorModel(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getColorModelSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/colormodel") @ExpectedResponses({ 200 }) @@ -172,7 +172,7 @@ Response getColorModelSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setColorModel(@HostParam("endpoint") String endpoint, - @QueryParam("color") String color, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @QueryParam("color") String color, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/colormodel") @@ -182,7 +182,7 @@ Mono> setColorModel(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response setColorModelSync(@HostParam("endpoint") String endpoint, - @QueryParam("color") String color, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @QueryParam("color") String color, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/priority") @@ -192,7 +192,7 @@ Response setColorModelSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setPriority(@HostParam("endpoint") String endpoint, - @QueryParam("priority") String priority, @HeaderParam("accept") String accept, + @QueryParam("priority") String priority, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/priority") @@ -202,7 +202,7 @@ Mono> setPriority(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response setPrioritySync(@HostParam("endpoint") String endpoint, - @QueryParam("priority") String priority, @HeaderParam("accept") String accept, + @QueryParam("priority") String priority, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/enum/operation/state/running") @@ -212,7 +212,7 @@ Response setPrioritySync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getRunningOperation(@HostParam("endpoint") String endpoint, - @QueryParam("state") String state, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @QueryParam("state") String state, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/enum/operation/state/running") @@ -222,7 +222,7 @@ Mono> getRunningOperation(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getRunningOperationSync(@HostParam("endpoint") String endpoint, - @QueryParam("state") String state, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @QueryParam("state") String state, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/enum/operation/state") @@ -232,7 +232,7 @@ Response getRunningOperationSync(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getOperation(@HostParam("endpoint") String endpoint, - @QueryParam("state") String state, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @QueryParam("state") String state, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/enum/operation/state") @@ -242,7 +242,7 @@ Mono> getOperation(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getOperationSync(@HostParam("endpoint") String endpoint, @QueryParam("state") String state, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringenumarray") @ExpectedResponses({ 200 }) @@ -251,7 +251,7 @@ Response getOperationSync(@HostParam("endpoint") String endpoint, @Q @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setStringEnumArray(@HostParam("endpoint") String endpoint, - @QueryParam("colorArray") String colorArray, @HeaderParam("accept") String accept, + @QueryParam("colorArray") String colorArray, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringenumarray") @@ -261,7 +261,7 @@ Mono> setStringEnumArray(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response setStringEnumArraySync(@HostParam("endpoint") String endpoint, - @QueryParam("colorArray") String colorArray, @HeaderParam("accept") String accept, + @QueryParam("colorArray") String colorArray, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/intenumarray") @@ -271,7 +271,7 @@ Response setStringEnumArraySync(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setIntEnumArray(@HostParam("endpoint") String endpoint, - @QueryParam("priorityArray") String priorityArray, @HeaderParam("accept") String accept, + @QueryParam("priorityArray") String priorityArray, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/intenumarray") @@ -281,7 +281,7 @@ Mono> setIntEnumArray(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response setIntEnumArraySync(@HostParam("endpoint") String endpoint, - @QueryParam("priorityArray") String priorityArray, @HeaderParam("accept") String accept, + @QueryParam("priorityArray") String priorityArray, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringarray") @@ -291,7 +291,7 @@ Response setIntEnumArraySync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setStringArray(@HostParam("endpoint") String endpoint, - @QueryParam("stringArray") String stringArray, @HeaderParam("accept") String accept, + @QueryParam("stringArray") String stringArray, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringarray") @@ -301,7 +301,7 @@ Mono> setStringArray(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response setStringArraySync(@HostParam("endpoint") String endpoint, - @QueryParam("stringArray") String stringArray, @HeaderParam("accept") String accept, + @QueryParam("stringArray") String stringArray, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/intarray") @@ -311,7 +311,7 @@ Response setStringArraySync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setIntArray(@HostParam("endpoint") String endpoint, - @QueryParam("intArray") String intArray, @HeaderParam("accept") String accept, + @QueryParam("intArray") String intArray, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/intarray") @@ -321,7 +321,7 @@ Mono> setIntArray(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response setIntArraySync(@HostParam("endpoint") String endpoint, - @QueryParam("intArray") String intArray, @HeaderParam("accept") String accept, + @QueryParam("intArray") String intArray, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringenummulti") @@ -332,7 +332,7 @@ Response setIntArraySync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setStringEnumMulti(@HostParam("endpoint") String endpoint, @QueryParam(value = "colorArray", multipleQueryParams = true) List colorArray, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringenummulti") @ExpectedResponses({ 200 }) @@ -342,7 +342,7 @@ Mono> setStringEnumMulti(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(HttpResponseException.class) Response setStringEnumMultiSync(@HostParam("endpoint") String endpoint, @QueryParam(value = "colorArray", multipleQueryParams = true) List colorArray, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/intenummulti") @ExpectedResponses({ 200 }) @@ -352,7 +352,7 @@ Response setStringEnumMultiSync(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setIntEnumMulti(@HostParam("endpoint") String endpoint, @QueryParam(value = "priorityArray", multipleQueryParams = true) List priorityArray, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/intenummulti") @ExpectedResponses({ 200 }) @@ -362,7 +362,7 @@ Mono> setIntEnumMulti(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(HttpResponseException.class) Response setIntEnumMultiSync(@HostParam("endpoint") String endpoint, @QueryParam(value = "priorityArray", multipleQueryParams = true) List priorityArray, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringmulti") @ExpectedResponses({ 200 }) @@ -372,7 +372,7 @@ Response setIntEnumMultiSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setStringMulti(@HostParam("endpoint") String endpoint, @QueryParam(value = "stringArray", multipleQueryParams = true) List stringArray, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringmulti") @ExpectedResponses({ 200 }) @@ -382,7 +382,7 @@ Mono> setStringMulti(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(HttpResponseException.class) Response setStringMultiSync(@HostParam("endpoint") String endpoint, @QueryParam(value = "stringArray", multipleQueryParams = true) List stringArray, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/intmulti") @ExpectedResponses({ 200 }) @@ -392,7 +392,7 @@ Response setStringMultiSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setIntMulti(@HostParam("endpoint") String endpoint, @QueryParam(value = "intArray", multipleQueryParams = true) List intArray, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/intmulti") @ExpectedResponses({ 200 }) @@ -402,7 +402,7 @@ Mono> setIntMulti(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response setIntMultiSync(@HostParam("endpoint") String endpoint, @QueryParam(value = "intArray", multipleQueryParams = true) List intArray, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringenumarrayheader") @ExpectedResponses({ 200 }) @@ -411,7 +411,7 @@ Response setIntMultiSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> setStringEnumArrayHeader(@HostParam("endpoint") String endpoint, - @HeaderParam("color-array") String colorArray, @HeaderParam("accept") String accept, + @HeaderParam("color-array") String colorArray, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/enum/operation/stringenumarrayheader") @@ -421,7 +421,7 @@ Mono> setStringEnumArrayHeader(@HostParam("endpoint") Strin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response setStringEnumArrayHeaderSync(@HostParam("endpoint") String endpoint, - @HeaderParam("color-array") String colorArray, @HeaderParam("accept") String accept, + @HeaderParam("color-array") String colorArray, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorModelClientImpl.java b/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorModelClientImpl.java index 8274dc5b1a..ba7a4d34da 100644 --- a/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorModelClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorModelClientImpl.java @@ -16,12 +16,12 @@ */ public final class ErrorModelClientImpl { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public ErrorOpsImpl getErrorOps() { /** * Initializes an instance of ErrorModelClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public ErrorModelClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public ErrorModelClientImpl(String endpoint) { * Initializes an instance of ErrorModelClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public ErrorModelClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public ErrorModelClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public ErrorModelClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorOpsImpl.java b/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorOpsImpl.java index d422ad091e..259b2fa4b1 100644 --- a/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorOpsImpl.java @@ -62,7 +62,7 @@ public interface ErrorOpsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> read(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> read(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/error") @@ -71,7 +71,7 @@ Mono> read(@HostParam("endpoint") String endpoint, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response readSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response readSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/cadl/flatten/implementation/FlattenClientImpl.java b/typespec-tests/src/main/java/com/cadl/flatten/implementation/FlattenClientImpl.java index 7aee907384..acf60e58aa 100644 --- a/typespec-tests/src/main/java/com/cadl/flatten/implementation/FlattenClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/flatten/implementation/FlattenClientImpl.java @@ -46,11 +46,12 @@ public final class FlattenClientImpl { private final FlattenClientService service; /** + * Flatten. */ private final String endpoint; /** - * Gets. + * Gets Flatten. * * @return the endpoint value. */ @@ -103,7 +104,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of FlattenClient client. * - * @param endpoint + * @param endpoint Flatten. * @param serviceVersion Service version. */ public FlattenClientImpl(String endpoint, FlattenServiceVersion serviceVersion) { @@ -115,7 +116,7 @@ public FlattenClientImpl(String endpoint, FlattenServiceVersion serviceVersion) * Initializes an instance of FlattenClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint + * @param endpoint Flatten. * @param serviceVersion Service version. */ public FlattenClientImpl(HttpPipeline httpPipeline, String endpoint, FlattenServiceVersion serviceVersion) { @@ -127,7 +128,7 @@ public FlattenClientImpl(HttpPipeline httpPipeline, String endpoint, FlattenServ * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint + * @param endpoint Flatten. * @param serviceVersion Service version. */ public FlattenClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, @@ -153,7 +154,7 @@ public interface FlattenClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> send(@HostParam("endpoint") String endpoint, @QueryParam("id") String id, @QueryParam("constantQueryParam") String constantQueryParam, @QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData sendRequest, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest, RequestOptions requestOptions, Context context); @Post("/flatten/send") @@ -164,7 +165,7 @@ Mono> send(@HostParam("endpoint") String endpoint, @QueryParam("i @UnexpectedResponseExceptionType(HttpResponseException.class) Response sendSync(@HostParam("endpoint") String endpoint, @QueryParam("id") String id, @QueryParam("constantQueryParam") String constantQueryParam, @QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData sendRequest, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest, RequestOptions requestOptions, Context context); @Post("/flatten/send-projected-name") @@ -174,8 +175,9 @@ Response sendSync(@HostParam("endpoint") String endpoint, @QueryParam("id" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> sendProjectedName(@HostParam("endpoint") String endpoint, @QueryParam("id") String id, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData sendProjectedNameRequest, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData sendProjectedNameRequest, RequestOptions requestOptions, + Context context); @Post("/flatten/send-projected-name") @ExpectedResponses({ 200 }) @@ -184,8 +186,9 @@ Mono> sendProjectedName(@HostParam("endpoint") String endpoint, @ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response sendProjectedNameSync(@HostParam("endpoint") String endpoint, @QueryParam("id") String id, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData sendProjectedNameRequest, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData sendProjectedNameRequest, RequestOptions requestOptions, + Context context); @Post("/flatten/send-long") @ExpectedResponses({ 200 }) @@ -194,7 +197,7 @@ Response sendProjectedNameSync(@HostParam("endpoint") String endpoint, @Qu @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> sendLong(@HostParam("endpoint") String endpoint, @QueryParam("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendLongRequest, RequestOptions requestOptions, Context context); @Post("/flatten/send-long") @@ -204,7 +207,7 @@ Mono> sendLong(@HostParam("endpoint") String endpoint, @QueryPara @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response sendLongSync(@HostParam("endpoint") String endpoint, @QueryParam("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendLongRequest, RequestOptions requestOptions, Context context); @Patch("/flatten/patch/{id}") @@ -215,7 +218,7 @@ Response sendLongSync(@HostParam("endpoint") String endpoint, @QueryParam( @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> update(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, @PathParam("id") long id, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData updateRequest, + @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData updateRequest, RequestOptions requestOptions, Context context); @Patch("/flatten/patch/{id}") @@ -226,7 +229,7 @@ Mono> update(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response updateSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, @PathParam("id") long id, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData updateRequest, + @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData updateRequest, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -237,7 +240,7 @@ Response updateSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadFile(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData uploadFileRequest, RequestOptions requestOptions, Context context); @@ -249,7 +252,7 @@ Mono> uploadFile(@HostParam("endpoint") String endpoint, @PathPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadFileSync(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData uploadFileRequest, RequestOptions requestOptions, Context context); @@ -261,7 +264,7 @@ Response uploadFileSync(@HostParam("endpoint") String endpoint, @PathParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadTodo(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData uploadTodoRequest, RequestOptions requestOptions, Context context); @@ -273,7 +276,7 @@ Mono> uploadTodo(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadTodoSync(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData uploadTodoRequest, RequestOptions requestOptions, Context context); } @@ -305,9 +308,9 @@ Response uploadTodoSync(@HostParam("endpoint") String endpoint, public Mono> sendWithResponseAsync(String id, BinaryData sendRequest, RequestOptions requestOptions) { final String constantQueryParam = "constant"; - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil.withContext(context -> service.send(this.getEndpoint(), id, constantQueryParam, - this.getServiceVersion().getVersion(), accept, sendRequest, requestOptions, context)); + this.getServiceVersion().getVersion(), contentType, sendRequest, requestOptions, context)); } /** @@ -336,9 +339,9 @@ public Mono> sendWithResponseAsync(String id, BinaryData sendRequ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(String id, BinaryData sendRequest, RequestOptions requestOptions) { final String constantQueryParam = "constant"; - final String accept = "application/json"; + final String contentType = "application/json"; return service.sendSync(this.getEndpoint(), id, constantQueryParam, this.getServiceVersion().getVersion(), - accept, sendRequest, requestOptions, Context.NONE); + contentType, sendRequest, requestOptions, Context.NONE); } /** @@ -363,8 +366,8 @@ public Response sendWithResponse(String id, BinaryData sendRequest, Reques @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendProjectedNameWithResponseAsync(String id, BinaryData sendProjectedNameRequest, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.sendProjectedName(this.getEndpoint(), id, accept, + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.sendProjectedName(this.getEndpoint(), id, contentType, sendProjectedNameRequest, requestOptions, context)); } @@ -390,9 +393,9 @@ public Mono> sendProjectedNameWithResponseAsync(String id, Binary @ServiceMethod(returns = ReturnType.SINGLE) public Response sendProjectedNameWithResponse(String id, BinaryData sendProjectedNameRequest, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendProjectedNameSync(this.getEndpoint(), id, accept, sendProjectedNameRequest, requestOptions, - Context.NONE); + final String contentType = "application/json"; + return service.sendProjectedNameSync(this.getEndpoint(), id, contentType, sendProjectedNameRequest, + requestOptions, Context.NONE); } /** @@ -436,9 +439,9 @@ public Response sendProjectedNameWithResponse(String id, BinaryData sendPr @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendLongWithResponseAsync(String name, BinaryData sendLongRequest, RequestOptions requestOptions) { - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil.withContext(context -> service.sendLong(this.getEndpoint(), name, - this.getServiceVersion().getVersion(), accept, sendLongRequest, requestOptions, context)); + this.getServiceVersion().getVersion(), contentType, sendLongRequest, requestOptions, context)); } /** @@ -481,8 +484,8 @@ public Mono> sendLongWithResponseAsync(String name, BinaryData se */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendLongWithResponse(String name, BinaryData sendLongRequest, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendLongSync(this.getEndpoint(), name, this.getServiceVersion().getVersion(), accept, + final String contentType = "application/json"; + return service.sendLongSync(this.getEndpoint(), name, this.getServiceVersion().getVersion(), contentType, sendLongRequest, requestOptions, Context.NONE); } @@ -595,8 +598,7 @@ public Response updateWithResponse(long id, BinaryData updateRequest public Mono> uploadFileWithResponseAsync(String name, BinaryData uploadFileRequest, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.uploadFile(this.getEndpoint(), name, contentType, accept, + return FluxUtil.withContext(context -> service.uploadFile(this.getEndpoint(), name, contentType, uploadFileRequest, requestOptions, context)); } @@ -616,8 +618,7 @@ public Mono> uploadFileWithResponseAsync(String name, BinaryData public Response uploadFileWithResponse(String name, BinaryData uploadFileRequest, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.uploadFileSync(this.getEndpoint(), name, contentType, accept, uploadFileRequest, requestOptions, + return service.uploadFileSync(this.getEndpoint(), name, contentType, uploadFileRequest, requestOptions, Context.NONE); } @@ -636,9 +637,8 @@ public Response uploadFileWithResponse(String name, BinaryData uploadFileR public Mono> uploadTodoWithResponseAsync(BinaryData uploadTodoRequest, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.uploadTodo(this.getEndpoint(), contentType, accept, - uploadTodoRequest, requestOptions, context)); + return FluxUtil.withContext( + context -> service.uploadTodo(this.getEndpoint(), contentType, uploadTodoRequest, requestOptions, context)); } /** @@ -655,8 +655,6 @@ public Mono> uploadTodoWithResponseAsync(BinaryData uploadTodoReq @ServiceMethod(returns = ReturnType.SINGLE) public Response uploadTodoWithResponse(BinaryData uploadTodoRequest, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.uploadTodoSync(this.getEndpoint(), contentType, accept, uploadTodoRequest, requestOptions, - Context.NONE); + return service.uploadTodoSync(this.getEndpoint(), contentType, uploadTodoRequest, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/internal/implementation/InternalClientImpl.java b/typespec-tests/src/main/java/com/cadl/internal/implementation/InternalClientImpl.java index aa279b79f4..d7f1cee9ee 100644 --- a/typespec-tests/src/main/java/com/cadl/internal/implementation/InternalClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/internal/implementation/InternalClientImpl.java @@ -16,12 +16,12 @@ */ public final class InternalClientImpl { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public InternalOpsImpl getInternalOps() { /** * Initializes an instance of InternalClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public InternalClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public InternalClientImpl(String endpoint) { * Initializes an instance of InternalClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public InternalClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public InternalClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public InternalClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/internal/implementation/InternalOpsImpl.java b/typespec-tests/src/main/java/com/cadl/internal/implementation/InternalOpsImpl.java index 091af0d13c..cfa0189417 100644 --- a/typespec-tests/src/main/java/com/cadl/internal/implementation/InternalOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/internal/implementation/InternalOpsImpl.java @@ -66,8 +66,8 @@ public interface InternalOpsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> postInternal(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/internal") @ExpectedResponses({ 200 }) @@ -76,8 +76,8 @@ Mono> postInternal(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response postInternalSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/internal") @ExpectedResponses({ 200 }) @@ -86,7 +86,7 @@ Response postInternalSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getInternal(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/internal") @ExpectedResponses({ 200 }) @@ -95,7 +95,7 @@ Mono> getInternal(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getInternalSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/internal/protocal-internal") @ExpectedResponses({ 204 }) @@ -104,7 +104,7 @@ Response getInternalSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> postProtocalInternal(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/internal/protocal-internal") @@ -114,7 +114,7 @@ Mono> postProtocalInternal(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response postProtocalInternalSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -150,9 +150,10 @@ Response postProtocalInternalSync(@HostParam("endpoint") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postInternalWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postInternal(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.postInternal(this.client.getEndpoint(), contentType, accept, + body, requestOptions, context)); } /** @@ -187,8 +188,10 @@ public Mono> postInternalWithResponseAsync(BinaryData body, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postInternalWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.postInternalSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.postInternalSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } /** @@ -258,9 +261,9 @@ public Response getInternalWithResponse(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postProtocalInternalWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.postProtocalInternal(this.client.getEndpoint(), accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.postProtocalInternal(this.client.getEndpoint(), contentType, + body, requestOptions, context)); } /** @@ -283,7 +286,8 @@ public Mono> postProtocalInternalWithResponseAsync(BinaryData bod */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postProtocalInternalWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.postProtocalInternalSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.postProtocalInternalSync(this.client.getEndpoint(), contentType, body, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/literalservice/implementation/LiteralOpsImpl.java b/typespec-tests/src/main/java/com/cadl/literalservice/implementation/LiteralOpsImpl.java index 081273e360..a216e21bd5 100644 --- a/typespec-tests/src/main/java/com/cadl/literalservice/implementation/LiteralOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/literalservice/implementation/LiteralOpsImpl.java @@ -66,8 +66,9 @@ public interface LiteralOpsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> put(@HostParam("endpoint") String endpoint, - @QueryParam("literalParam") String literalParam, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("literalParam") String literalParam, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/literal/put") @ExpectedResponses({ 200 }) @@ -76,8 +77,9 @@ Mono> put(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response putSync(@HostParam("endpoint") String endpoint, - @QueryParam("literalParam") String literalParam, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("literalParam") String literalParam, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -119,9 +121,10 @@ Response putSync(@HostParam("endpoint") String endpoint, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String literalParam = "literalParam"; + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.put(this.client.getEndpoint(), literalParam, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.put(this.client.getEndpoint(), literalParam, contentType, accept, + body, requestOptions, context)); } /** @@ -163,7 +166,9 @@ public Mono> putWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String literalParam = "literalParam"; + final String contentType = "application/json"; final String accept = "application/json"; - return service.putSync(this.client.getEndpoint(), literalParam, accept, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), literalParam, contentType, accept, body, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/literalservice/implementation/LiteralServiceClientImpl.java b/typespec-tests/src/main/java/com/cadl/literalservice/implementation/LiteralServiceClientImpl.java index a872510809..b0a0178bf1 100644 --- a/typespec-tests/src/main/java/com/cadl/literalservice/implementation/LiteralServiceClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/literalservice/implementation/LiteralServiceClientImpl.java @@ -16,12 +16,12 @@ */ public final class LiteralServiceClientImpl { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public LiteralOpsImpl getLiteralOps() { /** * Initializes an instance of LiteralServiceClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public LiteralServiceClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public LiteralServiceClientImpl(String endpoint) { * Initializes an instance of LiteralServiceClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public LiteralServiceClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public LiteralServiceClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public LiteralServiceClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/longrunning/implementation/LongRunningClientImpl.java b/typespec-tests/src/main/java/com/cadl/longrunning/implementation/LongRunningClientImpl.java index 619909975b..7445d31042 100644 --- a/typespec-tests/src/main/java/com/cadl/longrunning/implementation/LongRunningClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/longrunning/implementation/LongRunningClientImpl.java @@ -60,12 +60,12 @@ public final class LongRunningClientImpl { private final LongRunningClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -118,7 +118,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of LongRunningClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public LongRunningClientImpl(String endpoint, LongRunningServiceVersion serviceVersion) { @@ -130,7 +130,7 @@ public LongRunningClientImpl(String endpoint, LongRunningServiceVersion serviceV * Initializes an instance of LongRunningClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public LongRunningClientImpl(HttpPipeline httpPipeline, String endpoint, LongRunningServiceVersion serviceVersion) { @@ -142,7 +142,7 @@ public LongRunningClientImpl(HttpPipeline httpPipeline, String endpoint, LongRun * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public LongRunningClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, @@ -167,8 +167,8 @@ public interface LongRunningClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> longRunning(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> longRunning(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Post("/long-running/post") @ExpectedResponses({ 202 }) @@ -176,8 +176,8 @@ Mono> longRunning(@HostParam("endpoint") String endpoint, @Header @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response longRunningSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response longRunningSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/long-running/jobs/{id}") @ExpectedResponses({ 200 }) @@ -187,7 +187,7 @@ Response longRunningSync(@HostParam("endpoint") String endpoint, @HeaderPa @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getJob(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("id") String id, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/long-running/jobs/{id}") @ExpectedResponses({ 200 }) @@ -197,7 +197,7 @@ Mono> getJob(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getJobSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("id") String id, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/long-running/jobs") @ExpectedResponses({ 202 }) @@ -206,8 +206,9 @@ Response getJobSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createJob(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/long-running/jobs") @ExpectedResponses({ 202 }) @@ -216,8 +217,9 @@ Mono> createJob(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createJobSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -232,9 +234,7 @@ Response createJobSync(@HostParam("endpoint") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> longRunningWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.longRunning(this.getEndpoint(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.longRunning(this.getEndpoint(), requestOptions, context)); } /** @@ -249,8 +249,7 @@ private Mono> longRunningWithResponseAsync(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) private Response longRunningWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.longRunningSync(this.getEndpoint(), accept, requestOptions, Context.NONE); + return service.longRunningSync(this.getEndpoint(), requestOptions, Context.NONE); } /** @@ -481,6 +480,7 @@ public Response getJobWithResponse(String id, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createJobWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { @@ -497,7 +497,7 @@ private Mono> createJobWithResponseAsync(BinaryData body, R } }); return FluxUtil.withContext(context -> service.createJob(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, body, requestOptionsLocal, context)); + this.getServiceVersion().getVersion(), contentType, accept, body, requestOptionsLocal, context)); } /** @@ -556,6 +556,7 @@ private Mono> createJobWithResponseAsync(BinaryData body, R */ @ServiceMethod(returns = ReturnType.SINGLE) private Response createJobWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { @@ -571,8 +572,8 @@ private Response createJobWithResponse(BinaryData body, RequestOptio DateTimeRfc1123.toRfc1123String(OffsetDateTime.now())); } }); - return service.createJobSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, body, - requestOptionsLocal, Context.NONE); + return service.createJobSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept, + body, requestOptionsLocal, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/cadl/model/implementation/ModelClientImpl.java b/typespec-tests/src/main/java/com/cadl/model/implementation/ModelClientImpl.java index 82b8db3db3..9063724024 100644 --- a/typespec-tests/src/main/java/com/cadl/model/implementation/ModelClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/model/implementation/ModelClientImpl.java @@ -16,12 +16,12 @@ */ public final class ModelClientImpl { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public ModelOpsImpl getModelOps() { /** * Initializes an instance of ModelClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public ModelClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public ModelClientImpl(String endpoint) { * Initializes an instance of ModelClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public ModelClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public ModelClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public ModelClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/model/implementation/ModelOpsImpl.java b/typespec-tests/src/main/java/com/cadl/model/implementation/ModelOpsImpl.java index b21c38e620..a9173a6cc1 100644 --- a/typespec-tests/src/main/java/com/cadl/model/implementation/ModelOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/model/implementation/ModelOpsImpl.java @@ -64,7 +64,8 @@ public interface ModelOpsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put1(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> put1(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/model/resource1") @@ -73,7 +74,8 @@ Mono> put1(@HostParam("endpoint") String endpoint, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response put1Sync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response put1Sync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/model/resource2") @@ -82,7 +84,8 @@ Response put1Sync(@HostParam("endpoint") String endpoint, @HeaderPar @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put2(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> put2(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/model/resource2") @@ -91,7 +94,8 @@ Mono> put2(@HostParam("endpoint") String endpoint, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response put2Sync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response put2Sync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/model/resource3") @@ -100,7 +104,7 @@ Response put2Sync(@HostParam("endpoint") String endpoint, @HeaderPar @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get3(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> get3(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/model/resource3") @@ -109,7 +113,7 @@ Mono> get3(@HostParam("endpoint") String endpoint, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response get3Sync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response get3Sync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/model/nested") @@ -119,8 +123,8 @@ Response get3Sync(@HostParam("endpoint") String endpoint, @HeaderPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> putNested(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/model/nested") @ExpectedResponses({ 200 }) @@ -128,7 +132,8 @@ Mono> putNested(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putNestedSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response putNestedSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -172,9 +177,10 @@ Response putNestedSync(@HostParam("endpoint") String endpoint, @Head */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put1WithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.put1(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.put1(this.client.getEndpoint(), contentType, accept, body, requestOptions, context)); } /** @@ -217,8 +223,9 @@ public Mono> put1WithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response put1WithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.put1Sync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.put1Sync(this.client.getEndpoint(), contentType, accept, body, requestOptions, Context.NONE); } /** @@ -255,9 +262,10 @@ public Response put1WithResponse(BinaryData body, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> put2WithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.put2(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.put2(this.client.getEndpoint(), contentType, accept, body, requestOptions, context)); } /** @@ -294,8 +302,9 @@ public Mono> put2WithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response put2WithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.put2Sync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.put2Sync(this.client.getEndpoint(), contentType, accept, body, requestOptions, Context.NONE); } /** @@ -387,9 +396,10 @@ public Response get3WithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNestedWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.putNested(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.putNested(this.client.getEndpoint(), contentType, accept, body, + requestOptions, context)); } /** @@ -428,7 +438,9 @@ public Mono> putNestedWithResponseAsync(BinaryData body, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putNestedWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.putNestedSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.putNestedSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/MultiContentTypesClientImpl.java b/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/MultiContentTypesClientImpl.java index ee1a36ecb4..cf7ce9bb35 100644 --- a/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/MultiContentTypesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/MultiContentTypesClientImpl.java @@ -42,12 +42,12 @@ public final class MultiContentTypesClientImpl { private final MultiContentTypesClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -114,7 +114,7 @@ public MultipleContentTypesOnRequestsImpl getMultipleContentTypesOnRequests() { /** * Initializes an instance of MultiContentTypesClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public MultiContentTypesClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -125,7 +125,7 @@ public MultiContentTypesClientImpl(String endpoint) { * Initializes an instance of MultiContentTypesClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public MultiContentTypesClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -136,7 +136,7 @@ public MultiContentTypesClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public MultiContentTypesClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { @@ -163,8 +163,8 @@ public interface MultiContentTypesClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadWithOverload(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData data, + RequestOptions requestOptions, Context context); @Post("/upload/overload/multi-body-types") @ExpectedResponses({ 204 }) @@ -173,8 +173,8 @@ Mono> uploadWithOverload(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadWithOverloadSync(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData data, + RequestOptions requestOptions, Context context); } /** @@ -198,9 +198,8 @@ Response uploadWithOverloadSync(@HostParam("endpoint") String endpoint, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> uploadWithOverloadWithResponseAsync(String contentType, BinaryData data, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.uploadWithOverload(this.getEndpoint(), contentType, accept, data, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.uploadWithOverload(this.getEndpoint(), contentType, data, requestOptions, context)); } /** @@ -224,8 +223,6 @@ public Mono> uploadWithOverloadWithResponseAsync(String contentTy @ServiceMethod(returns = ReturnType.SINGLE) public Response uploadWithOverloadWithResponse(String contentType, BinaryData data, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.uploadWithOverloadSync(this.getEndpoint(), contentType, accept, data, requestOptions, - Context.NONE); + return service.uploadWithOverloadSync(this.getEndpoint(), contentType, data, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/MultipleContentTypesOnRequestsImpl.java b/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/MultipleContentTypesOnRequestsImpl.java index dcca8971ef..71562025f5 100644 --- a/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/MultipleContentTypesOnRequestsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/MultipleContentTypesOnRequestsImpl.java @@ -65,8 +65,8 @@ public interface MultipleContentTypesOnRequestsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadBytesWithSingleBodyTypeForMultiContentTypes(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData data, + RequestOptions requestOptions, Context context); @Post("/multiple/sharedroute/request/upload/single-body-type") @ExpectedResponses({ 204 }) @@ -75,8 +75,8 @@ Mono> uploadBytesWithSingleBodyTypeForMultiContentTypes(@HostPara @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadBytesWithSingleBodyTypeForMultiContentTypesSync(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData data, + RequestOptions requestOptions, Context context); @Post("/multiple/sharedroute/request/upload/multi-body-types") @ExpectedResponses({ 204 }) @@ -85,8 +85,8 @@ Response uploadBytesWithSingleBodyTypeForMultiContentTypesSync(@HostParam( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadBytesWithMultiBodyTypesForMultiContentTypes(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData data, + RequestOptions requestOptions, Context context); @Post("/multiple/sharedroute/request/upload/multi-body-types") @ExpectedResponses({ 204 }) @@ -95,8 +95,8 @@ Mono> uploadBytesWithMultiBodyTypesForMultiContentTypes(@HostPara @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadBytesWithMultiBodyTypesForMultiContentTypesSync(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData data, + RequestOptions requestOptions, Context context); @Post("/multiple/sharedroute/request/upload/multi-body-types") @ExpectedResponses({ 204 }) @@ -105,8 +105,8 @@ Response uploadBytesWithMultiBodyTypesForMultiContentTypesSync(@HostParam( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadJsonWithMultiBodyTypesForMultiContentTypes(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData data, + RequestOptions requestOptions, Context context); @Post("/multiple/sharedroute/request/upload/multi-body-types") @ExpectedResponses({ 204 }) @@ -115,8 +115,8 @@ Mono> uploadJsonWithMultiBodyTypesForMultiContentTypes(@HostParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadJsonWithMultiBodyTypesForMultiContentTypesSync(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData data, + RequestOptions requestOptions, Context context); @Post("/multiple/sharedroute/request/upload/multi-body-types") @ExpectedResponses({ 204 }) @@ -126,8 +126,7 @@ Response uploadJsonWithMultiBodyTypesForMultiContentTypesSync(@HostParam(" @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadJsonOrBytesWithMultiBodyTypesForMultiContentTypes( @HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData data, - RequestOptions requestOptions, Context context); + @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); @Post("/multiple/sharedroute/request/upload/multi-body-types") @ExpectedResponses({ 204 }) @@ -137,8 +136,7 @@ Mono> uploadJsonOrBytesWithMultiBodyTypesForMultiContentTypes( @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadJsonOrBytesWithMultiBodyTypesForMultiContentTypesSync( @HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData data, - RequestOptions requestOptions, Context context); + @BodyParam("application/json") BinaryData data, RequestOptions requestOptions, Context context); } /** @@ -162,10 +160,9 @@ Response uploadJsonOrBytesWithMultiBodyTypesForMultiContentTypesSync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono> uploadBytesWithSingleBodyTypeForMultiContentTypesWithResponseAsync(String contentType, BinaryData data, RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil .withContext(context -> service.uploadBytesWithSingleBodyTypeForMultiContentTypes(this.client.getEndpoint(), - contentType, accept, data, requestOptions, context)); + contentType, data, requestOptions, context)); } /** @@ -189,9 +186,8 @@ public Mono> uploadBytesWithSingleBodyTypeForMultiContentTypesWit @ServiceMethod(returns = ReturnType.SINGLE) public Response uploadBytesWithSingleBodyTypeForMultiContentTypesWithResponse(String contentType, BinaryData data, RequestOptions requestOptions) { - final String accept = "application/json"; return service.uploadBytesWithSingleBodyTypeForMultiContentTypesSync(this.client.getEndpoint(), contentType, - accept, data, requestOptions, Context.NONE); + data, requestOptions, Context.NONE); } /** @@ -215,10 +211,9 @@ public Response uploadBytesWithSingleBodyTypeForMultiContentTypesWithRespo @ServiceMethod(returns = ReturnType.SINGLE) public Mono> uploadBytesWithMultiBodyTypesForMultiContentTypesWithResponseAsync(String contentType, BinaryData data, RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil .withContext(context -> service.uploadBytesWithMultiBodyTypesForMultiContentTypes(this.client.getEndpoint(), - contentType, accept, data, requestOptions, context)); + contentType, data, requestOptions, context)); } /** @@ -242,9 +237,8 @@ public Mono> uploadBytesWithMultiBodyTypesForMultiContentTypesWit @ServiceMethod(returns = ReturnType.SINGLE) public Response uploadBytesWithMultiBodyTypesForMultiContentTypesWithResponse(String contentType, BinaryData data, RequestOptions requestOptions) { - final String accept = "application/json"; return service.uploadBytesWithMultiBodyTypesForMultiContentTypesSync(this.client.getEndpoint(), contentType, - accept, data, requestOptions, Context.NONE); + data, requestOptions, Context.NONE); } /** @@ -270,10 +264,9 @@ public Response uploadBytesWithMultiBodyTypesForMultiContentTypesWithRespo public Mono> uploadJsonWithMultiBodyTypesForMultiContentTypesWithResponseAsync(BinaryData data, RequestOptions requestOptions) { final String contentType = "application/json"; - final String accept = "application/json"; return FluxUtil .withContext(context -> service.uploadJsonWithMultiBodyTypesForMultiContentTypes(this.client.getEndpoint(), - contentType, accept, data, requestOptions, context)); + contentType, data, requestOptions, context)); } /** @@ -299,9 +292,8 @@ public Mono> uploadJsonWithMultiBodyTypesForMultiContentTypesWith public Response uploadJsonWithMultiBodyTypesForMultiContentTypesWithResponse(BinaryData data, RequestOptions requestOptions) { final String contentType = "application/json"; - final String accept = "application/json"; return service.uploadJsonWithMultiBodyTypesForMultiContentTypesSync(this.client.getEndpoint(), contentType, - accept, data, requestOptions, Context.NONE); + data, requestOptions, Context.NONE); } /** @@ -325,9 +317,8 @@ public Response uploadJsonWithMultiBodyTypesForMultiContentTypesWithRespon @ServiceMethod(returns = ReturnType.SINGLE) public Mono> uploadJsonOrBytesWithMultiBodyTypesForMultiContentTypesWithResponseAsync( String contentType, BinaryData data, RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext(context -> service.uploadJsonOrBytesWithMultiBodyTypesForMultiContentTypes( - this.client.getEndpoint(), contentType, accept, data, requestOptions, context)); + this.client.getEndpoint(), contentType, data, requestOptions, context)); } /** @@ -351,8 +342,7 @@ public Mono> uploadJsonOrBytesWithMultiBodyTypesForMultiContentTy @ServiceMethod(returns = ReturnType.SINGLE) public Response uploadJsonOrBytesWithMultiBodyTypesForMultiContentTypesWithResponse(String contentType, BinaryData data, RequestOptions requestOptions) { - final String accept = "application/json"; return service.uploadJsonOrBytesWithMultiBodyTypesForMultiContentTypesSync(this.client.getEndpoint(), - contentType, accept, data, requestOptions, Context.NONE); + contentType, data, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/SingleContentTypesImpl.java b/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/SingleContentTypesImpl.java index 1d5a4aae4a..5ed3adbc93 100644 --- a/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/SingleContentTypesImpl.java +++ b/typespec-tests/src/main/java/com/cadl/multicontenttypes/implementation/SingleContentTypesImpl.java @@ -66,7 +66,7 @@ public interface SingleContentTypesService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> downloadImageForSingleContentType(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/single/request/download/image") @ExpectedResponses({ 200 }) @@ -75,7 +75,7 @@ Mono> downloadImageForSingleContentType(@HostParam("endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response downloadImageForSingleContentTypeSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/single/request/upload/image") @ExpectedResponses({ 204 }) @@ -84,8 +84,8 @@ Response downloadImageForSingleContentTypeSync(@HostParam("endpoint" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadImageForSingleContentType(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("image/png") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("image/png") BinaryData data, + RequestOptions requestOptions, Context context); @Post("/single/request/upload/image") @ExpectedResponses({ 204 }) @@ -94,8 +94,8 @@ Mono> uploadImageForSingleContentType(@HostParam("endpoint") Stri @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadImageForSingleContentTypeSync(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("image/png") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("image/png") BinaryData data, + RequestOptions requestOptions, Context context); } /** @@ -163,9 +163,8 @@ public Response downloadImageForSingleContentTypeWithResponse(Reques public Mono> uploadImageForSingleContentTypeWithResponseAsync(BinaryData data, RequestOptions requestOptions) { final String contentType = "image/png"; - final String accept = "application/json"; return FluxUtil.withContext(context -> service.uploadImageForSingleContentType(this.client.getEndpoint(), - contentType, accept, data, requestOptions, context)); + contentType, data, requestOptions, context)); } /** @@ -187,8 +186,7 @@ public Mono> uploadImageForSingleContentTypeWithResponseAsync(Bin @ServiceMethod(returns = ReturnType.SINGLE) public Response uploadImageForSingleContentTypeWithResponse(BinaryData data, RequestOptions requestOptions) { final String contentType = "image/png"; - final String accept = "application/json"; - return service.uploadImageForSingleContentTypeSync(this.client.getEndpoint(), contentType, accept, data, - requestOptions, Context.NONE); + return service.uploadImageForSingleContentTypeSync(this.client.getEndpoint(), contentType, data, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/multipart/implementation/MultipartClientImpl.java b/typespec-tests/src/main/java/com/cadl/multipart/implementation/MultipartClientImpl.java index 42832caca9..d4fa9a6181 100644 --- a/typespec-tests/src/main/java/com/cadl/multipart/implementation/MultipartClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/multipart/implementation/MultipartClientImpl.java @@ -43,12 +43,12 @@ public final class MultipartClientImpl { private final MultipartClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -87,7 +87,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of MultipartClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public MultipartClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -98,7 +98,7 @@ public MultipartClientImpl(String endpoint) { * Initializes an instance of MultipartClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public MultipartClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -109,7 +109,7 @@ public MultipartClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public MultipartClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; @@ -133,8 +133,8 @@ public interface MultipartClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> upload(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("multipart/form-data") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData data, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/upload/images/{name}") @@ -144,8 +144,8 @@ Mono> upload(@HostParam("endpoint") String endpoint, @PathParam(" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadSync(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("multipart/form-data") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData data, + RequestOptions requestOptions, Context context); } /** @@ -170,9 +170,8 @@ Response uploadSync(@HostParam("endpoint") String endpoint, @PathParam("na @ServiceMethod(returns = ReturnType.SINGLE) public Mono> uploadWithResponseAsync(String name, BinaryData data, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; return FluxUtil.withContext( - context -> service.upload(this.getEndpoint(), name, contentType, accept, data, requestOptions, context)); + context -> service.upload(this.getEndpoint(), name, contentType, data, requestOptions, context)); } /** @@ -197,7 +196,6 @@ public Mono> uploadWithResponseAsync(String name, BinaryData data @ServiceMethod(returns = ReturnType.SINGLE) public Response uploadWithResponse(String name, BinaryData data, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.uploadSync(this.getEndpoint(), name, contentType, accept, data, requestOptions, Context.NONE); + return service.uploadSync(this.getEndpoint(), name, contentType, data, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/FirstClientImpl.java b/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/FirstClientImpl.java index bf980a08cd..72350c4d9d 100644 --- a/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/FirstClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/FirstClientImpl.java @@ -44,12 +44,12 @@ public final class FirstClientImpl { private final FirstClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -102,7 +102,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of FirstClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public FirstClientImpl(String endpoint, FirstServiceVersion serviceVersion) { @@ -114,7 +114,7 @@ public FirstClientImpl(String endpoint, FirstServiceVersion serviceVersion) { * Initializes an instance of FirstClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public FirstClientImpl(HttpPipeline httpPipeline, String endpoint, FirstServiceVersion serviceVersion) { @@ -126,7 +126,7 @@ public FirstClientImpl(HttpPipeline httpPipeline, String endpoint, FirstServiceV * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public FirstClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, @@ -152,7 +152,7 @@ public interface FirstClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/client1/resources/{name}") @ExpectedResponses({ 200 }) @@ -162,7 +162,7 @@ Mono> get(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** diff --git a/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/NoApiVersionClientImpl.java b/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/NoApiVersionClientImpl.java index 12ebd54b91..bd0eb8a1b1 100644 --- a/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/NoApiVersionClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/NoApiVersionClientImpl.java @@ -5,7 +5,6 @@ package com.cadl.multipleapiversion.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -41,12 +40,12 @@ public final class NoApiVersionClientImpl { private final NoApiVersionClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -99,7 +98,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of NoApiVersionClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public NoApiVersionClientImpl(String endpoint, NoApiVersionServiceVersion serviceVersion) { @@ -111,7 +110,7 @@ public NoApiVersionClientImpl(String endpoint, NoApiVersionServiceVersion servic * Initializes an instance of NoApiVersionClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public NoApiVersionClientImpl(HttpPipeline httpPipeline, String endpoint, @@ -124,7 +123,7 @@ public NoApiVersionClientImpl(HttpPipeline httpPipeline, String endpoint, * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public NoApiVersionClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, @@ -150,8 +149,8 @@ public interface NoApiVersionClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> action(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> action(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Post("/client3") @ExpectedResponses({ 200 }) @@ -159,8 +158,8 @@ Mono> action(@HostParam("endpoint") String endpoint, @HeaderParam @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response actionSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response actionSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); } /** @@ -182,8 +181,7 @@ Response actionSync(@HostParam("endpoint") String endpoint, @HeaderParam(" */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> actionWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.action(this.getEndpoint(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.action(this.getEndpoint(), requestOptions, context)); } /** @@ -205,7 +203,6 @@ public Mono> actionWithResponseAsync(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response actionWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.actionSync(this.getEndpoint(), accept, requestOptions, Context.NONE); + return service.actionSync(this.getEndpoint(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/SecondClientImpl.java b/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/SecondClientImpl.java index 71cbdd9fb9..0e29c7149b 100644 --- a/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/SecondClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/multipleapiversion/implementation/SecondClientImpl.java @@ -44,12 +44,12 @@ public final class SecondClientImpl { private final SecondClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -102,7 +102,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of SecondClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public SecondClientImpl(String endpoint, SecondServiceVersion serviceVersion) { @@ -114,7 +114,7 @@ public SecondClientImpl(String endpoint, SecondServiceVersion serviceVersion) { * Initializes an instance of SecondClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public SecondClientImpl(HttpPipeline httpPipeline, String endpoint, SecondServiceVersion serviceVersion) { @@ -126,7 +126,7 @@ public SecondClientImpl(HttpPipeline httpPipeline, String endpoint, SecondServic * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public SecondClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, @@ -152,7 +152,7 @@ public interface SecondClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/client2/resources/{name}") @ExpectedResponses({ 200 }) @@ -162,7 +162,7 @@ Mono> get(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** diff --git a/typespec-tests/src/main/java/com/cadl/naming/implementation/NamingClientImpl.java b/typespec-tests/src/main/java/com/cadl/naming/implementation/NamingClientImpl.java index 0c0c5b717d..e45bea2aea 100644 --- a/typespec-tests/src/main/java/com/cadl/naming/implementation/NamingClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/naming/implementation/NamingClientImpl.java @@ -16,12 +16,12 @@ */ public final class NamingClientImpl { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public NamingOpsImpl getNamingOps() { /** * Initializes an instance of NamingClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public NamingClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public NamingClientImpl(String endpoint) { * Initializes an instance of NamingClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public NamingClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public NamingClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public NamingClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/naming/implementation/NamingOpsImpl.java b/typespec-tests/src/main/java/com/cadl/naming/implementation/NamingOpsImpl.java index 7099e00ac3..5ec21c69f9 100644 --- a/typespec-tests/src/main/java/com/cadl/naming/implementation/NamingOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/naming/implementation/NamingOpsImpl.java @@ -67,8 +67,8 @@ public interface NamingOpsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> post(@HostParam("endpoint") String endpoint, @QueryParam("name") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/naming") @ExpectedResponses({ 200 }) @@ -77,8 +77,8 @@ Mono> post(@HostParam("endpoint") String endpoint, @QueryPa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response postSync(@HostParam("endpoint") String endpoint, @QueryParam("name") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/naming") @ExpectedResponses({ 200 }) @@ -87,7 +87,7 @@ Response postSync(@HostParam("endpoint") String endpoint, @QueryPara @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getAnonymous(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/naming") @ExpectedResponses({ 200 }) @@ -96,7 +96,7 @@ Mono> getAnonymous(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getAnonymousSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -156,9 +156,10 @@ Response getAnonymousSync(@HostParam("endpoint") String endpoint, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postWithResponseAsync(String name, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.post(this.client.getEndpoint(), name, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.post(this.client.getEndpoint(), name, contentType, accept, body, + requestOptions, context)); } /** @@ -217,8 +218,10 @@ public Mono> postWithResponseAsync(String name, BinaryData */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postWithResponse(String name, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.postSync(this.client.getEndpoint(), name, accept, body, requestOptions, Context.NONE); + return service.postSync(this.client.getEndpoint(), name, contentType, accept, body, requestOptions, + Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/cadl/optional/OptionalAsyncClient.java b/typespec-tests/src/main/java/com/cadl/optional/OptionalAsyncClient.java index 882eeeed25..4222b964b2 100644 --- a/typespec-tests/src/main/java/com/cadl/optional/OptionalAsyncClient.java +++ b/typespec-tests/src/main/java/com/cadl/optional/OptionalAsyncClient.java @@ -55,8 +55,6 @@ public final class OptionalAsyncClient { * * * - * * *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: - * "application/json".
request-header-optionalStringNoThe requestHeaderOptional parameter
* You can add these to a request with {@link RequestOptions#addHeader} diff --git a/typespec-tests/src/main/java/com/cadl/optional/OptionalClient.java b/typespec-tests/src/main/java/com/cadl/optional/OptionalClient.java index 96ecb5df55..899ca37b27 100644 --- a/typespec-tests/src/main/java/com/cadl/optional/OptionalClient.java +++ b/typespec-tests/src/main/java/com/cadl/optional/OptionalClient.java @@ -53,8 +53,6 @@ public final class OptionalClient { * * * - * * *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: - * "application/json".
request-header-optionalStringNoThe requestHeaderOptional parameter
* You can add these to a request with {@link RequestOptions#addHeader} diff --git a/typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalClientImpl.java b/typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalClientImpl.java index 8eee8db184..9d1063ffad 100644 --- a/typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalClientImpl.java @@ -16,12 +16,12 @@ */ public final class OptionalClientImpl { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public OptionalOpsImpl getOptionalOps() { /** * Initializes an instance of OptionalClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public OptionalClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public OptionalClientImpl(String endpoint) { * Initializes an instance of OptionalClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public OptionalClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public OptionalClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public OptionalClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalOpsImpl.java b/typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalOpsImpl.java index 3631cec7da..65cb53de0f 100644 --- a/typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalOpsImpl.java @@ -70,7 +70,8 @@ Mono> put(@HostParam("endpoint") String endpoint, @QueryParam("booleanRequired") boolean booleanRequired, @QueryParam("booleanRequiredNullable") Boolean booleanRequiredNullable, @QueryParam("stringRequired") String stringRequired, - @QueryParam("stringRequiredNullable") String stringRequiredNullable, @HeaderParam("accept") String accept, + @QueryParam("stringRequiredNullable") String stringRequiredNullable, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/optional/put") @@ -84,7 +85,8 @@ Response putSync(@HostParam("endpoint") String endpoint, @QueryParam("booleanRequired") boolean booleanRequired, @QueryParam("booleanRequiredNullable") Boolean booleanRequiredNullable, @QueryParam("stringRequired") String stringRequired, - @QueryParam("stringRequiredNullable") String stringRequiredNullable, @HeaderParam("accept") String accept, + @QueryParam("stringRequiredNullable") String stringRequiredNullable, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -103,8 +105,6 @@ Response putSync(@HostParam("endpoint") String endpoint, * * * - * * *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: - * "application/json".
request-header-optionalStringNoThe requestHeaderOptional parameter
* You can add these to a request with {@link RequestOptions#addHeader} @@ -188,6 +188,7 @@ Response putSync(@HostParam("endpoint") String endpoint, public Mono> putWithResponseAsync(String requestHeaderRequired, boolean booleanRequired, Boolean booleanRequiredNullable, String stringRequired, String stringRequiredNullable, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { @@ -195,9 +196,9 @@ public Mono> putWithResponseAsync(String requestHeaderRequi requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); } }); - return FluxUtil - .withContext(context -> service.put(this.client.getEndpoint(), requestHeaderRequired, booleanRequired, - booleanRequiredNullable, stringRequired, stringRequiredNullable, accept, requestOptionsLocal, context)); + return FluxUtil.withContext(context -> service.put(this.client.getEndpoint(), requestHeaderRequired, + booleanRequired, booleanRequiredNullable, stringRequired, stringRequiredNullable, contentType, accept, + requestOptionsLocal, context)); } /** @@ -215,8 +216,6 @@ public Mono> putWithResponseAsync(String requestHeaderRequi * * * - * * *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: - * "application/json".
request-header-optionalStringNoThe requestHeaderOptional parameter
* You can add these to a request with {@link RequestOptions#addHeader} @@ -300,6 +299,7 @@ public Mono> putWithResponseAsync(String requestHeaderRequi public Response putWithResponse(String requestHeaderRequired, boolean booleanRequired, Boolean booleanRequiredNullable, String stringRequired, String stringRequiredNullable, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { @@ -308,6 +308,7 @@ public Response putWithResponse(String requestHeaderRequired, boolea } }); return service.putSync(this.client.getEndpoint(), requestHeaderRequired, booleanRequired, - booleanRequiredNullable, stringRequired, stringRequiredNullable, accept, requestOptionsLocal, Context.NONE); + booleanRequiredNullable, stringRequired, stringRequiredNullable, contentType, accept, requestOptionsLocal, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/partialupdate/implementation/PartialUpdateClientImpl.java b/typespec-tests/src/main/java/com/cadl/partialupdate/implementation/PartialUpdateClientImpl.java index dec63b0243..b845d53aad 100644 --- a/typespec-tests/src/main/java/com/cadl/partialupdate/implementation/PartialUpdateClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/partialupdate/implementation/PartialUpdateClientImpl.java @@ -41,12 +41,12 @@ public final class PartialUpdateClientImpl { private final PartialUpdateClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -85,7 +85,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of PartialUpdateClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public PartialUpdateClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -96,7 +96,7 @@ public PartialUpdateClientImpl(String endpoint) { * Initializes an instance of PartialUpdateClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public PartialUpdateClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -107,7 +107,7 @@ public PartialUpdateClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public PartialUpdateClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; @@ -130,7 +130,7 @@ public interface PartialUpdateClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> read(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> read(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/partialupdate") @@ -139,7 +139,7 @@ Mono> read(@HostParam("endpoint") String endpoint, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response readSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response readSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchClientImpl.java b/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchClientImpl.java index 87497b2dbd..e6cdd0a91f 100644 --- a/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchClientImpl.java @@ -16,12 +16,12 @@ */ public final class PatchClientImpl { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public PatchesImpl getPatches() { /** * Initializes an instance of PatchClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public PatchClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public PatchClientImpl(String endpoint) { * Initializes an instance of PatchClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public PatchClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public PatchClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public PatchClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchesImpl.java b/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchesImpl.java index e3e46aed12..fd130e35dc 100644 --- a/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchesImpl.java +++ b/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchesImpl.java @@ -65,7 +65,7 @@ public interface PatchesService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrUpdateResource(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -76,7 +76,7 @@ Mono> createOrUpdateResource(@HostParam("endpoint") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrUpdateResourceSync(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -87,7 +87,7 @@ Response createOrUpdateResourceSync(@HostParam("endpoint") String en @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrUpdateOptionalResource(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/patch/resource/optional") @@ -97,7 +97,7 @@ Mono> createOrUpdateOptionalResource(@HostParam("endpoint") @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrUpdateOptionalResourceSync(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/patch/fish") @@ -107,7 +107,7 @@ Response createOrUpdateOptionalResourceSync(@HostParam("endpoint") S @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrUpdateFish(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData fish, RequestOptions requestOptions, Context context); @Patch("/patch/fish") @@ -117,7 +117,7 @@ Mono> createOrUpdateFish(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrUpdateFishSync(@HostParam("endpoint") String endpoint, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData fish, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/cadl/protocolandconvenient/ProtocolAndConvenientAsyncClient.java b/typespec-tests/src/main/java/com/cadl/protocolandconvenient/ProtocolAndConvenientAsyncClient.java index 52ed37be78..3822cd98a1 100644 --- a/typespec-tests/src/main/java/com/cadl/protocolandconvenient/ProtocolAndConvenientAsyncClient.java +++ b/typespec-tests/src/main/java/com/cadl/protocolandconvenient/ProtocolAndConvenientAsyncClient.java @@ -338,10 +338,10 @@ public PagedFlux list() { // Generated convenience method for list RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = list(requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) + return PagedFlux.create(() -> (continuationToken, pageSize) -> { + Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); + : pagedFluxResponse.byPage(continuationToken).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() diff --git a/typespec-tests/src/main/java/com/cadl/protocolandconvenient/implementation/ProtocolAndConvenienceOpsImpl.java b/typespec-tests/src/main/java/com/cadl/protocolandconvenient/implementation/ProtocolAndConvenienceOpsImpl.java index aefc9d2a6a..2e3b98433e 100644 --- a/typespec-tests/src/main/java/com/cadl/protocolandconvenient/implementation/ProtocolAndConvenienceOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/protocolandconvenient/implementation/ProtocolAndConvenienceOpsImpl.java @@ -94,8 +94,8 @@ public interface ProtocolAndConvenienceOpsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> onlyConvenient(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/protocolandconvenient/onlyConvenient") @ExpectedResponses({ 200 }) @@ -104,8 +104,8 @@ Mono> onlyConvenient(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response onlyConvenientSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/protocolandconvenient/onlyProtocol") @ExpectedResponses({ 200 }) @@ -114,8 +114,8 @@ Response onlyConvenientSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> onlyProtocol(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/protocolandconvenient/onlyProtocol") @ExpectedResponses({ 200 }) @@ -124,8 +124,8 @@ Mono> onlyProtocol(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response onlyProtocolSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/protocolandconvenient/bothConvenientAndProtocol") @ExpectedResponses({ 200 }) @@ -134,8 +134,8 @@ Response onlyProtocolSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> bothConvenientAndProtocol(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/protocolandconvenient/bothConvenientAndProtocol") @ExpectedResponses({ 200 }) @@ -144,8 +144,8 @@ Mono> bothConvenientAndProtocol(@HostParam("endpoint") Stri @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response bothConvenientAndProtocolSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/protocolandconvenient/errorSetting") @ExpectedResponses({ 200 }) @@ -154,8 +154,8 @@ Response bothConvenientAndProtocolSync(@HostParam("endpoint") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> errorSetting(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/protocolandconvenient/errorSetting") @ExpectedResponses({ 200 }) @@ -164,8 +164,8 @@ Mono> errorSetting(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response errorSettingSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/protocolandconvenient/resources/{name}") @ExpectedResponses({ 200, 201 }) @@ -175,8 +175,8 @@ Response errorSettingSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrReplace(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Put("/protocolandconvenient/resources/{name}") @ExpectedResponses({ 200, 201 }) @@ -186,8 +186,8 @@ Mono> createOrReplace(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrReplaceSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Get("/protocolandconvenient/resources") @ExpectedResponses({ 200 }) @@ -196,7 +196,7 @@ Response createOrReplaceSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/protocolandconvenient/resources") @@ -206,7 +206,7 @@ Mono> list(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -216,7 +216,7 @@ Response listSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -226,7 +226,7 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = tru @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -260,9 +260,10 @@ Response listNextSync(@PathParam(value = "nextLink", encoded = true) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> onlyConvenientWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.onlyConvenient(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.onlyConvenient(this.client.getEndpoint(), contentType, accept, + body, requestOptions, context)); } /** @@ -295,8 +296,10 @@ public Mono> onlyConvenientWithResponseAsync(BinaryData bod */ @ServiceMethod(returns = ReturnType.SINGLE) public Response onlyConvenientWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.onlyConvenientSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.onlyConvenientSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } /** @@ -330,9 +333,10 @@ public Response onlyConvenientWithResponse(BinaryData body, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> onlyProtocolWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.onlyProtocol(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.onlyProtocol(this.client.getEndpoint(), contentType, accept, + body, requestOptions, context)); } /** @@ -366,8 +370,10 @@ public Mono> onlyProtocolWithResponseAsync(BinaryData body, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response onlyProtocolWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.onlyProtocolSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.onlyProtocolSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } /** @@ -401,9 +407,10 @@ public Response onlyProtocolWithResponse(BinaryData body, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> bothConvenientAndProtocolWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.bothConvenientAndProtocol(this.client.getEndpoint(), accept, - body, requestOptions, context)); + return FluxUtil.withContext(context -> service.bothConvenientAndProtocol(this.client.getEndpoint(), contentType, + accept, body, requestOptions, context)); } /** @@ -436,9 +443,10 @@ public Mono> bothConvenientAndProtocolWithResponseAsync(Bin */ @ServiceMethod(returns = ReturnType.SINGLE) public Response bothConvenientAndProtocolWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.bothConvenientAndProtocolSync(this.client.getEndpoint(), accept, body, requestOptions, - Context.NONE); + return service.bothConvenientAndProtocolSync(this.client.getEndpoint(), contentType, accept, body, + requestOptions, Context.NONE); } /** @@ -471,9 +479,10 @@ public Response bothConvenientAndProtocolWithResponse(BinaryData bod */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> errorSettingWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.errorSetting(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.errorSetting(this.client.getEndpoint(), contentType, accept, + body, requestOptions, context)); } /** @@ -506,8 +515,10 @@ public Mono> errorSettingWithResponseAsync(BinaryData body, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response errorSettingWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.errorSettingSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.errorSettingSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } /** @@ -544,9 +555,11 @@ public Response errorSettingWithResponse(BinaryData body, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrReplaceWithResponseAsync(String name, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrReplace(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), name, accept, resource, requestOptions, context)); + return FluxUtil.withContext( + context -> service.createOrReplace(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + name, contentType, accept, resource, requestOptions, context)); } /** @@ -583,9 +596,10 @@ private Mono> createOrReplaceWithResponseAsync(String name, @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrReplaceWithResponse(String name, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.createOrReplaceSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - name, accept, resource, requestOptions, Context.NONE); + name, contentType, accept, resource, requestOptions, Context.NONE); } /** @@ -955,6 +969,8 @@ public PagedIterable list(RequestOptions requestOptions) { } /** + * Paging operation + * * Get the next page of items. *

Response Body Schema

* @@ -986,6 +1002,8 @@ private Mono> listNextSinglePageAsync(String nextLink, } /** + * Paging operation + * * Get the next page of items. *

Response Body Schema

* diff --git a/typespec-tests/src/main/java/com/cadl/protocolandconvenient/implementation/ProtocolAndConvenientClientImpl.java b/typespec-tests/src/main/java/com/cadl/protocolandconvenient/implementation/ProtocolAndConvenientClientImpl.java index b11dcbcb44..8c75e79e39 100644 --- a/typespec-tests/src/main/java/com/cadl/protocolandconvenient/implementation/ProtocolAndConvenientClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/protocolandconvenient/implementation/ProtocolAndConvenientClientImpl.java @@ -17,12 +17,12 @@ */ public final class ProtocolAndConvenientClientImpl { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -89,7 +89,7 @@ public ProtocolAndConvenienceOpsImpl getProtocolAndConvenienceOps() { /** * Initializes an instance of ProtocolAndConvenientClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public ProtocolAndConvenientClientImpl(String endpoint, ProtocolAndConvenientServiceVersion serviceVersion) { @@ -101,7 +101,7 @@ public ProtocolAndConvenientClientImpl(String endpoint, ProtocolAndConvenientSer * Initializes an instance of ProtocolAndConvenientClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public ProtocolAndConvenientClientImpl(HttpPipeline httpPipeline, String endpoint, @@ -114,7 +114,7 @@ public ProtocolAndConvenientClientImpl(HttpPipeline httpPipeline, String endpoin * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public ProtocolAndConvenientClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, diff --git a/typespec-tests/src/main/java/com/cadl/response/ResponseAsyncClient.java b/typespec-tests/src/main/java/com/cadl/response/ResponseAsyncClient.java index 7eddb6844c..5c2b7a571d 100644 --- a/typespec-tests/src/main/java/com/cadl/response/ResponseAsyncClient.java +++ b/typespec-tests/src/main/java/com/cadl/response/ResponseAsyncClient.java @@ -450,10 +450,10 @@ public PagedFlux listStrings() { // Generated convenience method for listStrings RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = listStrings(requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) + return PagedFlux.create(() -> (continuationToken, pageSize) -> { + Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); + : pagedFluxResponse.byPage(continuationToken).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -480,10 +480,10 @@ public PagedFlux listIntegers() { // Generated convenience method for listIntegers RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = listIntegers(requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) + return PagedFlux.create(() -> (continuationToken, pageSize) -> { + Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); + : pagedFluxResponse.byPage(continuationToken).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() diff --git a/typespec-tests/src/main/java/com/cadl/response/implementation/ResponseClientImpl.java b/typespec-tests/src/main/java/com/cadl/response/implementation/ResponseClientImpl.java index 50339e8d1f..3e618b8217 100644 --- a/typespec-tests/src/main/java/com/cadl/response/implementation/ResponseClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/response/implementation/ResponseClientImpl.java @@ -64,12 +64,12 @@ public final class ResponseClientImpl { private final ResponseClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -122,7 +122,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of ResponseClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public ResponseClientImpl(String endpoint, ResponseServiceVersion serviceVersion) { @@ -134,7 +134,7 @@ public ResponseClientImpl(String endpoint, ResponseServiceVersion serviceVersion * Initializes an instance of ResponseClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public ResponseClientImpl(HttpPipeline httpPipeline, String endpoint, ResponseServiceVersion serviceVersion) { @@ -146,7 +146,7 @@ public ResponseClientImpl(HttpPipeline httpPipeline, String endpoint, ResponseSe * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public ResponseClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, @@ -171,7 +171,7 @@ public interface ResponseClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getBinary(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/get-binary") @ExpectedResponses({ 200 }) @@ -179,7 +179,7 @@ Mono> getBinary(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getBinarySync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response getBinarySync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/get-array") @@ -189,7 +189,7 @@ Response getBinarySync(@HostParam("endpoint") String endpoint, @Head @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getArray(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/get-array") @ExpectedResponses({ 200 }) @@ -197,7 +197,7 @@ Mono> getArray(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getArraySync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response getArraySync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/get-another-array") @@ -207,7 +207,7 @@ Response getArraySync(@HostParam("endpoint") String endpoint, @Heade @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getAnotherArray(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/get-another-array") @ExpectedResponses({ 200 }) @@ -216,7 +216,7 @@ Mono> getAnotherArray(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getAnotherArraySync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/response/create-with-headers") @ExpectedResponses({ 201 }) @@ -225,7 +225,7 @@ Response getAnotherArraySync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createWithHeaders(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/response/create-with-headers") @ExpectedResponses({ 201 }) @@ -234,7 +234,7 @@ Mono> createWithHeaders(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createWithHeadersSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/response/delete-with-headers") @ExpectedResponses({ 204 }) @@ -242,8 +242,8 @@ Response createWithHeadersSync(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteWithHeaders(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> deleteWithHeaders(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Delete("/response/delete-with-headers") @ExpectedResponses({ 204 }) @@ -251,8 +251,8 @@ Mono> deleteWithHeaders(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteWithHeadersSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response deleteWithHeadersSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Head("/response/exists") @ExpectedResponses({ 200, 404 }) @@ -260,7 +260,7 @@ Response deleteWithHeadersSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> exists(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Head("/response/exists") @@ -269,7 +269,7 @@ Mono> exists(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response existsSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/response/lro-invalid-poll-response") @@ -279,8 +279,9 @@ Response existsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> lroInvalidPollResponse(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); @Post("/response/lro-invalid-poll-response") @ExpectedResponses({ 202 }) @@ -289,8 +290,9 @@ Mono> lroInvalidPollResponse(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response lroInvalidPollResponseSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); @Post("/response/lro-invalid-result") @ExpectedResponses({ 202 }) @@ -299,8 +301,9 @@ Response lroInvalidPollResponseSync(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> lroInvalidResult(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); @Post("/response/lro-invalid-result") @ExpectedResponses({ 202 }) @@ -309,8 +312,9 @@ Mono> lroInvalidResult(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response lroInvalidResultSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); @Get("/response/paged-string") @ExpectedResponses({ 200 }) @@ -319,7 +323,7 @@ Response lroInvalidResultSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listStrings(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/paged-string") @ExpectedResponses({ 200 }) @@ -328,7 +332,7 @@ Mono> listStrings(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listStringsSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/paged-int32") @ExpectedResponses({ 200 }) @@ -337,7 +341,7 @@ Response listStringsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listIntegers(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/paged-int32") @ExpectedResponses({ 200 }) @@ -346,7 +350,7 @@ Mono> listIntegers(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listIntegersSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -355,7 +359,7 @@ Response listIntegersSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listStringsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -365,7 +369,7 @@ Mono> listStringsNext(@PathParam(value = "nextLink", encode @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listStringsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -375,7 +379,7 @@ Response listStringsNextSync(@PathParam(value = "nextLink", encoded @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listIntegersNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -385,7 +389,7 @@ Mono> listIntegersNext(@PathParam(value = "nextLink", encod @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listIntegersNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -609,9 +613,7 @@ public Response createWithHeadersWithResponse(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteWithHeadersWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.deleteWithHeaders(this.getEndpoint(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.deleteWithHeaders(this.getEndpoint(), requestOptions, context)); } /** @@ -626,8 +628,7 @@ public Mono> deleteWithHeadersWithResponseAsync(RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithHeadersWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.deleteWithHeadersSync(this.getEndpoint(), accept, requestOptions, Context.NONE); + return service.deleteWithHeadersSync(this.getEndpoint(), requestOptions, Context.NONE); } /** @@ -696,9 +697,10 @@ public Response existsWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> lroInvalidPollResponseWithResponseAsync(BinaryData request, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.lroInvalidPollResponse(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, request, requestOptions, context)); + this.getServiceVersion().getVersion(), contentType, accept, request, requestOptions, context)); } /** @@ -724,9 +726,10 @@ private Mono> lroInvalidPollResponseWithResponseAsync(BinaryData */ @ServiceMethod(returns = ReturnType.SINGLE) private Response lroInvalidPollResponseWithResponse(BinaryData request, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.lroInvalidPollResponseSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, - request, requestOptions, Context.NONE); + return service.lroInvalidPollResponseSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + contentType, accept, request, requestOptions, Context.NONE); } /** @@ -900,9 +903,10 @@ public SyncPoller beginLroInvalidPollResponseWithMo */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> lroInvalidResultWithResponseAsync(BinaryData request, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.lroInvalidResult(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, request, requestOptions, context)); + this.getServiceVersion().getVersion(), contentType, accept, request, requestOptions, context)); } /** @@ -928,9 +932,10 @@ private Mono> lroInvalidResultWithResponseAsync(BinaryData reques */ @ServiceMethod(returns = ReturnType.SINGLE) private Response lroInvalidResultWithResponse(BinaryData request, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.lroInvalidResultSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, request, - requestOptions, Context.NONE); + return service.lroInvalidResultSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, + accept, request, requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/cadl/server/ContosoClientBuilder.java b/typespec-tests/src/main/java/com/cadl/server/ContosoClientBuilder.java index 6df345a264..09b7853e68 100644 --- a/typespec-tests/src/main/java/com/cadl/server/ContosoClientBuilder.java +++ b/typespec-tests/src/main/java/com/cadl/server/ContosoClientBuilder.java @@ -189,6 +189,24 @@ public ContosoClientBuilder endpoint(String endpoint) { return this; } + /* + * Api Version + */ + @Generated + private String apiVersion; + + /** + * Sets Api Version. + * + * @param apiVersion the apiVersion value. + * @return the ContosoClientBuilder. + */ + @Generated + public ContosoClientBuilder apiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + /* * Service version */ @@ -237,7 +255,7 @@ private ContosoClientImpl buildInnerClient() { ContosoServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : ContosoServiceVersion.getLatest(); ContosoClientImpl client = new ContosoClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), - this.endpoint, localServiceVersion); + this.endpoint, this.apiVersion, localServiceVersion); return client; } @@ -246,6 +264,7 @@ private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + Objects.requireNonNull(apiVersion, "'apiVersion' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/cadl/server/HttpbinClientBuilder.java b/typespec-tests/src/main/java/com/cadl/server/HttpbinClientBuilder.java index dadfb38252..944dd98a8c 100644 --- a/typespec-tests/src/main/java/com/cadl/server/HttpbinClientBuilder.java +++ b/typespec-tests/src/main/java/com/cadl/server/HttpbinClientBuilder.java @@ -264,6 +264,7 @@ private void validateClient() { // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(domain, "'domain' cannot be null."); Objects.requireNonNull(tld, "'tld' cannot be null."); + Objects.requireNonNull(relativePath, "'relativePath' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/cadl/server/implementation/ContosoClientImpl.java b/typespec-tests/src/main/java/com/cadl/server/implementation/ContosoClientImpl.java index ef7a6aa8f1..4bc0c43910 100644 --- a/typespec-tests/src/main/java/com/cadl/server/implementation/ContosoClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/server/implementation/ContosoClientImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; @@ -55,6 +54,20 @@ public String getEndpoint() { return this.endpoint; } + /** + * Api Version. + */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + /** * Service version. */ @@ -101,11 +114,12 @@ public SerializerAdapter getSerializerAdapter() { * Initializes an instance of ContosoClient client. * * @param endpoint Service endpoint. + * @param apiVersion Api Version. * @param serviceVersion Service version. */ - public ContosoClientImpl(String endpoint, ContosoServiceVersion serviceVersion) { + public ContosoClientImpl(String endpoint, String apiVersion, ContosoServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion, serviceVersion); } /** @@ -113,10 +127,12 @@ public ContosoClientImpl(String endpoint, ContosoServiceVersion serviceVersion) * * @param httpPipeline The HTTP pipeline to send requests through. * @param endpoint Service endpoint. + * @param apiVersion Api Version. * @param serviceVersion Service version. */ - public ContosoClientImpl(HttpPipeline httpPipeline, String endpoint, ContosoServiceVersion serviceVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + public ContosoClientImpl(HttpPipeline httpPipeline, String endpoint, String apiVersion, + ContosoServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion, serviceVersion); } /** @@ -125,13 +141,15 @@ public ContosoClientImpl(HttpPipeline httpPipeline, String endpoint, ContosoServ * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param endpoint Service endpoint. + * @param apiVersion Api Version. * @param serviceVersion Service version. */ public ContosoClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - ContosoServiceVersion serviceVersion) { + String apiVersion, ContosoServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; + this.apiVersion = apiVersion; this.serviceVersion = serviceVersion; this.service = RestProxy.create(ContosoClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -149,8 +167,7 @@ public interface ContosoClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> get(@HostParam("Endpoint") String endpoint, @HostParam("ApiVersion") String apiVersion, - @PathParam(value = "group", encoded = true) String group, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @PathParam(value = "group", encoded = true) String group, RequestOptions requestOptions, Context context); @Get("/contoso/{group}") @ExpectedResponses({ 200, 204 }) @@ -159,8 +176,7 @@ Mono> get(@HostParam("Endpoint") String endpoint, @HostParam("Api @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSync(@HostParam("Endpoint") String endpoint, @HostParam("ApiVersion") String apiVersion, - @PathParam(value = "group", encoded = true) String group, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @PathParam(value = "group", encoded = true) String group, RequestOptions requestOptions, Context context); } /** @@ -176,9 +192,8 @@ Response getSync(@HostParam("Endpoint") String endpoint, @HostParam("ApiVe */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(String group, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.getEndpoint(), this.getServiceVersion().getVersion(), - group, accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.get(this.getEndpoint(), this.getApiVersion(), group, requestOptions, context)); } /** @@ -194,8 +209,6 @@ public Mono> getWithResponseAsync(String group, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String group, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getSync(this.getEndpoint(), this.getServiceVersion().getVersion(), group, accept, requestOptions, - Context.NONE); + return service.getSync(this.getEndpoint(), this.getApiVersion(), group, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/server/implementation/HttpbinClientImpl.java b/typespec-tests/src/main/java/com/cadl/server/implementation/HttpbinClientImpl.java index 95fc0c5668..20c3a71dc2 100644 --- a/typespec-tests/src/main/java/com/cadl/server/implementation/HttpbinClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/server/implementation/HttpbinClientImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; @@ -166,8 +165,8 @@ public interface HttpbinClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> status(@HostParam("domain") String domain, @HostParam("tld") String tld, - @HostParam("relative-path") String relativePath, @PathParam("code") int code, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("relative-path") String relativePath, @PathParam("code") int code, RequestOptions requestOptions, + Context context); @Get("/status/{code}") @ExpectedResponses({ 200, 204 }) @@ -176,8 +175,8 @@ Mono> status(@HostParam("domain") String domain, @HostParam("tld" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response statusSync(@HostParam("domain") String domain, @HostParam("tld") String tld, - @HostParam("relative-path") String relativePath, @PathParam("code") int code, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("relative-path") String relativePath, @PathParam("code") int code, RequestOptions requestOptions, + Context context); } /** @@ -193,9 +192,8 @@ Response statusSync(@HostParam("domain") String domain, @HostParam("tld") */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> statusWithResponseAsync(int code, RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext(context -> service.status(this.getDomain(), this.getTld(), this.getRelativePath(), - code, accept, requestOptions, context)); + code, requestOptions, context)); } /** @@ -211,8 +209,7 @@ public Mono> statusWithResponseAsync(int code, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Response statusWithResponse(int code, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.statusSync(this.getDomain(), this.getTld(), this.getRelativePath(), code, accept, requestOptions, + return service.statusSync(this.getDomain(), this.getTld(), this.getRelativePath(), code, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/specialchars/implementation/BuiltinOpsImpl.java b/typespec-tests/src/main/java/com/cadl/specialchars/implementation/BuiltinOpsImpl.java index 5392d88b0a..95933ed802 100644 --- a/typespec-tests/src/main/java/com/cadl/specialchars/implementation/BuiltinOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/specialchars/implementation/BuiltinOpsImpl.java @@ -64,7 +64,8 @@ public interface BuiltinOpsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> read(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> read(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData readRequest, RequestOptions requestOptions, Context context); @Post("/specialchars") @@ -73,7 +74,8 @@ Mono> read(@HostParam("endpoint") String endpoint, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response readSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response readSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData readRequest, RequestOptions requestOptions, Context context); } @@ -109,9 +111,10 @@ Response readSync(@HostParam("endpoint") String endpoint, @HeaderPar */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> readWithResponseAsync(BinaryData readRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.read(this.client.getEndpoint(), accept, readRequest, requestOptions, context)); + return FluxUtil.withContext(context -> service.read(this.client.getEndpoint(), contentType, accept, readRequest, + requestOptions, context)); } /** @@ -146,7 +149,9 @@ public Mono> readWithResponseAsync(BinaryData readRequest, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response readWithResponse(BinaryData readRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.readSync(this.client.getEndpoint(), accept, readRequest, requestOptions, Context.NONE); + return service.readSync(this.client.getEndpoint(), contentType, accept, readRequest, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/specialchars/implementation/SpecialCharsClientImpl.java b/typespec-tests/src/main/java/com/cadl/specialchars/implementation/SpecialCharsClientImpl.java index 156eeb1699..a451aefaac 100644 --- a/typespec-tests/src/main/java/com/cadl/specialchars/implementation/SpecialCharsClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/specialchars/implementation/SpecialCharsClientImpl.java @@ -16,12 +16,12 @@ */ public final class SpecialCharsClientImpl { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public BuiltinOpsImpl getBuiltinOps() { /** * Initializes an instance of SpecialCharsClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public SpecialCharsClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public SpecialCharsClientImpl(String endpoint) { * Initializes an instance of SpecialCharsClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public SpecialCharsClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public SpecialCharsClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public SpecialCharsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/specialheaders/EtagHeadersAsyncClient.java b/typespec-tests/src/main/java/com/cadl/specialheaders/EtagHeadersAsyncClient.java index df0a0267d5..c32a81e9ba 100644 --- a/typespec-tests/src/main/java/com/cadl/specialheaders/EtagHeadersAsyncClient.java +++ b/typespec-tests/src/main/java/com/cadl/specialheaders/EtagHeadersAsyncClient.java @@ -323,10 +323,10 @@ public PagedFlux listWithEtag() { // Generated convenience method for listWithEtag RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = listWithEtag(requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) + return PagedFlux.create(() -> (continuationToken, pageSize) -> { + Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); + : pagedFluxResponse.byPage(continuationToken).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() diff --git a/typespec-tests/src/main/java/com/cadl/specialheaders/EtagHeadersOptionalBodyAsyncClient.java b/typespec-tests/src/main/java/com/cadl/specialheaders/EtagHeadersOptionalBodyAsyncClient.java index 5db8ba0859..ab66a8d62b 100644 --- a/typespec-tests/src/main/java/com/cadl/specialheaders/EtagHeadersOptionalBodyAsyncClient.java +++ b/typespec-tests/src/main/java/com/cadl/specialheaders/EtagHeadersOptionalBodyAsyncClient.java @@ -55,8 +55,6 @@ public final class EtagHeadersOptionalBodyAsyncClient { * * * - * * *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: - * "application/json".
If-MatchStringNoThe request should only proceed if an entity matches this * string.
If-None-MatchStringNoThe request should only proceed if no entity matches this diff --git a/typespec-tests/src/main/java/com/cadl/specialheaders/EtagHeadersOptionalBodyClient.java b/typespec-tests/src/main/java/com/cadl/specialheaders/EtagHeadersOptionalBodyClient.java index dd54c1264e..c811a07301 100644 --- a/typespec-tests/src/main/java/com/cadl/specialheaders/EtagHeadersOptionalBodyClient.java +++ b/typespec-tests/src/main/java/com/cadl/specialheaders/EtagHeadersOptionalBodyClient.java @@ -53,8 +53,6 @@ public final class EtagHeadersOptionalBodyClient { * * * - * * *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: - * "application/json".
If-MatchStringNoThe request should only proceed if an entity matches this * string.
If-None-MatchStringNoThe request should only proceed if no entity matches this diff --git a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersImpl.java b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersImpl.java index c3b31aafc6..18b60b8531 100644 --- a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersImpl.java +++ b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersImpl.java @@ -87,8 +87,8 @@ public interface EtagHeadersService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> putWithRequestHeaders(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Put("/etag-headers/resources/{name}") @ExpectedResponses({ 200, 201 }) @@ -98,8 +98,8 @@ Mono> putWithRequestHeaders(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(HttpResponseException.class) Response putWithRequestHeadersSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Patch("/etag-headers/resources/{name}") @ExpectedResponses({ 200, 201 }) @@ -109,7 +109,7 @@ Response putWithRequestHeadersSync(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchWithMatchHeaders(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -121,7 +121,7 @@ Mono> patchWithMatchHeaders(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchWithMatchHeadersSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -132,7 +132,7 @@ Response patchWithMatchHeadersSync(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithEtag(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/etag-headers/resources") @@ -142,7 +142,7 @@ Mono> listWithEtag(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithEtagSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -152,7 +152,7 @@ Response listWithEtagSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithEtagNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -162,7 +162,7 @@ Mono> listWithEtagNext(@PathParam(value = "nextLink", encod @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithEtagNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -216,9 +216,11 @@ Response listWithEtagNextSync(@PathParam(value = "nextLink", encoded @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithRequestHeadersWithResponseAsync(String name, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.putWithRequestHeaders(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), name, accept, resource, requestOptions, context)); + this.client.getServiceVersion().getVersion(), name, contentType, accept, resource, requestOptions, + context)); } /** @@ -271,9 +273,11 @@ public Mono> putWithRequestHeadersWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithRequestHeadersWithResponse(String name, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.putWithRequestHeadersSync(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), name, accept, resource, requestOptions, Context.NONE); + this.client.getServiceVersion().getVersion(), name, contentType, accept, resource, requestOptions, + Context.NONE); } /** @@ -501,6 +505,8 @@ public PagedIterable listWithEtag(RequestOptions requestOptions) { } /** + * Resource list operation template. + * * Get the next page of items. *

Response Body Schema

* @@ -533,6 +539,8 @@ private Mono> listWithEtagNextSinglePageAsync(String n } /** + * Resource list operation template. + * * Get the next page of items. *

Response Body Schema

* diff --git a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersOptionalBodiesImpl.java b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersOptionalBodiesImpl.java index eb05187da8..aa8e88bcbf 100644 --- a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersOptionalBodiesImpl.java +++ b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersOptionalBodiesImpl.java @@ -76,8 +76,8 @@ public interface EtagHeadersOptionalBodiesService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> putWithOptionalBody(@HostParam("endpoint") String endpoint, - @QueryParam("format") String format, @HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + @QueryParam("format") String format, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/etag-headers-optional-body") @ExpectedResponses({ 200 }) @@ -86,8 +86,8 @@ Mono> putWithOptionalBody(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response putWithOptionalBodySync(@HostParam("endpoint") String endpoint, - @QueryParam("format") String format, @HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + @QueryParam("format") String format, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -103,8 +103,6 @@ Response putWithOptionalBodySync(@HostParam("endpoint") String endpo * * * - * * *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: - * "application/json".
If-MatchStringNoThe request should only proceed if an entity matches this * string.
If-None-MatchStringNoThe request should only proceed if no entity matches this @@ -149,6 +147,7 @@ Response putWithOptionalBodySync(@HostParam("endpoint") String endpo @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithOptionalBodyWithResponseAsync(String format, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { @@ -156,8 +155,8 @@ public Mono> putWithOptionalBodyWithResponseAsync(String fo requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); } }); - return FluxUtil.withContext(context -> service.putWithOptionalBody(this.client.getEndpoint(), format, accept, - requestOptionsLocal, context)); + return FluxUtil.withContext(context -> service.putWithOptionalBody(this.client.getEndpoint(), format, + contentType, accept, requestOptionsLocal, context)); } /** @@ -173,8 +172,6 @@ public Mono> putWithOptionalBodyWithResponseAsync(String fo * * * - * * *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: - * "application/json".
If-MatchStringNoThe request should only proceed if an entity matches this * string.
If-None-MatchStringNoThe request should only proceed if no entity matches this @@ -218,6 +215,7 @@ public Mono> putWithOptionalBodyWithResponseAsync(String fo */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithOptionalBodyWithResponse(String format, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { @@ -225,7 +223,7 @@ public Response putWithOptionalBodyWithResponse(String format, Reque requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); } }); - return service.putWithOptionalBodySync(this.client.getEndpoint(), format, accept, requestOptionsLocal, - Context.NONE); + return service.putWithOptionalBodySync(this.client.getEndpoint(), format, contentType, accept, + requestOptionsLocal, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/RepeatabilityHeadersImpl.java b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/RepeatabilityHeadersImpl.java index 5af6d742a1..b45fdf9a70 100644 --- a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/RepeatabilityHeadersImpl.java +++ b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/RepeatabilityHeadersImpl.java @@ -92,7 +92,7 @@ public interface RepeatabilityHeadersService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/repeatability-headers/resources/{name}") @ExpectedResponses({ 200 }) @@ -102,7 +102,7 @@ Mono> get(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/repeatability-headers/resources/{name}") @ExpectedResponses({ 200, 201 }) @@ -112,8 +112,8 @@ Response getSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> put(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Put("/repeatability-headers/resources/{name}") @ExpectedResponses({ 200, 201 }) @@ -123,8 +123,8 @@ Mono> put(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response putSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Post("/repeatability-headers/resources/{name}:post") @ExpectedResponses({ 200 }) @@ -134,7 +134,7 @@ Response putSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> post(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/repeatability-headers/resources/{name}:post") @ExpectedResponses({ 200 }) @@ -144,7 +144,7 @@ Mono> post(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response postSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/repeatability-headers/resources/{name}") @ExpectedResponses({ 200, 201 }) @@ -154,7 +154,7 @@ Response postSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createLro(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -166,7 +166,7 @@ Mono> createLro(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response createLroSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); } @@ -272,6 +272,7 @@ public Response getWithResponse(String name, RequestOptions requestO @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(String name, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { @@ -287,8 +288,9 @@ public Mono> putWithResponseAsync(String name, BinaryData r DateTimeRfc1123.toRfc1123String(OffsetDateTime.now())); } }); - return FluxUtil.withContext(context -> service.put(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), name, accept, resource, requestOptionsLocal, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + name, contentType, accept, resource, requestOptionsLocal, context)); } /** @@ -335,6 +337,7 @@ public Mono> putWithResponseAsync(String name, BinaryData r */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(String name, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { @@ -350,8 +353,8 @@ public Response putWithResponse(String name, BinaryData resource, Re DateTimeRfc1123.toRfc1123String(OffsetDateTime.now())); } }); - return service.putSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), name, accept, - resource, requestOptionsLocal, Context.NONE); + return service.putSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), name, + contentType, accept, resource, requestOptionsLocal, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/SkipSpecialHeadersImpl.java b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/SkipSpecialHeadersImpl.java index fe882ab8ec..0903fb3eeb 100644 --- a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/SkipSpecialHeadersImpl.java +++ b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/SkipSpecialHeadersImpl.java @@ -76,7 +76,7 @@ public interface SkipSpecialHeadersService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteWithSpecialHeaders(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("foo") String foo, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HeaderParam("foo") String foo, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/skip-special-headers/resources/{name}") @@ -87,7 +87,7 @@ Mono> deleteWithSpecialHeaders(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteWithSpecialHeadersSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("foo") String foo, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HeaderParam("foo") String foo, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/SpecialHeadersClientImpl.java b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/SpecialHeadersClientImpl.java index 55e36167c3..fd88cb4588 100644 --- a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/SpecialHeadersClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/SpecialHeadersClientImpl.java @@ -17,12 +17,12 @@ */ public final class SpecialHeadersClientImpl { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -131,7 +131,7 @@ public SkipSpecialHeadersImpl getSkipSpecialHeaders() { /** * Initializes an instance of SpecialHeadersClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public SpecialHeadersClientImpl(String endpoint, SpecialHeadersServiceVersion serviceVersion) { @@ -143,7 +143,7 @@ public SpecialHeadersClientImpl(String endpoint, SpecialHeadersServiceVersion se * Initializes an instance of SpecialHeadersClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public SpecialHeadersClientImpl(HttpPipeline httpPipeline, String endpoint, @@ -156,7 +156,7 @@ public SpecialHeadersClientImpl(HttpPipeline httpPipeline, String endpoint, * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public SpecialHeadersClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, diff --git a/typespec-tests/src/main/java/com/cadl/union/implementation/UnionClientImpl.java b/typespec-tests/src/main/java/com/cadl/union/implementation/UnionClientImpl.java index 240291b036..c2598deaec 100644 --- a/typespec-tests/src/main/java/com/cadl/union/implementation/UnionClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/union/implementation/UnionClientImpl.java @@ -17,11 +17,12 @@ */ public final class UnionClientImpl { /** + * Union. */ private final String endpoint; /** - * Gets. + * Gets Union. * * @return the endpoint value. */ @@ -88,7 +89,7 @@ public UnionFlattenOpsImpl getUnionFlattenOps() { /** * Initializes an instance of UnionClient client. * - * @param endpoint + * @param endpoint Union. * @param serviceVersion Service version. */ public UnionClientImpl(String endpoint, UnionServiceVersion serviceVersion) { @@ -100,7 +101,7 @@ public UnionClientImpl(String endpoint, UnionServiceVersion serviceVersion) { * Initializes an instance of UnionClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint + * @param endpoint Union. * @param serviceVersion Service version. */ public UnionClientImpl(HttpPipeline httpPipeline, String endpoint, UnionServiceVersion serviceVersion) { @@ -112,7 +113,7 @@ public UnionClientImpl(HttpPipeline httpPipeline, String endpoint, UnionServiceV * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint + * @param endpoint Union. * @param serviceVersion Service version. */ public UnionClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, diff --git a/typespec-tests/src/main/java/com/cadl/union/implementation/UnionFlattenOpsImpl.java b/typespec-tests/src/main/java/com/cadl/union/implementation/UnionFlattenOpsImpl.java index dfd7cce30e..9a7ee5cd53 100644 --- a/typespec-tests/src/main/java/com/cadl/union/implementation/UnionFlattenOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/union/implementation/UnionFlattenOpsImpl.java @@ -84,7 +84,7 @@ public interface UnionFlattenOpsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> send(@HostParam("endpoint") String endpoint, @QueryParam("id") String id, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest, RequestOptions requestOptions, Context context); @Post("/union/send") @@ -94,7 +94,7 @@ Mono> send(@HostParam("endpoint") String endpoint, @QueryParam("i @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response sendSync(@HostParam("endpoint") String endpoint, @QueryParam("id") String id, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest, RequestOptions requestOptions, Context context); @Post("/union/send-long") @@ -104,7 +104,7 @@ Response sendSync(@HostParam("endpoint") String endpoint, @QueryParam("id" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> sendLong(@HostParam("endpoint") String endpoint, @QueryParam("id") String id, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendLongRequest, RequestOptions requestOptions, Context context); @Post("/union/send-long") @@ -114,7 +114,7 @@ Mono> sendLong(@HostParam("endpoint") String endpoint, @QueryPara @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response sendLongSync(@HostParam("endpoint") String endpoint, @QueryParam("id") String id, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendLongRequest, RequestOptions requestOptions, Context context); @Get("/union/param") @@ -123,8 +123,8 @@ Response sendLongSync(@HostParam("endpoint") String endpoint, @QueryParam( @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> get(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/union/param") @ExpectedResponses({ 200 }) @@ -132,8 +132,7 @@ Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response getSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); @Post("/union/generate") @ExpectedResponses({ 202 }) @@ -142,7 +141,7 @@ Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("acc @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> generate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/union/generate") @@ -152,7 +151,7 @@ Mono> generate(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response generateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -181,9 +180,9 @@ Response generateSync(@HostParam("endpoint") String endpoint, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(String id, BinaryData sendRequest, RequestOptions requestOptions) { - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil.withContext(context -> service.send(this.client.getEndpoint(), id, - this.client.getServiceVersion().getVersion(), accept, sendRequest, requestOptions, context)); + this.client.getServiceVersion().getVersion(), contentType, sendRequest, requestOptions, context)); } /** @@ -210,9 +209,9 @@ public Mono> sendWithResponseAsync(String id, BinaryData sendRequ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(String id, BinaryData sendRequest, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendSync(this.client.getEndpoint(), id, this.client.getServiceVersion().getVersion(), accept, - sendRequest, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sendSync(this.client.getEndpoint(), id, this.client.getServiceVersion().getVersion(), + contentType, sendRequest, requestOptions, Context.NONE); } /** @@ -251,9 +250,9 @@ public Response sendWithResponse(String id, BinaryData sendRequest, Reques @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendLongWithResponseAsync(String id, BinaryData sendLongRequest, RequestOptions requestOptions) { - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil.withContext(context -> service.sendLong(this.client.getEndpoint(), id, - this.client.getServiceVersion().getVersion(), accept, sendLongRequest, requestOptions, context)); + this.client.getServiceVersion().getVersion(), contentType, sendLongRequest, requestOptions, context)); } /** @@ -291,9 +290,9 @@ public Mono> sendLongWithResponseAsync(String id, BinaryData send */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendLongWithResponse(String id, BinaryData sendLongRequest, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendLongSync(this.client.getEndpoint(), id, this.client.getServiceVersion().getVersion(), accept, - sendLongRequest, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sendLongSync(this.client.getEndpoint(), id, this.client.getServiceVersion().getVersion(), + contentType, sendLongRequest, requestOptions, Context.NONE); } /** @@ -315,8 +314,7 @@ public Response sendLongWithResponse(String id, BinaryData sendLongRequest */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), requestOptions, context)); } /** @@ -338,8 +336,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/cadl/versioning/VersioningAsyncClient.java b/typespec-tests/src/main/java/com/cadl/versioning/VersioningAsyncClient.java index 5050cafeea..d7016ff8b4 100644 --- a/typespec-tests/src/main/java/com/cadl/versioning/VersioningAsyncClient.java +++ b/typespec-tests/src/main/java/com/cadl/versioning/VersioningAsyncClient.java @@ -233,10 +233,10 @@ public PagedFlux list(List select, String expand) { requestOptions.addQueryParam("expand", expand, false); } PagedFlux pagedFluxResponse = list(requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) + return PagedFlux.create(() -> (continuationToken, pageSize) -> { + Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); + : pagedFluxResponse.byPage(continuationToken).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -263,10 +263,10 @@ public PagedFlux list() { // Generated convenience method for list RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = list(requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) + return PagedFlux.create(() -> (continuationToken, pageSize) -> { + Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); + : pagedFluxResponse.byPage(continuationToken).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() diff --git a/typespec-tests/src/main/java/com/cadl/versioning/implementation/VersioningClientImpl.java b/typespec-tests/src/main/java/com/cadl/versioning/implementation/VersioningClientImpl.java index 52829b6d51..b64dbb93fa 100644 --- a/typespec-tests/src/main/java/com/cadl/versioning/implementation/VersioningClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/versioning/implementation/VersioningClientImpl.java @@ -17,12 +17,12 @@ */ public final class VersioningClientImpl { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -89,7 +89,7 @@ public VersioningOpsImpl getVersioningOps() { /** * Initializes an instance of VersioningClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public VersioningClientImpl(String endpoint, VersioningServiceVersion serviceVersion) { @@ -101,7 +101,7 @@ public VersioningClientImpl(String endpoint, VersioningServiceVersion serviceVer * Initializes an instance of VersioningClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public VersioningClientImpl(HttpPipeline httpPipeline, String endpoint, VersioningServiceVersion serviceVersion) { @@ -113,7 +113,7 @@ public VersioningClientImpl(HttpPipeline httpPipeline, String endpoint, Versioni * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. * @param serviceVersion Service version. */ public VersioningClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, diff --git a/typespec-tests/src/main/java/com/cadl/versioning/implementation/VersioningOpsImpl.java b/typespec-tests/src/main/java/com/cadl/versioning/implementation/VersioningOpsImpl.java index dda7074b57..e32901663d 100644 --- a/typespec-tests/src/main/java/com/cadl/versioning/implementation/VersioningOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/versioning/implementation/VersioningOpsImpl.java @@ -95,7 +95,7 @@ public interface VersioningOpsService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> export(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/versioning/resources/{name}:export") @ExpectedResponses({ 202 }) @@ -105,7 +105,7 @@ Mono> export(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response exportSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/versioning/resources") @ExpectedResponses({ 200 }) @@ -114,7 +114,7 @@ Response exportSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/versioning/resources") @@ -124,7 +124,7 @@ Mono> list(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/versioning/resources/{name}") @@ -135,8 +135,8 @@ Response listSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createLongRunning(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Put("/versioning/resources/{name}") @ExpectedResponses({ 200, 201 }) @@ -146,8 +146,8 @@ Mono> createLongRunning(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(HttpResponseException.class) Response createLongRunningSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -156,7 +156,7 @@ Response createLongRunningSync(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -166,7 +166,7 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = tru @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -657,9 +657,11 @@ public PagedIterable list(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createLongRunningWithResponseAsync(String name, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.createLongRunning(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), name, accept, resource, requestOptions, context)); + this.client.getServiceVersion().getVersion(), name, contentType, accept, resource, requestOptions, + context)); } /** @@ -696,9 +698,10 @@ private Mono> createLongRunningWithResponseAsync(String nam @ServiceMethod(returns = ReturnType.SINGLE) private Response createLongRunningWithResponse(String name, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.createLongRunningSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - name, accept, resource, requestOptions, Context.NONE); + name, contentType, accept, resource, requestOptions, Context.NONE); } /** @@ -886,6 +889,8 @@ public SyncPoller beginCreateLongRunningWithMode } /** + * Resource list operation template. + * * Get the next page of items. *

Response Body Schema

* @@ -917,6 +922,8 @@ private Mono> listNextSinglePageAsync(String nextLink, } /** + * Resource list operation template. + * * Get the next page of items. *

Response Body Schema

* diff --git a/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityClientImpl.java b/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityClientImpl.java index e5b08514f9..e7e9451941 100644 --- a/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityClientImpl.java @@ -44,12 +44,12 @@ public final class VisibilityClientImpl { private final VisibilityClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -116,7 +116,7 @@ public VisibilityWritesImpl getVisibilityWrites() { /** * Initializes an instance of VisibilityClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public VisibilityClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -127,7 +127,7 @@ public VisibilityClientImpl(String endpoint) { * Initializes an instance of VisibilityClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public VisibilityClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -138,7 +138,7 @@ public VisibilityClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public VisibilityClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; @@ -162,7 +162,7 @@ public interface VisibilityClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/visibility/read") @@ -171,7 +171,7 @@ Mono> get(@HostParam("endpoint") String endpoint, @HeaderPa @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/visibility/write") @@ -180,7 +180,8 @@ Response getSync(@HostParam("endpoint") String endpoint, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> create(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> create(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData dog, RequestOptions requestOptions, Context context); @Put("/visibility/write") @@ -189,7 +190,8 @@ Mono> create(@HostParam("endpoint") String endpoint, @Heade @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response createSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData dog, RequestOptions requestOptions, Context context); @Post("/visibility/query") @@ -198,7 +200,8 @@ Response createSync(@HostParam("endpoint") String endpoint, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> query(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> query(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData dog, RequestOptions requestOptions, Context context); @Post("/visibility/query") @@ -207,7 +210,8 @@ Mono> query(@HostParam("endpoint") String endpoint, @Header @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response querySync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response querySync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData dog, RequestOptions requestOptions, Context context); @Put("/visibility/roundtrip") @@ -217,8 +221,8 @@ Response querySync(@HostParam("endpoint") String endpoint, @HeaderPa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> roundtrip(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/visibility/roundtrip") @ExpectedResponses({ 200 }) @@ -226,7 +230,8 @@ Mono> roundtrip(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response roundtripSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response roundtripSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -310,9 +315,10 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createWithResponseAsync(BinaryData dog, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.getEndpoint(), accept, dog, requestOptions, context)); + return FluxUtil.withContext( + context -> service.create(this.getEndpoint(), contentType, accept, dog, requestOptions, context)); } /** @@ -345,8 +351,9 @@ public Mono> createWithResponseAsync(BinaryData dog, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createWithResponse(BinaryData dog, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createSync(this.getEndpoint(), accept, dog, requestOptions, Context.NONE); + return service.createSync(this.getEndpoint(), contentType, accept, dog, requestOptions, Context.NONE); } /** @@ -380,8 +387,10 @@ public Response createWithResponse(BinaryData dog, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> queryWithResponseAsync(BinaryData dog, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.query(this.getEndpoint(), accept, dog, requestOptions, context)); + return FluxUtil.withContext( + context -> service.query(this.getEndpoint(), contentType, accept, dog, requestOptions, context)); } /** @@ -415,8 +424,9 @@ public Mono> queryWithResponseAsync(BinaryData dog, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response queryWithResponse(BinaryData dog, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.querySync(this.getEndpoint(), accept, dog, requestOptions, Context.NONE); + return service.querySync(this.getEndpoint(), contentType, accept, dog, requestOptions, Context.NONE); } /** @@ -449,9 +459,10 @@ public Response queryWithResponse(BinaryData dog, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> roundtripWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.roundtrip(this.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.roundtrip(this.getEndpoint(), contentType, accept, body, requestOptions, context)); } /** @@ -484,7 +495,8 @@ public Mono> roundtripWithResponseAsync(BinaryData body, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response roundtripWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.roundtripSync(this.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.roundtripSync(this.getEndpoint(), contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityReadsImpl.java b/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityReadsImpl.java index 1f963da1e5..0cc46f0a42 100644 --- a/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityReadsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityReadsImpl.java @@ -63,7 +63,7 @@ public interface VisibilityReadsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/read") @@ -72,7 +72,7 @@ Mono> get(@HostParam("endpoint") String endpoint, @HeaderPa @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityWritesImpl.java b/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityWritesImpl.java index f9949728ad..19648f316f 100644 --- a/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityWritesImpl.java +++ b/typespec-tests/src/main/java/com/cadl/visibility/implementation/VisibilityWritesImpl.java @@ -64,7 +64,8 @@ public interface VisibilityWritesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> create(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Mono> create(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData dog, RequestOptions requestOptions, Context context); @Put("/write") @@ -73,7 +74,8 @@ Mono> create(@HostParam("endpoint") String endpoint, @Heade @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, + Response createSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData dog, RequestOptions requestOptions, Context context); } @@ -107,9 +109,10 @@ Response createSync(@HostParam("endpoint") String endpoint, @HeaderP */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createWithResponseAsync(BinaryData dog, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), accept, dog, requestOptions, context)); + return FluxUtil.withContext( + context -> service.create(this.client.getEndpoint(), contentType, accept, dog, requestOptions, context)); } /** @@ -142,7 +145,8 @@ public Mono> createWithResponseAsync(BinaryData dog, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createWithResponse(BinaryData dog, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createSync(this.client.getEndpoint(), accept, dog, requestOptions, Context.NONE); + return service.createSync(this.client.getEndpoint(), contentType, accept, dog, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/wiretype/implementation/WireTypeClientImpl.java b/typespec-tests/src/main/java/com/cadl/wiretype/implementation/WireTypeClientImpl.java index f6f76dd425..8a6e2a8d30 100644 --- a/typespec-tests/src/main/java/com/cadl/wiretype/implementation/WireTypeClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/wiretype/implementation/WireTypeClientImpl.java @@ -16,12 +16,12 @@ */ public final class WireTypeClientImpl { /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -74,7 +74,7 @@ public WireTypeOpsImpl getWireTypeOps() { /** * Initializes an instance of WireTypeClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public WireTypeClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -85,7 +85,7 @@ public WireTypeClientImpl(String endpoint) { * Initializes an instance of WireTypeClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public WireTypeClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -96,7 +96,7 @@ public WireTypeClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public WireTypeClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; diff --git a/typespec-tests/src/main/java/com/cadl/wiretype/implementation/WireTypeOpsImpl.java b/typespec-tests/src/main/java/com/cadl/wiretype/implementation/WireTypeOpsImpl.java index ef9a7b989f..2670cb132f 100644 --- a/typespec-tests/src/main/java/com/cadl/wiretype/implementation/WireTypeOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/wiretype/implementation/WireTypeOpsImpl.java @@ -65,8 +65,8 @@ public interface WireTypeOpsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> superClassMismatch(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/wireType/superClassMismatch") @ExpectedResponses({ 200 }) @@ -75,8 +75,8 @@ Mono> superClassMismatch(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response superClassMismatchSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/wireType/subClassMismatch") @ExpectedResponses({ 200 }) @@ -85,8 +85,8 @@ Response superClassMismatchSync(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> subClassMismatch(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/wireType/subClassMismatch") @ExpectedResponses({ 200 }) @@ -95,8 +95,8 @@ Mono> subClassMismatch(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response subClassMismatchSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/wireType/bothClassMismatch") @ExpectedResponses({ 200 }) @@ -105,8 +105,8 @@ Response subClassMismatchSync(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> bothClassMismatch(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/wireType/bothClassMismatch") @ExpectedResponses({ 200 }) @@ -115,8 +115,8 @@ Mono> bothClassMismatch(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response bothClassMismatchSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -150,9 +150,10 @@ Response bothClassMismatchSync(@HostParam("endpoint") String endpoin @ServiceMethod(returns = ReturnType.SINGLE) public Mono> superClassMismatchWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.superClassMismatch(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.superClassMismatch(this.client.getEndpoint(), contentType, + accept, body, requestOptions, context)); } /** @@ -185,8 +186,10 @@ public Mono> superClassMismatchWithResponseAsync(BinaryData */ @ServiceMethod(returns = ReturnType.SINGLE) public Response superClassMismatchWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.superClassMismatchSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.superClassMismatchSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } /** @@ -220,9 +223,10 @@ public Response superClassMismatchWithResponse(BinaryData body, Requ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> subClassMismatchWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.subClassMismatch(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.subClassMismatch(this.client.getEndpoint(), contentType, accept, + body, requestOptions, context)); } /** @@ -255,8 +259,10 @@ public Mono> subClassMismatchWithResponseAsync(BinaryData b */ @ServiceMethod(returns = ReturnType.SINGLE) public Response subClassMismatchWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.subClassMismatchSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.subClassMismatchSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } /** @@ -290,9 +296,10 @@ public Response subClassMismatchWithResponse(BinaryData body, Reques @ServiceMethod(returns = ReturnType.SINGLE) public Mono> bothClassMismatchWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.bothClassMismatch(this.client.getEndpoint(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.bothClassMismatch(this.client.getEndpoint(), contentType, accept, + body, requestOptions, context)); } /** @@ -325,7 +332,9 @@ public Mono> bothClassMismatchWithResponseAsync(BinaryData */ @ServiceMethod(returns = ReturnType.SINGLE) public Response bothClassMismatchWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.bothClassMismatchSync(this.client.getEndpoint(), accept, body, requestOptions, Context.NONE); + return service.bothClassMismatchSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/naming/ClientModelAsyncClient.java b/typespec-tests/src/main/java/com/client/naming/ModelAsyncClient.java similarity index 95% rename from typespec-tests/src/main/java/com/client/naming/ClientModelAsyncClient.java rename to typespec-tests/src/main/java/com/client/naming/ModelAsyncClient.java index ad6a0fe3df..4a780a726b 100644 --- a/typespec-tests/src/main/java/com/client/naming/ClientModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/client/naming/ModelAsyncClient.java @@ -16,7 +16,7 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; -import com.client.naming.implementation.ClientModelsImpl; +import com.client.naming.implementation.ModelsImpl; import com.client.naming.models.ClientModel; import com.client.naming.models.JavaModel; import reactor.core.publisher.Mono; @@ -25,17 +25,17 @@ * Initializes a new instance of the asynchronous NamingClient type. */ @ServiceClient(builder = NamingClientBuilder.class, isAsync = true) -public final class ClientModelAsyncClient { +public final class ModelAsyncClient { @Generated - private final ClientModelsImpl serviceClient; + private final ModelsImpl serviceClient; /** - * Initializes an instance of ClientModelAsyncClient class. + * Initializes an instance of ModelAsyncClient class. * * @param serviceClient the service client implementation. */ @Generated - ClientModelAsyncClient(ClientModelsImpl serviceClient) { + ModelAsyncClient(ModelsImpl serviceClient) { this.serviceClient = serviceClient; } diff --git a/typespec-tests/src/main/java/com/client/naming/ClientModelClient.java b/typespec-tests/src/main/java/com/client/naming/ModelClient.java similarity index 95% rename from typespec-tests/src/main/java/com/client/naming/ClientModelClient.java rename to typespec-tests/src/main/java/com/client/naming/ModelClient.java index 4417a4d8fa..dd1a3e5da0 100644 --- a/typespec-tests/src/main/java/com/client/naming/ClientModelClient.java +++ b/typespec-tests/src/main/java/com/client/naming/ModelClient.java @@ -15,7 +15,7 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; -import com.client.naming.implementation.ClientModelsImpl; +import com.client.naming.implementation.ModelsImpl; import com.client.naming.models.ClientModel; import com.client.naming.models.JavaModel; @@ -23,17 +23,17 @@ * Initializes a new instance of the synchronous NamingClient type. */ @ServiceClient(builder = NamingClientBuilder.class) -public final class ClientModelClient { +public final class ModelClient { @Generated - private final ClientModelsImpl serviceClient; + private final ModelsImpl serviceClient; /** - * Initializes an instance of ClientModelClient class. + * Initializes an instance of ModelClient class. * * @param serviceClient the service client implementation. */ @Generated - ClientModelClient(ClientModelsImpl serviceClient) { + ModelClient(ModelsImpl serviceClient) { this.serviceClient = serviceClient; } diff --git a/typespec-tests/src/main/java/com/client/naming/NamingClientBuilder.java b/typespec-tests/src/main/java/com/client/naming/NamingClientBuilder.java index dfeb2c86c9..3fcf4562d5 100644 --- a/typespec-tests/src/main/java/com/client/naming/NamingClientBuilder.java +++ b/typespec-tests/src/main/java/com/client/naming/NamingClientBuilder.java @@ -42,10 +42,10 @@ @ServiceClientBuilder( serviceClients = { NamingClient.class, - ClientModelClient.class, + ModelClient.class, UnionEnumClient.class, NamingAsyncClient.class, - ClientModelAsyncClient.class, + ModelAsyncClient.class, UnionEnumAsyncClient.class }) public final class NamingClientBuilder implements HttpTrait, ConfigurationTrait { @@ -262,13 +262,13 @@ public NamingAsyncClient buildAsyncClient() { } /** - * Builds an instance of ClientModelAsyncClient class. + * Builds an instance of ModelAsyncClient class. * - * @return an instance of ClientModelAsyncClient. + * @return an instance of ModelAsyncClient. */ @Generated - public ClientModelAsyncClient buildClientModelAsyncClient() { - return new ClientModelAsyncClient(buildInnerClient().getClientModels()); + public ModelAsyncClient buildModelAsyncClient() { + return new ModelAsyncClient(buildInnerClient().getModels()); } /** @@ -292,13 +292,13 @@ public NamingClient buildClient() { } /** - * Builds an instance of ClientModelClient class. + * Builds an instance of ModelClient class. * - * @return an instance of ClientModelClient. + * @return an instance of ModelClient. */ @Generated - public ClientModelClient buildClientModelClient() { - return new ClientModelClient(buildInnerClient().getClientModels()); + public ModelClient buildModelClient() { + return new ModelClient(buildInnerClient().getModels()); } /** diff --git a/typespec-tests/src/main/java/com/client/naming/implementation/ClientModelsImpl.java b/typespec-tests/src/main/java/com/client/naming/implementation/ModelsImpl.java similarity index 83% rename from typespec-tests/src/main/java/com/client/naming/implementation/ClientModelsImpl.java rename to typespec-tests/src/main/java/com/client/naming/implementation/ModelsImpl.java index a1cf0ec689..7ac45d89d1 100644 --- a/typespec-tests/src/main/java/com/client/naming/implementation/ClientModelsImpl.java +++ b/typespec-tests/src/main/java/com/client/naming/implementation/ModelsImpl.java @@ -26,13 +26,13 @@ import reactor.core.publisher.Mono; /** - * An instance of this class provides access to all the operations defined in ClientModels. + * An instance of this class provides access to all the operations defined in Models. */ -public final class ClientModelsImpl { +public final class ModelsImpl { /** * The proxy service used to perform REST calls. */ - private final ClientModelsService service; + private final ModelsService service; /** * The service client containing this operation class. @@ -40,30 +40,29 @@ public final class ClientModelsImpl { private final NamingClientImpl client; /** - * Initializes an instance of ClientModelsImpl. + * Initializes an instance of ModelsImpl. * * @param client the instance of the service client containing this operation class. */ - ClientModelsImpl(NamingClientImpl client) { - this.service - = RestProxy.create(ClientModelsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + ModelsImpl(NamingClientImpl client) { + this.service = RestProxy.create(ModelsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for NamingClientClientModels to be used by the proxy service to perform - * REST calls. + * The interface defining all the services for NamingClientModels to be used by the proxy service to perform REST + * calls. */ @Host("http://localhost:3000") - @ServiceInterface(name = "NamingClientClientMo") - public interface ClientModelsService { + @ServiceInterface(name = "NamingClientModels") + public interface ModelsService { @Post("/client/naming/model/client") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> client(@HeaderParam("accept") String accept, + Mono> client(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/client/naming/model/client") @@ -72,8 +71,8 @@ Mono> client(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response clientSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response clientSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/client/naming/model/language") @ExpectedResponses({ 204 }) @@ -81,7 +80,7 @@ Response clientSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> language(@HeaderParam("accept") String accept, + Mono> language(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/client/naming/model/language") @@ -90,7 +89,7 @@ Mono> language(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response languageSync(@HeaderParam("accept") String accept, + Response languageSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -114,8 +113,8 @@ Response languageSync(@HeaderParam("accept") String accept, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> clientWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.client(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.client(contentType, body, requestOptions, context)); } /** @@ -138,8 +137,8 @@ public Mono> clientWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response clientWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.clientSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.clientSync(contentType, body, requestOptions, Context.NONE); } /** @@ -162,8 +161,8 @@ public Response clientWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> languageWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.language(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.language(contentType, body, requestOptions, context)); } /** @@ -186,7 +185,7 @@ public Mono> languageWithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response languageWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.languageSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.languageSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/naming/implementation/NamingClientImpl.java b/typespec-tests/src/main/java/com/client/naming/implementation/NamingClientImpl.java index b302925913..6a21dc908c 100644 --- a/typespec-tests/src/main/java/com/client/naming/implementation/NamingClientImpl.java +++ b/typespec-tests/src/main/java/com/client/naming/implementation/NamingClientImpl.java @@ -71,17 +71,17 @@ public SerializerAdapter getSerializerAdapter() { } /** - * The ClientModelsImpl object to access its operations. + * The ModelsImpl object to access its operations. */ - private final ClientModelsImpl clientModels; + private final ModelsImpl models; /** - * Gets the ClientModelsImpl object to access its operations. + * Gets the ModelsImpl object to access its operations. * - * @return the ClientModelsImpl object. + * @return the ModelsImpl object. */ - public ClientModelsImpl getClientModels() { - return this.clientModels; + public ModelsImpl getModels() { + return this.models; } /** @@ -124,7 +124,7 @@ public NamingClientImpl(HttpPipeline httpPipeline) { public NamingClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; - this.clientModels = new ClientModelsImpl(this); + this.models = new ModelsImpl(this); this.unionEnums = new UnionEnumsImpl(this); this.service = RestProxy.create(NamingClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -141,8 +141,7 @@ public interface NamingClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> clientName(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> clientName(RequestOptions requestOptions, Context context); @Post("/client/naming/operation") @ExpectedResponses({ 204 }) @@ -150,8 +149,7 @@ Mono> clientName(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response clientNameSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response clientNameSync(RequestOptions requestOptions, Context context); @Post("/client/naming/parameter") @ExpectedResponses({ 204 }) @@ -159,8 +157,8 @@ Response clientNameSync(@HeaderParam("accept") String accept, RequestOptio @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> parameter(@QueryParam("defaultName") String clientName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> parameter(@QueryParam("defaultName") String clientName, RequestOptions requestOptions, + Context context); @Post("/client/naming/parameter") @ExpectedResponses({ 204 }) @@ -168,8 +166,8 @@ Mono> parameter(@QueryParam("defaultName") String clientName, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response parameterSync(@QueryParam("defaultName") String clientName, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response parameterSync(@QueryParam("defaultName") String clientName, RequestOptions requestOptions, + Context context); @Post("/client/naming/property/client") @ExpectedResponses({ 204 }) @@ -177,7 +175,7 @@ Response parameterSync(@QueryParam("defaultName") String clientName, @Head @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> client(@HeaderParam("accept") String accept, + Mono> client(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/client/naming/property/client") @@ -186,8 +184,8 @@ Mono> client(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response clientSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response clientSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/client/naming/property/language") @ExpectedResponses({ 204 }) @@ -195,7 +193,7 @@ Response clientSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> language(@HeaderParam("accept") String accept, + Mono> language(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/client/naming/property/language") @@ -204,7 +202,7 @@ Mono> language(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response languageSync(@HeaderParam("accept") String accept, + Response languageSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/client/naming/property/compatible-with-encoded-name") @@ -213,7 +211,7 @@ Response languageSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> compatibleWithEncodedName(@HeaderParam("accept") String accept, + Mono> compatibleWithEncodedName(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/client/naming/property/compatible-with-encoded-name") @@ -222,7 +220,7 @@ Mono> compatibleWithEncodedName(@HeaderParam("accept") String acc @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response compatibleWithEncodedNameSync(@HeaderParam("accept") String accept, + Response compatibleWithEncodedNameSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/client/naming/header") @@ -231,8 +229,8 @@ Response compatibleWithEncodedNameSync(@HeaderParam("accept") String accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> request(@HeaderParam("default-name") String clientName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> request(@HeaderParam("default-name") String clientName, RequestOptions requestOptions, + Context context); @Post("/client/naming/header") @ExpectedResponses({ 204 }) @@ -240,8 +238,8 @@ Mono> request(@HeaderParam("default-name") String clientName, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requestSync(@HeaderParam("default-name") String clientName, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response requestSync(@HeaderParam("default-name") String clientName, RequestOptions requestOptions, + Context context); @Get("/client/naming/header") @ExpectedResponses({ 204 }) @@ -249,8 +247,7 @@ Response requestSync(@HeaderParam("default-name") String clientName, @Head @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> response(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> response(RequestOptions requestOptions, Context context); @Get("/client/naming/header") @ExpectedResponses({ 204 }) @@ -258,8 +255,7 @@ Mono> response(@HeaderParam("accept") String accept, RequestOptio @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response responseSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response responseSync(RequestOptions requestOptions, Context context); } /** @@ -274,8 +270,7 @@ Response responseSync(@HeaderParam("accept") String accept, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> clientNameWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.clientName(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.clientName(requestOptions, context)); } /** @@ -290,8 +285,7 @@ public Mono> clientNameWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response clientNameWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.clientNameSync(accept, requestOptions, Context.NONE); + return service.clientNameSync(requestOptions, Context.NONE); } /** @@ -307,8 +301,7 @@ public Response clientNameWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> parameterWithResponseAsync(String clientName, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.parameter(clientName, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.parameter(clientName, requestOptions, context)); } /** @@ -324,8 +317,7 @@ public Mono> parameterWithResponseAsync(String clientName, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response parameterWithResponse(String clientName, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.parameterSync(clientName, accept, requestOptions, Context.NONE); + return service.parameterSync(clientName, requestOptions, Context.NONE); } /** @@ -348,8 +340,8 @@ public Response parameterWithResponse(String clientName, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> clientWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.client(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.client(contentType, body, requestOptions, context)); } /** @@ -372,8 +364,8 @@ public Mono> clientWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response clientWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.clientSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.clientSync(contentType, body, requestOptions, Context.NONE); } /** @@ -396,8 +388,8 @@ public Response clientWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> languageWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.language(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.language(contentType, body, requestOptions, context)); } /** @@ -420,8 +412,8 @@ public Mono> languageWithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response languageWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.languageSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.languageSync(contentType, body, requestOptions, Context.NONE); } /** @@ -445,9 +437,9 @@ public Response languageWithResponse(BinaryData body, RequestOptions reque @ServiceMethod(returns = ReturnType.SINGLE) public Mono> compatibleWithEncodedNameWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil - .withContext(context -> service.compatibleWithEncodedName(accept, body, requestOptions, context)); + .withContext(context -> service.compatibleWithEncodedName(contentType, body, requestOptions, context)); } /** @@ -470,8 +462,8 @@ public Mono> compatibleWithEncodedNameWithResponseAsync(BinaryDat */ @ServiceMethod(returns = ReturnType.SINGLE) public Response compatibleWithEncodedNameWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.compatibleWithEncodedNameSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.compatibleWithEncodedNameSync(contentType, body, requestOptions, Context.NONE); } /** @@ -487,8 +479,7 @@ public Response compatibleWithEncodedNameWithResponse(BinaryData body, Req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> requestWithResponseAsync(String clientName, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.request(clientName, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.request(clientName, requestOptions, context)); } /** @@ -504,8 +495,7 @@ public Mono> requestWithResponseAsync(String clientName, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response requestWithResponse(String clientName, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.requestSync(clientName, accept, requestOptions, Context.NONE); + return service.requestSync(clientName, requestOptions, Context.NONE); } /** @@ -520,8 +510,7 @@ public Response requestWithResponse(String clientName, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.response(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.response(requestOptions, context)); } /** @@ -536,7 +525,6 @@ public Mono> responseWithResponseAsync(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response responseWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.responseSync(accept, requestOptions, Context.NONE); + return service.responseSync(requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/naming/implementation/UnionEnumsImpl.java b/typespec-tests/src/main/java/com/client/naming/implementation/UnionEnumsImpl.java index 5e4fab48e7..b7ff363129 100644 --- a/typespec-tests/src/main/java/com/client/naming/implementation/UnionEnumsImpl.java +++ b/typespec-tests/src/main/java/com/client/naming/implementation/UnionEnumsImpl.java @@ -63,7 +63,7 @@ public interface UnionEnumsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unionEnumName(@HeaderParam("accept") String accept, + Mono> unionEnumName(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/client/naming/union-enum/union-enum-name") @@ -72,7 +72,7 @@ Mono> unionEnumName(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unionEnumNameSync(@HeaderParam("accept") String accept, + Response unionEnumNameSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/client/naming/union-enum/union-enum-member-name") @@ -81,7 +81,7 @@ Response unionEnumNameSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unionEnumMemberName(@HeaderParam("accept") String accept, + Mono> unionEnumMemberName(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/client/naming/union-enum/union-enum-member-name") @@ -90,7 +90,7 @@ Mono> unionEnumMemberName(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unionEnumMemberNameSync(@HeaderParam("accept") String accept, + Response unionEnumMemberNameSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -112,8 +112,8 @@ Response unionEnumMemberNameSync(@HeaderParam("accept") String accept, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unionEnumNameWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.unionEnumName(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.unionEnumName(contentType, body, requestOptions, context)); } /** @@ -134,8 +134,8 @@ public Mono> unionEnumNameWithResponseAsync(BinaryData body, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response unionEnumNameWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.unionEnumNameSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.unionEnumNameSync(contentType, body, requestOptions, Context.NONE); } /** @@ -156,8 +156,8 @@ public Response unionEnumNameWithResponse(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unionEnumMemberNameWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.unionEnumMemberName(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.unionEnumMemberName(contentType, body, requestOptions, context)); } /** @@ -178,7 +178,7 @@ public Mono> unionEnumMemberNameWithResponseAsync(BinaryData body */ @ServiceMethod(returns = ReturnType.SINGLE) public Response unionEnumMemberNameWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.unionEnumMemberNameSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.unionEnumMemberNameSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/bytes/implementation/HeadersImpl.java b/typespec-tests/src/main/java/com/encode/bytes/implementation/HeadersImpl.java index ade2fdb28e..6ff5c712a4 100644 --- a/typespec-tests/src/main/java/com/encode/bytes/implementation/HeadersImpl.java +++ b/typespec-tests/src/main/java/com/encode/bytes/implementation/HeadersImpl.java @@ -66,8 +66,8 @@ public interface HeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> defaultMethod(@HeaderParam("value") String value, RequestOptions requestOptions, + Context context); @Get("/encode/bytes/header/default") @ExpectedResponses({ 204 }) @@ -75,8 +75,8 @@ Mono> defaultMethod(@HeaderParam("value") String value, @HeaderPa @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response defaultMethodSync(@HeaderParam("value") String value, RequestOptions requestOptions, + Context context); @Get("/encode/bytes/header/base64") @ExpectedResponses({ 204 }) @@ -84,8 +84,7 @@ Response defaultMethodSync(@HeaderParam("value") String value, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64(@HeaderParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> base64(@HeaderParam("value") String value, RequestOptions requestOptions, Context context); @Get("/encode/bytes/header/base64") @ExpectedResponses({ 204 }) @@ -93,8 +92,7 @@ Mono> base64(@HeaderParam("value") String value, @HeaderParam("ac @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64Sync(@HeaderParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response base64Sync(@HeaderParam("value") String value, RequestOptions requestOptions, Context context); @Get("/encode/bytes/header/base64url") @ExpectedResponses({ 204 }) @@ -102,8 +100,8 @@ Response base64Sync(@HeaderParam("value") String value, @HeaderParam("acce @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64url(@HeaderParam("value") Base64Url value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> base64url(@HeaderParam("value") Base64Url value, RequestOptions requestOptions, + Context context); @Get("/encode/bytes/header/base64url") @ExpectedResponses({ 204 }) @@ -111,8 +109,8 @@ Mono> base64url(@HeaderParam("value") Base64Url value, @HeaderPar @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlSync(@HeaderParam("value") Base64Url value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response base64urlSync(@HeaderParam("value") Base64Url value, RequestOptions requestOptions, + Context context); @Get("/encode/bytes/header/base64url-array") @ExpectedResponses({ 204 }) @@ -120,8 +118,8 @@ Response base64urlSync(@HeaderParam("value") Base64Url value, @HeaderParam @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64urlArray(@HeaderParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> base64urlArray(@HeaderParam("value") String value, RequestOptions requestOptions, + Context context); @Get("/encode/bytes/header/base64url-array") @ExpectedResponses({ 204 }) @@ -129,8 +127,8 @@ Mono> base64urlArray(@HeaderParam("value") String value, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlArraySync(@HeaderParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response base64urlArraySync(@HeaderParam("value") String value, RequestOptions requestOptions, + Context context); } /** @@ -146,9 +144,8 @@ Response base64urlArraySync(@HeaderParam("value") String value, @HeaderPar */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(byte[] value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = Base64Util.encodeToString(value); - return FluxUtil.withContext(context -> service.defaultMethod(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.defaultMethod(valueConverted, requestOptions, context)); } /** @@ -164,9 +161,8 @@ public Mono> defaultMethodWithResponseAsync(byte[] value, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(byte[] value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = Base64Util.encodeToString(value); - return service.defaultMethodSync(valueConverted, accept, requestOptions, Context.NONE); + return service.defaultMethodSync(valueConverted, requestOptions, Context.NONE); } /** @@ -182,9 +178,8 @@ public Response defaultMethodWithResponse(byte[] value, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64WithResponseAsync(byte[] value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = Base64Util.encodeToString(value); - return FluxUtil.withContext(context -> service.base64(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64(valueConverted, requestOptions, context)); } /** @@ -200,9 +195,8 @@ public Mono> base64WithResponseAsync(byte[] value, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64WithResponse(byte[] value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = Base64Util.encodeToString(value); - return service.base64Sync(valueConverted, accept, requestOptions, Context.NONE); + return service.base64Sync(valueConverted, requestOptions, Context.NONE); } /** @@ -218,9 +212,8 @@ public Response base64WithResponse(byte[] value, RequestOptions requestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64urlWithResponseAsync(byte[] value, RequestOptions requestOptions) { - final String accept = "application/json"; Base64Url valueConverted = Base64Url.encode(value); - return FluxUtil.withContext(context -> service.base64url(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64url(valueConverted, requestOptions, context)); } /** @@ -236,9 +229,8 @@ public Mono> base64urlWithResponseAsync(byte[] value, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64urlWithResponse(byte[] value, RequestOptions requestOptions) { - final String accept = "application/json"; Base64Url valueConverted = Base64Url.encode(value); - return service.base64urlSync(valueConverted, accept, requestOptions, Context.NONE); + return service.base64urlSync(valueConverted, requestOptions, Context.NONE); } /** @@ -254,12 +246,11 @@ public Response base64urlWithResponse(byte[] value, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64urlArrayWithResponseAsync(List value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( value.stream().map(paramItemValue -> Base64Url.encode(paramItemValue)).collect(Collectors.toList()), CollectionFormat.CSV); - return FluxUtil.withContext(context -> service.base64urlArray(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64urlArray(valueConverted, requestOptions, context)); } /** @@ -275,11 +266,10 @@ public Mono> base64urlArrayWithResponseAsync(List value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64urlArrayWithResponse(List value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( value.stream().map(paramItemValue -> Base64Url.encode(paramItemValue)).collect(Collectors.toList()), CollectionFormat.CSV); - return service.base64urlArraySync(valueConverted, accept, requestOptions, Context.NONE); + return service.base64urlArraySync(valueConverted, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/bytes/implementation/PropertiesImpl.java b/typespec-tests/src/main/java/com/encode/bytes/implementation/PropertiesImpl.java index bbf7991a31..fadb0b0f01 100644 --- a/typespec-tests/src/main/java/com/encode/bytes/implementation/PropertiesImpl.java +++ b/typespec-tests/src/main/java/com/encode/bytes/implementation/PropertiesImpl.java @@ -63,8 +63,9 @@ public interface PropertiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> defaultMethod(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/default") @ExpectedResponses({ 200 }) @@ -72,8 +73,9 @@ Mono> defaultMethod(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response defaultMethodSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/base64") @ExpectedResponses({ 200 }) @@ -81,8 +83,9 @@ Response defaultMethodSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> base64(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/base64") @ExpectedResponses({ 200 }) @@ -90,8 +93,9 @@ Mono> base64(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64Sync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response base64Sync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/base64url") @ExpectedResponses({ 200 }) @@ -99,8 +103,9 @@ Response base64Sync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64url(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> base64url(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/base64url") @ExpectedResponses({ 200 }) @@ -108,8 +113,9 @@ Mono> base64url(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response base64urlSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/base64url-array") @ExpectedResponses({ 200 }) @@ -117,8 +123,9 @@ Response base64urlSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64urlArray(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> base64urlArray(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/base64url-array") @ExpectedResponses({ 200 }) @@ -126,8 +133,9 @@ Mono> base64urlArray(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlArraySync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response base64urlArraySync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -158,8 +166,10 @@ Response base64urlArraySync(@HeaderParam("accept") String accept, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.defaultMethod(accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.defaultMethod(contentType, accept, body, requestOptions, context)); } /** @@ -190,8 +200,9 @@ public Mono> defaultMethodWithResponseAsync(BinaryData body */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.defaultMethodSync(accept, body, requestOptions, Context.NONE); + return service.defaultMethodSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -222,8 +233,9 @@ public Response defaultMethodWithResponse(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64WithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.base64(accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64(contentType, accept, body, requestOptions, context)); } /** @@ -254,8 +266,9 @@ public Mono> base64WithResponseAsync(BinaryData body, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64WithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.base64Sync(accept, body, requestOptions, Context.NONE); + return service.base64Sync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -286,8 +299,9 @@ public Response base64WithResponse(BinaryData body, RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64urlWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.base64url(accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64url(contentType, accept, body, requestOptions, context)); } /** @@ -318,8 +332,9 @@ public Mono> base64urlWithResponseAsync(BinaryData body, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64urlWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.base64urlSync(accept, body, requestOptions, Context.NONE); + return service.base64urlSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -354,8 +369,10 @@ public Response base64urlWithResponse(BinaryData body, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64urlArrayWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.base64urlArray(accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.base64urlArray(contentType, accept, body, requestOptions, context)); } /** @@ -390,7 +407,8 @@ public Mono> base64urlArrayWithResponseAsync(BinaryData bod */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64urlArrayWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.base64urlArraySync(accept, body, requestOptions, Context.NONE); + return service.base64urlArraySync(contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/bytes/implementation/QueriesImpl.java b/typespec-tests/src/main/java/com/encode/bytes/implementation/QueriesImpl.java index a902ff21d0..176ea4989f 100644 --- a/typespec-tests/src/main/java/com/encode/bytes/implementation/QueriesImpl.java +++ b/typespec-tests/src/main/java/com/encode/bytes/implementation/QueriesImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -67,8 +66,8 @@ public interface QueriesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@QueryParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> defaultMethod(@QueryParam("value") String value, RequestOptions requestOptions, + Context context); @Get("/encode/bytes/query/default") @ExpectedResponses({ 204 }) @@ -76,8 +75,8 @@ Mono> defaultMethod(@QueryParam("value") String value, @HeaderPar @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@QueryParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response defaultMethodSync(@QueryParam("value") String value, RequestOptions requestOptions, + Context context); @Get("/encode/bytes/query/base64") @ExpectedResponses({ 204 }) @@ -85,8 +84,7 @@ Response defaultMethodSync(@QueryParam("value") String value, @HeaderParam @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64(@QueryParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> base64(@QueryParam("value") String value, RequestOptions requestOptions, Context context); @Get("/encode/bytes/query/base64") @ExpectedResponses({ 204 }) @@ -94,8 +92,7 @@ Mono> base64(@QueryParam("value") String value, @HeaderParam("acc @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64Sync(@QueryParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response base64Sync(@QueryParam("value") String value, RequestOptions requestOptions, Context context); @Get("/encode/bytes/query/base64url") @ExpectedResponses({ 204 }) @@ -103,8 +100,8 @@ Response base64Sync(@QueryParam("value") String value, @HeaderParam("accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64url(@QueryParam("value") Base64Url value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> base64url(@QueryParam("value") Base64Url value, RequestOptions requestOptions, + Context context); @Get("/encode/bytes/query/base64url") @ExpectedResponses({ 204 }) @@ -112,8 +109,8 @@ Mono> base64url(@QueryParam("value") Base64Url value, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlSync(@QueryParam("value") Base64Url value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response base64urlSync(@QueryParam("value") Base64Url value, RequestOptions requestOptions, + Context context); @Get("/encode/bytes/query/base64url-array") @ExpectedResponses({ 204 }) @@ -121,8 +118,8 @@ Response base64urlSync(@QueryParam("value") Base64Url value, @HeaderParam( @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64urlArray(@QueryParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> base64urlArray(@QueryParam("value") String value, RequestOptions requestOptions, + Context context); @Get("/encode/bytes/query/base64url-array") @ExpectedResponses({ 204 }) @@ -130,8 +127,8 @@ Mono> base64urlArray(@QueryParam("value") String value, @HeaderPa @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlArraySync(@QueryParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response base64urlArraySync(@QueryParam("value") String value, RequestOptions requestOptions, + Context context); } /** @@ -147,9 +144,8 @@ Response base64urlArraySync(@QueryParam("value") String value, @HeaderPara */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(byte[] value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = Base64Util.encodeToString(value); - return FluxUtil.withContext(context -> service.defaultMethod(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.defaultMethod(valueConverted, requestOptions, context)); } /** @@ -165,9 +161,8 @@ public Mono> defaultMethodWithResponseAsync(byte[] value, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(byte[] value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = Base64Util.encodeToString(value); - return service.defaultMethodSync(valueConverted, accept, requestOptions, Context.NONE); + return service.defaultMethodSync(valueConverted, requestOptions, Context.NONE); } /** @@ -183,9 +178,8 @@ public Response defaultMethodWithResponse(byte[] value, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64WithResponseAsync(byte[] value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = Base64Util.encodeToString(value); - return FluxUtil.withContext(context -> service.base64(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64(valueConverted, requestOptions, context)); } /** @@ -201,9 +195,8 @@ public Mono> base64WithResponseAsync(byte[] value, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64WithResponse(byte[] value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = Base64Util.encodeToString(value); - return service.base64Sync(valueConverted, accept, requestOptions, Context.NONE); + return service.base64Sync(valueConverted, requestOptions, Context.NONE); } /** @@ -219,9 +212,8 @@ public Response base64WithResponse(byte[] value, RequestOptions requestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64urlWithResponseAsync(byte[] value, RequestOptions requestOptions) { - final String accept = "application/json"; Base64Url valueConverted = Base64Url.encode(value); - return FluxUtil.withContext(context -> service.base64url(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64url(valueConverted, requestOptions, context)); } /** @@ -237,9 +229,8 @@ public Mono> base64urlWithResponseAsync(byte[] value, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64urlWithResponse(byte[] value, RequestOptions requestOptions) { - final String accept = "application/json"; Base64Url valueConverted = Base64Url.encode(value); - return service.base64urlSync(valueConverted, accept, requestOptions, Context.NONE); + return service.base64urlSync(valueConverted, requestOptions, Context.NONE); } /** @@ -255,12 +246,11 @@ public Response base64urlWithResponse(byte[] value, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64urlArrayWithResponseAsync(List value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( value.stream().map(paramItemValue -> Base64Url.encode(paramItemValue)).collect(Collectors.toList()), CollectionFormat.CSV); - return FluxUtil.withContext(context -> service.base64urlArray(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64urlArray(valueConverted, requestOptions, context)); } /** @@ -276,11 +266,10 @@ public Mono> base64urlArrayWithResponseAsync(List value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64urlArrayWithResponse(List value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( value.stream().map(paramItemValue -> Base64Url.encode(paramItemValue)).collect(Collectors.toList()), CollectionFormat.CSV); - return service.base64urlArraySync(valueConverted, accept, requestOptions, Context.NONE); + return service.base64urlArraySync(valueConverted, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/bytes/implementation/RequestBodiesImpl.java b/typespec-tests/src/main/java/com/encode/bytes/implementation/RequestBodiesImpl.java index 257247ebad..0d8c967708 100644 --- a/typespec-tests/src/main/java/com/encode/bytes/implementation/RequestBodiesImpl.java +++ b/typespec-tests/src/main/java/com/encode/bytes/implementation/RequestBodiesImpl.java @@ -63,7 +63,7 @@ public interface RequestBodiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("accept") String accept, + Mono> defaultMethod(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/default") @@ -72,7 +72,7 @@ Mono> defaultMethod(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("accept") String accept, + Response defaultMethodSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/octet-stream") @@ -82,8 +82,7 @@ Response defaultMethodSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> octetStream(@HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/octet-stream") BinaryData value, - RequestOptions requestOptions, Context context); + @BodyParam("application/octet-stream") BinaryData value, RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/octet-stream") @ExpectedResponses({ 204 }) @@ -92,8 +91,7 @@ Mono> octetStream(@HeaderParam("content-type") String contentType @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response octetStreamSync(@HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/octet-stream") BinaryData value, - RequestOptions requestOptions, Context context); + @BodyParam("application/octet-stream") BinaryData value, RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/custom-content-type") @ExpectedResponses({ 204 }) @@ -102,8 +100,7 @@ Response octetStreamSync(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> customContentType(@HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("image/png") BinaryData value, - RequestOptions requestOptions, Context context); + @BodyParam("image/png") BinaryData value, RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/custom-content-type") @ExpectedResponses({ 204 }) @@ -112,8 +109,7 @@ Mono> customContentType(@HeaderParam("content-type") String conte @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response customContentTypeSync(@HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("image/png") BinaryData value, - RequestOptions requestOptions, Context context); + @BodyParam("image/png") BinaryData value, RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/base64") @ExpectedResponses({ 204 }) @@ -121,7 +117,7 @@ Response customContentTypeSync(@HeaderParam("content-type") String content @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64(@HeaderParam("accept") String accept, + Mono> base64(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/base64") @@ -130,8 +126,8 @@ Mono> base64(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64Sync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData value, - RequestOptions requestOptions, Context context); + Response base64Sync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/base64url") @ExpectedResponses({ 204 }) @@ -139,7 +135,7 @@ Response base64Sync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64url(@HeaderParam("accept") String accept, + Mono> base64url(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/base64url") @@ -148,7 +144,7 @@ Mono> base64url(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlSync(@HeaderParam("accept") String accept, + Response base64urlSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); } @@ -170,8 +166,8 @@ Response base64urlSync(@HeaderParam("accept") String accept, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(BinaryData value, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.defaultMethod(accept, value, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.defaultMethod(contentType, value, requestOptions, context)); } /** @@ -192,8 +188,8 @@ public Mono> defaultMethodWithResponseAsync(BinaryData value, Req */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(BinaryData value, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.defaultMethodSync(accept, value, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.defaultMethodSync(contentType, value, requestOptions, Context.NONE); } /** @@ -215,9 +211,7 @@ public Response defaultMethodWithResponse(BinaryData value, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> octetStreamWithResponseAsync(BinaryData value, RequestOptions requestOptions) { final String contentType = "application/octet-stream"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.octetStream(contentType, accept, value, requestOptions, context)); + return FluxUtil.withContext(context -> service.octetStream(contentType, value, requestOptions, context)); } /** @@ -239,8 +233,7 @@ public Mono> octetStreamWithResponseAsync(BinaryData value, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response octetStreamWithResponse(BinaryData value, RequestOptions requestOptions) { final String contentType = "application/octet-stream"; - final String accept = "application/json"; - return service.octetStreamSync(contentType, accept, value, requestOptions, Context.NONE); + return service.octetStreamSync(contentType, value, requestOptions, Context.NONE); } /** @@ -262,9 +255,7 @@ public Response octetStreamWithResponse(BinaryData value, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> customContentTypeWithResponseAsync(BinaryData value, RequestOptions requestOptions) { final String contentType = "image/png"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.customContentType(contentType, accept, value, requestOptions, context)); + return FluxUtil.withContext(context -> service.customContentType(contentType, value, requestOptions, context)); } /** @@ -286,8 +277,7 @@ public Mono> customContentTypeWithResponseAsync(BinaryData value, @ServiceMethod(returns = ReturnType.SINGLE) public Response customContentTypeWithResponse(BinaryData value, RequestOptions requestOptions) { final String contentType = "image/png"; - final String accept = "application/json"; - return service.customContentTypeSync(contentType, accept, value, requestOptions, Context.NONE); + return service.customContentTypeSync(contentType, value, requestOptions, Context.NONE); } /** @@ -308,8 +298,8 @@ public Response customContentTypeWithResponse(BinaryData value, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64WithResponseAsync(BinaryData value, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.base64(accept, value, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.base64(contentType, value, requestOptions, context)); } /** @@ -330,8 +320,8 @@ public Mono> base64WithResponseAsync(BinaryData value, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64WithResponse(BinaryData value, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.base64Sync(accept, value, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.base64Sync(contentType, value, requestOptions, Context.NONE); } /** @@ -352,8 +342,8 @@ public Response base64WithResponse(BinaryData value, RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64urlWithResponseAsync(BinaryData value, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.base64url(accept, value, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.base64url(contentType, value, requestOptions, context)); } /** @@ -374,7 +364,7 @@ public Mono> base64urlWithResponseAsync(BinaryData value, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64urlWithResponse(BinaryData value, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.base64urlSync(accept, value, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.base64urlSync(contentType, value, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/bytes/implementation/ResponseBodiesImpl.java b/typespec-tests/src/main/java/com/encode/bytes/implementation/ResponseBodiesImpl.java index 771602d9f8..7aa9f06c83 100644 --- a/typespec-tests/src/main/java/com/encode/bytes/implementation/ResponseBodiesImpl.java +++ b/typespec-tests/src/main/java/com/encode/bytes/implementation/ResponseBodiesImpl.java @@ -62,7 +62,7 @@ public interface ResponseBodiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> defaultMethod(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/default") @@ -71,7 +71,7 @@ Mono> defaultMethod(@HeaderParam("accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response defaultMethodSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/octet-stream") @@ -80,7 +80,7 @@ Response defaultMethodSync(@HeaderParam("accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> octetStream(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> octetStream(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/octet-stream") @@ -89,7 +89,7 @@ Mono> octetStream(@HeaderParam("accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response octetStreamSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response octetStreamSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/custom-content-type") @@ -98,7 +98,7 @@ Response octetStreamSync(@HeaderParam("accept") String accept, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> customContentType(@HeaderParam("accept") String accept, + Mono> customContentType(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/custom-content-type") @@ -107,7 +107,7 @@ Mono> customContentType(@HeaderParam("accept") String accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response customContentTypeSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response customContentTypeSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/base64") @@ -116,7 +116,7 @@ Response customContentTypeSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> base64(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/base64") @@ -125,7 +125,7 @@ Mono> base64(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64Sync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response base64Sync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/base64url") @@ -134,7 +134,7 @@ Response base64Sync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64url(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> base64url(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/base64url") @@ -143,7 +143,7 @@ Mono> base64url(@HeaderParam("accept") String accept, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response base64urlSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } diff --git a/typespec-tests/src/main/java/com/encode/datetime/implementation/HeadersImpl.java b/typespec-tests/src/main/java/com/encode/datetime/implementation/HeadersImpl.java index 1df2acf9e8..a28340f48f 100644 --- a/typespec-tests/src/main/java/com/encode/datetime/implementation/HeadersImpl.java +++ b/typespec-tests/src/main/java/com/encode/datetime/implementation/HeadersImpl.java @@ -66,8 +66,8 @@ public interface HeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("value") DateTimeRfc1123 value, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> defaultMethod(@HeaderParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/header/default") @ExpectedResponses({ 204 }) @@ -75,8 +75,8 @@ Mono> defaultMethod(@HeaderParam("value") DateTimeRfc1123 value, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("value") DateTimeRfc1123 value, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response defaultMethodSync(@HeaderParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/header/rfc3339") @ExpectedResponses({ 204 }) @@ -84,8 +84,8 @@ Response defaultMethodSync(@HeaderParam("value") DateTimeRfc1123 value, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc3339(@HeaderParam("value") OffsetDateTime value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> rfc3339(@HeaderParam("value") OffsetDateTime value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/header/rfc3339") @ExpectedResponses({ 204 }) @@ -93,8 +93,8 @@ Mono> rfc3339(@HeaderParam("value") OffsetDateTime value, @Header @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc3339Sync(@HeaderParam("value") OffsetDateTime value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response rfc3339Sync(@HeaderParam("value") OffsetDateTime value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/header/rfc7231") @ExpectedResponses({ 204 }) @@ -102,8 +102,8 @@ Response rfc3339Sync(@HeaderParam("value") OffsetDateTime value, @HeaderPa @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc7231(@HeaderParam("value") DateTimeRfc1123 value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> rfc7231(@HeaderParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/header/rfc7231") @ExpectedResponses({ 204 }) @@ -111,8 +111,8 @@ Mono> rfc7231(@HeaderParam("value") DateTimeRfc1123 value, @Heade @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc7231Sync(@HeaderParam("value") DateTimeRfc1123 value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response rfc7231Sync(@HeaderParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/header/unix-timestamp") @ExpectedResponses({ 204 }) @@ -120,8 +120,8 @@ Response rfc7231Sync(@HeaderParam("value") DateTimeRfc1123 value, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestamp(@HeaderParam("value") long value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> unixTimestamp(@HeaderParam("value") long value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/header/unix-timestamp") @ExpectedResponses({ 204 }) @@ -129,8 +129,8 @@ Mono> unixTimestamp(@HeaderParam("value") long value, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampSync(@HeaderParam("value") long value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response unixTimestampSync(@HeaderParam("value") long value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/header/unix-timestamp-array") @ExpectedResponses({ 204 }) @@ -138,8 +138,8 @@ Response unixTimestampSync(@HeaderParam("value") long value, @HeaderParam( @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestampArray(@HeaderParam("value") String value, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> unixTimestampArray(@HeaderParam("value") String value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/header/unix-timestamp-array") @ExpectedResponses({ 204 }) @@ -147,8 +147,8 @@ Mono> unixTimestampArray(@HeaderParam("value") String value, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampArraySync(@HeaderParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response unixTimestampArraySync(@HeaderParam("value") String value, RequestOptions requestOptions, + Context context); } /** @@ -164,9 +164,8 @@ Response unixTimestampArraySync(@HeaderParam("value") String value, @Heade */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; DateTimeRfc1123 valueConverted = new DateTimeRfc1123(value); - return FluxUtil.withContext(context -> service.defaultMethod(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.defaultMethod(valueConverted, requestOptions, context)); } /** @@ -182,9 +181,8 @@ public Mono> defaultMethodWithResponseAsync(OffsetDateTime value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; DateTimeRfc1123 valueConverted = new DateTimeRfc1123(value); - return service.defaultMethodSync(valueConverted, accept, requestOptions, Context.NONE); + return service.defaultMethodSync(valueConverted, requestOptions, Context.NONE); } /** @@ -200,8 +198,7 @@ public Response defaultMethodWithResponse(OffsetDateTime value, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc3339WithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.rfc3339(value, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.rfc3339(value, requestOptions, context)); } /** @@ -217,8 +214,7 @@ public Mono> rfc3339WithResponseAsync(OffsetDateTime value, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc3339WithResponse(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.rfc3339Sync(value, accept, requestOptions, Context.NONE); + return service.rfc3339Sync(value, requestOptions, Context.NONE); } /** @@ -234,9 +230,8 @@ public Response rfc3339WithResponse(OffsetDateTime value, RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc7231WithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; DateTimeRfc1123 valueConverted = new DateTimeRfc1123(value); - return FluxUtil.withContext(context -> service.rfc7231(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.rfc7231(valueConverted, requestOptions, context)); } /** @@ -252,9 +247,8 @@ public Mono> rfc7231WithResponseAsync(OffsetDateTime value, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc7231WithResponse(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; DateTimeRfc1123 valueConverted = new DateTimeRfc1123(value); - return service.rfc7231Sync(valueConverted, accept, requestOptions, Context.NONE); + return service.rfc7231Sync(valueConverted, requestOptions, Context.NONE); } /** @@ -270,9 +264,8 @@ public Response rfc7231WithResponse(OffsetDateTime value, RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unixTimestampWithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; long valueConverted = value.toEpochSecond(); - return FluxUtil.withContext(context -> service.unixTimestamp(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.unixTimestamp(valueConverted, requestOptions, context)); } /** @@ -288,9 +281,8 @@ public Mono> unixTimestampWithResponseAsync(OffsetDateTime value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response unixTimestampWithResponse(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; long valueConverted = value.toEpochSecond(); - return service.unixTimestampSync(valueConverted, accept, requestOptions, Context.NONE); + return service.unixTimestampSync(valueConverted, requestOptions, Context.NONE); } /** @@ -307,13 +299,11 @@ public Response unixTimestampWithResponse(OffsetDateTime value, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unixTimestampArrayWithResponseAsync(List value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( value.stream().map(paramItemValue -> paramItemValue.toEpochSecond()).collect(Collectors.toList()), CollectionFormat.CSV); - return FluxUtil - .withContext(context -> service.unixTimestampArray(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.unixTimestampArray(valueConverted, requestOptions, context)); } /** @@ -329,11 +319,10 @@ public Mono> unixTimestampArrayWithResponseAsync(List unixTimestampArrayWithResponse(List value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( value.stream().map(paramItemValue -> paramItemValue.toEpochSecond()).collect(Collectors.toList()), CollectionFormat.CSV); - return service.unixTimestampArraySync(valueConverted, accept, requestOptions, Context.NONE); + return service.unixTimestampArraySync(valueConverted, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/datetime/implementation/PropertiesImpl.java b/typespec-tests/src/main/java/com/encode/datetime/implementation/PropertiesImpl.java index 6fed967c47..7b1be1ade9 100644 --- a/typespec-tests/src/main/java/com/encode/datetime/implementation/PropertiesImpl.java +++ b/typespec-tests/src/main/java/com/encode/datetime/implementation/PropertiesImpl.java @@ -63,8 +63,9 @@ public interface PropertiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> defaultMethod(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/default") @ExpectedResponses({ 200 }) @@ -72,8 +73,9 @@ Mono> defaultMethod(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response defaultMethodSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/rfc3339") @ExpectedResponses({ 200 }) @@ -81,8 +83,9 @@ Response defaultMethodSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc3339(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> rfc3339(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/rfc3339") @ExpectedResponses({ 200 }) @@ -90,8 +93,9 @@ Mono> rfc3339(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc3339Sync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response rfc3339Sync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/rfc7231") @ExpectedResponses({ 200 }) @@ -99,8 +103,9 @@ Response rfc3339Sync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc7231(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> rfc7231(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/rfc7231") @ExpectedResponses({ 200 }) @@ -108,8 +113,9 @@ Mono> rfc7231(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc7231Sync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response rfc7231Sync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/unix-timestamp") @ExpectedResponses({ 200 }) @@ -117,8 +123,9 @@ Response rfc7231Sync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestamp(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> unixTimestamp(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/unix-timestamp") @ExpectedResponses({ 200 }) @@ -126,8 +133,9 @@ Mono> unixTimestamp(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response unixTimestampSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/unix-timestamp-array") @ExpectedResponses({ 200 }) @@ -135,8 +143,9 @@ Response unixTimestampSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestampArray(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> unixTimestampArray(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/unix-timestamp-array") @ExpectedResponses({ 200 }) @@ -144,8 +153,9 @@ Mono> unixTimestampArray(@HeaderParam("accept") String acce @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampArraySync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response unixTimestampArraySync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -176,8 +186,10 @@ Response unixTimestampArraySync(@HeaderParam("accept") String accept */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.defaultMethod(accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.defaultMethod(contentType, accept, body, requestOptions, context)); } /** @@ -208,8 +220,9 @@ public Mono> defaultMethodWithResponseAsync(BinaryData body */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.defaultMethodSync(accept, body, requestOptions, Context.NONE); + return service.defaultMethodSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -240,8 +253,9 @@ public Response defaultMethodWithResponse(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc3339WithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.rfc3339(accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.rfc3339(contentType, accept, body, requestOptions, context)); } /** @@ -272,8 +286,9 @@ public Mono> rfc3339WithResponseAsync(BinaryData body, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc3339WithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.rfc3339Sync(accept, body, requestOptions, Context.NONE); + return service.rfc3339Sync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -304,8 +319,9 @@ public Response rfc3339WithResponse(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc7231WithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.rfc7231(accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.rfc7231(contentType, accept, body, requestOptions, context)); } /** @@ -336,8 +352,9 @@ public Mono> rfc7231WithResponseAsync(BinaryData body, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc7231WithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.rfc7231Sync(accept, body, requestOptions, Context.NONE); + return service.rfc7231Sync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -368,8 +385,10 @@ public Response rfc7231WithResponse(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unixTimestampWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.unixTimestamp(accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.unixTimestamp(contentType, accept, body, requestOptions, context)); } /** @@ -400,8 +419,9 @@ public Mono> unixTimestampWithResponseAsync(BinaryData body */ @ServiceMethod(returns = ReturnType.SINGLE) public Response unixTimestampWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.unixTimestampSync(accept, body, requestOptions, Context.NONE); + return service.unixTimestampSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -437,8 +457,10 @@ public Response unixTimestampWithResponse(BinaryData body, RequestOp @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unixTimestampArrayWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.unixTimestampArray(accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.unixTimestampArray(contentType, accept, body, requestOptions, context)); } /** @@ -473,7 +495,8 @@ public Mono> unixTimestampArrayWithResponseAsync(BinaryData */ @ServiceMethod(returns = ReturnType.SINGLE) public Response unixTimestampArrayWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.unixTimestampArraySync(accept, body, requestOptions, Context.NONE); + return service.unixTimestampArraySync(contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/datetime/implementation/QueriesImpl.java b/typespec-tests/src/main/java/com/encode/datetime/implementation/QueriesImpl.java index 9aa4c27e97..c093cd7e19 100644 --- a/typespec-tests/src/main/java/com/encode/datetime/implementation/QueriesImpl.java +++ b/typespec-tests/src/main/java/com/encode/datetime/implementation/QueriesImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -67,8 +66,8 @@ public interface QueriesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@QueryParam("value") OffsetDateTime value, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> defaultMethod(@QueryParam("value") OffsetDateTime value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/query/default") @ExpectedResponses({ 204 }) @@ -76,8 +75,8 @@ Mono> defaultMethod(@QueryParam("value") OffsetDateTime value, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@QueryParam("value") OffsetDateTime value, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response defaultMethodSync(@QueryParam("value") OffsetDateTime value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/query/rfc3339") @ExpectedResponses({ 204 }) @@ -85,8 +84,8 @@ Response defaultMethodSync(@QueryParam("value") OffsetDateTime value, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc3339(@QueryParam("value") OffsetDateTime value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> rfc3339(@QueryParam("value") OffsetDateTime value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/query/rfc3339") @ExpectedResponses({ 204 }) @@ -94,8 +93,8 @@ Mono> rfc3339(@QueryParam("value") OffsetDateTime value, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc3339Sync(@QueryParam("value") OffsetDateTime value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response rfc3339Sync(@QueryParam("value") OffsetDateTime value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/query/rfc7231") @ExpectedResponses({ 204 }) @@ -103,8 +102,8 @@ Response rfc3339Sync(@QueryParam("value") OffsetDateTime value, @HeaderPar @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc7231(@QueryParam("value") DateTimeRfc1123 value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> rfc7231(@QueryParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/query/rfc7231") @ExpectedResponses({ 204 }) @@ -112,8 +111,8 @@ Mono> rfc7231(@QueryParam("value") DateTimeRfc1123 value, @Header @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc7231Sync(@QueryParam("value") DateTimeRfc1123 value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response rfc7231Sync(@QueryParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/query/unix-timestamp") @ExpectedResponses({ 204 }) @@ -121,8 +120,8 @@ Response rfc7231Sync(@QueryParam("value") DateTimeRfc1123 value, @HeaderPa @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestamp(@QueryParam("value") long value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> unixTimestamp(@QueryParam("value") long value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/query/unix-timestamp") @ExpectedResponses({ 204 }) @@ -130,8 +129,8 @@ Mono> unixTimestamp(@QueryParam("value") long value, @HeaderParam @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampSync(@QueryParam("value") long value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response unixTimestampSync(@QueryParam("value") long value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/query/unix-timestamp-array") @ExpectedResponses({ 204 }) @@ -139,8 +138,8 @@ Response unixTimestampSync(@QueryParam("value") long value, @HeaderParam(" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestampArray(@QueryParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> unixTimestampArray(@QueryParam("value") String value, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/query/unix-timestamp-array") @ExpectedResponses({ 204 }) @@ -148,8 +147,8 @@ Mono> unixTimestampArray(@QueryParam("value") String value, @Head @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampArraySync(@QueryParam("value") String value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response unixTimestampArraySync(@QueryParam("value") String value, RequestOptions requestOptions, + Context context); } /** @@ -165,8 +164,7 @@ Response unixTimestampArraySync(@QueryParam("value") String value, @Header */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.defaultMethod(value, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.defaultMethod(value, requestOptions, context)); } /** @@ -182,8 +180,7 @@ public Mono> defaultMethodWithResponseAsync(OffsetDateTime value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.defaultMethodSync(value, accept, requestOptions, Context.NONE); + return service.defaultMethodSync(value, requestOptions, Context.NONE); } /** @@ -199,8 +196,7 @@ public Response defaultMethodWithResponse(OffsetDateTime value, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc3339WithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.rfc3339(value, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.rfc3339(value, requestOptions, context)); } /** @@ -216,8 +212,7 @@ public Mono> rfc3339WithResponseAsync(OffsetDateTime value, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc3339WithResponse(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.rfc3339Sync(value, accept, requestOptions, Context.NONE); + return service.rfc3339Sync(value, requestOptions, Context.NONE); } /** @@ -233,9 +228,8 @@ public Response rfc3339WithResponse(OffsetDateTime value, RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc7231WithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; DateTimeRfc1123 valueConverted = new DateTimeRfc1123(value); - return FluxUtil.withContext(context -> service.rfc7231(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.rfc7231(valueConverted, requestOptions, context)); } /** @@ -251,9 +245,8 @@ public Mono> rfc7231WithResponseAsync(OffsetDateTime value, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc7231WithResponse(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; DateTimeRfc1123 valueConverted = new DateTimeRfc1123(value); - return service.rfc7231Sync(valueConverted, accept, requestOptions, Context.NONE); + return service.rfc7231Sync(valueConverted, requestOptions, Context.NONE); } /** @@ -269,9 +262,8 @@ public Response rfc7231WithResponse(OffsetDateTime value, RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unixTimestampWithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; long valueConverted = value.toEpochSecond(); - return FluxUtil.withContext(context -> service.unixTimestamp(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.unixTimestamp(valueConverted, requestOptions, context)); } /** @@ -287,9 +279,8 @@ public Mono> unixTimestampWithResponseAsync(OffsetDateTime value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response unixTimestampWithResponse(OffsetDateTime value, RequestOptions requestOptions) { - final String accept = "application/json"; long valueConverted = value.toEpochSecond(); - return service.unixTimestampSync(valueConverted, accept, requestOptions, Context.NONE); + return service.unixTimestampSync(valueConverted, requestOptions, Context.NONE); } /** @@ -306,13 +297,11 @@ public Response unixTimestampWithResponse(OffsetDateTime value, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unixTimestampArrayWithResponseAsync(List value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( value.stream().map(paramItemValue -> paramItemValue.toEpochSecond()).collect(Collectors.toList()), CollectionFormat.CSV); - return FluxUtil - .withContext(context -> service.unixTimestampArray(valueConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.unixTimestampArray(valueConverted, requestOptions, context)); } /** @@ -328,11 +317,10 @@ public Mono> unixTimestampArrayWithResponseAsync(List unixTimestampArrayWithResponse(List value, RequestOptions requestOptions) { - final String accept = "application/json"; String valueConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( value.stream().map(paramItemValue -> paramItemValue.toEpochSecond()).collect(Collectors.toList()), CollectionFormat.CSV); - return service.unixTimestampArraySync(valueConverted, accept, requestOptions, Context.NONE); + return service.unixTimestampArraySync(valueConverted, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/datetime/implementation/ResponseHeadersImpl.java b/typespec-tests/src/main/java/com/encode/datetime/implementation/ResponseHeadersImpl.java index c731513bbb..5f01e18700 100644 --- a/typespec-tests/src/main/java/com/encode/datetime/implementation/ResponseHeadersImpl.java +++ b/typespec-tests/src/main/java/com/encode/datetime/implementation/ResponseHeadersImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -61,8 +60,7 @@ public interface ResponseHeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> defaultMethod(RequestOptions requestOptions, Context context); @Get("/encode/datetime/responseheader/default") @ExpectedResponses({ 204 }) @@ -70,8 +68,7 @@ Mono> defaultMethod(@HeaderParam("accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response defaultMethodSync(RequestOptions requestOptions, Context context); @Get("/encode/datetime/responseheader/rfc3339") @ExpectedResponses({ 204 }) @@ -79,8 +76,7 @@ Response defaultMethodSync(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc3339(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> rfc3339(RequestOptions requestOptions, Context context); @Get("/encode/datetime/responseheader/rfc3339") @ExpectedResponses({ 204 }) @@ -88,8 +84,7 @@ Mono> rfc3339(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc3339Sync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response rfc3339Sync(RequestOptions requestOptions, Context context); @Get("/encode/datetime/responseheader/rfc7231") @ExpectedResponses({ 204 }) @@ -97,8 +92,7 @@ Response rfc3339Sync(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc7231(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> rfc7231(RequestOptions requestOptions, Context context); @Get("/encode/datetime/responseheader/rfc7231") @ExpectedResponses({ 204 }) @@ -106,8 +100,7 @@ Mono> rfc7231(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc7231Sync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response rfc7231Sync(RequestOptions requestOptions, Context context); @Get("/encode/datetime/responseheader/unix-timestamp") @ExpectedResponses({ 204 }) @@ -115,8 +108,7 @@ Response rfc7231Sync(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestamp(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> unixTimestamp(RequestOptions requestOptions, Context context); @Get("/encode/datetime/responseheader/unix-timestamp") @ExpectedResponses({ 204 }) @@ -124,8 +116,7 @@ Mono> unixTimestamp(@HeaderParam("accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response unixTimestampSync(RequestOptions requestOptions, Context context); } /** @@ -140,8 +131,7 @@ Response unixTimestampSync(@HeaderParam("accept") String accept, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.defaultMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.defaultMethod(requestOptions, context)); } /** @@ -156,8 +146,7 @@ public Mono> defaultMethodWithResponseAsync(RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.defaultMethodSync(accept, requestOptions, Context.NONE); + return service.defaultMethodSync(requestOptions, Context.NONE); } /** @@ -172,8 +161,7 @@ public Response defaultMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc3339WithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.rfc3339(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.rfc3339(requestOptions, context)); } /** @@ -188,8 +176,7 @@ public Mono> rfc3339WithResponseAsync(RequestOptions requestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc3339WithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.rfc3339Sync(accept, requestOptions, Context.NONE); + return service.rfc3339Sync(requestOptions, Context.NONE); } /** @@ -204,8 +191,7 @@ public Response rfc3339WithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc7231WithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.rfc7231(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.rfc7231(requestOptions, context)); } /** @@ -220,8 +206,7 @@ public Mono> rfc7231WithResponseAsync(RequestOptions requestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc7231WithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.rfc7231Sync(accept, requestOptions, Context.NONE); + return service.rfc7231Sync(requestOptions, Context.NONE); } /** @@ -236,8 +221,7 @@ public Response rfc7231WithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unixTimestampWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.unixTimestamp(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.unixTimestamp(requestOptions, context)); } /** @@ -252,7 +236,6 @@ public Mono> unixTimestampWithResponseAsync(RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response unixTimestampWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.unixTimestampSync(accept, requestOptions, Context.NONE); + return service.unixTimestampSync(requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/duration/implementation/HeadersImpl.java b/typespec-tests/src/main/java/com/encode/duration/implementation/HeadersImpl.java index 602448ae71..466082b506 100644 --- a/typespec-tests/src/main/java/com/encode/duration/implementation/HeadersImpl.java +++ b/typespec-tests/src/main/java/com/encode/duration/implementation/HeadersImpl.java @@ -64,8 +64,8 @@ public interface HeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("duration") Duration duration, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> defaultMethod(@HeaderParam("duration") Duration duration, RequestOptions requestOptions, + Context context); @Get("/encode/duration/header/default") @ExpectedResponses({ 204 }) @@ -73,8 +73,8 @@ Mono> defaultMethod(@HeaderParam("duration") Duration duration, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("duration") Duration duration, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response defaultMethodSync(@HeaderParam("duration") Duration duration, RequestOptions requestOptions, + Context context); @Get("/encode/duration/header/iso8601") @ExpectedResponses({ 204 }) @@ -82,8 +82,8 @@ Response defaultMethodSync(@HeaderParam("duration") Duration duration, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> iso8601(@HeaderParam("duration") Duration duration, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> iso8601(@HeaderParam("duration") Duration duration, RequestOptions requestOptions, + Context context); @Get("/encode/duration/header/iso8601") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> iso8601(@HeaderParam("duration") Duration duration, @Header @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response iso8601Sync(@HeaderParam("duration") Duration duration, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response iso8601Sync(@HeaderParam("duration") Duration duration, RequestOptions requestOptions, + Context context); @Get("/encode/duration/header/iso8601-array") @ExpectedResponses({ 204 }) @@ -100,8 +100,8 @@ Response iso8601Sync(@HeaderParam("duration") Duration duration, @HeaderPa @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> iso8601Array(@HeaderParam("duration") String duration, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> iso8601Array(@HeaderParam("duration") String duration, RequestOptions requestOptions, + Context context); @Get("/encode/duration/header/iso8601-array") @ExpectedResponses({ 204 }) @@ -109,8 +109,8 @@ Mono> iso8601Array(@HeaderParam("duration") String duration, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response iso8601ArraySync(@HeaderParam("duration") String duration, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response iso8601ArraySync(@HeaderParam("duration") String duration, RequestOptions requestOptions, + Context context); @Get("/encode/duration/header/int32-seconds") @ExpectedResponses({ 204 }) @@ -118,8 +118,8 @@ Response iso8601ArraySync(@HeaderParam("duration") String duration, @Heade @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> int32Seconds(@HeaderParam("duration") long duration, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> int32Seconds(@HeaderParam("duration") long duration, RequestOptions requestOptions, + Context context); @Get("/encode/duration/header/int32-seconds") @ExpectedResponses({ 204 }) @@ -127,8 +127,8 @@ Mono> int32Seconds(@HeaderParam("duration") long duration, @Heade @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response int32SecondsSync(@HeaderParam("duration") long duration, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response int32SecondsSync(@HeaderParam("duration") long duration, RequestOptions requestOptions, + Context context); @Get("/encode/duration/header/float-seconds") @ExpectedResponses({ 204 }) @@ -136,8 +136,8 @@ Response int32SecondsSync(@HeaderParam("duration") long duration, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> floatSeconds(@HeaderParam("duration") double duration, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> floatSeconds(@HeaderParam("duration") double duration, RequestOptions requestOptions, + Context context); @Get("/encode/duration/header/float-seconds") @ExpectedResponses({ 204 }) @@ -145,8 +145,8 @@ Mono> floatSeconds(@HeaderParam("duration") double duration, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response floatSecondsSync(@HeaderParam("duration") double duration, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response floatSecondsSync(@HeaderParam("duration") double duration, RequestOptions requestOptions, + Context context); @Get("/encode/duration/header/float64-seconds") @ExpectedResponses({ 204 }) @@ -154,8 +154,8 @@ Response floatSecondsSync(@HeaderParam("duration") double duration, @Heade @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> float64Seconds(@HeaderParam("duration") double duration, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> float64Seconds(@HeaderParam("duration") double duration, RequestOptions requestOptions, + Context context); @Get("/encode/duration/header/float64-seconds") @ExpectedResponses({ 204 }) @@ -163,8 +163,8 @@ Mono> float64Seconds(@HeaderParam("duration") double duration, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response float64SecondsSync(@HeaderParam("duration") double duration, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response float64SecondsSync(@HeaderParam("duration") double duration, RequestOptions requestOptions, + Context context); } /** @@ -180,8 +180,7 @@ Response float64SecondsSync(@HeaderParam("duration") double duration, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(Duration duration, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.defaultMethod(duration, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.defaultMethod(duration, requestOptions, context)); } /** @@ -197,8 +196,7 @@ public Mono> defaultMethodWithResponseAsync(Duration duration, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(Duration duration, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.defaultMethodSync(duration, accept, requestOptions, Context.NONE); + return service.defaultMethodSync(duration, requestOptions, Context.NONE); } /** @@ -214,8 +212,7 @@ public Response defaultMethodWithResponse(Duration duration, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> iso8601WithResponseAsync(Duration duration, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.iso8601(duration, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.iso8601(duration, requestOptions, context)); } /** @@ -231,8 +228,7 @@ public Mono> iso8601WithResponseAsync(Duration duration, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response iso8601WithResponse(Duration duration, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.iso8601Sync(duration, accept, requestOptions, Context.NONE); + return service.iso8601Sync(duration, requestOptions, Context.NONE); } /** @@ -248,11 +244,9 @@ public Response iso8601WithResponse(Duration duration, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> iso8601ArrayWithResponseAsync(List duration, RequestOptions requestOptions) { - final String accept = "application/json"; String durationConverted = JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(duration, CollectionFormat.CSV); - return FluxUtil - .withContext(context -> service.iso8601Array(durationConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.iso8601Array(durationConverted, requestOptions, context)); } /** @@ -268,10 +262,9 @@ public Mono> iso8601ArrayWithResponseAsync(List duratio */ @ServiceMethod(returns = ReturnType.SINGLE) public Response iso8601ArrayWithResponse(List duration, RequestOptions requestOptions) { - final String accept = "application/json"; String durationConverted = JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(duration, CollectionFormat.CSV); - return service.iso8601ArraySync(durationConverted, accept, requestOptions, Context.NONE); + return service.iso8601ArraySync(durationConverted, requestOptions, Context.NONE); } /** @@ -287,10 +280,8 @@ public Response iso8601ArrayWithResponse(List duration, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> int32SecondsWithResponseAsync(Duration duration, RequestOptions requestOptions) { - final String accept = "application/json"; long durationConverted = duration.getSeconds(); - return FluxUtil - .withContext(context -> service.int32Seconds(durationConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.int32Seconds(durationConverted, requestOptions, context)); } /** @@ -306,9 +297,8 @@ public Mono> int32SecondsWithResponseAsync(Duration duration, Req */ @ServiceMethod(returns = ReturnType.SINGLE) public Response int32SecondsWithResponse(Duration duration, RequestOptions requestOptions) { - final String accept = "application/json"; long durationConverted = duration.getSeconds(); - return service.int32SecondsSync(durationConverted, accept, requestOptions, Context.NONE); + return service.int32SecondsSync(durationConverted, requestOptions, Context.NONE); } /** @@ -324,10 +314,8 @@ public Response int32SecondsWithResponse(Duration duration, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> floatSecondsWithResponseAsync(Duration duration, RequestOptions requestOptions) { - final String accept = "application/json"; double durationConverted = (double) duration.toNanos() / 1000_000_000L; - return FluxUtil - .withContext(context -> service.floatSeconds(durationConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.floatSeconds(durationConverted, requestOptions, context)); } /** @@ -343,9 +331,8 @@ public Mono> floatSecondsWithResponseAsync(Duration duration, Req */ @ServiceMethod(returns = ReturnType.SINGLE) public Response floatSecondsWithResponse(Duration duration, RequestOptions requestOptions) { - final String accept = "application/json"; double durationConverted = (double) duration.toNanos() / 1000_000_000L; - return service.floatSecondsSync(durationConverted, accept, requestOptions, Context.NONE); + return service.floatSecondsSync(durationConverted, requestOptions, Context.NONE); } /** @@ -361,10 +348,8 @@ public Response floatSecondsWithResponse(Duration duration, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> float64SecondsWithResponseAsync(Duration duration, RequestOptions requestOptions) { - final String accept = "application/json"; double durationConverted = (double) duration.toNanos() / 1000_000_000L; - return FluxUtil - .withContext(context -> service.float64Seconds(durationConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.float64Seconds(durationConverted, requestOptions, context)); } /** @@ -380,8 +365,7 @@ public Mono> float64SecondsWithResponseAsync(Duration duration, R */ @ServiceMethod(returns = ReturnType.SINGLE) public Response float64SecondsWithResponse(Duration duration, RequestOptions requestOptions) { - final String accept = "application/json"; double durationConverted = (double) duration.toNanos() / 1000_000_000L; - return service.float64SecondsSync(durationConverted, accept, requestOptions, Context.NONE); + return service.float64SecondsSync(durationConverted, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/duration/implementation/PropertiesImpl.java b/typespec-tests/src/main/java/com/encode/duration/implementation/PropertiesImpl.java index b21e32a5c1..5c97a30990 100644 --- a/typespec-tests/src/main/java/com/encode/duration/implementation/PropertiesImpl.java +++ b/typespec-tests/src/main/java/com/encode/duration/implementation/PropertiesImpl.java @@ -63,8 +63,9 @@ public interface PropertiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> defaultMethod(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/duration/property/default") @ExpectedResponses({ 200 }) @@ -72,8 +73,9 @@ Mono> defaultMethod(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response defaultMethodSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/duration/property/iso8601") @ExpectedResponses({ 200 }) @@ -81,8 +83,9 @@ Response defaultMethodSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> iso8601(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> iso8601(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/duration/property/iso8601") @ExpectedResponses({ 200 }) @@ -90,8 +93,9 @@ Mono> iso8601(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response iso8601Sync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response iso8601Sync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/duration/property/int32-seconds") @ExpectedResponses({ 200 }) @@ -99,8 +103,9 @@ Response iso8601Sync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> int32Seconds(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> int32Seconds(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/duration/property/int32-seconds") @ExpectedResponses({ 200 }) @@ -108,8 +113,9 @@ Mono> int32Seconds(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response int32SecondsSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response int32SecondsSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/duration/property/float-seconds") @ExpectedResponses({ 200 }) @@ -117,8 +123,9 @@ Response int32SecondsSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> floatSeconds(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> floatSeconds(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/duration/property/float-seconds") @ExpectedResponses({ 200 }) @@ -126,8 +133,9 @@ Mono> floatSeconds(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response floatSecondsSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response floatSecondsSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/duration/property/float64-seconds") @ExpectedResponses({ 200 }) @@ -135,8 +143,9 @@ Response floatSecondsSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> float64Seconds(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> float64Seconds(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/duration/property/float64-seconds") @ExpectedResponses({ 200 }) @@ -144,8 +153,9 @@ Mono> float64Seconds(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response float64SecondsSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response float64SecondsSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/duration/property/float-seconds-array") @ExpectedResponses({ 200 }) @@ -153,8 +163,9 @@ Response float64SecondsSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> floatSecondsArray(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> floatSecondsArray(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/encode/duration/property/float-seconds-array") @ExpectedResponses({ 200 }) @@ -162,8 +173,9 @@ Mono> floatSecondsArray(@HeaderParam("accept") String accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response floatSecondsArraySync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response floatSecondsArraySync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -194,8 +206,10 @@ Response floatSecondsArraySync(@HeaderParam("accept") String accept, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.defaultMethod(accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.defaultMethod(contentType, accept, body, requestOptions, context)); } /** @@ -226,8 +240,9 @@ public Mono> defaultMethodWithResponseAsync(BinaryData body */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.defaultMethodSync(accept, body, requestOptions, Context.NONE); + return service.defaultMethodSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -258,8 +273,9 @@ public Response defaultMethodWithResponse(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> iso8601WithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.iso8601(accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.iso8601(contentType, accept, body, requestOptions, context)); } /** @@ -290,8 +306,9 @@ public Mono> iso8601WithResponseAsync(BinaryData body, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response iso8601WithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.iso8601Sync(accept, body, requestOptions, Context.NONE); + return service.iso8601Sync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -322,8 +339,10 @@ public Response iso8601WithResponse(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> int32SecondsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.int32Seconds(accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.int32Seconds(contentType, accept, body, requestOptions, context)); } /** @@ -354,8 +373,9 @@ public Mono> int32SecondsWithResponseAsync(BinaryData body, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response int32SecondsWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.int32SecondsSync(accept, body, requestOptions, Context.NONE); + return service.int32SecondsSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -386,8 +406,10 @@ public Response int32SecondsWithResponse(BinaryData body, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> floatSecondsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.floatSeconds(accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.floatSeconds(contentType, accept, body, requestOptions, context)); } /** @@ -418,8 +440,9 @@ public Mono> floatSecondsWithResponseAsync(BinaryData body, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response floatSecondsWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.floatSecondsSync(accept, body, requestOptions, Context.NONE); + return service.floatSecondsSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -450,8 +473,10 @@ public Response floatSecondsWithResponse(BinaryData body, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> float64SecondsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.float64Seconds(accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.float64Seconds(contentType, accept, body, requestOptions, context)); } /** @@ -482,8 +507,9 @@ public Mono> float64SecondsWithResponseAsync(BinaryData bod */ @ServiceMethod(returns = ReturnType.SINGLE) public Response float64SecondsWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.float64SecondsSync(accept, body, requestOptions, Context.NONE); + return service.float64SecondsSync(contentType, accept, body, requestOptions, Context.NONE); } /** @@ -519,8 +545,10 @@ public Response float64SecondsWithResponse(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Mono> floatSecondsArrayWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.floatSecondsArray(accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.floatSecondsArray(contentType, accept, body, requestOptions, context)); } /** @@ -555,7 +583,8 @@ public Mono> floatSecondsArrayWithResponseAsync(BinaryData */ @ServiceMethod(returns = ReturnType.SINGLE) public Response floatSecondsArrayWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.floatSecondsArraySync(accept, body, requestOptions, Context.NONE); + return service.floatSecondsArraySync(contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/duration/implementation/QueriesImpl.java b/typespec-tests/src/main/java/com/encode/duration/implementation/QueriesImpl.java index ad2e6d2387..bccb586fc2 100644 --- a/typespec-tests/src/main/java/com/encode/duration/implementation/QueriesImpl.java +++ b/typespec-tests/src/main/java/com/encode/duration/implementation/QueriesImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -66,8 +65,8 @@ public interface QueriesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@QueryParam("input") Duration input, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> defaultMethod(@QueryParam("input") Duration input, RequestOptions requestOptions, + Context context); @Get("/encode/duration/query/default") @ExpectedResponses({ 204 }) @@ -75,8 +74,8 @@ Mono> defaultMethod(@QueryParam("input") Duration input, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@QueryParam("input") Duration input, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response defaultMethodSync(@QueryParam("input") Duration input, RequestOptions requestOptions, + Context context); @Get("/encode/duration/query/iso8601") @ExpectedResponses({ 204 }) @@ -84,8 +83,8 @@ Response defaultMethodSync(@QueryParam("input") Duration input, @HeaderPar @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> iso8601(@QueryParam("input") Duration input, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> iso8601(@QueryParam("input") Duration input, RequestOptions requestOptions, + Context context); @Get("/encode/duration/query/iso8601") @ExpectedResponses({ 204 }) @@ -93,8 +92,7 @@ Mono> iso8601(@QueryParam("input") Duration input, @HeaderParam(" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response iso8601Sync(@QueryParam("input") Duration input, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response iso8601Sync(@QueryParam("input") Duration input, RequestOptions requestOptions, Context context); @Get("/encode/duration/query/int32-seconds") @ExpectedResponses({ 204 }) @@ -102,8 +100,8 @@ Response iso8601Sync(@QueryParam("input") Duration input, @HeaderParam("ac @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> int32Seconds(@QueryParam("input") long input, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> int32Seconds(@QueryParam("input") long input, RequestOptions requestOptions, + Context context); @Get("/encode/duration/query/int32-seconds") @ExpectedResponses({ 204 }) @@ -111,8 +109,8 @@ Mono> int32Seconds(@QueryParam("input") long input, @HeaderParam( @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response int32SecondsSync(@QueryParam("input") long input, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response int32SecondsSync(@QueryParam("input") long input, RequestOptions requestOptions, + Context context); @Get("/encode/duration/query/float-seconds") @ExpectedResponses({ 204 }) @@ -120,8 +118,8 @@ Response int32SecondsSync(@QueryParam("input") long input, @HeaderParam("a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> floatSeconds(@QueryParam("input") double input, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> floatSeconds(@QueryParam("input") double input, RequestOptions requestOptions, + Context context); @Get("/encode/duration/query/float-seconds") @ExpectedResponses({ 204 }) @@ -129,8 +127,8 @@ Mono> floatSeconds(@QueryParam("input") double input, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response floatSecondsSync(@QueryParam("input") double input, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response floatSecondsSync(@QueryParam("input") double input, RequestOptions requestOptions, + Context context); @Get("/encode/duration/query/float64-seconds") @ExpectedResponses({ 204 }) @@ -138,8 +136,8 @@ Response floatSecondsSync(@QueryParam("input") double input, @HeaderParam( @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> float64Seconds(@QueryParam("input") double input, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> float64Seconds(@QueryParam("input") double input, RequestOptions requestOptions, + Context context); @Get("/encode/duration/query/float64-seconds") @ExpectedResponses({ 204 }) @@ -147,8 +145,8 @@ Mono> float64Seconds(@QueryParam("input") double input, @HeaderPa @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response float64SecondsSync(@QueryParam("input") double input, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response float64SecondsSync(@QueryParam("input") double input, RequestOptions requestOptions, + Context context); @Get("/encode/duration/query/int32-seconds-array") @ExpectedResponses({ 204 }) @@ -156,8 +154,8 @@ Response float64SecondsSync(@QueryParam("input") double input, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> int32SecondsArray(@QueryParam("input") String input, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> int32SecondsArray(@QueryParam("input") String input, RequestOptions requestOptions, + Context context); @Get("/encode/duration/query/int32-seconds-array") @ExpectedResponses({ 204 }) @@ -165,8 +163,8 @@ Mono> int32SecondsArray(@QueryParam("input") String input, @Heade @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response int32SecondsArraySync(@QueryParam("input") String input, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response int32SecondsArraySync(@QueryParam("input") String input, RequestOptions requestOptions, + Context context); } /** @@ -182,8 +180,7 @@ Response int32SecondsArraySync(@QueryParam("input") String input, @HeaderP */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(Duration input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.defaultMethod(input, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.defaultMethod(input, requestOptions, context)); } /** @@ -199,8 +196,7 @@ public Mono> defaultMethodWithResponseAsync(Duration input, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(Duration input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.defaultMethodSync(input, accept, requestOptions, Context.NONE); + return service.defaultMethodSync(input, requestOptions, Context.NONE); } /** @@ -216,8 +212,7 @@ public Response defaultMethodWithResponse(Duration input, RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> iso8601WithResponseAsync(Duration input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.iso8601(input, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.iso8601(input, requestOptions, context)); } /** @@ -233,8 +228,7 @@ public Mono> iso8601WithResponseAsync(Duration input, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response iso8601WithResponse(Duration input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.iso8601Sync(input, accept, requestOptions, Context.NONE); + return service.iso8601Sync(input, requestOptions, Context.NONE); } /** @@ -250,9 +244,8 @@ public Response iso8601WithResponse(Duration input, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> int32SecondsWithResponseAsync(Duration input, RequestOptions requestOptions) { - final String accept = "application/json"; long inputConverted = input.getSeconds(); - return FluxUtil.withContext(context -> service.int32Seconds(inputConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.int32Seconds(inputConverted, requestOptions, context)); } /** @@ -268,9 +261,8 @@ public Mono> int32SecondsWithResponseAsync(Duration input, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response int32SecondsWithResponse(Duration input, RequestOptions requestOptions) { - final String accept = "application/json"; long inputConverted = input.getSeconds(); - return service.int32SecondsSync(inputConverted, accept, requestOptions, Context.NONE); + return service.int32SecondsSync(inputConverted, requestOptions, Context.NONE); } /** @@ -286,9 +278,8 @@ public Response int32SecondsWithResponse(Duration input, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> floatSecondsWithResponseAsync(Duration input, RequestOptions requestOptions) { - final String accept = "application/json"; double inputConverted = (double) input.toNanos() / 1000_000_000L; - return FluxUtil.withContext(context -> service.floatSeconds(inputConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.floatSeconds(inputConverted, requestOptions, context)); } /** @@ -304,9 +295,8 @@ public Mono> floatSecondsWithResponseAsync(Duration input, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response floatSecondsWithResponse(Duration input, RequestOptions requestOptions) { - final String accept = "application/json"; double inputConverted = (double) input.toNanos() / 1000_000_000L; - return service.floatSecondsSync(inputConverted, accept, requestOptions, Context.NONE); + return service.floatSecondsSync(inputConverted, requestOptions, Context.NONE); } /** @@ -322,9 +312,8 @@ public Response floatSecondsWithResponse(Duration input, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> float64SecondsWithResponseAsync(Duration input, RequestOptions requestOptions) { - final String accept = "application/json"; double inputConverted = (double) input.toNanos() / 1000_000_000L; - return FluxUtil.withContext(context -> service.float64Seconds(inputConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.float64Seconds(inputConverted, requestOptions, context)); } /** @@ -340,9 +329,8 @@ public Mono> float64SecondsWithResponseAsync(Duration input, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response float64SecondsWithResponse(Duration input, RequestOptions requestOptions) { - final String accept = "application/json"; double inputConverted = (double) input.toNanos() / 1000_000_000L; - return service.float64SecondsSync(inputConverted, accept, requestOptions, Context.NONE); + return service.float64SecondsSync(inputConverted, requestOptions, Context.NONE); } /** @@ -359,13 +347,11 @@ public Response float64SecondsWithResponse(Duration input, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> int32SecondsArrayWithResponseAsync(List input, RequestOptions requestOptions) { - final String accept = "application/json"; String inputConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( input.stream().map(paramItemValue -> paramItemValue.getSeconds()).collect(Collectors.toList()), CollectionFormat.CSV); - return FluxUtil - .withContext(context -> service.int32SecondsArray(inputConverted, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.int32SecondsArray(inputConverted, requestOptions, context)); } /** @@ -381,11 +367,10 @@ public Mono> int32SecondsArrayWithResponseAsync(List in */ @ServiceMethod(returns = ReturnType.SINGLE) public Response int32SecondsArrayWithResponse(List input, RequestOptions requestOptions) { - final String accept = "application/json"; String inputConverted = JacksonAdapter.createDefaultSerializerAdapter() .serializeIterable( input.stream().map(paramItemValue -> paramItemValue.getSeconds()).collect(Collectors.toList()), CollectionFormat.CSV); - return service.int32SecondsArraySync(inputConverted, accept, requestOptions, Context.NONE); + return service.int32SecondsArraySync(inputConverted, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/basic/implementation/ExplicitBodiesImpl.java b/typespec-tests/src/main/java/com/parameters/basic/implementation/ExplicitBodiesImpl.java index 0da230c5da..b8fba3c8c3 100644 --- a/typespec-tests/src/main/java/com/parameters/basic/implementation/ExplicitBodiesImpl.java +++ b/typespec-tests/src/main/java/com/parameters/basic/implementation/ExplicitBodiesImpl.java @@ -63,7 +63,7 @@ public interface ExplicitBodiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> simple(@HeaderParam("accept") String accept, + Mono> simple(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/parameters/basic/explicit-body/simple") @@ -72,8 +72,8 @@ Mono> simple(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response simpleSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response simpleSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -96,8 +96,8 @@ Response simpleSync(@HeaderParam("accept") String accept, @BodyParam("appl */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> simpleWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.simple(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.simple(contentType, body, requestOptions, context)); } /** @@ -120,7 +120,7 @@ public Mono> simpleWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response simpleWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.simpleSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.simpleSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/basic/implementation/ImplicitBodiesImpl.java b/typespec-tests/src/main/java/com/parameters/basic/implementation/ImplicitBodiesImpl.java index e6488ff8c4..94e75bcb9d 100644 --- a/typespec-tests/src/main/java/com/parameters/basic/implementation/ImplicitBodiesImpl.java +++ b/typespec-tests/src/main/java/com/parameters/basic/implementation/ImplicitBodiesImpl.java @@ -63,7 +63,7 @@ public interface ImplicitBodiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> simple(@HeaderParam("accept") String accept, + Mono> simple(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData simpleRequest, RequestOptions requestOptions, Context context); @Put("/parameters/basic/implicit-body/simple") @@ -72,7 +72,7 @@ Mono> simple(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response simpleSync(@HeaderParam("accept") String accept, + Response simpleSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData simpleRequest, RequestOptions requestOptions, Context context); } @@ -96,8 +96,8 @@ Response simpleSync(@HeaderParam("accept") String accept, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> simpleWithResponseAsync(BinaryData simpleRequest, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.simple(accept, simpleRequest, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.simple(contentType, simpleRequest, requestOptions, context)); } /** @@ -120,7 +120,7 @@ public Mono> simpleWithResponseAsync(BinaryData simpleRequest, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response simpleWithResponse(BinaryData simpleRequest, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.simpleSync(accept, simpleRequest, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.simpleSync(contentType, simpleRequest, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/bodyoptionality/OptionalExplicitAsyncClient.java b/typespec-tests/src/main/java/com/parameters/bodyoptionality/OptionalExplicitAsyncClient.java index 3fc48d2233..971f5b8944 100644 --- a/typespec-tests/src/main/java/com/parameters/bodyoptionality/OptionalExplicitAsyncClient.java +++ b/typespec-tests/src/main/java/com/parameters/bodyoptionality/OptionalExplicitAsyncClient.java @@ -40,14 +40,6 @@ public final class OptionalExplicitAsyncClient { /** * The set operation. - *

Header Parameters

- * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: - * "application/json".
- * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -71,14 +63,6 @@ public Mono> setWithResponse(RequestOptions requestOptions) {
 
     /**
      * The omit operation.
-     * 

Header Parameters

- * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: - * "application/json".
- * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
diff --git a/typespec-tests/src/main/java/com/parameters/bodyoptionality/OptionalExplicitClient.java b/typespec-tests/src/main/java/com/parameters/bodyoptionality/OptionalExplicitClient.java
index 435a507941..78a671dfa4 100644
--- a/typespec-tests/src/main/java/com/parameters/bodyoptionality/OptionalExplicitClient.java
+++ b/typespec-tests/src/main/java/com/parameters/bodyoptionality/OptionalExplicitClient.java
@@ -38,14 +38,6 @@ public final class OptionalExplicitClient {
 
     /**
      * The set operation.
-     * 

Header Parameters

- * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: - * "application/json".
- * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -69,14 +61,6 @@ public Response setWithResponse(RequestOptions requestOptions) {
 
     /**
      * The omit operation.
-     * 

Header Parameters

- * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: - * "application/json".
- * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
diff --git a/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/BodyOptionalityClientImpl.java b/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/BodyOptionalityClientImpl.java
index 9e11573ccc..9ac49d53a0 100644
--- a/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/BodyOptionalityClientImpl.java
+++ b/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/BodyOptionalityClientImpl.java
@@ -126,7 +126,7 @@ public interface BodyOptionalityClientService {
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> requiredExplicit(@HeaderParam("accept") String accept,
+        Mono> requiredExplicit(@HeaderParam("Content-Type") String contentType,
             @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
 
         @Post("/parameters/body-optionality/required-explicit")
@@ -135,7 +135,7 @@ Mono> requiredExplicit(@HeaderParam("accept") String accept,
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response requiredExplicitSync(@HeaderParam("accept") String accept,
+        Response requiredExplicitSync(@HeaderParam("Content-Type") String contentType,
             @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
 
         @Post("/parameters/body-optionality/required-implicit")
@@ -144,7 +144,7 @@ Response requiredExplicitSync(@HeaderParam("accept") String accept,
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> requiredImplicit(@HeaderParam("accept") String accept,
+        Mono> requiredImplicit(@HeaderParam("Content-Type") String contentType,
             @BodyParam("application/json") BinaryData requiredImplicitRequest, RequestOptions requestOptions,
             Context context);
 
@@ -154,7 +154,7 @@ Mono> requiredImplicit(@HeaderParam("accept") String accept,
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response requiredImplicitSync(@HeaderParam("accept") String accept,
+        Response requiredImplicitSync(@HeaderParam("Content-Type") String contentType,
             @BodyParam("application/json") BinaryData requiredImplicitRequest, RequestOptions requestOptions,
             Context context);
     }
@@ -179,8 +179,8 @@ Response requiredImplicitSync(@HeaderParam("accept") String accept,
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> requiredExplicitWithResponseAsync(BinaryData body, RequestOptions requestOptions) {
-        final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.requiredExplicit(accept, body, requestOptions, context));
+        final String contentType = "application/json";
+        return FluxUtil.withContext(context -> service.requiredExplicit(contentType, body, requestOptions, context));
     }
 
     /**
@@ -203,8 +203,8 @@ public Mono> requiredExplicitWithResponseAsync(BinaryData body, R
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response requiredExplicitWithResponse(BinaryData body, RequestOptions requestOptions) {
-        final String accept = "application/json";
-        return service.requiredExplicitSync(accept, body, requestOptions, Context.NONE);
+        final String contentType = "application/json";
+        return service.requiredExplicitSync(contentType, body, requestOptions, Context.NONE);
     }
 
     /**
@@ -228,9 +228,9 @@ public Response requiredExplicitWithResponse(BinaryData body, RequestOptio
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> requiredImplicitWithResponseAsync(BinaryData requiredImplicitRequest,
         RequestOptions requestOptions) {
-        final String accept = "application/json";
-        return FluxUtil
-            .withContext(context -> service.requiredImplicit(accept, requiredImplicitRequest, requestOptions, context));
+        final String contentType = "application/json";
+        return FluxUtil.withContext(
+            context -> service.requiredImplicit(contentType, requiredImplicitRequest, requestOptions, context));
     }
 
     /**
@@ -254,7 +254,7 @@ public Mono> requiredImplicitWithResponseAsync(BinaryData require
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response requiredImplicitWithResponse(BinaryData requiredImplicitRequest,
         RequestOptions requestOptions) {
-        final String accept = "application/json";
-        return service.requiredImplicitSync(accept, requiredImplicitRequest, requestOptions, Context.NONE);
+        final String contentType = "application/json";
+        return service.requiredImplicitSync(contentType, requiredImplicitRequest, requestOptions, Context.NONE);
     }
 }
diff --git a/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/OptionalExplicitsImpl.java b/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/OptionalExplicitsImpl.java
index 91b84dee3f..766827b3df 100644
--- a/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/OptionalExplicitsImpl.java
+++ b/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/OptionalExplicitsImpl.java
@@ -62,7 +62,8 @@ public interface OptionalExplicitsService {
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> set(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+        Mono> set(@HeaderParam("Content-Type") String contentType, RequestOptions requestOptions,
+            Context context);
 
         @Post("/parameters/body-optionality/optional-explicit/set")
         @ExpectedResponses({ 204 })
@@ -70,7 +71,8 @@ public interface OptionalExplicitsService {
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response setSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+        Response setSync(@HeaderParam("Content-Type") String contentType, RequestOptions requestOptions,
+            Context context);
 
         @Post("/parameters/body-optionality/optional-explicit/omit")
         @ExpectedResponses({ 204 })
@@ -78,7 +80,8 @@ public interface OptionalExplicitsService {
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> omit(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+        Mono> omit(@HeaderParam("Content-Type") String contentType, RequestOptions requestOptions,
+            Context context);
 
         @Post("/parameters/body-optionality/optional-explicit/omit")
         @ExpectedResponses({ 204 })
@@ -86,19 +89,12 @@ public interface OptionalExplicitsService {
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response omitSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+        Response omitSync(@HeaderParam("Content-Type") String contentType, RequestOptions requestOptions,
+            Context context);
     }
 
     /**
      * The set operation.
-     * 

Header Parameters

- * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: - * "application/json".
- * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -116,26 +112,18 @@ public interface OptionalExplicitsService {
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> setWithResponseAsync(RequestOptions requestOptions) {
-        final String accept = "application/json";
+        final String contentType = "application/json";
         RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
         requestOptionsLocal.addRequestCallback(requestLocal -> {
             if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) {
                 requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json");
             }
         });
-        return FluxUtil.withContext(context -> service.set(accept, requestOptionsLocal, context));
+        return FluxUtil.withContext(context -> service.set(contentType, requestOptionsLocal, context));
     }
 
     /**
      * The set operation.
-     * 

Header Parameters

- * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: - * "application/json".
- * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -153,26 +141,18 @@ public Mono> setWithResponseAsync(RequestOptions requestOptions)
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response setWithResponse(RequestOptions requestOptions) {
-        final String accept = "application/json";
+        final String contentType = "application/json";
         RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
         requestOptionsLocal.addRequestCallback(requestLocal -> {
             if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) {
                 requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json");
             }
         });
-        return service.setSync(accept, requestOptionsLocal, Context.NONE);
+        return service.setSync(contentType, requestOptionsLocal, Context.NONE);
     }
 
     /**
      * The omit operation.
-     * 

Header Parameters

- * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: - * "application/json".
- * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -190,26 +170,18 @@ public Response setWithResponse(RequestOptions requestOptions) {
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> omitWithResponseAsync(RequestOptions requestOptions) {
-        final String accept = "application/json";
+        final String contentType = "application/json";
         RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
         requestOptionsLocal.addRequestCallback(requestLocal -> {
             if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) {
                 requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json");
             }
         });
-        return FluxUtil.withContext(context -> service.omit(accept, requestOptionsLocal, context));
+        return FluxUtil.withContext(context -> service.omit(contentType, requestOptionsLocal, context));
     }
 
     /**
      * The omit operation.
-     * 

Header Parameters

- * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: - * "application/json".
- * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -227,13 +199,13 @@ public Mono> omitWithResponseAsync(RequestOptions requestOptions)
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response omitWithResponse(RequestOptions requestOptions) {
-        final String accept = "application/json";
+        final String contentType = "application/json";
         RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
         requestOptionsLocal.addRequestCallback(requestLocal -> {
             if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) {
                 requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json");
             }
         });
-        return service.omitSync(accept, requestOptionsLocal, Context.NONE);
+        return service.omitSync(contentType, requestOptionsLocal, Context.NONE);
     }
 }
diff --git a/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/HeadersImpl.java b/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/HeadersImpl.java
index 267582535c..6e220ab978 100644
--- a/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/HeadersImpl.java
+++ b/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/HeadersImpl.java
@@ -63,8 +63,7 @@ public interface HeadersService {
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> csv(@HeaderParam("colors") String colors, @HeaderParam("accept") String accept,
-            RequestOptions requestOptions, Context context);
+        Mono> csv(@HeaderParam("colors") String colors, RequestOptions requestOptions, Context context);
 
         @Get("/parameters/collection-format/header/csv")
         @ExpectedResponses({ 204 })
@@ -72,8 +71,7 @@ Mono> csv(@HeaderParam("colors") String colors, @HeaderParam("acc
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response csvSync(@HeaderParam("colors") String colors, @HeaderParam("accept") String accept,
-            RequestOptions requestOptions, Context context);
+        Response csvSync(@HeaderParam("colors") String colors, RequestOptions requestOptions, Context context);
     }
 
     /**
@@ -89,11 +87,10 @@ Response csvSync(@HeaderParam("colors") String colors, @HeaderParam("accep
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> csvWithResponseAsync(List colors, RequestOptions requestOptions) {
-        final String accept = "application/json";
         String colorsConverted = colors.stream()
             .map(paramItemValue -> Objects.toString(paramItemValue, ""))
             .collect(Collectors.joining(","));
-        return FluxUtil.withContext(context -> service.csv(colorsConverted, accept, requestOptions, context));
+        return FluxUtil.withContext(context -> service.csv(colorsConverted, requestOptions, context));
     }
 
     /**
@@ -109,10 +106,9 @@ public Mono> csvWithResponseAsync(List colors, RequestOpt
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response csvWithResponse(List colors, RequestOptions requestOptions) {
-        final String accept = "application/json";
         String colorsConverted = colors.stream()
             .map(paramItemValue -> Objects.toString(paramItemValue, ""))
             .collect(Collectors.joining(","));
-        return service.csvSync(colorsConverted, accept, requestOptions, Context.NONE);
+        return service.csvSync(colorsConverted, requestOptions, Context.NONE);
     }
 }
diff --git a/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/QueriesImpl.java b/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/QueriesImpl.java
index b55f7842f8..695c4a5eab 100644
--- a/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/QueriesImpl.java
+++ b/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/QueriesImpl.java
@@ -6,7 +6,6 @@
 
 import com.azure.core.annotation.ExpectedResponses;
 import com.azure.core.annotation.Get;
-import com.azure.core.annotation.HeaderParam;
 import com.azure.core.annotation.Host;
 import com.azure.core.annotation.QueryParam;
 import com.azure.core.annotation.ReturnType;
@@ -65,7 +64,7 @@ public interface QueriesService {
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> multi(@QueryParam(value = "colors", multipleQueryParams = true) List colors,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            RequestOptions requestOptions, Context context);
 
         @Get("/parameters/collection-format/query/multi")
         @ExpectedResponses({ 204 })
@@ -74,7 +73,7 @@ Mono> multi(@QueryParam(value = "colors", multipleQueryParams = t
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response multiSync(@QueryParam(value = "colors", multipleQueryParams = true) List colors,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            RequestOptions requestOptions, Context context);
 
         @Get("/parameters/collection-format/query/ssv")
         @ExpectedResponses({ 204 })
@@ -82,8 +81,7 @@ Response multiSync(@QueryParam(value = "colors", multipleQueryParams = tru
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> ssv(@QueryParam("colors") String colors, @HeaderParam("accept") String accept,
-            RequestOptions requestOptions, Context context);
+        Mono> ssv(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context);
 
         @Get("/parameters/collection-format/query/ssv")
         @ExpectedResponses({ 204 })
@@ -91,8 +89,7 @@ Mono> ssv(@QueryParam("colors") String colors, @HeaderParam("acce
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response ssvSync(@QueryParam("colors") String colors, @HeaderParam("accept") String accept,
-            RequestOptions requestOptions, Context context);
+        Response ssvSync(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context);
 
         @Get("/parameters/collection-format/query/tsv")
         @ExpectedResponses({ 204 })
@@ -100,8 +97,7 @@ Response ssvSync(@QueryParam("colors") String colors, @HeaderParam("accept
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> tsv(@QueryParam("colors") String colors, @HeaderParam("accept") String accept,
-            RequestOptions requestOptions, Context context);
+        Mono> tsv(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context);
 
         @Get("/parameters/collection-format/query/tsv")
         @ExpectedResponses({ 204 })
@@ -109,8 +105,7 @@ Mono> tsv(@QueryParam("colors") String colors, @HeaderParam("acce
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response tsvSync(@QueryParam("colors") String colors, @HeaderParam("accept") String accept,
-            RequestOptions requestOptions, Context context);
+        Response tsvSync(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context);
 
         @Get("/parameters/collection-format/query/pipes")
         @ExpectedResponses({ 204 })
@@ -118,8 +113,7 @@ Response tsvSync(@QueryParam("colors") String colors, @HeaderParam("accept
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> pipes(@QueryParam("colors") String colors, @HeaderParam("accept") String accept,
-            RequestOptions requestOptions, Context context);
+        Mono> pipes(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context);
 
         @Get("/parameters/collection-format/query/pipes")
         @ExpectedResponses({ 204 })
@@ -127,8 +121,7 @@ Mono> pipes(@QueryParam("colors") String colors, @HeaderParam("ac
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response pipesSync(@QueryParam("colors") String colors, @HeaderParam("accept") String accept,
-            RequestOptions requestOptions, Context context);
+        Response pipesSync(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context);
 
         @Get("/parameters/collection-format/query/csv")
         @ExpectedResponses({ 204 })
@@ -136,8 +129,7 @@ Response pipesSync(@QueryParam("colors") String colors, @HeaderParam("acce
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> csv(@QueryParam("colors") String colors, @HeaderParam("accept") String accept,
-            RequestOptions requestOptions, Context context);
+        Mono> csv(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context);
 
         @Get("/parameters/collection-format/query/csv")
         @ExpectedResponses({ 204 })
@@ -145,8 +137,7 @@ Mono> csv(@QueryParam("colors") String colors, @HeaderParam("acce
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response csvSync(@QueryParam("colors") String colors, @HeaderParam("accept") String accept,
-            RequestOptions requestOptions, Context context);
+        Response csvSync(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context);
     }
 
     /**
@@ -162,10 +153,9 @@ Response csvSync(@QueryParam("colors") String colors, @HeaderParam("accept
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> multiWithResponseAsync(List colors, RequestOptions requestOptions) {
-        final String accept = "application/json";
         List colorsConverted
             = colors.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList());
-        return FluxUtil.withContext(context -> service.multi(colorsConverted, accept, requestOptions, context));
+        return FluxUtil.withContext(context -> service.multi(colorsConverted, requestOptions, context));
     }
 
     /**
@@ -181,10 +171,9 @@ public Mono> multiWithResponseAsync(List colors, RequestO
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response multiWithResponse(List colors, RequestOptions requestOptions) {
-        final String accept = "application/json";
         List colorsConverted
             = colors.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList());
-        return service.multiSync(colorsConverted, accept, requestOptions, Context.NONE);
+        return service.multiSync(colorsConverted, requestOptions, Context.NONE);
     }
 
     /**
@@ -200,11 +189,10 @@ public Response multiWithResponse(List colors, RequestOptions requ
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> ssvWithResponseAsync(List colors, RequestOptions requestOptions) {
-        final String accept = "application/json";
         String colorsConverted = colors.stream()
             .map(paramItemValue -> Objects.toString(paramItemValue, ""))
             .collect(Collectors.joining(" "));
-        return FluxUtil.withContext(context -> service.ssv(colorsConverted, accept, requestOptions, context));
+        return FluxUtil.withContext(context -> service.ssv(colorsConverted, requestOptions, context));
     }
 
     /**
@@ -220,11 +208,10 @@ public Mono> ssvWithResponseAsync(List colors, RequestOpt
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response ssvWithResponse(List colors, RequestOptions requestOptions) {
-        final String accept = "application/json";
         String colorsConverted = colors.stream()
             .map(paramItemValue -> Objects.toString(paramItemValue, ""))
             .collect(Collectors.joining(" "));
-        return service.ssvSync(colorsConverted, accept, requestOptions, Context.NONE);
+        return service.ssvSync(colorsConverted, requestOptions, Context.NONE);
     }
 
     /**
@@ -240,11 +227,10 @@ public Response ssvWithResponse(List colors, RequestOptions reques
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> tsvWithResponseAsync(List colors, RequestOptions requestOptions) {
-        final String accept = "application/json";
         String colorsConverted = colors.stream()
             .map(paramItemValue -> Objects.toString(paramItemValue, ""))
             .collect(Collectors.joining("\t"));
-        return FluxUtil.withContext(context -> service.tsv(colorsConverted, accept, requestOptions, context));
+        return FluxUtil.withContext(context -> service.tsv(colorsConverted, requestOptions, context));
     }
 
     /**
@@ -260,11 +246,10 @@ public Mono> tsvWithResponseAsync(List colors, RequestOpt
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response tsvWithResponse(List colors, RequestOptions requestOptions) {
-        final String accept = "application/json";
         String colorsConverted = colors.stream()
             .map(paramItemValue -> Objects.toString(paramItemValue, ""))
             .collect(Collectors.joining("\t"));
-        return service.tsvSync(colorsConverted, accept, requestOptions, Context.NONE);
+        return service.tsvSync(colorsConverted, requestOptions, Context.NONE);
     }
 
     /**
@@ -280,11 +265,10 @@ public Response tsvWithResponse(List colors, RequestOptions reques
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> pipesWithResponseAsync(List colors, RequestOptions requestOptions) {
-        final String accept = "application/json";
         String colorsConverted = colors.stream()
             .map(paramItemValue -> Objects.toString(paramItemValue, ""))
             .collect(Collectors.joining("|"));
-        return FluxUtil.withContext(context -> service.pipes(colorsConverted, accept, requestOptions, context));
+        return FluxUtil.withContext(context -> service.pipes(colorsConverted, requestOptions, context));
     }
 
     /**
@@ -300,11 +284,10 @@ public Mono> pipesWithResponseAsync(List colors, RequestO
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response pipesWithResponse(List colors, RequestOptions requestOptions) {
-        final String accept = "application/json";
         String colorsConverted = colors.stream()
             .map(paramItemValue -> Objects.toString(paramItemValue, ""))
             .collect(Collectors.joining("|"));
-        return service.pipesSync(colorsConverted, accept, requestOptions, Context.NONE);
+        return service.pipesSync(colorsConverted, requestOptions, Context.NONE);
     }
 
     /**
@@ -320,11 +303,10 @@ public Response pipesWithResponse(List colors, RequestOptions requ
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> csvWithResponseAsync(List colors, RequestOptions requestOptions) {
-        final String accept = "application/json";
         String colorsConverted = colors.stream()
             .map(paramItemValue -> Objects.toString(paramItemValue, ""))
             .collect(Collectors.joining(","));
-        return FluxUtil.withContext(context -> service.csv(colorsConverted, accept, requestOptions, context));
+        return FluxUtil.withContext(context -> service.csv(colorsConverted, requestOptions, context));
     }
 
     /**
@@ -340,10 +322,9 @@ public Mono> csvWithResponseAsync(List colors, RequestOpt
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response csvWithResponse(List colors, RequestOptions requestOptions) {
-        final String accept = "application/json";
         String colorsConverted = colors.stream()
             .map(paramItemValue -> Objects.toString(paramItemValue, ""))
             .collect(Collectors.joining(","));
-        return service.csvSync(colorsConverted, accept, requestOptions, Context.NONE);
+        return service.csvSync(colorsConverted, requestOptions, Context.NONE);
     }
 }
diff --git a/typespec-tests/src/main/java/com/parameters/spread/implementation/AliasImpl.java b/typespec-tests/src/main/java/com/parameters/spread/implementation/AliasImpl.java
index 2f592407cf..2c723ca0d0 100644
--- a/typespec-tests/src/main/java/com/parameters/spread/implementation/AliasImpl.java
+++ b/typespec-tests/src/main/java/com/parameters/spread/implementation/AliasImpl.java
@@ -63,7 +63,7 @@ public interface AliasService {
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> spreadAsRequestBody(@HeaderParam("accept") String accept,
+        Mono> spreadAsRequestBody(@HeaderParam("Content-Type") String contentType,
             @BodyParam("application/json") BinaryData spreadAsRequestBodyRequest, RequestOptions requestOptions,
             Context context);
 
@@ -73,7 +73,7 @@ Mono> spreadAsRequestBody(@HeaderParam("accept") String accept,
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response spreadAsRequestBodySync(@HeaderParam("accept") String accept,
+        Response spreadAsRequestBodySync(@HeaderParam("Content-Type") String contentType,
             @BodyParam("application/json") BinaryData spreadAsRequestBodyRequest, RequestOptions requestOptions,
             Context context);
 
@@ -84,7 +84,7 @@ Response spreadAsRequestBodySync(@HeaderParam("accept") String accept,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> spreadAsRequestParameter(@PathParam("id") String id,
-            @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("accept") String accept,
+            @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("Content-Type") String contentType,
             @BodyParam("application/json") BinaryData spreadAsRequestParameterRequest, RequestOptions requestOptions,
             Context context);
 
@@ -95,7 +95,7 @@ Mono> spreadAsRequestParameter(@PathParam("id") String id,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response spreadAsRequestParameterSync(@PathParam("id") String id,
-            @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("accept") String accept,
+            @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("Content-Type") String contentType,
             @BodyParam("application/json") BinaryData spreadAsRequestParameterRequest, RequestOptions requestOptions,
             Context context);
 
@@ -106,7 +106,7 @@ Response spreadAsRequestParameterSync(@PathParam("id") String id,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> spreadWithMultipleParameters(@PathParam("id") String id,
-            @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("accept") String accept,
+            @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("Content-Type") String contentType,
             @BodyParam("application/json") BinaryData spreadWithMultipleParametersRequest,
             RequestOptions requestOptions, Context context);
 
@@ -117,7 +117,7 @@ Mono> spreadWithMultipleParameters(@PathParam("id") String id,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response spreadWithMultipleParametersSync(@PathParam("id") String id,
-            @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("accept") String accept,
+            @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("Content-Type") String contentType,
             @BodyParam("application/json") BinaryData spreadWithMultipleParametersRequest,
             RequestOptions requestOptions, Context context);
     }
@@ -143,9 +143,9 @@ Response spreadWithMultipleParametersSync(@PathParam("id") String id,
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> spreadAsRequestBodyWithResponseAsync(BinaryData spreadAsRequestBodyRequest,
         RequestOptions requestOptions) {
-        final String accept = "application/json";
+        final String contentType = "application/json";
         return FluxUtil.withContext(
-            context -> service.spreadAsRequestBody(accept, spreadAsRequestBodyRequest, requestOptions, context));
+            context -> service.spreadAsRequestBody(contentType, spreadAsRequestBodyRequest, requestOptions, context));
     }
 
     /**
@@ -169,8 +169,8 @@ public Mono> spreadAsRequestBodyWithResponseAsync(BinaryData spre
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response spreadAsRequestBodyWithResponse(BinaryData spreadAsRequestBodyRequest,
         RequestOptions requestOptions) {
-        final String accept = "application/json";
-        return service.spreadAsRequestBodySync(accept, spreadAsRequestBodyRequest, requestOptions, Context.NONE);
+        final String contentType = "application/json";
+        return service.spreadAsRequestBodySync(contentType, spreadAsRequestBodyRequest, requestOptions, Context.NONE);
     }
 
     /**
@@ -196,8 +196,8 @@ public Response spreadAsRequestBodyWithResponse(BinaryData spreadAsRequest
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> spreadAsRequestParameterWithResponseAsync(String id, String xMsTestHeader,
         BinaryData spreadAsRequestParameterRequest, RequestOptions requestOptions) {
-        final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.spreadAsRequestParameter(id, xMsTestHeader, accept,
+        final String contentType = "application/json";
+        return FluxUtil.withContext(context -> service.spreadAsRequestParameter(id, xMsTestHeader, contentType,
             spreadAsRequestParameterRequest, requestOptions, context));
     }
 
@@ -224,8 +224,8 @@ public Mono> spreadAsRequestParameterWithResponseAsync(String id,
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response spreadAsRequestParameterWithResponse(String id, String xMsTestHeader,
         BinaryData spreadAsRequestParameterRequest, RequestOptions requestOptions) {
-        final String accept = "application/json";
-        return service.spreadAsRequestParameterSync(id, xMsTestHeader, accept, spreadAsRequestParameterRequest,
+        final String contentType = "application/json";
+        return service.spreadAsRequestParameterSync(id, xMsTestHeader, contentType, spreadAsRequestParameterRequest,
             requestOptions, Context.NONE);
     }
 
@@ -257,8 +257,8 @@ public Response spreadAsRequestParameterWithResponse(String id, String xMs
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> spreadWithMultipleParametersWithResponseAsync(String id, String xMsTestHeader,
         BinaryData spreadWithMultipleParametersRequest, RequestOptions requestOptions) {
-        final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.spreadWithMultipleParameters(id, xMsTestHeader, accept,
+        final String contentType = "application/json";
+        return FluxUtil.withContext(context -> service.spreadWithMultipleParameters(id, xMsTestHeader, contentType,
             spreadWithMultipleParametersRequest, requestOptions, context));
     }
 
@@ -290,8 +290,8 @@ public Mono> spreadWithMultipleParametersWithResponseAsync(String
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response spreadWithMultipleParametersWithResponse(String id, String xMsTestHeader,
         BinaryData spreadWithMultipleParametersRequest, RequestOptions requestOptions) {
-        final String accept = "application/json";
-        return service.spreadWithMultipleParametersSync(id, xMsTestHeader, accept, spreadWithMultipleParametersRequest,
-            requestOptions, Context.NONE);
+        final String contentType = "application/json";
+        return service.spreadWithMultipleParametersSync(id, xMsTestHeader, contentType,
+            spreadWithMultipleParametersRequest, requestOptions, Context.NONE);
     }
 }
diff --git a/typespec-tests/src/main/java/com/parameters/spread/implementation/ModelsImpl.java b/typespec-tests/src/main/java/com/parameters/spread/implementation/ModelsImpl.java
index c56205230a..fb0640c249 100644
--- a/typespec-tests/src/main/java/com/parameters/spread/implementation/ModelsImpl.java
+++ b/typespec-tests/src/main/java/com/parameters/spread/implementation/ModelsImpl.java
@@ -63,7 +63,7 @@ public interface ModelsService {
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> spreadAsRequestBody(@HeaderParam("accept") String accept,
+        Mono> spreadAsRequestBody(@HeaderParam("Content-Type") String contentType,
             @BodyParam("application/json") BinaryData spreadAsRequestBodyRequest1, RequestOptions requestOptions,
             Context context);
 
@@ -73,7 +73,7 @@ Mono> spreadAsRequestBody(@HeaderParam("accept") String accept,
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response spreadAsRequestBodySync(@HeaderParam("accept") String accept,
+        Response spreadAsRequestBodySync(@HeaderParam("Content-Type") String contentType,
             @BodyParam("application/json") BinaryData spreadAsRequestBodyRequest1, RequestOptions requestOptions,
             Context context);
 
@@ -83,7 +83,7 @@ Response spreadAsRequestBodySync(@HeaderParam("accept") String accept,
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> spreadCompositeRequestOnlyWithBody(@HeaderParam("accept") String accept,
+        Mono> spreadCompositeRequestOnlyWithBody(@HeaderParam("Content-Type") String contentType,
             @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
 
         @Put("/parameters/spread/model/composite-request-only-with-body")
@@ -92,7 +92,7 @@ Mono> spreadCompositeRequestOnlyWithBody(@HeaderParam("accept") S
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response spreadCompositeRequestOnlyWithBodySync(@HeaderParam("accept") String accept,
+        Response spreadCompositeRequestOnlyWithBodySync(@HeaderParam("Content-Type") String contentType,
             @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
 
         @Put("/parameters/spread/model/composite-request-without-body/{name}")
@@ -102,8 +102,7 @@ Response spreadCompositeRequestOnlyWithBodySync(@HeaderParam("accept") Str
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> spreadCompositeRequestWithoutBody(@PathParam("name") String name,
-            @HeaderParam("test-header") String testHeader, @HeaderParam("accept") String accept,
-            RequestOptions requestOptions, Context context);
+            @HeaderParam("test-header") String testHeader, RequestOptions requestOptions, Context context);
 
         @Put("/parameters/spread/model/composite-request-without-body/{name}")
         @ExpectedResponses({ 204 })
@@ -112,8 +111,7 @@ Mono> spreadCompositeRequestWithoutBody(@PathParam("name") String
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response spreadCompositeRequestWithoutBodySync(@PathParam("name") String name,
-            @HeaderParam("test-header") String testHeader, @HeaderParam("accept") String accept,
-            RequestOptions requestOptions, Context context);
+            @HeaderParam("test-header") String testHeader, RequestOptions requestOptions, Context context);
 
         @Put("/parameters/spread/model/composite-request/{name}")
         @ExpectedResponses({ 204 })
@@ -122,7 +120,7 @@ Response spreadCompositeRequestWithoutBodySync(@PathParam("name") String n
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> spreadCompositeRequest(@PathParam("name") String name,
-            @HeaderParam("test-header") String testHeader, @HeaderParam("accept") String accept,
+            @HeaderParam("test-header") String testHeader, @HeaderParam("Content-Type") String contentType,
             @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
 
         @Put("/parameters/spread/model/composite-request/{name}")
@@ -132,7 +130,7 @@ Mono> spreadCompositeRequest(@PathParam("name") String name,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response spreadCompositeRequestSync(@PathParam("name") String name,
-            @HeaderParam("test-header") String testHeader, @HeaderParam("accept") String accept,
+            @HeaderParam("test-header") String testHeader, @HeaderParam("Content-Type") String contentType,
             @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
 
         @Put("/parameters/spread/model/composite-request-mix/{name}")
@@ -142,7 +140,7 @@ Response spreadCompositeRequestSync(@PathParam("name") String name,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> spreadCompositeRequestMix(@PathParam("name") String name,
-            @HeaderParam("test-header") String testHeader, @HeaderParam("accept") String accept,
+            @HeaderParam("test-header") String testHeader, @HeaderParam("Content-Type") String contentType,
             @BodyParam("application/json") BinaryData spreadCompositeRequestMixRequest, RequestOptions requestOptions,
             Context context);
 
@@ -153,7 +151,7 @@ Mono> spreadCompositeRequestMix(@PathParam("name") String name,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response spreadCompositeRequestMixSync(@PathParam("name") String name,
-            @HeaderParam("test-header") String testHeader, @HeaderParam("accept") String accept,
+            @HeaderParam("test-header") String testHeader, @HeaderParam("Content-Type") String contentType,
             @BodyParam("application/json") BinaryData spreadCompositeRequestMixRequest, RequestOptions requestOptions,
             Context context);
     }
@@ -179,9 +177,9 @@ Response spreadCompositeRequestMixSync(@PathParam("name") String name,
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> spreadAsRequestBodyWithResponseAsync(BinaryData spreadAsRequestBodyRequest1,
         RequestOptions requestOptions) {
-        final String accept = "application/json";
+        final String contentType = "application/json";
         return FluxUtil.withContext(
-            context -> service.spreadAsRequestBody(accept, spreadAsRequestBodyRequest1, requestOptions, context));
+            context -> service.spreadAsRequestBody(contentType, spreadAsRequestBodyRequest1, requestOptions, context));
     }
 
     /**
@@ -205,8 +203,8 @@ public Mono> spreadAsRequestBodyWithResponseAsync(BinaryData spre
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response spreadAsRequestBodyWithResponse(BinaryData spreadAsRequestBodyRequest1,
         RequestOptions requestOptions) {
-        final String accept = "application/json";
-        return service.spreadAsRequestBodySync(accept, spreadAsRequestBodyRequest1, requestOptions, Context.NONE);
+        final String contentType = "application/json";
+        return service.spreadAsRequestBodySync(contentType, spreadAsRequestBodyRequest1, requestOptions, Context.NONE);
     }
 
     /**
@@ -230,9 +228,9 @@ public Response spreadAsRequestBodyWithResponse(BinaryData spreadAsRequest
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> spreadCompositeRequestOnlyWithBodyWithResponseAsync(BinaryData body,
         RequestOptions requestOptions) {
-        final String accept = "application/json";
-        return FluxUtil
-            .withContext(context -> service.spreadCompositeRequestOnlyWithBody(accept, body, requestOptions, context));
+        final String contentType = "application/json";
+        return FluxUtil.withContext(
+            context -> service.spreadCompositeRequestOnlyWithBody(contentType, body, requestOptions, context));
     }
 
     /**
@@ -256,8 +254,8 @@ public Mono> spreadCompositeRequestOnlyWithBodyWithResponseAsync(
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response spreadCompositeRequestOnlyWithBodyWithResponse(BinaryData body,
         RequestOptions requestOptions) {
-        final String accept = "application/json";
-        return service.spreadCompositeRequestOnlyWithBodySync(accept, body, requestOptions, Context.NONE);
+        final String contentType = "application/json";
+        return service.spreadCompositeRequestOnlyWithBodySync(contentType, body, requestOptions, Context.NONE);
     }
 
     /**
@@ -275,9 +273,8 @@ public Response spreadCompositeRequestOnlyWithBodyWithResponse(BinaryData
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> spreadCompositeRequestWithoutBodyWithResponseAsync(String name, String testHeader,
         RequestOptions requestOptions) {
-        final String accept = "application/json";
         return FluxUtil.withContext(
-            context -> service.spreadCompositeRequestWithoutBody(name, testHeader, accept, requestOptions, context));
+            context -> service.spreadCompositeRequestWithoutBody(name, testHeader, requestOptions, context));
     }
 
     /**
@@ -295,8 +292,7 @@ public Mono> spreadCompositeRequestWithoutBodyWithResponseAsync(S
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response spreadCompositeRequestWithoutBodyWithResponse(String name, String testHeader,
         RequestOptions requestOptions) {
-        final String accept = "application/json";
-        return service.spreadCompositeRequestWithoutBodySync(name, testHeader, accept, requestOptions, Context.NONE);
+        return service.spreadCompositeRequestWithoutBodySync(name, testHeader, requestOptions, Context.NONE);
     }
 
     /**
@@ -322,9 +318,9 @@ public Response spreadCompositeRequestWithoutBodyWithResponse(String name,
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> spreadCompositeRequestWithResponseAsync(String name, String testHeader, BinaryData body,
         RequestOptions requestOptions) {
-        final String accept = "application/json";
+        final String contentType = "application/json";
         return FluxUtil.withContext(
-            context -> service.spreadCompositeRequest(name, testHeader, accept, body, requestOptions, context));
+            context -> service.spreadCompositeRequest(name, testHeader, contentType, body, requestOptions, context));
     }
 
     /**
@@ -350,8 +346,8 @@ public Mono> spreadCompositeRequestWithResponseAsync(String name,
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response spreadCompositeRequestWithResponse(String name, String testHeader, BinaryData body,
         RequestOptions requestOptions) {
-        final String accept = "application/json";
-        return service.spreadCompositeRequestSync(name, testHeader, accept, body, requestOptions, Context.NONE);
+        final String contentType = "application/json";
+        return service.spreadCompositeRequestSync(name, testHeader, contentType, body, requestOptions, Context.NONE);
     }
 
     /**
@@ -377,8 +373,8 @@ public Response spreadCompositeRequestWithResponse(String name, String tes
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> spreadCompositeRequestMixWithResponseAsync(String name, String testHeader,
         BinaryData spreadCompositeRequestMixRequest, RequestOptions requestOptions) {
-        final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.spreadCompositeRequestMix(name, testHeader, accept,
+        final String contentType = "application/json";
+        return FluxUtil.withContext(context -> service.spreadCompositeRequestMix(name, testHeader, contentType,
             spreadCompositeRequestMixRequest, requestOptions, context));
     }
 
@@ -405,8 +401,8 @@ public Mono> spreadCompositeRequestMixWithResponseAsync(String na
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response spreadCompositeRequestMixWithResponse(String name, String testHeader,
         BinaryData spreadCompositeRequestMixRequest, RequestOptions requestOptions) {
-        final String accept = "application/json";
-        return service.spreadCompositeRequestMixSync(name, testHeader, accept, spreadCompositeRequestMixRequest,
+        final String contentType = "application/json";
+        return service.spreadCompositeRequestMixSync(name, testHeader, contentType, spreadCompositeRequestMixRequest,
             requestOptions, Context.NONE);
     }
 }
diff --git a/typespec-tests/src/main/java/com/payload/jsonmergepatch/implementation/JsonMergePatchClientImpl.java b/typespec-tests/src/main/java/com/payload/jsonmergepatch/implementation/JsonMergePatchClientImpl.java
index a96d48530e..cfe0492c3f 100644
--- a/typespec-tests/src/main/java/com/payload/jsonmergepatch/implementation/JsonMergePatchClientImpl.java
+++ b/typespec-tests/src/main/java/com/payload/jsonmergepatch/implementation/JsonMergePatchClientImpl.java
@@ -113,8 +113,9 @@ public interface JsonMergePatchClientService {
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> createResource(@HeaderParam("accept") String accept,
-            @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
+        Mono> createResource(@HeaderParam("Content-Type") String contentType,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body,
+            RequestOptions requestOptions, Context context);
 
         @Put("/json-merge-patch/create/resource")
         @ExpectedResponses({ 200 })
@@ -122,8 +123,9 @@ Mono> createResource(@HeaderParam("accept") String accept,
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response createResourceSync(@HeaderParam("accept") String accept,
-            @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
+        Response createResourceSync(@HeaderParam("Content-Type") String contentType,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body,
+            RequestOptions requestOptions, Context context);
 
         @Patch("/json-merge-patch/update/resource")
         @ExpectedResponses({ 200 })
@@ -132,7 +134,7 @@ Response createResourceSync(@HeaderParam("accept") String accept,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> updateResource(@HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body,
+            @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body,
             RequestOptions requestOptions, Context context);
 
         @Patch("/json-merge-patch/update/resource")
@@ -142,7 +144,7 @@ Mono> updateResource(@HeaderParam("content-type") String co
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response updateResourceSync(@HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body,
+            @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body,
             RequestOptions requestOptions, Context context);
 
         @Patch("/json-merge-patch/update/resource/optional")
@@ -152,7 +154,7 @@ Response updateResourceSync(@HeaderParam("content-type") String cont
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> updateOptionalResource(@HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Patch("/json-merge-patch/update/resource/optional")
         @ExpectedResponses({ 200 })
@@ -161,7 +163,7 @@ Mono> updateOptionalResource(@HeaderParam("content-type") S
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response updateOptionalResourceSync(@HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
     }
 
     /**
@@ -224,8 +226,10 @@ Response updateOptionalResourceSync(@HeaderParam("content-type") Str
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> createResourceWithResponseAsync(BinaryData body, RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.createResource(accept, body, requestOptions, context));
+        return FluxUtil
+            .withContext(context -> service.createResource(contentType, accept, body, requestOptions, context));
     }
 
     /**
@@ -288,8 +292,9 @@ public Mono> createResourceWithResponseAsync(BinaryData bod
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response createResourceWithResponse(BinaryData body, RequestOptions requestOptions) {
+        final String contentType = "application/json";
         final String accept = "application/json";
-        return service.createResourceSync(accept, body, requestOptions, Context.NONE);
+        return service.createResourceSync(contentType, accept, body, requestOptions, Context.NONE);
     }
 
     /**
diff --git a/typespec-tests/src/main/java/com/payload/mediatype/implementation/StringBodiesImpl.java b/typespec-tests/src/main/java/com/payload/mediatype/implementation/StringBodiesImpl.java
index 6514b25f96..205b382e4c 100644
--- a/typespec-tests/src/main/java/com/payload/mediatype/implementation/StringBodiesImpl.java
+++ b/typespec-tests/src/main/java/com/payload/mediatype/implementation/StringBodiesImpl.java
@@ -65,8 +65,7 @@ public interface StringBodiesService {
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> sendAsText(@HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, @BodyParam("text/plain") BinaryData text,
-            RequestOptions requestOptions, Context context);
+            @BodyParam("text/plain") BinaryData text, RequestOptions requestOptions, Context context);
 
         @Post("/payload/media-type/string-body/sendAsText")
         @ExpectedResponses({ 200 })
@@ -75,8 +74,7 @@ Mono> sendAsText(@HeaderParam("content-type") String contentType,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response sendAsTextSync(@HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, @BodyParam("text/plain") BinaryData text,
-            RequestOptions requestOptions, Context context);
+            @BodyParam("text/plain") BinaryData text, RequestOptions requestOptions, Context context);
 
         @Get("/payload/media-type/string-body/getAsText")
         @ExpectedResponses({ 200 })
@@ -84,7 +82,7 @@ Response sendAsTextSync(@HeaderParam("content-type") String contentType,
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> getAsText(@HeaderParam("accept") String accept, RequestOptions requestOptions,
+        Mono> getAsText(@HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("/payload/media-type/string-body/getAsText")
@@ -93,7 +91,7 @@ Mono> getAsText(@HeaderParam("accept") String accept, Reque
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response getAsTextSync(@HeaderParam("accept") String accept, RequestOptions requestOptions,
+        Response getAsTextSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Post("/payload/media-type/string-body/sendAsJson")
@@ -103,8 +101,7 @@ Response getAsTextSync(@HeaderParam("accept") String accept, Request
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> sendAsJson(@HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData text,
-            RequestOptions requestOptions, Context context);
+            @BodyParam("application/json") BinaryData text, RequestOptions requestOptions, Context context);
 
         @Post("/payload/media-type/string-body/sendAsJson")
         @ExpectedResponses({ 200 })
@@ -113,8 +110,7 @@ Mono> sendAsJson(@HeaderParam("content-type") String contentType,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response sendAsJsonSync(@HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData text,
-            RequestOptions requestOptions, Context context);
+            @BodyParam("application/json") BinaryData text, RequestOptions requestOptions, Context context);
 
         @Get("/payload/media-type/string-body/getAsJson")
         @ExpectedResponses({ 200 })
@@ -122,7 +118,7 @@ Response sendAsJsonSync(@HeaderParam("content-type") String contentType,
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> getAsJson(@HeaderParam("accept") String accept, RequestOptions requestOptions,
+        Mono> getAsJson(@HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("/payload/media-type/string-body/getAsJson")
@@ -131,7 +127,7 @@ Mono> getAsJson(@HeaderParam("accept") String accept, Reque
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response getAsJsonSync(@HeaderParam("accept") String accept, RequestOptions requestOptions,
+        Response getAsJsonSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
     }
 
@@ -154,8 +150,7 @@ Response getAsJsonSync(@HeaderParam("accept") String accept, Request
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> sendAsTextWithResponseAsync(BinaryData text, RequestOptions requestOptions) {
         final String contentType = "text/plain";
-        final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.sendAsText(contentType, accept, text, requestOptions, context));
+        return FluxUtil.withContext(context -> service.sendAsText(contentType, text, requestOptions, context));
     }
 
     /**
@@ -177,8 +172,7 @@ public Mono> sendAsTextWithResponseAsync(BinaryData text, Request
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response sendAsTextWithResponse(BinaryData text, RequestOptions requestOptions) {
         final String contentType = "text/plain";
-        final String accept = "application/json";
-        return service.sendAsTextSync(contentType, accept, text, requestOptions, Context.NONE);
+        return service.sendAsTextSync(contentType, text, requestOptions, Context.NONE);
     }
 
     /**
@@ -242,8 +236,7 @@ public Response getAsTextWithResponse(RequestOptions requestOptions)
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> sendAsJsonWithResponseAsync(BinaryData text, RequestOptions requestOptions) {
         final String contentType = "application/json";
-        final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.sendAsJson(contentType, accept, text, requestOptions, context));
+        return FluxUtil.withContext(context -> service.sendAsJson(contentType, text, requestOptions, context));
     }
 
     /**
@@ -265,8 +258,7 @@ public Mono> sendAsJsonWithResponseAsync(BinaryData text, Request
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response sendAsJsonWithResponse(BinaryData text, RequestOptions requestOptions) {
         final String contentType = "application/json";
-        final String accept = "application/json";
-        return service.sendAsJsonSync(contentType, accept, text, requestOptions, Context.NONE);
+        return service.sendAsJsonSync(contentType, text, requestOptions, Context.NONE);
     }
 
     /**
diff --git a/typespec-tests/src/main/java/com/payload/multipart/implementation/FormDatasImpl.java b/typespec-tests/src/main/java/com/payload/multipart/implementation/FormDatasImpl.java
index 40e13e1521..d34df545a8 100644
--- a/typespec-tests/src/main/java/com/payload/multipart/implementation/FormDatasImpl.java
+++ b/typespec-tests/src/main/java/com/payload/multipart/implementation/FormDatasImpl.java
@@ -65,8 +65,7 @@ public interface FormDatasService {
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> basic(@HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body,
-            RequestOptions requestOptions, Context context);
+            @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context);
 
         // @Multipart not supported by RestProxy
         @Post("/multipart/form-data/mixed-parts")
@@ -75,7 +74,7 @@ Mono> basic(@HeaderParam("content-type") String contentType,
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response basicSync(@HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept,
+        Response basicSync(@HeaderParam("content-type") String contentType,
             @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context);
 
         // @Multipart not supported by RestProxy
@@ -86,8 +85,7 @@ Response basicSync(@HeaderParam("content-type") String contentType, @Heade
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> complex(@HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body,
-            RequestOptions requestOptions, Context context);
+            @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context);
 
         // @Multipart not supported by RestProxy
         @Post("/multipart/form-data/complex-parts")
@@ -97,8 +95,7 @@ Mono> complex(@HeaderParam("content-type") String contentType,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response complexSync(@HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body,
-            RequestOptions requestOptions, Context context);
+            @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context);
 
         // @Multipart not supported by RestProxy
         @Post("/multipart/form-data/json-part")
@@ -108,8 +105,7 @@ Response complexSync(@HeaderParam("content-type") String contentType,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> jsonPart(@HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body,
-            RequestOptions requestOptions, Context context);
+            @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context);
 
         // @Multipart not supported by RestProxy
         @Post("/multipart/form-data/json-part")
@@ -119,8 +115,7 @@ Mono> jsonPart(@HeaderParam("content-type") String contentType,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response jsonPartSync(@HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body,
-            RequestOptions requestOptions, Context context);
+            @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context);
 
         // @Multipart not supported by RestProxy
         @Post("/multipart/form-data/binary-array-parts")
@@ -130,8 +125,7 @@ Response jsonPartSync(@HeaderParam("content-type") String contentType,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> binaryArrayParts(@HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body,
-            RequestOptions requestOptions, Context context);
+            @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context);
 
         // @Multipart not supported by RestProxy
         @Post("/multipart/form-data/binary-array-parts")
@@ -141,8 +135,7 @@ Mono> binaryArrayParts(@HeaderParam("content-type") String conten
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response binaryArrayPartsSync(@HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body,
-            RequestOptions requestOptions, Context context);
+            @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context);
 
         // @Multipart not supported by RestProxy
         @Post("/multipart/form-data/json-array-parts")
@@ -152,8 +145,7 @@ Response binaryArrayPartsSync(@HeaderParam("content-type") String contentT
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> jsonArrayParts(@HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body,
-            RequestOptions requestOptions, Context context);
+            @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context);
 
         // @Multipart not supported by RestProxy
         @Post("/multipart/form-data/json-array-parts")
@@ -163,8 +155,7 @@ Mono> jsonArrayParts(@HeaderParam("content-type") String contentT
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response jsonArrayPartsSync(@HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body,
-            RequestOptions requestOptions, Context context);
+            @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context);
 
         // @Multipart not supported by RestProxy
         @Post("/multipart/form-data/multi-binary-parts")
@@ -174,8 +165,7 @@ Response jsonArrayPartsSync(@HeaderParam("content-type") String contentTyp
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> multiBinaryParts(@HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body,
-            RequestOptions requestOptions, Context context);
+            @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context);
 
         // @Multipart not supported by RestProxy
         @Post("/multipart/form-data/multi-binary-parts")
@@ -185,8 +175,7 @@ Mono> multiBinaryParts(@HeaderParam("content-type") String conten
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response multiBinaryPartsSync(@HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body,
-            RequestOptions requestOptions, Context context);
+            @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context);
 
         // @Multipart not supported by RestProxy
         @Post("/multipart/form-data/check-filename-and-content-type")
@@ -196,8 +185,7 @@ Response multiBinaryPartsSync(@HeaderParam("content-type") String contentT
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> checkFileNameAndContentType(@HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body,
-            RequestOptions requestOptions, Context context);
+            @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context);
 
         // @Multipart not supported by RestProxy
         @Post("/multipart/form-data/check-filename-and-content-type")
@@ -207,8 +195,7 @@ Mono> checkFileNameAndContentType(@HeaderParam("content-type") St
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response checkFileNameAndContentTypeSync(@HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body,
-            RequestOptions requestOptions, Context context);
+            @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context);
 
         // @Multipart not supported by RestProxy
         @Post("/multipart/form-data/anonymous-model")
@@ -218,8 +205,8 @@ Response checkFileNameAndContentTypeSync(@HeaderParam("content-type") Stri
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> anonymousModel(@HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData anonymousModelRequest,
-            RequestOptions requestOptions, Context context);
+            @BodyParam("multipart/form-data") BinaryData anonymousModelRequest, RequestOptions requestOptions,
+            Context context);
 
         // @Multipart not supported by RestProxy
         @Post("/multipart/form-data/anonymous-model")
@@ -229,8 +216,8 @@ Mono> anonymousModel(@HeaderParam("content-type") String contentT
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response anonymousModelSync(@HeaderParam("content-type") String contentType,
-            @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData anonymousModelRequest,
-            RequestOptions requestOptions, Context context);
+            @BodyParam("multipart/form-data") BinaryData anonymousModelRequest, RequestOptions requestOptions,
+            Context context);
     }
 
     /**
@@ -247,8 +234,7 @@ Response anonymousModelSync(@HeaderParam("content-type") String contentTyp
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> basicWithResponseAsync(BinaryData body, RequestOptions requestOptions) {
         final String contentType = "multipart/form-data";
-        final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.basic(contentType, accept, body, requestOptions, context));
+        return FluxUtil.withContext(context -> service.basic(contentType, body, requestOptions, context));
     }
 
     /**
@@ -265,8 +251,7 @@ public Mono> basicWithResponseAsync(BinaryData body, RequestOptio
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response basicWithResponse(BinaryData body, RequestOptions requestOptions) {
         final String contentType = "multipart/form-data";
-        final String accept = "application/json";
-        return service.basicSync(contentType, accept, body, requestOptions, Context.NONE);
+        return service.basicSync(contentType, body, requestOptions, Context.NONE);
     }
 
     /**
@@ -283,8 +268,7 @@ public Response basicWithResponse(BinaryData body, RequestOptions requestO
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> complexWithResponseAsync(BinaryData body, RequestOptions requestOptions) {
         final String contentType = "multipart/form-data";
-        final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.complex(contentType, accept, body, requestOptions, context));
+        return FluxUtil.withContext(context -> service.complex(contentType, body, requestOptions, context));
     }
 
     /**
@@ -301,8 +285,7 @@ public Mono> complexWithResponseAsync(BinaryData body, RequestOpt
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response complexWithResponse(BinaryData body, RequestOptions requestOptions) {
         final String contentType = "multipart/form-data";
-        final String accept = "application/json";
-        return service.complexSync(contentType, accept, body, requestOptions, Context.NONE);
+        return service.complexSync(contentType, body, requestOptions, Context.NONE);
     }
 
     /**
@@ -319,8 +302,7 @@ public Response complexWithResponse(BinaryData body, RequestOptions reques
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> jsonPartWithResponseAsync(BinaryData body, RequestOptions requestOptions) {
         final String contentType = "multipart/form-data";
-        final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.jsonPart(contentType, accept, body, requestOptions, context));
+        return FluxUtil.withContext(context -> service.jsonPart(contentType, body, requestOptions, context));
     }
 
     /**
@@ -337,8 +319,7 @@ public Mono> jsonPartWithResponseAsync(BinaryData body, RequestOp
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response jsonPartWithResponse(BinaryData body, RequestOptions requestOptions) {
         final String contentType = "multipart/form-data";
-        final String accept = "application/json";
-        return service.jsonPartSync(contentType, accept, body, requestOptions, Context.NONE);
+        return service.jsonPartSync(contentType, body, requestOptions, Context.NONE);
     }
 
     /**
@@ -355,9 +336,7 @@ public Response jsonPartWithResponse(BinaryData body, RequestOptions reque
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> binaryArrayPartsWithResponseAsync(BinaryData body, RequestOptions requestOptions) {
         final String contentType = "multipart/form-data";
-        final String accept = "application/json";
-        return FluxUtil
-            .withContext(context -> service.binaryArrayParts(contentType, accept, body, requestOptions, context));
+        return FluxUtil.withContext(context -> service.binaryArrayParts(contentType, body, requestOptions, context));
     }
 
     /**
@@ -374,8 +353,7 @@ public Mono> binaryArrayPartsWithResponseAsync(BinaryData body, R
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response binaryArrayPartsWithResponse(BinaryData body, RequestOptions requestOptions) {
         final String contentType = "multipart/form-data";
-        final String accept = "application/json";
-        return service.binaryArrayPartsSync(contentType, accept, body, requestOptions, Context.NONE);
+        return service.binaryArrayPartsSync(contentType, body, requestOptions, Context.NONE);
     }
 
     /**
@@ -392,9 +370,7 @@ public Response binaryArrayPartsWithResponse(BinaryData body, RequestOptio
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> jsonArrayPartsWithResponseAsync(BinaryData body, RequestOptions requestOptions) {
         final String contentType = "multipart/form-data";
-        final String accept = "application/json";
-        return FluxUtil
-            .withContext(context -> service.jsonArrayParts(contentType, accept, body, requestOptions, context));
+        return FluxUtil.withContext(context -> service.jsonArrayParts(contentType, body, requestOptions, context));
     }
 
     /**
@@ -411,8 +387,7 @@ public Mono> jsonArrayPartsWithResponseAsync(BinaryData body, Req
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response jsonArrayPartsWithResponse(BinaryData body, RequestOptions requestOptions) {
         final String contentType = "multipart/form-data";
-        final String accept = "application/json";
-        return service.jsonArrayPartsSync(contentType, accept, body, requestOptions, Context.NONE);
+        return service.jsonArrayPartsSync(contentType, body, requestOptions, Context.NONE);
     }
 
     /**
@@ -429,9 +404,7 @@ public Response jsonArrayPartsWithResponse(BinaryData body, RequestOptions
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> multiBinaryPartsWithResponseAsync(BinaryData body, RequestOptions requestOptions) {
         final String contentType = "multipart/form-data";
-        final String accept = "application/json";
-        return FluxUtil
-            .withContext(context -> service.multiBinaryParts(contentType, accept, body, requestOptions, context));
+        return FluxUtil.withContext(context -> service.multiBinaryParts(contentType, body, requestOptions, context));
     }
 
     /**
@@ -448,8 +421,7 @@ public Mono> multiBinaryPartsWithResponseAsync(BinaryData body, R
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response multiBinaryPartsWithResponse(BinaryData body, RequestOptions requestOptions) {
         final String contentType = "multipart/form-data";
-        final String accept = "application/json";
-        return service.multiBinaryPartsSync(contentType, accept, body, requestOptions, Context.NONE);
+        return service.multiBinaryPartsSync(contentType, body, requestOptions, Context.NONE);
     }
 
     /**
@@ -467,9 +439,8 @@ public Response multiBinaryPartsWithResponse(BinaryData body, RequestOptio
     public Mono> checkFileNameAndContentTypeWithResponseAsync(BinaryData body,
         RequestOptions requestOptions) {
         final String contentType = "multipart/form-data";
-        final String accept = "application/json";
-        return FluxUtil.withContext(
-            context -> service.checkFileNameAndContentType(contentType, accept, body, requestOptions, context));
+        return FluxUtil
+            .withContext(context -> service.checkFileNameAndContentType(contentType, body, requestOptions, context));
     }
 
     /**
@@ -486,8 +457,7 @@ public Mono> checkFileNameAndContentTypeWithResponseAsync(BinaryD
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response checkFileNameAndContentTypeWithResponse(BinaryData body, RequestOptions requestOptions) {
         final String contentType = "multipart/form-data";
-        final String accept = "application/json";
-        return service.checkFileNameAndContentTypeSync(contentType, accept, body, requestOptions, Context.NONE);
+        return service.checkFileNameAndContentTypeSync(contentType, body, requestOptions, Context.NONE);
     }
 
     /**
@@ -505,9 +475,8 @@ public Response checkFileNameAndContentTypeWithResponse(BinaryData body, R
     public Mono> anonymousModelWithResponseAsync(BinaryData anonymousModelRequest,
         RequestOptions requestOptions) {
         final String contentType = "multipart/form-data";
-        final String accept = "application/json";
         return FluxUtil.withContext(
-            context -> service.anonymousModel(contentType, accept, anonymousModelRequest, requestOptions, context));
+            context -> service.anonymousModel(contentType, anonymousModelRequest, requestOptions, context));
     }
 
     /**
@@ -524,7 +493,6 @@ public Mono> anonymousModelWithResponseAsync(BinaryData anonymous
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response anonymousModelWithResponse(BinaryData anonymousModelRequest, RequestOptions requestOptions) {
         final String contentType = "multipart/form-data";
-        final String accept = "application/json";
-        return service.anonymousModelSync(contentType, accept, anonymousModelRequest, requestOptions, Context.NONE);
+        return service.anonymousModelSync(contentType, anonymousModelRequest, requestOptions, Context.NONE);
     }
 }
diff --git a/typespec-tests/src/main/java/com/payload/pageable/PageableAsyncClient.java b/typespec-tests/src/main/java/com/payload/pageable/PageableAsyncClient.java
index 1aab73bd48..8ccb1f5ac4 100644
--- a/typespec-tests/src/main/java/com/payload/pageable/PageableAsyncClient.java
+++ b/typespec-tests/src/main/java/com/payload/pageable/PageableAsyncClient.java
@@ -86,10 +86,10 @@ public PagedFlux list() {
         // Generated convenience method for list
         RequestOptions requestOptions = new RequestOptions();
         PagedFlux pagedFluxResponse = list(requestOptions);
-        return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
-            Flux> flux = (continuationTokenParam == null)
+        return PagedFlux.create(() -> (continuationToken, pageSize) -> {
+            Flux> flux = (continuationToken == null)
                 ? pagedFluxResponse.byPage().take(1)
-                : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+                : pagedFluxResponse.byPage(continuationToken).take(1);
             return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
                 pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
                 pagedResponse.getValue()
diff --git a/typespec-tests/src/main/java/com/payload/pageable/implementation/PageableClientImpl.java b/typespec-tests/src/main/java/com/payload/pageable/implementation/PageableClientImpl.java
index 6e4347e371..7f63146b5f 100644
--- a/typespec-tests/src/main/java/com/payload/pageable/implementation/PageableClientImpl.java
+++ b/typespec-tests/src/main/java/com/payload/pageable/implementation/PageableClientImpl.java
@@ -117,7 +117,7 @@ public interface PageableClientService {
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> list(@HeaderParam("accept") String accept, RequestOptions requestOptions,
+        Mono> list(@HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("/payload/pageable")
@@ -126,7 +126,7 @@ Mono> list(@HeaderParam("accept") String accept, RequestOpt
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response listSync(@HeaderParam("accept") String accept, RequestOptions requestOptions,
+        Response listSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions,
             Context context);
 
         @Get("{nextLink}")
@@ -136,7 +136,7 @@ Response listSync(@HeaderParam("accept") String accept, RequestOptio
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("{nextLink}")
         @ExpectedResponses({ 200 })
@@ -145,7 +145,7 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = tru
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
-            @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
     }
 
     /**
@@ -319,6 +319,8 @@ public PagedIterable list(RequestOptions requestOptions) {
     }
 
     /**
+     * List users
+     * 
      * Get the next page of items.
      * 

Response Body Schema

* @@ -345,6 +347,8 @@ private Mono> listNextSinglePageAsync(String nextLink, } /** + * List users + * * Get the next page of items. *

Response Body Schema

* diff --git a/typespec-tests/src/main/java/com/resiliency/servicedriven/ResiliencyServiceDrivenClientBuilder.java b/typespec-tests/src/main/java/com/resiliency/servicedriven/ResiliencyServiceDrivenClientBuilder.java index e56acf8643..a833d3c4d1 100644 --- a/typespec-tests/src/main/java/com/resiliency/servicedriven/ResiliencyServiceDrivenClientBuilder.java +++ b/typespec-tests/src/main/java/com/resiliency/servicedriven/ResiliencyServiceDrivenClientBuilder.java @@ -213,6 +213,24 @@ public ResiliencyServiceDrivenClientBuilder serviceDeploymentVersion(String serv return this; } + /* + * Pass in either 'v1' or 'v2'. This represents the API version of a service. + */ + @Generated + private String apiVersion; + + /** + * Sets Pass in either 'v1' or 'v2'. This represents the API version of a service. + * + * @param apiVersion the apiVersion value. + * @return the ResiliencyServiceDrivenClientBuilder. + */ + @Generated + public ResiliencyServiceDrivenClientBuilder apiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + /* * Service version */ @@ -262,7 +280,7 @@ private ResiliencyServiceDrivenClientImpl buildInnerClient() { = (serviceVersion != null) ? serviceVersion : ServiceDrivenServiceVersion.getLatest(); ResiliencyServiceDrivenClientImpl client = new ResiliencyServiceDrivenClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), - this.endpoint, this.serviceDeploymentVersion, localServiceVersion); + this.endpoint, this.serviceDeploymentVersion, this.apiVersion, localServiceVersion); return client; } @@ -272,6 +290,7 @@ private void validateClient() { // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); Objects.requireNonNull(serviceDeploymentVersion, "'serviceDeploymentVersion' cannot be null."); + Objects.requireNonNull(apiVersion, "'apiVersion' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/resiliency/servicedriven/implementation/ResiliencyServiceDrivenClientImpl.java b/typespec-tests/src/main/java/com/resiliency/servicedriven/implementation/ResiliencyServiceDrivenClientImpl.java index 0ab9638406..9bf3d7c0bb 100644 --- a/typespec-tests/src/main/java/com/resiliency/servicedriven/implementation/ResiliencyServiceDrivenClientImpl.java +++ b/typespec-tests/src/main/java/com/resiliency/servicedriven/implementation/ResiliencyServiceDrivenClientImpl.java @@ -8,7 +8,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; import com.azure.core.annotation.Head; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.QueryParam; @@ -75,6 +74,20 @@ public String getServiceDeploymentVersion() { return this.serviceDeploymentVersion; } + /** + * Pass in either 'v1' or 'v2'. This represents the API version of a service. + */ + private final String apiVersion; + + /** + * Gets Pass in either 'v1' or 'v2'. This represents the API version of a service. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + /** * Service version. */ @@ -124,12 +137,14 @@ public SerializerAdapter getSerializerAdapter() { * @param serviceDeploymentVersion Pass in either 'v1' or 'v2'. This represents a version of the service deployment * in history. 'v1' is for the deployment when the service had only one api version. 'v2' is for the deployment when * the service had api-versions 'v1' and 'v2'. + * @param apiVersion Pass in either 'v1' or 'v2'. This represents the API version of a service. * @param serviceVersion Service version. */ - public ResiliencyServiceDrivenClientImpl(String endpoint, String serviceDeploymentVersion, + public ResiliencyServiceDrivenClientImpl(String endpoint, String serviceDeploymentVersion, String apiVersion, ServiceDrivenServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceDeploymentVersion, serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceDeploymentVersion, apiVersion, + serviceVersion); } /** @@ -140,12 +155,13 @@ public ResiliencyServiceDrivenClientImpl(String endpoint, String serviceDeployme * @param serviceDeploymentVersion Pass in either 'v1' or 'v2'. This represents a version of the service deployment * in history. 'v1' is for the deployment when the service had only one api version. 'v2' is for the deployment when * the service had api-versions 'v1' and 'v2'. + * @param apiVersion Pass in either 'v1' or 'v2'. This represents the API version of a service. * @param serviceVersion Service version. */ public ResiliencyServiceDrivenClientImpl(HttpPipeline httpPipeline, String endpoint, - String serviceDeploymentVersion, ServiceDrivenServiceVersion serviceVersion) { + String serviceDeploymentVersion, String apiVersion, ServiceDrivenServiceVersion serviceVersion) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceDeploymentVersion, - serviceVersion); + apiVersion, serviceVersion); } /** @@ -157,14 +173,17 @@ public ResiliencyServiceDrivenClientImpl(HttpPipeline httpPipeline, String endpo * @param serviceDeploymentVersion Pass in either 'v1' or 'v2'. This represents a version of the service deployment * in history. 'v1' is for the deployment when the service had only one api version. 'v2' is for the deployment when * the service had api-versions 'v1' and 'v2'. + * @param apiVersion Pass in either 'v1' or 'v2'. This represents the API version of a service. * @param serviceVersion Service version. */ public ResiliencyServiceDrivenClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint, String serviceDeploymentVersion, ServiceDrivenServiceVersion serviceVersion) { + String endpoint, String serviceDeploymentVersion, String apiVersion, + ServiceDrivenServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; this.serviceDeploymentVersion = serviceDeploymentVersion; + this.apiVersion = apiVersion; this.serviceVersion = serviceVersion; this.service = RestProxy.create(ResiliencyServiceDrivenClientService.class, this.httpPipeline, this.getSerializerAdapter()); @@ -185,8 +204,7 @@ public interface ResiliencyServiceDrivenClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> addOperation(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Delete("/add-operation") @ExpectedResponses({ 204 }) @@ -196,8 +214,7 @@ Mono> addOperation(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response addOperationSync(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Head("/add-optional-param/from-none") @ExpectedResponses({ 204 }) @@ -207,8 +224,7 @@ Response addOperationSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> fromNone(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Head("/add-optional-param/from-none") @ExpectedResponses({ 204 }) @@ -218,8 +234,7 @@ Mono> fromNone(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response fromNoneSync(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Get("/add-optional-param/from-one-required") @ExpectedResponses({ 204 }) @@ -230,7 +245,7 @@ Response fromNoneSync(@HostParam("endpoint") String endpoint, Mono> fromOneRequired(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, @HostParam("apiVersion") String apiVersion, @QueryParam("parameter") String parameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Get("/add-optional-param/from-one-required") @ExpectedResponses({ 204 }) @@ -241,7 +256,7 @@ Mono> fromOneRequired(@HostParam("endpoint") String endpoint, Response fromOneRequiredSync(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, @HostParam("apiVersion") String apiVersion, @QueryParam("parameter") String parameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Get("/add-optional-param/from-one-optional") @ExpectedResponses({ 204 }) @@ -251,8 +266,7 @@ Response fromOneRequiredSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> fromOneOptional(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Get("/add-optional-param/from-one-optional") @ExpectedResponses({ 204 }) @@ -262,8 +276,7 @@ Mono> fromOneOptional(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response fromOneOptionalSync(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); } /** @@ -278,10 +291,8 @@ Response fromOneOptionalSync(@HostParam("endpoint") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> addOperationWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.addOperation(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.addOperation(this.getEndpoint(), + this.getServiceDeploymentVersion(), this.getApiVersion(), requestOptions, context)); } /** @@ -296,9 +307,8 @@ public Mono> addOperationWithResponseAsync(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response addOperationWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.addOperationSync(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.addOperationSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), + requestOptions, Context.NONE); } /** @@ -320,9 +330,8 @@ public Response addOperationWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromNoneWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext(context -> service.fromNone(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), accept, requestOptions, context)); + this.getApiVersion(), requestOptions, context)); } /** @@ -344,9 +353,8 @@ public Mono> fromNoneWithResponseAsync(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromNoneWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.fromNoneSync(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.fromNoneSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), + requestOptions, Context.NONE); } /** @@ -370,10 +378,8 @@ public Response fromNoneWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromOneRequiredWithResponseAsync(String parameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.fromOneRequired(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), parameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.fromOneRequired(this.getEndpoint(), + this.getServiceDeploymentVersion(), this.getApiVersion(), parameter, requestOptions, context)); } /** @@ -397,9 +403,8 @@ public Mono> fromOneRequiredWithResponseAsync(String parameter, R */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromOneRequiredWithResponse(String parameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.fromOneRequiredSync(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), parameter, accept, requestOptions, Context.NONE); + return service.fromOneRequiredSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), + parameter, requestOptions, Context.NONE); } /** @@ -423,10 +428,8 @@ public Response fromOneRequiredWithResponse(String parameter, RequestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromOneOptionalWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.fromOneOptional(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.fromOneOptional(this.getEndpoint(), + this.getServiceDeploymentVersion(), this.getApiVersion(), requestOptions, context)); } /** @@ -450,8 +453,7 @@ public Mono> fromOneOptionalWithResponseAsync(RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromOneOptionalWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.fromOneOptionalSync(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.fromOneOptionalSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), + requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/ResiliencyServiceDrivenClientBuilder.java b/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/ResiliencyServiceDrivenClientBuilder.java index 4b851ce32d..1e2ca9c103 100644 --- a/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/ResiliencyServiceDrivenClientBuilder.java +++ b/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/ResiliencyServiceDrivenClientBuilder.java @@ -213,6 +213,26 @@ public ResiliencyServiceDrivenClientBuilder serviceDeploymentVersion(String serv return this; } + /* + * Pass in 'v1'. This represents the API version of the service. Will grow up in the next deployment to be both 'v1' + * and 'v2' + */ + @Generated + private String apiVersion; + + /** + * Sets Pass in 'v1'. This represents the API version of the service. Will grow up in the next deployment to be both + * 'v1' and 'v2'. + * + * @param apiVersion the apiVersion value. + * @return the ResiliencyServiceDrivenClientBuilder. + */ + @Generated + public ResiliencyServiceDrivenClientBuilder apiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + /* * Service version */ @@ -262,7 +282,7 @@ private ResiliencyServiceDrivenClientImpl buildInnerClient() { = (serviceVersion != null) ? serviceVersion : ServiceDrivenServiceVersion.getLatest(); ResiliencyServiceDrivenClientImpl client = new ResiliencyServiceDrivenClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), - this.endpoint, this.serviceDeploymentVersion, localServiceVersion); + this.endpoint, this.serviceDeploymentVersion, this.apiVersion, localServiceVersion); return client; } @@ -272,6 +292,7 @@ private void validateClient() { // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); Objects.requireNonNull(serviceDeploymentVersion, "'serviceDeploymentVersion' cannot be null."); + Objects.requireNonNull(apiVersion, "'apiVersion' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/implementation/ResiliencyServiceDrivenClientImpl.java b/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/implementation/ResiliencyServiceDrivenClientImpl.java index e52308a2ad..dde4ef8910 100644 --- a/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/implementation/ResiliencyServiceDrivenClientImpl.java +++ b/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/implementation/ResiliencyServiceDrivenClientImpl.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; import com.azure.core.annotation.Head; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.QueryParam; @@ -74,6 +73,22 @@ public String getServiceDeploymentVersion() { return this.serviceDeploymentVersion; } + /** + * Pass in 'v1'. This represents the API version of the service. Will grow up in the next deployment to be both 'v1' + * and 'v2'. + */ + private final String apiVersion; + + /** + * Gets Pass in 'v1'. This represents the API version of the service. Will grow up in the next deployment to be both + * 'v1' and 'v2'. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + /** * Service version. */ @@ -123,12 +138,15 @@ public SerializerAdapter getSerializerAdapter() { * @param serviceDeploymentVersion Pass in either 'v1' or 'v2'. This represents a version of the service deployment * in history. 'v1' is for the deployment when the service had only one api version. 'v2' is for the deployment when * the service had api-versions 'v1' and 'v2'. + * @param apiVersion Pass in 'v1'. This represents the API version of the service. Will grow up in the next + * deployment to be both 'v1' and 'v2'. * @param serviceVersion Service version. */ - public ResiliencyServiceDrivenClientImpl(String endpoint, String serviceDeploymentVersion, + public ResiliencyServiceDrivenClientImpl(String endpoint, String serviceDeploymentVersion, String apiVersion, ServiceDrivenServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceDeploymentVersion, serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceDeploymentVersion, apiVersion, + serviceVersion); } /** @@ -139,12 +157,14 @@ public ResiliencyServiceDrivenClientImpl(String endpoint, String serviceDeployme * @param serviceDeploymentVersion Pass in either 'v1' or 'v2'. This represents a version of the service deployment * in history. 'v1' is for the deployment when the service had only one api version. 'v2' is for the deployment when * the service had api-versions 'v1' and 'v2'. + * @param apiVersion Pass in 'v1'. This represents the API version of the service. Will grow up in the next + * deployment to be both 'v1' and 'v2'. * @param serviceVersion Service version. */ public ResiliencyServiceDrivenClientImpl(HttpPipeline httpPipeline, String endpoint, - String serviceDeploymentVersion, ServiceDrivenServiceVersion serviceVersion) { + String serviceDeploymentVersion, String apiVersion, ServiceDrivenServiceVersion serviceVersion) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceDeploymentVersion, - serviceVersion); + apiVersion, serviceVersion); } /** @@ -156,14 +176,18 @@ public ResiliencyServiceDrivenClientImpl(HttpPipeline httpPipeline, String endpo * @param serviceDeploymentVersion Pass in either 'v1' or 'v2'. This represents a version of the service deployment * in history. 'v1' is for the deployment when the service had only one api version. 'v2' is for the deployment when * the service had api-versions 'v1' and 'v2'. + * @param apiVersion Pass in 'v1'. This represents the API version of the service. Will grow up in the next + * deployment to be both 'v1' and 'v2'. * @param serviceVersion Service version. */ public ResiliencyServiceDrivenClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint, String serviceDeploymentVersion, ServiceDrivenServiceVersion serviceVersion) { + String endpoint, String serviceDeploymentVersion, String apiVersion, + ServiceDrivenServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; this.serviceDeploymentVersion = serviceDeploymentVersion; + this.apiVersion = apiVersion; this.serviceVersion = serviceVersion; this.service = RestProxy.create(ResiliencyServiceDrivenClientService.class, this.httpPipeline, this.getSerializerAdapter()); @@ -184,8 +208,7 @@ public interface ResiliencyServiceDrivenClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> fromNone(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Head("/add-optional-param/from-none") @ExpectedResponses({ 204 }) @@ -195,8 +218,7 @@ Mono> fromNone(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response fromNoneSync(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Get("/add-optional-param/from-one-required") @ExpectedResponses({ 204 }) @@ -207,7 +229,7 @@ Response fromNoneSync(@HostParam("endpoint") String endpoint, Mono> fromOneRequired(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, @HostParam("apiVersion") String apiVersion, @QueryParam("parameter") String parameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Get("/add-optional-param/from-one-required") @ExpectedResponses({ 204 }) @@ -218,7 +240,7 @@ Mono> fromOneRequired(@HostParam("endpoint") String endpoint, Response fromOneRequiredSync(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, @HostParam("apiVersion") String apiVersion, @QueryParam("parameter") String parameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Get("/add-optional-param/from-one-optional") @ExpectedResponses({ 204 }) @@ -228,8 +250,7 @@ Response fromOneRequiredSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> fromOneOptional(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Get("/add-optional-param/from-one-optional") @ExpectedResponses({ 204 }) @@ -239,8 +260,7 @@ Mono> fromOneOptional(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response fromOneOptionalSync(@HostParam("endpoint") String endpoint, @HostParam("serviceDeploymentVersion") String serviceDeploymentVersion, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); } /** @@ -256,9 +276,8 @@ Response fromOneOptionalSync(@HostParam("endpoint") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromNoneWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext(context -> service.fromNone(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), accept, requestOptions, context)); + this.getApiVersion(), requestOptions, context)); } /** @@ -274,9 +293,8 @@ public Mono> fromNoneWithResponseAsync(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromNoneWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.fromNoneSync(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.fromNoneSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), + requestOptions, Context.NONE); } /** @@ -293,10 +311,8 @@ public Response fromNoneWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromOneRequiredWithResponseAsync(String parameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.fromOneRequired(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), parameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.fromOneRequired(this.getEndpoint(), + this.getServiceDeploymentVersion(), this.getApiVersion(), parameter, requestOptions, context)); } /** @@ -313,9 +329,8 @@ public Mono> fromOneRequiredWithResponseAsync(String parameter, R */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromOneRequiredWithResponse(String parameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.fromOneRequiredSync(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), parameter, accept, requestOptions, Context.NONE); + return service.fromOneRequiredSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), + parameter, requestOptions, Context.NONE); } /** @@ -338,10 +353,8 @@ public Response fromOneRequiredWithResponse(String parameter, RequestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromOneOptionalWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.fromOneOptional(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.fromOneOptional(this.getEndpoint(), + this.getServiceDeploymentVersion(), this.getApiVersion(), requestOptions, context)); } /** @@ -364,8 +377,7 @@ public Mono> fromOneOptionalWithResponseAsync(RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromOneOptionalWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.fromOneOptionalSync(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.fromOneOptionalSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), + requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/serialization/encodedname/json/implementation/PropertiesImpl.java b/typespec-tests/src/main/java/com/serialization/encodedname/json/implementation/PropertiesImpl.java index 342282e241..fb64a2b5c7 100644 --- a/typespec-tests/src/main/java/com/serialization/encodedname/json/implementation/PropertiesImpl.java +++ b/typespec-tests/src/main/java/com/serialization/encodedname/json/implementation/PropertiesImpl.java @@ -64,8 +64,8 @@ public interface PropertiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> send(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/serialization/encoded-name/json/property") @ExpectedResponses({ 204 }) @@ -73,8 +73,8 @@ Mono> send(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response sendSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/serialization/encoded-name/json/property") @ExpectedResponses({ 200 }) @@ -82,7 +82,7 @@ Response sendSync(@HeaderParam("accept") String accept, @BodyParam("applic @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/serialization/encoded-name/json/property") @@ -91,7 +91,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -115,8 +115,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.send(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.send(contentType, body, requestOptions, context)); } /** @@ -139,8 +139,8 @@ public Mono> sendWithResponseAsync(BinaryData body, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sendSync(contentType, body, requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/server/endpoint/notdefined/implementation/NotDefinedClientImpl.java b/typespec-tests/src/main/java/com/server/endpoint/notdefined/implementation/NotDefinedClientImpl.java index 8d282a971e..7cce6d2572 100644 --- a/typespec-tests/src/main/java/com/server/endpoint/notdefined/implementation/NotDefinedClientImpl.java +++ b/typespec-tests/src/main/java/com/server/endpoint/notdefined/implementation/NotDefinedClientImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Head; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.ReturnType; @@ -40,12 +39,12 @@ public final class NotDefinedClientImpl { private final NotDefinedClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -84,7 +83,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of NotDefinedClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public NotDefinedClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -95,7 +94,7 @@ public NotDefinedClientImpl(String endpoint) { * Initializes an instance of NotDefinedClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public NotDefinedClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -106,7 +105,7 @@ public NotDefinedClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public NotDefinedClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; @@ -128,8 +127,8 @@ public interface NotDefinedClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> valid(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> valid(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Head("/server/endpoint/not-defined/valid") @ExpectedResponses({ 200 }) @@ -137,8 +136,8 @@ Mono> valid(@HostParam("endpoint") String endpoint, @HeaderParam( @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response validSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response validSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); } /** @@ -153,8 +152,7 @@ Response validSync(@HostParam("endpoint") String endpoint, @HeaderParam("a */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> validWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.valid(this.getEndpoint(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.valid(this.getEndpoint(), requestOptions, context)); } /** @@ -169,7 +167,6 @@ public Mono> validWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.validSync(this.getEndpoint(), accept, requestOptions, Context.NONE); + return service.validSync(this.getEndpoint(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/server/path/multiple/MultipleClientBuilder.java b/typespec-tests/src/main/java/com/server/path/multiple/MultipleClientBuilder.java index 1ebc0bd08f..4ebb6b9d97 100644 --- a/typespec-tests/src/main/java/com/server/path/multiple/MultipleClientBuilder.java +++ b/typespec-tests/src/main/java/com/server/path/multiple/MultipleClientBuilder.java @@ -189,6 +189,24 @@ public MultipleClientBuilder endpoint(String endpoint) { return this; } + /* + * Pass in v1.0 for API version. + */ + @Generated + private String apiVersion; + + /** + * Sets Pass in v1.0 for API version. + * + * @param apiVersion the apiVersion value. + * @return the MultipleClientBuilder. + */ + @Generated + public MultipleClientBuilder apiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + /* * Service version */ @@ -237,7 +255,7 @@ private MultipleClientImpl buildInnerClient() { MultipleServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : MultipleServiceVersion.getLatest(); MultipleClientImpl client = new MultipleClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, this.apiVersion, localServiceVersion); return client; } @@ -246,6 +264,7 @@ private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + Objects.requireNonNull(apiVersion, "'apiVersion' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/server/path/multiple/implementation/MultipleClientImpl.java b/typespec-tests/src/main/java/com/server/path/multiple/implementation/MultipleClientImpl.java index 93144cb321..ba725b365e 100644 --- a/typespec-tests/src/main/java/com/server/path/multiple/implementation/MultipleClientImpl.java +++ b/typespec-tests/src/main/java/com/server/path/multiple/implementation/MultipleClientImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; @@ -55,6 +54,20 @@ public String getEndpoint() { return this.endpoint; } + /** + * Pass in v1.0 for API version. + */ + private final String apiVersion; + + /** + * Gets Pass in v1.0 for API version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + /** * Service version. */ @@ -101,11 +114,12 @@ public SerializerAdapter getSerializerAdapter() { * Initializes an instance of MultipleClient client. * * @param endpoint Pass in http://localhost:3000 for endpoint. + * @param apiVersion Pass in v1.0 for API version. * @param serviceVersion Service version. */ - public MultipleClientImpl(String endpoint, MultipleServiceVersion serviceVersion) { + public MultipleClientImpl(String endpoint, String apiVersion, MultipleServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion, serviceVersion); } /** @@ -113,10 +127,12 @@ public MultipleClientImpl(String endpoint, MultipleServiceVersion serviceVersion * * @param httpPipeline The HTTP pipeline to send requests through. * @param endpoint Pass in http://localhost:3000 for endpoint. + * @param apiVersion Pass in v1.0 for API version. * @param serviceVersion Service version. */ - public MultipleClientImpl(HttpPipeline httpPipeline, String endpoint, MultipleServiceVersion serviceVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + public MultipleClientImpl(HttpPipeline httpPipeline, String endpoint, String apiVersion, + MultipleServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion, serviceVersion); } /** @@ -125,13 +141,15 @@ public MultipleClientImpl(HttpPipeline httpPipeline, String endpoint, MultipleSe * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param endpoint Pass in http://localhost:3000 for endpoint. + * @param apiVersion Pass in v1.0 for API version. * @param serviceVersion Service version. */ public MultipleClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - MultipleServiceVersion serviceVersion) { + String apiVersion, MultipleServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; + this.apiVersion = apiVersion; this.serviceVersion = serviceVersion; this.service = RestProxy.create(MultipleClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -149,8 +167,7 @@ public interface MultipleClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> noOperationParams(@HostParam("endpoint") String endpoint, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Get("/") @ExpectedResponses({ 204 }) @@ -159,8 +176,7 @@ Mono> noOperationParams(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response noOperationParamsSync(@HostParam("endpoint") String endpoint, - @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @HostParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Get("/{keyword}") @ExpectedResponses({ 204 }) @@ -170,7 +186,7 @@ Response noOperationParamsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withOperationPathParam(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("keyword") String keyword, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Get("/{keyword}") @ExpectedResponses({ 204 }) @@ -180,7 +196,7 @@ Mono> withOperationPathParam(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(HttpResponseException.class) Response withOperationPathParamSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("keyword") String keyword, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -195,9 +211,8 @@ Response withOperationPathParamSync(@HostParam("endpoint") String endpoint */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> noOperationParamsWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.noOperationParams(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.noOperationParams(this.getEndpoint(), this.getApiVersion(), requestOptions, context)); } /** @@ -212,9 +227,7 @@ public Mono> noOperationParamsWithResponseAsync(RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response noOperationParamsWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.noOperationParamsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, - requestOptions, Context.NONE); + return service.noOperationParamsSync(this.getEndpoint(), this.getApiVersion(), requestOptions, Context.NONE); } /** @@ -230,9 +243,8 @@ public Response noOperationParamsWithResponse(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withOperationPathParamWithResponseAsync(String keyword, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withOperationPathParam(this.getEndpoint(), - this.getServiceVersion().getVersion(), keyword, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withOperationPathParam(this.getEndpoint(), this.getApiVersion(), + keyword, requestOptions, context)); } /** @@ -248,8 +260,7 @@ public Mono> withOperationPathParamWithResponseAsync(String keywo */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withOperationPathParamWithResponse(String keyword, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withOperationPathParamSync(this.getEndpoint(), this.getServiceVersion().getVersion(), keyword, - accept, requestOptions, Context.NONE); + return service.withOperationPathParamSync(this.getEndpoint(), this.getApiVersion(), keyword, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/server/path/single/implementation/SingleClientImpl.java b/typespec-tests/src/main/java/com/server/path/single/implementation/SingleClientImpl.java index bfd0a77abe..59c6962adc 100644 --- a/typespec-tests/src/main/java/com/server/path/single/implementation/SingleClientImpl.java +++ b/typespec-tests/src/main/java/com/server/path/single/implementation/SingleClientImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Head; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.ReturnType; @@ -127,8 +126,8 @@ public interface SingleClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> myOp(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> myOp(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Head("/server/path/single/myOp") @ExpectedResponses({ 200 }) @@ -136,8 +135,7 @@ Mono> myOp(@HostParam("endpoint") String endpoint, @HeaderParam(" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response myOpSync(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response myOpSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); } /** @@ -152,8 +150,7 @@ Response myOpSync(@HostParam("endpoint") String endpoint, @HeaderParam("ac */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> myOpWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.myOp(this.getEndpoint(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.myOp(this.getEndpoint(), requestOptions, context)); } /** @@ -168,7 +165,6 @@ public Mono> myOpWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response myOpWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.myOpSync(this.getEndpoint(), accept, requestOptions, Context.NONE); + return service.myOpSync(this.getEndpoint(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/server/versions/notversioned/implementation/NotVersionedClientImpl.java b/typespec-tests/src/main/java/com/server/versions/notversioned/implementation/NotVersionedClientImpl.java index 25d41d2449..eff9b16d95 100644 --- a/typespec-tests/src/main/java/com/server/versions/notversioned/implementation/NotVersionedClientImpl.java +++ b/typespec-tests/src/main/java/com/server/versions/notversioned/implementation/NotVersionedClientImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Head; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; @@ -131,8 +130,8 @@ public interface NotVersionedClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withoutApiVersion(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> withoutApiVersion(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Head("/server/versions/not-versioned/without-api-version") @ExpectedResponses({ 200 }) @@ -140,8 +139,8 @@ Mono> withoutApiVersion(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withoutApiVersionSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response withoutApiVersionSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Head("/server/versions/not-versioned/with-query-api-version") @ExpectedResponses({ 200 }) @@ -150,8 +149,7 @@ Response withoutApiVersionSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withQueryApiVersion(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); @Head("/server/versions/not-versioned/with-query-api-version") @ExpectedResponses({ 200 }) @@ -160,8 +158,7 @@ Mono> withQueryApiVersion(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response withQueryApiVersionSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); @Head("/server/versions/not-versioned/with-path-api-version/{apiVersion}") @ExpectedResponses({ 200 }) @@ -170,8 +167,7 @@ Response withQueryApiVersionSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withPathApiVersion(@HostParam("endpoint") String endpoint, - @PathParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @PathParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Head("/server/versions/not-versioned/with-path-api-version/{apiVersion}") @ExpectedResponses({ 200 }) @@ -180,8 +176,7 @@ Mono> withPathApiVersion(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response withPathApiVersionSync(@HostParam("endpoint") String endpoint, - @PathParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @PathParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); } /** @@ -196,9 +191,7 @@ Response withPathApiVersionSync(@HostParam("endpoint") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withoutApiVersionWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.withoutApiVersion(this.getEndpoint(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withoutApiVersion(this.getEndpoint(), requestOptions, context)); } /** @@ -213,8 +206,7 @@ public Mono> withoutApiVersionWithResponseAsync(RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withoutApiVersionWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withoutApiVersionSync(this.getEndpoint(), accept, requestOptions, Context.NONE); + return service.withoutApiVersionSync(this.getEndpoint(), requestOptions, Context.NONE); } /** @@ -230,9 +222,8 @@ public Response withoutApiVersionWithResponse(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withQueryApiVersionWithResponseAsync(String apiVersion, RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext( - context -> service.withQueryApiVersion(this.getEndpoint(), apiVersion, accept, requestOptions, context)); + context -> service.withQueryApiVersion(this.getEndpoint(), apiVersion, requestOptions, context)); } /** @@ -248,8 +239,7 @@ public Mono> withQueryApiVersionWithResponseAsync(String apiVersi */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withQueryApiVersionWithResponse(String apiVersion, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withQueryApiVersionSync(this.getEndpoint(), apiVersion, accept, requestOptions, Context.NONE); + return service.withQueryApiVersionSync(this.getEndpoint(), apiVersion, requestOptions, Context.NONE); } /** @@ -265,9 +255,8 @@ public Response withQueryApiVersionWithResponse(String apiVersion, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withPathApiVersionWithResponseAsync(String apiVersion, RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext( - context -> service.withPathApiVersion(this.getEndpoint(), apiVersion, accept, requestOptions, context)); + context -> service.withPathApiVersion(this.getEndpoint(), apiVersion, requestOptions, context)); } /** @@ -283,7 +272,6 @@ public Mono> withPathApiVersionWithResponseAsync(String apiVersio */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withPathApiVersionWithResponse(String apiVersion, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withPathApiVersionSync(this.getEndpoint(), apiVersion, accept, requestOptions, Context.NONE); + return service.withPathApiVersionSync(this.getEndpoint(), apiVersion, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/server/versions/versioned/implementation/VersionedClientImpl.java b/typespec-tests/src/main/java/com/server/versions/versioned/implementation/VersionedClientImpl.java index fae0a0f208..70b6ff082e 100644 --- a/typespec-tests/src/main/java/com/server/versions/versioned/implementation/VersionedClientImpl.java +++ b/typespec-tests/src/main/java/com/server/versions/versioned/implementation/VersionedClientImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Head; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; @@ -150,8 +149,8 @@ public interface VersionedClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withoutApiVersion(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> withoutApiVersion(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Head("/server/versions/versioned/without-api-version") @ExpectedResponses({ 200 }) @@ -159,8 +158,8 @@ Mono> withoutApiVersion(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withoutApiVersionSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response withoutApiVersionSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Head("/server/versions/versioned/with-query-api-version") @ExpectedResponses({ 200 }) @@ -169,8 +168,7 @@ Response withoutApiVersionSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withQueryApiVersion(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); @Head("/server/versions/versioned/with-query-api-version") @ExpectedResponses({ 200 }) @@ -179,8 +177,7 @@ Mono> withQueryApiVersion(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response withQueryApiVersionSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); @Head("/server/versions/versioned/with-path-api-version/{apiVersion}") @ExpectedResponses({ 200 }) @@ -189,8 +186,7 @@ Response withQueryApiVersionSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withPathApiVersion(@HostParam("endpoint") String endpoint, - @PathParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @PathParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Head("/server/versions/versioned/with-path-api-version/{apiVersion}") @ExpectedResponses({ 200 }) @@ -199,8 +195,7 @@ Mono> withPathApiVersion(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response withPathApiVersionSync(@HostParam("endpoint") String endpoint, - @PathParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @PathParam("apiVersion") String apiVersion, RequestOptions requestOptions, Context context); @Head("/server/versions/versioned/with-query-old-api-version") @ExpectedResponses({ 200 }) @@ -209,8 +204,7 @@ Response withPathApiVersionSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withQueryOldApiVersion(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); @Head("/server/versions/versioned/with-query-old-api-version") @ExpectedResponses({ 200 }) @@ -219,8 +213,7 @@ Mono> withQueryOldApiVersion(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response withQueryOldApiVersionSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); } /** @@ -235,9 +228,7 @@ Response withQueryOldApiVersionSync(@HostParam("endpoint") String endpoint */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withoutApiVersionWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.withoutApiVersion(this.getEndpoint(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withoutApiVersion(this.getEndpoint(), requestOptions, context)); } /** @@ -252,8 +243,7 @@ public Mono> withoutApiVersionWithResponseAsync(RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withoutApiVersionWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withoutApiVersionSync(this.getEndpoint(), accept, requestOptions, Context.NONE); + return service.withoutApiVersionSync(this.getEndpoint(), requestOptions, Context.NONE); } /** @@ -268,9 +258,8 @@ public Response withoutApiVersionWithResponse(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withQueryApiVersionWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext(context -> service.withQueryApiVersion(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, requestOptions, context)); + this.getServiceVersion().getVersion(), requestOptions, context)); } /** @@ -285,8 +274,7 @@ public Mono> withQueryApiVersionWithResponseAsync(RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withQueryApiVersionWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withQueryApiVersionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + return service.withQueryApiVersionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), requestOptions, Context.NONE); } @@ -302,9 +290,8 @@ public Response withQueryApiVersionWithResponse(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withPathApiVersionWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext(context -> service.withPathApiVersion(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, requestOptions, context)); + this.getServiceVersion().getVersion(), requestOptions, context)); } /** @@ -319,9 +306,8 @@ public Mono> withPathApiVersionWithResponseAsync(RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withPathApiVersionWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withPathApiVersionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, - requestOptions, Context.NONE); + return service.withPathApiVersionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), requestOptions, + Context.NONE); } /** @@ -336,9 +322,8 @@ public Response withPathApiVersionWithResponse(RequestOptions requestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withQueryOldApiVersionWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext(context -> service.withQueryOldApiVersion(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, requestOptions, context)); + this.getServiceVersion().getVersion(), requestOptions, context)); } /** @@ -353,8 +338,7 @@ public Mono> withQueryOldApiVersionWithResponseAsync(RequestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withQueryOldApiVersionWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withQueryOldApiVersionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + return service.withQueryOldApiVersionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/specialheaders/conditionalrequest/implementation/ConditionalRequestClientImpl.java b/typespec-tests/src/main/java/com/specialheaders/conditionalrequest/implementation/ConditionalRequestClientImpl.java index b5b4d489a0..df7fa365a0 100644 --- a/typespec-tests/src/main/java/com/specialheaders/conditionalrequest/implementation/ConditionalRequestClientImpl.java +++ b/typespec-tests/src/main/java/com/specialheaders/conditionalrequest/implementation/ConditionalRequestClientImpl.java @@ -5,7 +5,6 @@ package com.specialheaders.conditionalrequest.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; @@ -109,8 +108,7 @@ public interface ConditionalRequestClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> postIfMatch(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> postIfMatch(RequestOptions requestOptions, Context context); @Post("/special-headers/conditional-request/if-match") @ExpectedResponses({ 204 }) @@ -118,8 +116,7 @@ Mono> postIfMatch(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postIfMatchSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response postIfMatchSync(RequestOptions requestOptions, Context context); @Post("/special-headers/conditional-request/if-none-match") @ExpectedResponses({ 204 }) @@ -127,8 +124,7 @@ Response postIfMatchSync(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> postIfNoneMatch(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> postIfNoneMatch(RequestOptions requestOptions, Context context); @Post("/special-headers/conditional-request/if-none-match") @ExpectedResponses({ 204 }) @@ -136,8 +132,7 @@ Mono> postIfNoneMatch(@HeaderParam("accept") String accept, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postIfNoneMatchSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response postIfNoneMatchSync(RequestOptions requestOptions, Context context); } /** @@ -160,8 +155,7 @@ Response postIfNoneMatchSync(@HeaderParam("accept") String accept, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postIfMatchWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.postIfMatch(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.postIfMatch(requestOptions, context)); } /** @@ -184,8 +178,7 @@ public Mono> postIfMatchWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postIfMatchWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.postIfMatchSync(accept, requestOptions, Context.NONE); + return service.postIfMatchSync(requestOptions, Context.NONE); } /** @@ -208,8 +201,7 @@ public Response postIfMatchWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postIfNoneMatchWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.postIfNoneMatch(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.postIfNoneMatch(requestOptions, context)); } /** @@ -232,7 +224,6 @@ public Mono> postIfNoneMatchWithResponseAsync(RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postIfNoneMatchWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.postIfNoneMatchSync(accept, requestOptions, Context.NONE); + return service.postIfNoneMatchSync(requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/specialheaders/repeatability/implementation/RepeatabilityClientImpl.java b/typespec-tests/src/main/java/com/specialheaders/repeatability/implementation/RepeatabilityClientImpl.java index 2fac45b8ce..2a173296b4 100644 --- a/typespec-tests/src/main/java/com/specialheaders/repeatability/implementation/RepeatabilityClientImpl.java +++ b/typespec-tests/src/main/java/com/specialheaders/repeatability/implementation/RepeatabilityClientImpl.java @@ -5,7 +5,6 @@ package com.specialheaders.repeatability.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; @@ -113,8 +112,7 @@ public interface RepeatabilityClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> immediateSuccess(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> immediateSuccess(RequestOptions requestOptions, Context context); @Post("/special-headers/repeatability/immediateSuccess") @ExpectedResponses({ 204 }) @@ -122,8 +120,7 @@ Mono> immediateSuccess(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response immediateSuccessSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response immediateSuccessSync(RequestOptions requestOptions, Context context); } /** @@ -147,7 +144,6 @@ Response immediateSuccessSync(@HeaderParam("accept") String accept, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> immediateSuccessWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { if (requestLocal.getHeaders().get(HttpHeaderName.fromString("repeatability-request-id")) == null) { @@ -162,7 +158,7 @@ public Mono> immediateSuccessWithResponseAsync(RequestOptions req DateTimeRfc1123.toRfc1123String(OffsetDateTime.now())); } }); - return FluxUtil.withContext(context -> service.immediateSuccess(accept, requestOptionsLocal, context)); + return FluxUtil.withContext(context -> service.immediateSuccess(requestOptionsLocal, context)); } /** @@ -186,7 +182,6 @@ public Mono> immediateSuccessWithResponseAsync(RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Response immediateSuccessWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { if (requestLocal.getHeaders().get(HttpHeaderName.fromString("repeatability-request-id")) == null) { @@ -201,6 +196,6 @@ public Response immediateSuccessWithResponse(RequestOptions requestOptions DateTimeRfc1123.toRfc1123String(OffsetDateTime.now())); } }); - return service.immediateSuccessSync(accept, requestOptionsLocal, Context.NONE); + return service.immediateSuccessSync(requestOptionsLocal, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/specialwords/implementation/ModelPropertiesImpl.java b/typespec-tests/src/main/java/com/specialwords/implementation/ModelPropertiesImpl.java index db9360cc23..5cafb1140f 100644 --- a/typespec-tests/src/main/java/com/specialwords/implementation/ModelPropertiesImpl.java +++ b/typespec-tests/src/main/java/com/specialwords/implementation/ModelPropertiesImpl.java @@ -63,7 +63,7 @@ public interface ModelPropertiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> sameAsModel(@HeaderParam("accept") String accept, + Mono> sameAsModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/model-properties/same-as-model") @@ -72,7 +72,7 @@ Mono> sameAsModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sameAsModelSync(@HeaderParam("accept") String accept, + Response sameAsModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -96,8 +96,8 @@ Response sameAsModelSync(@HeaderParam("accept") String accept, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sameAsModelWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.sameAsModel(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.sameAsModel(contentType, body, requestOptions, context)); } /** @@ -120,7 +120,7 @@ public Mono> sameAsModelWithResponseAsync(BinaryData body, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sameAsModelWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sameAsModelSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sameAsModelSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/specialwords/implementation/ModelsImpl.java b/typespec-tests/src/main/java/com/specialwords/implementation/ModelsImpl.java index d4b6404abf..87d74f2309 100644 --- a/typespec-tests/src/main/java/com/specialwords/implementation/ModelsImpl.java +++ b/typespec-tests/src/main/java/com/specialwords/implementation/ModelsImpl.java @@ -62,7 +62,7 @@ public interface ModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAnd(@HeaderParam("accept") String accept, + Mono> withAnd(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/and") @@ -71,8 +71,8 @@ Mono> withAnd(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAndSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response withAndSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/as") @ExpectedResponses({ 204 }) @@ -80,7 +80,7 @@ Response withAndSync(@HeaderParam("accept") String accept, @BodyParam("app @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAs(@HeaderParam("accept") String accept, + Mono> withAs(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/as") @@ -89,8 +89,8 @@ Mono> withAs(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAsSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response withAsSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/assert") @ExpectedResponses({ 204 }) @@ -98,7 +98,7 @@ Response withAsSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAssert(@HeaderParam("accept") String accept, + Mono> withAssert(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/assert") @@ -107,7 +107,7 @@ Mono> withAssert(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAssertSync(@HeaderParam("accept") String accept, + Response withAssertSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/async") @@ -116,7 +116,7 @@ Response withAssertSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAsync(@HeaderParam("accept") String accept, + Mono> withAsync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/async") @@ -125,7 +125,7 @@ Mono> withAsync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAsyncSync(@HeaderParam("accept") String accept, + Response withAsyncSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/await") @@ -134,7 +134,7 @@ Response withAsyncSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAwait(@HeaderParam("accept") String accept, + Mono> withAwait(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/await") @@ -143,7 +143,7 @@ Mono> withAwait(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAwaitSync(@HeaderParam("accept") String accept, + Response withAwaitSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/break") @@ -152,7 +152,7 @@ Response withAwaitSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withBreak(@HeaderParam("accept") String accept, + Mono> withBreak(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/break") @@ -161,7 +161,7 @@ Mono> withBreak(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withBreakSync(@HeaderParam("accept") String accept, + Response withBreakSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/class") @@ -170,7 +170,7 @@ Response withBreakSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withClass(@HeaderParam("accept") String accept, + Mono> withClass(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/class") @@ -179,7 +179,7 @@ Mono> withClass(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withClassSync(@HeaderParam("accept") String accept, + Response withClassSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/constructor") @@ -188,7 +188,7 @@ Response withClassSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withConstructor(@HeaderParam("accept") String accept, + Mono> withConstructor(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/constructor") @@ -197,7 +197,7 @@ Mono> withConstructor(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withConstructorSync(@HeaderParam("accept") String accept, + Response withConstructorSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/continue") @@ -206,7 +206,7 @@ Response withConstructorSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withContinue(@HeaderParam("accept") String accept, + Mono> withContinue(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/continue") @@ -215,7 +215,7 @@ Mono> withContinue(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withContinueSync(@HeaderParam("accept") String accept, + Response withContinueSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/def") @@ -224,7 +224,7 @@ Response withContinueSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withDef(@HeaderParam("accept") String accept, + Mono> withDef(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/def") @@ -233,8 +233,8 @@ Mono> withDef(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withDefSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response withDefSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/del") @ExpectedResponses({ 204 }) @@ -242,7 +242,7 @@ Response withDefSync(@HeaderParam("accept") String accept, @BodyParam("app @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withDel(@HeaderParam("accept") String accept, + Mono> withDel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/del") @@ -251,8 +251,8 @@ Mono> withDel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withDelSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response withDelSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/elif") @ExpectedResponses({ 204 }) @@ -260,7 +260,7 @@ Response withDelSync(@HeaderParam("accept") String accept, @BodyParam("app @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withElif(@HeaderParam("accept") String accept, + Mono> withElif(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/elif") @@ -269,7 +269,7 @@ Mono> withElif(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withElifSync(@HeaderParam("accept") String accept, + Response withElifSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/else") @@ -278,7 +278,7 @@ Response withElifSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withElse(@HeaderParam("accept") String accept, + Mono> withElse(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/else") @@ -287,7 +287,7 @@ Mono> withElse(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withElseSync(@HeaderParam("accept") String accept, + Response withElseSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/except") @@ -296,7 +296,7 @@ Response withElseSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withExcept(@HeaderParam("accept") String accept, + Mono> withExcept(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/except") @@ -305,7 +305,7 @@ Mono> withExcept(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withExceptSync(@HeaderParam("accept") String accept, + Response withExceptSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/exec") @@ -314,7 +314,7 @@ Response withExceptSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withExec(@HeaderParam("accept") String accept, + Mono> withExec(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/exec") @@ -323,7 +323,7 @@ Mono> withExec(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withExecSync(@HeaderParam("accept") String accept, + Response withExecSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/finally") @@ -332,7 +332,7 @@ Response withExecSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withFinally(@HeaderParam("accept") String accept, + Mono> withFinally(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/finally") @@ -341,7 +341,7 @@ Mono> withFinally(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withFinallySync(@HeaderParam("accept") String accept, + Response withFinallySync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/for") @@ -350,7 +350,7 @@ Response withFinallySync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withFor(@HeaderParam("accept") String accept, + Mono> withFor(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/for") @@ -359,8 +359,8 @@ Mono> withFor(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withForSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response withForSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/from") @ExpectedResponses({ 204 }) @@ -368,7 +368,7 @@ Response withForSync(@HeaderParam("accept") String accept, @BodyParam("app @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withFrom(@HeaderParam("accept") String accept, + Mono> withFrom(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/from") @@ -377,7 +377,7 @@ Mono> withFrom(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withFromSync(@HeaderParam("accept") String accept, + Response withFromSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/global") @@ -386,7 +386,7 @@ Response withFromSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withGlobal(@HeaderParam("accept") String accept, + Mono> withGlobal(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/global") @@ -395,7 +395,7 @@ Mono> withGlobal(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withGlobalSync(@HeaderParam("accept") String accept, + Response withGlobalSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/if") @@ -404,7 +404,7 @@ Response withGlobalSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withIf(@HeaderParam("accept") String accept, + Mono> withIf(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/if") @@ -413,8 +413,8 @@ Mono> withIf(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withIfSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response withIfSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/import") @ExpectedResponses({ 204 }) @@ -422,7 +422,7 @@ Response withIfSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withImport(@HeaderParam("accept") String accept, + Mono> withImport(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/import") @@ -431,7 +431,7 @@ Mono> withImport(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withImportSync(@HeaderParam("accept") String accept, + Response withImportSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/in") @@ -440,7 +440,7 @@ Response withImportSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withIn(@HeaderParam("accept") String accept, + Mono> withIn(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/in") @@ -449,8 +449,8 @@ Mono> withIn(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withInSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response withInSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/is") @ExpectedResponses({ 204 }) @@ -458,7 +458,7 @@ Response withInSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withIs(@HeaderParam("accept") String accept, + Mono> withIs(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/is") @@ -467,8 +467,8 @@ Mono> withIs(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withIsSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response withIsSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/lambda") @ExpectedResponses({ 204 }) @@ -476,7 +476,7 @@ Response withIsSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withLambda(@HeaderParam("accept") String accept, + Mono> withLambda(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/lambda") @@ -485,7 +485,7 @@ Mono> withLambda(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withLambdaSync(@HeaderParam("accept") String accept, + Response withLambdaSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/not") @@ -494,7 +494,7 @@ Response withLambdaSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withNot(@HeaderParam("accept") String accept, + Mono> withNot(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/not") @@ -503,8 +503,8 @@ Mono> withNot(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withNotSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response withNotSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/or") @ExpectedResponses({ 204 }) @@ -512,7 +512,7 @@ Response withNotSync(@HeaderParam("accept") String accept, @BodyParam("app @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withOr(@HeaderParam("accept") String accept, + Mono> withOr(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/or") @@ -521,8 +521,8 @@ Mono> withOr(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withOrSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response withOrSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/pass") @ExpectedResponses({ 204 }) @@ -530,7 +530,7 @@ Response withOrSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withPass(@HeaderParam("accept") String accept, + Mono> withPass(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/pass") @@ -539,7 +539,7 @@ Mono> withPass(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withPassSync(@HeaderParam("accept") String accept, + Response withPassSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/raise") @@ -548,7 +548,7 @@ Response withPassSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withRaise(@HeaderParam("accept") String accept, + Mono> withRaise(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/raise") @@ -557,7 +557,7 @@ Mono> withRaise(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withRaiseSync(@HeaderParam("accept") String accept, + Response withRaiseSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/return") @@ -566,7 +566,7 @@ Response withRaiseSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withReturn(@HeaderParam("accept") String accept, + Mono> withReturn(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/return") @@ -575,7 +575,7 @@ Mono> withReturn(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withReturnSync(@HeaderParam("accept") String accept, + Response withReturnSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/try") @@ -584,7 +584,7 @@ Response withReturnSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withTry(@HeaderParam("accept") String accept, + Mono> withTry(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/try") @@ -593,8 +593,8 @@ Mono> withTry(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withTrySync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response withTrySync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/while") @ExpectedResponses({ 204 }) @@ -602,7 +602,7 @@ Response withTrySync(@HeaderParam("accept") String accept, @BodyParam("app @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withWhile(@HeaderParam("accept") String accept, + Mono> withWhile(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/while") @@ -611,7 +611,7 @@ Mono> withWhile(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withWhileSync(@HeaderParam("accept") String accept, + Response withWhileSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/with") @@ -620,7 +620,7 @@ Response withWhileSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withWith(@HeaderParam("accept") String accept, + Mono> withWith(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/with") @@ -629,7 +629,7 @@ Mono> withWith(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withWithSync(@HeaderParam("accept") String accept, + Response withWithSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/yield") @@ -638,7 +638,7 @@ Response withWithSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withYield(@HeaderParam("accept") String accept, + Mono> withYield(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/special-words/models/yield") @@ -647,7 +647,7 @@ Mono> withYield(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withYieldSync(@HeaderParam("accept") String accept, + Response withYieldSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -671,8 +671,8 @@ Response withYieldSync(@HeaderParam("accept") String accept, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAndWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withAnd(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withAnd(contentType, body, requestOptions, context)); } /** @@ -695,8 +695,8 @@ public Mono> withAndWithResponseAsync(BinaryData body, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAndWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withAndSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withAndSync(contentType, body, requestOptions, Context.NONE); } /** @@ -719,8 +719,8 @@ public Response withAndWithResponse(BinaryData body, RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withAs(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withAs(contentType, body, requestOptions, context)); } /** @@ -743,8 +743,8 @@ public Mono> withAsWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAsWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withAsSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withAsSync(contentType, body, requestOptions, Context.NONE); } /** @@ -767,8 +767,8 @@ public Response withAsWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAssertWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withAssert(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withAssert(contentType, body, requestOptions, context)); } /** @@ -791,8 +791,8 @@ public Mono> withAssertWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAssertWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withAssertSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withAssertSync(contentType, body, requestOptions, Context.NONE); } /** @@ -815,8 +815,8 @@ public Response withAssertWithResponse(BinaryData body, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAsyncWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withAsync(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withAsync(contentType, body, requestOptions, context)); } /** @@ -839,8 +839,8 @@ public Mono> withAsyncWithResponseAsync(BinaryData body, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAsyncWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withAsyncSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withAsyncSync(contentType, body, requestOptions, Context.NONE); } /** @@ -863,8 +863,8 @@ public Response withAsyncWithResponse(BinaryData body, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAwaitWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withAwait(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withAwait(contentType, body, requestOptions, context)); } /** @@ -887,8 +887,8 @@ public Mono> withAwaitWithResponseAsync(BinaryData body, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAwaitWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withAwaitSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withAwaitSync(contentType, body, requestOptions, Context.NONE); } /** @@ -911,8 +911,8 @@ public Response withAwaitWithResponse(BinaryData body, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withBreakWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withBreak(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withBreak(contentType, body, requestOptions, context)); } /** @@ -935,8 +935,8 @@ public Mono> withBreakWithResponseAsync(BinaryData body, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withBreakWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withBreakSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withBreakSync(contentType, body, requestOptions, Context.NONE); } /** @@ -959,8 +959,8 @@ public Response withBreakWithResponse(BinaryData body, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withClassWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withClass(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withClass(contentType, body, requestOptions, context)); } /** @@ -983,8 +983,8 @@ public Mono> withClassWithResponseAsync(BinaryData body, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withClassWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withClassSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withClassSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1007,8 +1007,8 @@ public Response withClassWithResponse(BinaryData body, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withConstructorWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withConstructor(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withConstructor(contentType, body, requestOptions, context)); } /** @@ -1031,8 +1031,8 @@ public Mono> withConstructorWithResponseAsync(BinaryData body, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withConstructorWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withConstructorSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withConstructorSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1055,8 +1055,8 @@ public Response withConstructorWithResponse(BinaryData body, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withContinueWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withContinue(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withContinue(contentType, body, requestOptions, context)); } /** @@ -1079,8 +1079,8 @@ public Mono> withContinueWithResponseAsync(BinaryData body, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withContinueWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withContinueSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withContinueSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1103,8 +1103,8 @@ public Response withContinueWithResponse(BinaryData body, RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withDefWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withDef(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withDef(contentType, body, requestOptions, context)); } /** @@ -1127,8 +1127,8 @@ public Mono> withDefWithResponseAsync(BinaryData body, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withDefWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withDefSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withDefSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1151,8 +1151,8 @@ public Response withDefWithResponse(BinaryData body, RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withDelWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withDel(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withDel(contentType, body, requestOptions, context)); } /** @@ -1175,8 +1175,8 @@ public Mono> withDelWithResponseAsync(BinaryData body, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withDelWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withDelSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withDelSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1199,8 +1199,8 @@ public Response withDelWithResponse(BinaryData body, RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withElifWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withElif(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withElif(contentType, body, requestOptions, context)); } /** @@ -1223,8 +1223,8 @@ public Mono> withElifWithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withElifWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withElifSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withElifSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1247,8 +1247,8 @@ public Response withElifWithResponse(BinaryData body, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withElseWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withElse(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withElse(contentType, body, requestOptions, context)); } /** @@ -1271,8 +1271,8 @@ public Mono> withElseWithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withElseWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withElseSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withElseSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1295,8 +1295,8 @@ public Response withElseWithResponse(BinaryData body, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withExceptWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withExcept(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withExcept(contentType, body, requestOptions, context)); } /** @@ -1319,8 +1319,8 @@ public Mono> withExceptWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withExceptWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withExceptSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withExceptSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1343,8 +1343,8 @@ public Response withExceptWithResponse(BinaryData body, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withExecWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withExec(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withExec(contentType, body, requestOptions, context)); } /** @@ -1367,8 +1367,8 @@ public Mono> withExecWithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withExecWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withExecSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withExecSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1391,8 +1391,8 @@ public Response withExecWithResponse(BinaryData body, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withFinallyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withFinally(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withFinally(contentType, body, requestOptions, context)); } /** @@ -1415,8 +1415,8 @@ public Mono> withFinallyWithResponseAsync(BinaryData body, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withFinallyWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withFinallySync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withFinallySync(contentType, body, requestOptions, Context.NONE); } /** @@ -1439,8 +1439,8 @@ public Response withFinallyWithResponse(BinaryData body, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withForWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withFor(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withFor(contentType, body, requestOptions, context)); } /** @@ -1463,8 +1463,8 @@ public Mono> withForWithResponseAsync(BinaryData body, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withForWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withForSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withForSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1487,8 +1487,8 @@ public Response withForWithResponse(BinaryData body, RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withFromWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withFrom(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withFrom(contentType, body, requestOptions, context)); } /** @@ -1511,8 +1511,8 @@ public Mono> withFromWithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withFromWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withFromSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withFromSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1535,8 +1535,8 @@ public Response withFromWithResponse(BinaryData body, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withGlobalWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withGlobal(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withGlobal(contentType, body, requestOptions, context)); } /** @@ -1559,8 +1559,8 @@ public Mono> withGlobalWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withGlobalWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withGlobalSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withGlobalSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1583,8 +1583,8 @@ public Response withGlobalWithResponse(BinaryData body, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withIfWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withIf(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withIf(contentType, body, requestOptions, context)); } /** @@ -1607,8 +1607,8 @@ public Mono> withIfWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withIfWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withIfSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withIfSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1631,8 +1631,8 @@ public Response withIfWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withImportWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withImport(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withImport(contentType, body, requestOptions, context)); } /** @@ -1655,8 +1655,8 @@ public Mono> withImportWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withImportWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withImportSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withImportSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1679,8 +1679,8 @@ public Response withImportWithResponse(BinaryData body, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withInWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withIn(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withIn(contentType, body, requestOptions, context)); } /** @@ -1703,8 +1703,8 @@ public Mono> withInWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withInWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withInSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withInSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1727,8 +1727,8 @@ public Response withInWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withIsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withIs(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withIs(contentType, body, requestOptions, context)); } /** @@ -1751,8 +1751,8 @@ public Mono> withIsWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withIsWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withIsSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withIsSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1775,8 +1775,8 @@ public Response withIsWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withLambdaWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withLambda(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withLambda(contentType, body, requestOptions, context)); } /** @@ -1799,8 +1799,8 @@ public Mono> withLambdaWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withLambdaWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withLambdaSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withLambdaSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1823,8 +1823,8 @@ public Response withLambdaWithResponse(BinaryData body, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withNotWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withNot(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withNot(contentType, body, requestOptions, context)); } /** @@ -1847,8 +1847,8 @@ public Mono> withNotWithResponseAsync(BinaryData body, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withNotWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withNotSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withNotSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1871,8 +1871,8 @@ public Response withNotWithResponse(BinaryData body, RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withOrWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withOr(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withOr(contentType, body, requestOptions, context)); } /** @@ -1895,8 +1895,8 @@ public Mono> withOrWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withOrWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withOrSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withOrSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1919,8 +1919,8 @@ public Response withOrWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withPassWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withPass(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withPass(contentType, body, requestOptions, context)); } /** @@ -1943,8 +1943,8 @@ public Mono> withPassWithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withPassWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withPassSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withPassSync(contentType, body, requestOptions, Context.NONE); } /** @@ -1967,8 +1967,8 @@ public Response withPassWithResponse(BinaryData body, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withRaiseWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withRaise(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withRaise(contentType, body, requestOptions, context)); } /** @@ -1991,8 +1991,8 @@ public Mono> withRaiseWithResponseAsync(BinaryData body, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withRaiseWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withRaiseSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withRaiseSync(contentType, body, requestOptions, Context.NONE); } /** @@ -2015,8 +2015,8 @@ public Response withRaiseWithResponse(BinaryData body, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withReturnWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withReturn(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withReturn(contentType, body, requestOptions, context)); } /** @@ -2039,8 +2039,8 @@ public Mono> withReturnWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withReturnWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withReturnSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withReturnSync(contentType, body, requestOptions, Context.NONE); } /** @@ -2063,8 +2063,8 @@ public Response withReturnWithResponse(BinaryData body, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withTryWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withTry(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withTry(contentType, body, requestOptions, context)); } /** @@ -2087,8 +2087,8 @@ public Mono> withTryWithResponseAsync(BinaryData body, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withTryWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withTrySync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withTrySync(contentType, body, requestOptions, Context.NONE); } /** @@ -2111,8 +2111,8 @@ public Response withTryWithResponse(BinaryData body, RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withWhileWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withWhile(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withWhile(contentType, body, requestOptions, context)); } /** @@ -2135,8 +2135,8 @@ public Mono> withWhileWithResponseAsync(BinaryData body, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withWhileWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withWhileSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withWhileSync(contentType, body, requestOptions, Context.NONE); } /** @@ -2159,8 +2159,8 @@ public Response withWhileWithResponse(BinaryData body, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withWithWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withWith(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withWith(contentType, body, requestOptions, context)); } /** @@ -2183,8 +2183,8 @@ public Mono> withWithWithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withWithWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withWithSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withWithSync(contentType, body, requestOptions, Context.NONE); } /** @@ -2207,8 +2207,8 @@ public Response withWithWithResponse(BinaryData body, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withYieldWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withYield(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.withYield(contentType, body, requestOptions, context)); } /** @@ -2231,7 +2231,7 @@ public Mono> withYieldWithResponseAsync(BinaryData body, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withYieldWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withYieldSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.withYieldSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/specialwords/implementation/OperationsImpl.java b/typespec-tests/src/main/java/com/specialwords/implementation/OperationsImpl.java index cbd4595300..56816afd4d 100644 --- a/typespec-tests/src/main/java/com/specialwords/implementation/OperationsImpl.java +++ b/typespec-tests/src/main/java/com/specialwords/implementation/OperationsImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -61,7 +60,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> and(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> and(RequestOptions requestOptions, Context context); @Get("/special-words/operations/and") @ExpectedResponses({ 204 }) @@ -69,7 +68,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response andSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response andSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/as") @ExpectedResponses({ 204 }) @@ -77,7 +76,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> as(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> as(RequestOptions requestOptions, Context context); @Get("/special-words/operations/as") @ExpectedResponses({ 204 }) @@ -85,7 +84,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response asSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response asSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/assert") @ExpectedResponses({ 204 }) @@ -93,8 +92,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> assertMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> assertMethod(RequestOptions requestOptions, Context context); @Get("/special-words/operations/assert") @ExpectedResponses({ 204 }) @@ -102,8 +100,7 @@ Mono> assertMethod(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response assertMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response assertMethodSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/async") @ExpectedResponses({ 204 }) @@ -111,8 +108,7 @@ Response assertMethodSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> async(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> async(RequestOptions requestOptions, Context context); @Get("/special-words/operations/async") @ExpectedResponses({ 204 }) @@ -120,7 +116,7 @@ Mono> async(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response asyncSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response asyncSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/await") @ExpectedResponses({ 204 }) @@ -128,8 +124,7 @@ Mono> async(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> await(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> await(RequestOptions requestOptions, Context context); @Get("/special-words/operations/await") @ExpectedResponses({ 204 }) @@ -137,7 +132,7 @@ Mono> await(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response awaitSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response awaitSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/break") @ExpectedResponses({ 204 }) @@ -145,8 +140,7 @@ Mono> await(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> breakMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> breakMethod(RequestOptions requestOptions, Context context); @Get("/special-words/operations/break") @ExpectedResponses({ 204 }) @@ -154,8 +148,7 @@ Mono> breakMethod(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response breakMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response breakMethodSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/class") @ExpectedResponses({ 204 }) @@ -163,8 +156,7 @@ Response breakMethodSync(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> classMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> classMethod(RequestOptions requestOptions, Context context); @Get("/special-words/operations/class") @ExpectedResponses({ 204 }) @@ -172,8 +164,7 @@ Mono> classMethod(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response classMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response classMethodSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/constructor") @ExpectedResponses({ 204 }) @@ -181,8 +172,7 @@ Response classMethodSync(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> constructor(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> constructor(RequestOptions requestOptions, Context context); @Get("/special-words/operations/constructor") @ExpectedResponses({ 204 }) @@ -190,8 +180,7 @@ Mono> constructor(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response constructorSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response constructorSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/continue") @ExpectedResponses({ 204 }) @@ -199,8 +188,7 @@ Response constructorSync(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> continueMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> continueMethod(RequestOptions requestOptions, Context context); @Get("/special-words/operations/continue") @ExpectedResponses({ 204 }) @@ -208,8 +196,7 @@ Mono> continueMethod(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response continueMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response continueMethodSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/def") @ExpectedResponses({ 204 }) @@ -217,7 +204,7 @@ Response continueMethodSync(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> def(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> def(RequestOptions requestOptions, Context context); @Get("/special-words/operations/def") @ExpectedResponses({ 204 }) @@ -225,7 +212,7 @@ Response continueMethodSync(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response defSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/del") @ExpectedResponses({ 204 }) @@ -233,7 +220,7 @@ Response continueMethodSync(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> del(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> del(RequestOptions requestOptions, Context context); @Get("/special-words/operations/del") @ExpectedResponses({ 204 }) @@ -241,7 +228,7 @@ Response continueMethodSync(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response delSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response delSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/elif") @ExpectedResponses({ 204 }) @@ -249,7 +236,7 @@ Response continueMethodSync(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> elif(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> elif(RequestOptions requestOptions, Context context); @Get("/special-words/operations/elif") @ExpectedResponses({ 204 }) @@ -257,7 +244,7 @@ Response continueMethodSync(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response elifSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response elifSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/else") @ExpectedResponses({ 204 }) @@ -265,8 +252,7 @@ Response continueMethodSync(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> elseMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> elseMethod(RequestOptions requestOptions, Context context); @Get("/special-words/operations/else") @ExpectedResponses({ 204 }) @@ -274,8 +260,7 @@ Mono> elseMethod(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response elseMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response elseMethodSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/except") @ExpectedResponses({ 204 }) @@ -283,8 +268,7 @@ Response elseMethodSync(@HeaderParam("accept") String accept, RequestOptio @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> except(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> except(RequestOptions requestOptions, Context context); @Get("/special-words/operations/except") @ExpectedResponses({ 204 }) @@ -292,7 +276,7 @@ Mono> except(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response exceptSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response exceptSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/exec") @ExpectedResponses({ 204 }) @@ -300,7 +284,7 @@ Mono> except(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> exec(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> exec(RequestOptions requestOptions, Context context); @Get("/special-words/operations/exec") @ExpectedResponses({ 204 }) @@ -308,7 +292,7 @@ Mono> except(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response execSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response execSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/finally") @ExpectedResponses({ 204 }) @@ -316,8 +300,7 @@ Mono> except(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> finallyMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> finallyMethod(RequestOptions requestOptions, Context context); @Get("/special-words/operations/finally") @ExpectedResponses({ 204 }) @@ -325,8 +308,7 @@ Mono> finallyMethod(@HeaderParam("accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response finallyMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response finallyMethodSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/for") @ExpectedResponses({ 204 }) @@ -334,8 +316,7 @@ Response finallyMethodSync(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> forMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> forMethod(RequestOptions requestOptions, Context context); @Get("/special-words/operations/for") @ExpectedResponses({ 204 }) @@ -343,8 +324,7 @@ Mono> forMethod(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response forMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response forMethodSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/from") @ExpectedResponses({ 204 }) @@ -352,7 +332,7 @@ Response forMethodSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> from(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> from(RequestOptions requestOptions, Context context); @Get("/special-words/operations/from") @ExpectedResponses({ 204 }) @@ -360,7 +340,7 @@ Response forMethodSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response fromSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response fromSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/global") @ExpectedResponses({ 204 }) @@ -368,8 +348,7 @@ Response forMethodSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> global(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> global(RequestOptions requestOptions, Context context); @Get("/special-words/operations/global") @ExpectedResponses({ 204 }) @@ -377,7 +356,7 @@ Mono> global(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response globalSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response globalSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/if") @ExpectedResponses({ 204 }) @@ -385,8 +364,7 @@ Mono> global(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> ifMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> ifMethod(RequestOptions requestOptions, Context context); @Get("/special-words/operations/if") @ExpectedResponses({ 204 }) @@ -394,8 +372,7 @@ Mono> ifMethod(@HeaderParam("accept") String accept, RequestOptio @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response ifMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response ifMethodSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/import") @ExpectedResponses({ 204 }) @@ -403,8 +380,7 @@ Response ifMethodSync(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> importMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> importMethod(RequestOptions requestOptions, Context context); @Get("/special-words/operations/import") @ExpectedResponses({ 204 }) @@ -412,8 +388,7 @@ Mono> importMethod(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response importMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response importMethodSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/in") @ExpectedResponses({ 204 }) @@ -421,7 +396,7 @@ Response importMethodSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> in(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> in(RequestOptions requestOptions, Context context); @Get("/special-words/operations/in") @ExpectedResponses({ 204 }) @@ -429,7 +404,7 @@ Response importMethodSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response inSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response inSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/is") @ExpectedResponses({ 204 }) @@ -437,7 +412,7 @@ Response importMethodSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> is(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> is(RequestOptions requestOptions, Context context); @Get("/special-words/operations/is") @ExpectedResponses({ 204 }) @@ -445,7 +420,7 @@ Response importMethodSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response isSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response isSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/lambda") @ExpectedResponses({ 204 }) @@ -453,8 +428,7 @@ Response importMethodSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> lambda(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> lambda(RequestOptions requestOptions, Context context); @Get("/special-words/operations/lambda") @ExpectedResponses({ 204 }) @@ -462,7 +436,7 @@ Mono> lambda(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response lambdaSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response lambdaSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/not") @ExpectedResponses({ 204 }) @@ -470,7 +444,7 @@ Mono> lambda(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> not(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> not(RequestOptions requestOptions, Context context); @Get("/special-words/operations/not") @ExpectedResponses({ 204 }) @@ -478,7 +452,7 @@ Mono> lambda(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response notSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response notSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/or") @ExpectedResponses({ 204 }) @@ -486,7 +460,7 @@ Mono> lambda(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> or(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> or(RequestOptions requestOptions, Context context); @Get("/special-words/operations/or") @ExpectedResponses({ 204 }) @@ -494,7 +468,7 @@ Mono> lambda(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response orSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response orSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/pass") @ExpectedResponses({ 204 }) @@ -502,7 +476,7 @@ Mono> lambda(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> pass(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> pass(RequestOptions requestOptions, Context context); @Get("/special-words/operations/pass") @ExpectedResponses({ 204 }) @@ -510,7 +484,7 @@ Mono> lambda(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response passSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response passSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/raise") @ExpectedResponses({ 204 }) @@ -518,8 +492,7 @@ Mono> lambda(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> raise(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> raise(RequestOptions requestOptions, Context context); @Get("/special-words/operations/raise") @ExpectedResponses({ 204 }) @@ -527,7 +500,7 @@ Mono> raise(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response raiseSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response raiseSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/return") @ExpectedResponses({ 204 }) @@ -535,8 +508,7 @@ Mono> raise(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> returnMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> returnMethod(RequestOptions requestOptions, Context context); @Get("/special-words/operations/return") @ExpectedResponses({ 204 }) @@ -544,8 +516,7 @@ Mono> returnMethod(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response returnMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response returnMethodSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/try") @ExpectedResponses({ 204 }) @@ -553,8 +524,7 @@ Response returnMethodSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> tryMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> tryMethod(RequestOptions requestOptions, Context context); @Get("/special-words/operations/try") @ExpectedResponses({ 204 }) @@ -562,8 +532,7 @@ Mono> tryMethod(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response tryMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response tryMethodSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/while") @ExpectedResponses({ 204 }) @@ -571,8 +540,7 @@ Response tryMethodSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> whileMethod(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> whileMethod(RequestOptions requestOptions, Context context); @Get("/special-words/operations/while") @ExpectedResponses({ 204 }) @@ -580,8 +548,7 @@ Mono> whileMethod(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response whileMethodSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response whileMethodSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/with") @ExpectedResponses({ 204 }) @@ -589,7 +556,7 @@ Response whileMethodSync(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> with(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> with(RequestOptions requestOptions, Context context); @Get("/special-words/operations/with") @ExpectedResponses({ 204 }) @@ -597,7 +564,7 @@ Response whileMethodSync(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response withSync(RequestOptions requestOptions, Context context); @Get("/special-words/operations/yield") @ExpectedResponses({ 204 }) @@ -605,8 +572,7 @@ Response whileMethodSync(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> yield(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> yield(RequestOptions requestOptions, Context context); @Get("/special-words/operations/yield") @ExpectedResponses({ 204 }) @@ -614,7 +580,7 @@ Mono> yield(@HeaderParam("accept") String accept, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response yieldSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response yieldSync(RequestOptions requestOptions, Context context); } /** @@ -629,8 +595,7 @@ Mono> yield(@HeaderParam("accept") String accept, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> andWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.and(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.and(requestOptions, context)); } /** @@ -645,8 +610,7 @@ public Mono> andWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response andWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.andSync(accept, requestOptions, Context.NONE); + return service.andSync(requestOptions, Context.NONE); } /** @@ -661,8 +625,7 @@ public Response andWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> asWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.as(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.as(requestOptions, context)); } /** @@ -677,8 +640,7 @@ public Mono> asWithResponseAsync(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response asWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.asSync(accept, requestOptions, Context.NONE); + return service.asSync(requestOptions, Context.NONE); } /** @@ -693,8 +655,7 @@ public Response asWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> assertMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.assertMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.assertMethod(requestOptions, context)); } /** @@ -709,8 +670,7 @@ public Mono> assertMethodWithResponseAsync(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response assertMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.assertMethodSync(accept, requestOptions, Context.NONE); + return service.assertMethodSync(requestOptions, Context.NONE); } /** @@ -725,8 +685,7 @@ public Response assertMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> asyncWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.async(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.async(requestOptions, context)); } /** @@ -741,8 +700,7 @@ public Mono> asyncWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response asyncWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.asyncSync(accept, requestOptions, Context.NONE); + return service.asyncSync(requestOptions, Context.NONE); } /** @@ -757,8 +715,7 @@ public Response asyncWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> awaitWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.await(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.await(requestOptions, context)); } /** @@ -773,8 +730,7 @@ public Mono> awaitWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response awaitWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.awaitSync(accept, requestOptions, Context.NONE); + return service.awaitSync(requestOptions, Context.NONE); } /** @@ -789,8 +745,7 @@ public Response awaitWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> breakMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.breakMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.breakMethod(requestOptions, context)); } /** @@ -805,8 +760,7 @@ public Mono> breakMethodWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response breakMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.breakMethodSync(accept, requestOptions, Context.NONE); + return service.breakMethodSync(requestOptions, Context.NONE); } /** @@ -821,8 +775,7 @@ public Response breakMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> classMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.classMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.classMethod(requestOptions, context)); } /** @@ -837,8 +790,7 @@ public Mono> classMethodWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response classMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.classMethodSync(accept, requestOptions, Context.NONE); + return service.classMethodSync(requestOptions, Context.NONE); } /** @@ -853,8 +805,7 @@ public Response classMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> constructorWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.constructor(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.constructor(requestOptions, context)); } /** @@ -869,8 +820,7 @@ public Mono> constructorWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response constructorWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.constructorSync(accept, requestOptions, Context.NONE); + return service.constructorSync(requestOptions, Context.NONE); } /** @@ -885,8 +835,7 @@ public Response constructorWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> continueMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.continueMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.continueMethod(requestOptions, context)); } /** @@ -901,8 +850,7 @@ public Mono> continueMethodWithResponseAsync(RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response continueMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.continueMethodSync(accept, requestOptions, Context.NONE); + return service.continueMethodSync(requestOptions, Context.NONE); } /** @@ -917,8 +865,7 @@ public Response continueMethodWithResponse(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.def(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.def(requestOptions, context)); } /** @@ -933,8 +880,7 @@ public Mono> defWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.defSync(accept, requestOptions, Context.NONE); + return service.defSync(requestOptions, Context.NONE); } /** @@ -949,8 +895,7 @@ public Response defWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.del(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.del(requestOptions, context)); } /** @@ -965,8 +910,7 @@ public Mono> delWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response delWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.delSync(accept, requestOptions, Context.NONE); + return service.delSync(requestOptions, Context.NONE); } /** @@ -981,8 +925,7 @@ public Response delWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> elifWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.elif(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.elif(requestOptions, context)); } /** @@ -997,8 +940,7 @@ public Mono> elifWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response elifWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.elifSync(accept, requestOptions, Context.NONE); + return service.elifSync(requestOptions, Context.NONE); } /** @@ -1013,8 +955,7 @@ public Response elifWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> elseMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.elseMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.elseMethod(requestOptions, context)); } /** @@ -1029,8 +970,7 @@ public Mono> elseMethodWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response elseMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.elseMethodSync(accept, requestOptions, Context.NONE); + return service.elseMethodSync(requestOptions, Context.NONE); } /** @@ -1045,8 +985,7 @@ public Response elseMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> exceptWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.except(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.except(requestOptions, context)); } /** @@ -1061,8 +1000,7 @@ public Mono> exceptWithResponseAsync(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response exceptWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.exceptSync(accept, requestOptions, Context.NONE); + return service.exceptSync(requestOptions, Context.NONE); } /** @@ -1077,8 +1015,7 @@ public Response exceptWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> execWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.exec(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.exec(requestOptions, context)); } /** @@ -1093,8 +1030,7 @@ public Mono> execWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response execWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.execSync(accept, requestOptions, Context.NONE); + return service.execSync(requestOptions, Context.NONE); } /** @@ -1109,8 +1045,7 @@ public Response execWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> finallyMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.finallyMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.finallyMethod(requestOptions, context)); } /** @@ -1125,8 +1060,7 @@ public Mono> finallyMethodWithResponseAsync(RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response finallyMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.finallyMethodSync(accept, requestOptions, Context.NONE); + return service.finallyMethodSync(requestOptions, Context.NONE); } /** @@ -1141,8 +1075,7 @@ public Response finallyMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> forMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.forMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.forMethod(requestOptions, context)); } /** @@ -1157,8 +1090,7 @@ public Mono> forMethodWithResponseAsync(RequestOptions requestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response forMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.forMethodSync(accept, requestOptions, Context.NONE); + return service.forMethodSync(requestOptions, Context.NONE); } /** @@ -1173,8 +1105,7 @@ public Response forMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.from(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.from(requestOptions, context)); } /** @@ -1189,8 +1120,7 @@ public Mono> fromWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.fromSync(accept, requestOptions, Context.NONE); + return service.fromSync(requestOptions, Context.NONE); } /** @@ -1205,8 +1135,7 @@ public Response fromWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> globalWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.global(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.global(requestOptions, context)); } /** @@ -1221,8 +1150,7 @@ public Mono> globalWithResponseAsync(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response globalWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.globalSync(accept, requestOptions, Context.NONE); + return service.globalSync(requestOptions, Context.NONE); } /** @@ -1237,8 +1165,7 @@ public Response globalWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> ifMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.ifMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.ifMethod(requestOptions, context)); } /** @@ -1253,8 +1180,7 @@ public Mono> ifMethodWithResponseAsync(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response ifMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.ifMethodSync(accept, requestOptions, Context.NONE); + return service.ifMethodSync(requestOptions, Context.NONE); } /** @@ -1269,8 +1195,7 @@ public Response ifMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> importMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.importMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.importMethod(requestOptions, context)); } /** @@ -1285,8 +1210,7 @@ public Mono> importMethodWithResponseAsync(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response importMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.importMethodSync(accept, requestOptions, Context.NONE); + return service.importMethodSync(requestOptions, Context.NONE); } /** @@ -1301,8 +1225,7 @@ public Response importMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> inWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.in(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.in(requestOptions, context)); } /** @@ -1317,8 +1240,7 @@ public Mono> inWithResponseAsync(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response inWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.inSync(accept, requestOptions, Context.NONE); + return service.inSync(requestOptions, Context.NONE); } /** @@ -1333,8 +1255,7 @@ public Response inWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> isWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.is(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.is(requestOptions, context)); } /** @@ -1349,8 +1270,7 @@ public Mono> isWithResponseAsync(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response isWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.isSync(accept, requestOptions, Context.NONE); + return service.isSync(requestOptions, Context.NONE); } /** @@ -1365,8 +1285,7 @@ public Response isWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> lambdaWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.lambda(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.lambda(requestOptions, context)); } /** @@ -1381,8 +1300,7 @@ public Mono> lambdaWithResponseAsync(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response lambdaWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.lambdaSync(accept, requestOptions, Context.NONE); + return service.lambdaSync(requestOptions, Context.NONE); } /** @@ -1397,8 +1315,7 @@ public Response lambdaWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> notWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.not(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.not(requestOptions, context)); } /** @@ -1413,8 +1330,7 @@ public Mono> notWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response notWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.notSync(accept, requestOptions, Context.NONE); + return service.notSync(requestOptions, Context.NONE); } /** @@ -1429,8 +1345,7 @@ public Response notWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> orWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.or(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.or(requestOptions, context)); } /** @@ -1445,8 +1360,7 @@ public Mono> orWithResponseAsync(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response orWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.orSync(accept, requestOptions, Context.NONE); + return service.orSync(requestOptions, Context.NONE); } /** @@ -1461,8 +1375,7 @@ public Response orWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> passWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.pass(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.pass(requestOptions, context)); } /** @@ -1477,8 +1390,7 @@ public Mono> passWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response passWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.passSync(accept, requestOptions, Context.NONE); + return service.passSync(requestOptions, Context.NONE); } /** @@ -1493,8 +1405,7 @@ public Response passWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> raiseWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.raise(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.raise(requestOptions, context)); } /** @@ -1509,8 +1420,7 @@ public Mono> raiseWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response raiseWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.raiseSync(accept, requestOptions, Context.NONE); + return service.raiseSync(requestOptions, Context.NONE); } /** @@ -1525,8 +1435,7 @@ public Response raiseWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> returnMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.returnMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.returnMethod(requestOptions, context)); } /** @@ -1541,8 +1450,7 @@ public Mono> returnMethodWithResponseAsync(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response returnMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.returnMethodSync(accept, requestOptions, Context.NONE); + return service.returnMethodSync(requestOptions, Context.NONE); } /** @@ -1557,8 +1465,7 @@ public Response returnMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> tryMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.tryMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.tryMethod(requestOptions, context)); } /** @@ -1573,8 +1480,7 @@ public Mono> tryMethodWithResponseAsync(RequestOptions requestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response tryMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.tryMethodSync(accept, requestOptions, Context.NONE); + return service.tryMethodSync(requestOptions, Context.NONE); } /** @@ -1589,8 +1495,7 @@ public Response tryMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> whileMethodWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.whileMethod(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.whileMethod(requestOptions, context)); } /** @@ -1605,8 +1510,7 @@ public Mono> whileMethodWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response whileMethodWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.whileMethodSync(accept, requestOptions, Context.NONE); + return service.whileMethodSync(requestOptions, Context.NONE); } /** @@ -1621,8 +1525,7 @@ public Response whileMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.with(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.with(requestOptions, context)); } /** @@ -1637,8 +1540,7 @@ public Mono> withWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withSync(accept, requestOptions, Context.NONE); + return service.withSync(requestOptions, Context.NONE); } /** @@ -1653,8 +1555,7 @@ public Response withWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> yieldWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.yield(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.yield(requestOptions, context)); } /** @@ -1669,7 +1570,6 @@ public Mono> yieldWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response yieldWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.yieldSync(accept, requestOptions, Context.NONE); + return service.yieldSync(requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/specialwords/implementation/ParametersImpl.java b/typespec-tests/src/main/java/com/specialwords/implementation/ParametersImpl.java index 40e40e0a6a..b412b4d91b 100644 --- a/typespec-tests/src/main/java/com/specialwords/implementation/ParametersImpl.java +++ b/typespec-tests/src/main/java/com/specialwords/implementation/ParametersImpl.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -62,8 +61,7 @@ public interface ParametersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAnd(@QueryParam("and") String and, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withAnd(@QueryParam("and") String and, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/and") @ExpectedResponses({ 204 }) @@ -71,8 +69,7 @@ Mono> withAnd(@QueryParam("and") String and, @HeaderParam("accept @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAndSync(@QueryParam("and") String and, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withAndSync(@QueryParam("and") String and, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/as") @ExpectedResponses({ 204 }) @@ -80,8 +77,7 @@ Response withAndSync(@QueryParam("and") String and, @HeaderParam("accept") @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAs(@QueryParam("as") String as, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withAs(@QueryParam("as") String as, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/as") @ExpectedResponses({ 204 }) @@ -89,8 +85,7 @@ Mono> withAs(@QueryParam("as") String as, @HeaderParam("accept") @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAsSync(@QueryParam("as") String as, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withAsSync(@QueryParam("as") String as, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/assert") @ExpectedResponses({ 204 }) @@ -98,8 +93,8 @@ Response withAsSync(@QueryParam("as") String as, @HeaderParam("accept") St @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAssert(@QueryParam("assert") String assertParameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> withAssert(@QueryParam("assert") String assertParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/assert") @ExpectedResponses({ 204 }) @@ -107,8 +102,8 @@ Mono> withAssert(@QueryParam("assert") String assertParameter, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAssertSync(@QueryParam("assert") String assertParameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response withAssertSync(@QueryParam("assert") String assertParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/async") @ExpectedResponses({ 204 }) @@ -116,8 +111,8 @@ Response withAssertSync(@QueryParam("assert") String assertParameter, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAsync(@QueryParam("async") String async, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withAsync(@QueryParam("async") String async, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/async") @ExpectedResponses({ 204 }) @@ -125,8 +120,7 @@ Mono> withAsync(@QueryParam("async") String async, @HeaderParam(" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAsyncSync(@QueryParam("async") String async, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withAsyncSync(@QueryParam("async") String async, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/await") @ExpectedResponses({ 204 }) @@ -134,8 +128,8 @@ Response withAsyncSync(@QueryParam("async") String async, @HeaderParam("ac @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAwait(@QueryParam("await") String await, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withAwait(@QueryParam("await") String await, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/await") @ExpectedResponses({ 204 }) @@ -143,8 +137,7 @@ Mono> withAwait(@QueryParam("await") String await, @HeaderParam(" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAwaitSync(@QueryParam("await") String await, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withAwaitSync(@QueryParam("await") String await, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/break") @ExpectedResponses({ 204 }) @@ -152,8 +145,8 @@ Response withAwaitSync(@QueryParam("await") String await, @HeaderParam("ac @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withBreak(@QueryParam("break") String breakParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withBreak(@QueryParam("break") String breakParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/break") @ExpectedResponses({ 204 }) @@ -161,8 +154,8 @@ Mono> withBreak(@QueryParam("break") String breakParameter, @Head @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withBreakSync(@QueryParam("break") String breakParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withBreakSync(@QueryParam("break") String breakParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/class") @ExpectedResponses({ 204 }) @@ -170,8 +163,8 @@ Response withBreakSync(@QueryParam("break") String breakParameter, @Header @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withClass(@QueryParam("class") String classParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withClass(@QueryParam("class") String classParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/class") @ExpectedResponses({ 204 }) @@ -179,8 +172,8 @@ Mono> withClass(@QueryParam("class") String classParameter, @Head @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withClassSync(@QueryParam("class") String classParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withClassSync(@QueryParam("class") String classParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/constructor") @ExpectedResponses({ 204 }) @@ -189,7 +182,7 @@ Response withClassSync(@QueryParam("class") String classParameter, @Header @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withConstructor(@QueryParam("constructor") String constructor, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/constructor") @ExpectedResponses({ 204 }) @@ -197,8 +190,8 @@ Mono> withConstructor(@QueryParam("constructor") String construct @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withConstructorSync(@QueryParam("constructor") String constructor, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response withConstructorSync(@QueryParam("constructor") String constructor, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/continue") @ExpectedResponses({ 204 }) @@ -207,7 +200,7 @@ Response withConstructorSync(@QueryParam("constructor") String constructor @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withContinue(@QueryParam("continue") String continueParameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/continue") @ExpectedResponses({ 204 }) @@ -215,8 +208,8 @@ Mono> withContinue(@QueryParam("continue") String continueParamet @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withContinueSync(@QueryParam("continue") String continueParameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response withContinueSync(@QueryParam("continue") String continueParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/def") @ExpectedResponses({ 204 }) @@ -224,8 +217,7 @@ Response withContinueSync(@QueryParam("continue") String continueParameter @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withDef(@QueryParam("def") String def, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withDef(@QueryParam("def") String def, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/def") @ExpectedResponses({ 204 }) @@ -233,8 +225,7 @@ Mono> withDef(@QueryParam("def") String def, @HeaderParam("accept @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withDefSync(@QueryParam("def") String def, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withDefSync(@QueryParam("def") String def, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/del") @ExpectedResponses({ 204 }) @@ -242,8 +233,7 @@ Response withDefSync(@QueryParam("def") String def, @HeaderParam("accept") @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withDel(@QueryParam("del") String del, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withDel(@QueryParam("del") String del, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/del") @ExpectedResponses({ 204 }) @@ -251,8 +241,7 @@ Mono> withDel(@QueryParam("del") String del, @HeaderParam("accept @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withDelSync(@QueryParam("del") String del, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withDelSync(@QueryParam("del") String del, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/elif") @ExpectedResponses({ 204 }) @@ -260,8 +249,7 @@ Response withDelSync(@QueryParam("del") String del, @HeaderParam("accept") @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withElif(@QueryParam("elif") String elif, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withElif(@QueryParam("elif") String elif, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/elif") @ExpectedResponses({ 204 }) @@ -269,8 +257,7 @@ Mono> withElif(@QueryParam("elif") String elif, @HeaderParam("acc @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withElifSync(@QueryParam("elif") String elif, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withElifSync(@QueryParam("elif") String elif, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/else") @ExpectedResponses({ 204 }) @@ -278,8 +265,8 @@ Response withElifSync(@QueryParam("elif") String elif, @HeaderParam("accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withElse(@QueryParam("else") String elseParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withElse(@QueryParam("else") String elseParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/else") @ExpectedResponses({ 204 }) @@ -287,8 +274,8 @@ Mono> withElse(@QueryParam("else") String elseParameter, @HeaderP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withElseSync(@QueryParam("else") String elseParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withElseSync(@QueryParam("else") String elseParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/except") @ExpectedResponses({ 204 }) @@ -296,8 +283,8 @@ Response withElseSync(@QueryParam("else") String elseParameter, @HeaderPar @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withExcept(@QueryParam("except") String except, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withExcept(@QueryParam("except") String except, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/except") @ExpectedResponses({ 204 }) @@ -305,8 +292,8 @@ Mono> withExcept(@QueryParam("except") String except, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withExceptSync(@QueryParam("except") String except, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withExceptSync(@QueryParam("except") String except, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/exec") @ExpectedResponses({ 204 }) @@ -314,8 +301,7 @@ Response withExceptSync(@QueryParam("except") String except, @HeaderParam( @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withExec(@QueryParam("exec") String exec, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withExec(@QueryParam("exec") String exec, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/exec") @ExpectedResponses({ 204 }) @@ -323,8 +309,7 @@ Mono> withExec(@QueryParam("exec") String exec, @HeaderParam("acc @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withExecSync(@QueryParam("exec") String exec, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withExecSync(@QueryParam("exec") String exec, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/finally") @ExpectedResponses({ 204 }) @@ -332,8 +317,8 @@ Response withExecSync(@QueryParam("exec") String exec, @HeaderParam("accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withFinally(@QueryParam("finally") String finallyParameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> withFinally(@QueryParam("finally") String finallyParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/finally") @ExpectedResponses({ 204 }) @@ -341,8 +326,8 @@ Mono> withFinally(@QueryParam("finally") String finallyParameter, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withFinallySync(@QueryParam("finally") String finallyParameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response withFinallySync(@QueryParam("finally") String finallyParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/for") @ExpectedResponses({ 204 }) @@ -350,8 +335,8 @@ Response withFinallySync(@QueryParam("finally") String finallyParameter, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withFor(@QueryParam("for") String forParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withFor(@QueryParam("for") String forParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/for") @ExpectedResponses({ 204 }) @@ -359,8 +344,8 @@ Mono> withFor(@QueryParam("for") String forParameter, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withForSync(@QueryParam("for") String forParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withForSync(@QueryParam("for") String forParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/from") @ExpectedResponses({ 204 }) @@ -368,8 +353,7 @@ Response withForSync(@QueryParam("for") String forParameter, @HeaderParam( @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withFrom(@QueryParam("from") String from, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withFrom(@QueryParam("from") String from, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/from") @ExpectedResponses({ 204 }) @@ -377,8 +361,7 @@ Mono> withFrom(@QueryParam("from") String from, @HeaderParam("acc @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withFromSync(@QueryParam("from") String from, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withFromSync(@QueryParam("from") String from, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/global") @ExpectedResponses({ 204 }) @@ -386,8 +369,8 @@ Response withFromSync(@QueryParam("from") String from, @HeaderParam("accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withGlobal(@QueryParam("global") String global, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withGlobal(@QueryParam("global") String global, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/global") @ExpectedResponses({ 204 }) @@ -395,8 +378,8 @@ Mono> withGlobal(@QueryParam("global") String global, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withGlobalSync(@QueryParam("global") String global, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withGlobalSync(@QueryParam("global") String global, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/if") @ExpectedResponses({ 204 }) @@ -404,8 +387,8 @@ Response withGlobalSync(@QueryParam("global") String global, @HeaderParam( @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withIf(@QueryParam("if") String ifParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withIf(@QueryParam("if") String ifParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/if") @ExpectedResponses({ 204 }) @@ -413,8 +396,7 @@ Mono> withIf(@QueryParam("if") String ifParameter, @HeaderParam(" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withIfSync(@QueryParam("if") String ifParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withIfSync(@QueryParam("if") String ifParameter, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/import") @ExpectedResponses({ 204 }) @@ -422,8 +404,8 @@ Response withIfSync(@QueryParam("if") String ifParameter, @HeaderParam("ac @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withImport(@QueryParam("import") String importParameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> withImport(@QueryParam("import") String importParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/import") @ExpectedResponses({ 204 }) @@ -431,8 +413,8 @@ Mono> withImport(@QueryParam("import") String importParameter, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withImportSync(@QueryParam("import") String importParameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response withImportSync(@QueryParam("import") String importParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/in") @ExpectedResponses({ 204 }) @@ -440,8 +422,7 @@ Response withImportSync(@QueryParam("import") String importParameter, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withIn(@QueryParam("in") String in, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withIn(@QueryParam("in") String in, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/in") @ExpectedResponses({ 204 }) @@ -449,8 +430,7 @@ Mono> withIn(@QueryParam("in") String in, @HeaderParam("accept") @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withInSync(@QueryParam("in") String in, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withInSync(@QueryParam("in") String in, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/is") @ExpectedResponses({ 204 }) @@ -458,8 +438,7 @@ Response withInSync(@QueryParam("in") String in, @HeaderParam("accept") St @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withIs(@QueryParam("is") String is, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withIs(@QueryParam("is") String is, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/is") @ExpectedResponses({ 204 }) @@ -467,8 +446,7 @@ Mono> withIs(@QueryParam("is") String is, @HeaderParam("accept") @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withIsSync(@QueryParam("is") String is, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withIsSync(@QueryParam("is") String is, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/lambda") @ExpectedResponses({ 204 }) @@ -476,8 +454,8 @@ Response withIsSync(@QueryParam("is") String is, @HeaderParam("accept") St @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withLambda(@QueryParam("lambda") String lambda, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withLambda(@QueryParam("lambda") String lambda, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/lambda") @ExpectedResponses({ 204 }) @@ -485,8 +463,8 @@ Mono> withLambda(@QueryParam("lambda") String lambda, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withLambdaSync(@QueryParam("lambda") String lambda, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withLambdaSync(@QueryParam("lambda") String lambda, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/not") @ExpectedResponses({ 204 }) @@ -494,8 +472,7 @@ Response withLambdaSync(@QueryParam("lambda") String lambda, @HeaderParam( @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withNot(@QueryParam("not") String not, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withNot(@QueryParam("not") String not, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/not") @ExpectedResponses({ 204 }) @@ -503,8 +480,7 @@ Mono> withNot(@QueryParam("not") String not, @HeaderParam("accept @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withNotSync(@QueryParam("not") String not, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withNotSync(@QueryParam("not") String not, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/or") @ExpectedResponses({ 204 }) @@ -512,8 +488,7 @@ Response withNotSync(@QueryParam("not") String not, @HeaderParam("accept") @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withOr(@QueryParam("or") String or, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withOr(@QueryParam("or") String or, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/or") @ExpectedResponses({ 204 }) @@ -521,8 +496,7 @@ Mono> withOr(@QueryParam("or") String or, @HeaderParam("accept") @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withOrSync(@QueryParam("or") String or, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withOrSync(@QueryParam("or") String or, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/pass") @ExpectedResponses({ 204 }) @@ -530,8 +504,7 @@ Response withOrSync(@QueryParam("or") String or, @HeaderParam("accept") St @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withPass(@QueryParam("pass") String pass, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withPass(@QueryParam("pass") String pass, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/pass") @ExpectedResponses({ 204 }) @@ -539,8 +512,7 @@ Mono> withPass(@QueryParam("pass") String pass, @HeaderParam("acc @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withPassSync(@QueryParam("pass") String pass, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withPassSync(@QueryParam("pass") String pass, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/raise") @ExpectedResponses({ 204 }) @@ -548,8 +520,8 @@ Response withPassSync(@QueryParam("pass") String pass, @HeaderParam("accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withRaise(@QueryParam("raise") String raise, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withRaise(@QueryParam("raise") String raise, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/raise") @ExpectedResponses({ 204 }) @@ -557,8 +529,7 @@ Mono> withRaise(@QueryParam("raise") String raise, @HeaderParam(" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withRaiseSync(@QueryParam("raise") String raise, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withRaiseSync(@QueryParam("raise") String raise, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/return") @ExpectedResponses({ 204 }) @@ -566,8 +537,8 @@ Response withRaiseSync(@QueryParam("raise") String raise, @HeaderParam("ac @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withReturn(@QueryParam("return") String returnParameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> withReturn(@QueryParam("return") String returnParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/return") @ExpectedResponses({ 204 }) @@ -575,8 +546,8 @@ Mono> withReturn(@QueryParam("return") String returnParameter, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withReturnSync(@QueryParam("return") String returnParameter, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Response withReturnSync(@QueryParam("return") String returnParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/try") @ExpectedResponses({ 204 }) @@ -584,8 +555,8 @@ Response withReturnSync(@QueryParam("return") String returnParameter, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withTry(@QueryParam("try") String tryParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withTry(@QueryParam("try") String tryParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/try") @ExpectedResponses({ 204 }) @@ -593,8 +564,8 @@ Mono> withTry(@QueryParam("try") String tryParameter, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withTrySync(@QueryParam("try") String tryParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withTrySync(@QueryParam("try") String tryParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/while") @ExpectedResponses({ 204 }) @@ -602,8 +573,8 @@ Response withTrySync(@QueryParam("try") String tryParameter, @HeaderParam( @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withWhile(@QueryParam("while") String whileParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withWhile(@QueryParam("while") String whileParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/while") @ExpectedResponses({ 204 }) @@ -611,8 +582,8 @@ Mono> withWhile(@QueryParam("while") String whileParameter, @Head @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withWhileSync(@QueryParam("while") String whileParameter, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withWhileSync(@QueryParam("while") String whileParameter, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/with") @ExpectedResponses({ 204 }) @@ -620,8 +591,7 @@ Response withWhileSync(@QueryParam("while") String whileParameter, @Header @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withWith(@QueryParam("with") String with, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withWith(@QueryParam("with") String with, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/with") @ExpectedResponses({ 204 }) @@ -629,8 +599,7 @@ Mono> withWith(@QueryParam("with") String with, @HeaderParam("acc @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withWithSync(@QueryParam("with") String with, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withWithSync(@QueryParam("with") String with, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/yield") @ExpectedResponses({ 204 }) @@ -638,8 +607,8 @@ Response withWithSync(@QueryParam("with") String with, @HeaderParam("accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withYield(@QueryParam("yield") String yield, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Mono> withYield(@QueryParam("yield") String yield, RequestOptions requestOptions, + Context context); @Get("/special-words/parameters/yield") @ExpectedResponses({ 204 }) @@ -647,8 +616,7 @@ Mono> withYield(@QueryParam("yield") String yield, @HeaderParam(" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withYieldSync(@QueryParam("yield") String yield, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response withYieldSync(@QueryParam("yield") String yield, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/cancellationToken") @ExpectedResponses({ 204 }) @@ -657,7 +625,7 @@ Response withYieldSync(@QueryParam("yield") String yield, @HeaderParam("ac @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> withCancellationToken(@QueryParam("cancellationToken") String cancellationToken, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/cancellationToken") @ExpectedResponses({ 204 }) @@ -666,7 +634,7 @@ Mono> withCancellationToken(@QueryParam("cancellationToken") Stri @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response withCancellationTokenSync(@QueryParam("cancellationToken") String cancellationToken, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -682,8 +650,7 @@ Response withCancellationTokenSync(@QueryParam("cancellationToken") String */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAndWithResponseAsync(String and, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withAnd(and, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withAnd(and, requestOptions, context)); } /** @@ -699,8 +666,7 @@ public Mono> withAndWithResponseAsync(String and, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAndWithResponse(String and, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withAndSync(and, accept, requestOptions, Context.NONE); + return service.withAndSync(and, requestOptions, Context.NONE); } /** @@ -716,8 +682,7 @@ public Response withAndWithResponse(String and, RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAsWithResponseAsync(String as, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withAs(as, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withAs(as, requestOptions, context)); } /** @@ -733,8 +698,7 @@ public Mono> withAsWithResponseAsync(String as, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAsWithResponse(String as, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withAsSync(as, accept, requestOptions, Context.NONE); + return service.withAsSync(as, requestOptions, Context.NONE); } /** @@ -750,8 +714,7 @@ public Response withAsWithResponse(String as, RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAssertWithResponseAsync(String assertParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withAssert(assertParameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withAssert(assertParameter, requestOptions, context)); } /** @@ -767,8 +730,7 @@ public Mono> withAssertWithResponseAsync(String assertParameter, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAssertWithResponse(String assertParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withAssertSync(assertParameter, accept, requestOptions, Context.NONE); + return service.withAssertSync(assertParameter, requestOptions, Context.NONE); } /** @@ -784,8 +746,7 @@ public Response withAssertWithResponse(String assertParameter, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAsyncWithResponseAsync(String async, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withAsync(async, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withAsync(async, requestOptions, context)); } /** @@ -801,8 +762,7 @@ public Mono> withAsyncWithResponseAsync(String async, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAsyncWithResponse(String async, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withAsyncSync(async, accept, requestOptions, Context.NONE); + return service.withAsyncSync(async, requestOptions, Context.NONE); } /** @@ -818,8 +778,7 @@ public Response withAsyncWithResponse(String async, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAwaitWithResponseAsync(String await, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withAwait(await, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withAwait(await, requestOptions, context)); } /** @@ -835,8 +794,7 @@ public Mono> withAwaitWithResponseAsync(String await, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAwaitWithResponse(String await, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withAwaitSync(await, accept, requestOptions, Context.NONE); + return service.withAwaitSync(await, requestOptions, Context.NONE); } /** @@ -852,8 +810,7 @@ public Response withAwaitWithResponse(String await, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withBreakWithResponseAsync(String breakParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withBreak(breakParameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withBreak(breakParameter, requestOptions, context)); } /** @@ -869,8 +826,7 @@ public Mono> withBreakWithResponseAsync(String breakParameter, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withBreakWithResponse(String breakParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withBreakSync(breakParameter, accept, requestOptions, Context.NONE); + return service.withBreakSync(breakParameter, requestOptions, Context.NONE); } /** @@ -886,8 +842,7 @@ public Response withBreakWithResponse(String breakParameter, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withClassWithResponseAsync(String classParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withClass(classParameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withClass(classParameter, requestOptions, context)); } /** @@ -903,8 +858,7 @@ public Mono> withClassWithResponseAsync(String classParameter, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withClassWithResponse(String classParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withClassSync(classParameter, accept, requestOptions, Context.NONE); + return service.withClassSync(classParameter, requestOptions, Context.NONE); } /** @@ -920,8 +874,7 @@ public Response withClassWithResponse(String classParameter, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withConstructorWithResponseAsync(String constructor, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withConstructor(constructor, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withConstructor(constructor, requestOptions, context)); } /** @@ -937,8 +890,7 @@ public Mono> withConstructorWithResponseAsync(String constructor, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withConstructorWithResponse(String constructor, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withConstructorSync(constructor, accept, requestOptions, Context.NONE); + return service.withConstructorSync(constructor, requestOptions, Context.NONE); } /** @@ -954,9 +906,7 @@ public Response withConstructorWithResponse(String constructor, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withContinueWithResponseAsync(String continueParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.withContinue(continueParameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withContinue(continueParameter, requestOptions, context)); } /** @@ -972,8 +922,7 @@ public Mono> withContinueWithResponseAsync(String continueParamet */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withContinueWithResponse(String continueParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withContinueSync(continueParameter, accept, requestOptions, Context.NONE); + return service.withContinueSync(continueParameter, requestOptions, Context.NONE); } /** @@ -989,8 +938,7 @@ public Response withContinueWithResponse(String continueParameter, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withDefWithResponseAsync(String def, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withDef(def, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withDef(def, requestOptions, context)); } /** @@ -1006,8 +954,7 @@ public Mono> withDefWithResponseAsync(String def, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withDefWithResponse(String def, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withDefSync(def, accept, requestOptions, Context.NONE); + return service.withDefSync(def, requestOptions, Context.NONE); } /** @@ -1023,8 +970,7 @@ public Response withDefWithResponse(String def, RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withDelWithResponseAsync(String del, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withDel(del, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withDel(del, requestOptions, context)); } /** @@ -1040,8 +986,7 @@ public Mono> withDelWithResponseAsync(String del, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withDelWithResponse(String del, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withDelSync(del, accept, requestOptions, Context.NONE); + return service.withDelSync(del, requestOptions, Context.NONE); } /** @@ -1057,8 +1002,7 @@ public Response withDelWithResponse(String del, RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withElifWithResponseAsync(String elif, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withElif(elif, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withElif(elif, requestOptions, context)); } /** @@ -1074,8 +1018,7 @@ public Mono> withElifWithResponseAsync(String elif, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withElifWithResponse(String elif, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withElifSync(elif, accept, requestOptions, Context.NONE); + return service.withElifSync(elif, requestOptions, Context.NONE); } /** @@ -1091,8 +1034,7 @@ public Response withElifWithResponse(String elif, RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withElseWithResponseAsync(String elseParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withElse(elseParameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withElse(elseParameter, requestOptions, context)); } /** @@ -1108,8 +1050,7 @@ public Mono> withElseWithResponseAsync(String elseParameter, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withElseWithResponse(String elseParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withElseSync(elseParameter, accept, requestOptions, Context.NONE); + return service.withElseSync(elseParameter, requestOptions, Context.NONE); } /** @@ -1125,8 +1066,7 @@ public Response withElseWithResponse(String elseParameter, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withExceptWithResponseAsync(String except, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withExcept(except, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withExcept(except, requestOptions, context)); } /** @@ -1142,8 +1082,7 @@ public Mono> withExceptWithResponseAsync(String except, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withExceptWithResponse(String except, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withExceptSync(except, accept, requestOptions, Context.NONE); + return service.withExceptSync(except, requestOptions, Context.NONE); } /** @@ -1159,8 +1098,7 @@ public Response withExceptWithResponse(String except, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withExecWithResponseAsync(String exec, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withExec(exec, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withExec(exec, requestOptions, context)); } /** @@ -1176,8 +1114,7 @@ public Mono> withExecWithResponseAsync(String exec, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withExecWithResponse(String exec, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withExecSync(exec, accept, requestOptions, Context.NONE); + return service.withExecSync(exec, requestOptions, Context.NONE); } /** @@ -1193,8 +1130,7 @@ public Response withExecWithResponse(String exec, RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withFinallyWithResponseAsync(String finallyParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withFinally(finallyParameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withFinally(finallyParameter, requestOptions, context)); } /** @@ -1210,8 +1146,7 @@ public Mono> withFinallyWithResponseAsync(String finallyParameter */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withFinallyWithResponse(String finallyParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withFinallySync(finallyParameter, accept, requestOptions, Context.NONE); + return service.withFinallySync(finallyParameter, requestOptions, Context.NONE); } /** @@ -1227,8 +1162,7 @@ public Response withFinallyWithResponse(String finallyParameter, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withForWithResponseAsync(String forParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withFor(forParameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withFor(forParameter, requestOptions, context)); } /** @@ -1244,8 +1178,7 @@ public Mono> withForWithResponseAsync(String forParameter, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withForWithResponse(String forParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withForSync(forParameter, accept, requestOptions, Context.NONE); + return service.withForSync(forParameter, requestOptions, Context.NONE); } /** @@ -1261,8 +1194,7 @@ public Response withForWithResponse(String forParameter, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withFromWithResponseAsync(String from, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withFrom(from, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withFrom(from, requestOptions, context)); } /** @@ -1278,8 +1210,7 @@ public Mono> withFromWithResponseAsync(String from, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withFromWithResponse(String from, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withFromSync(from, accept, requestOptions, Context.NONE); + return service.withFromSync(from, requestOptions, Context.NONE); } /** @@ -1295,8 +1226,7 @@ public Response withFromWithResponse(String from, RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withGlobalWithResponseAsync(String global, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withGlobal(global, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withGlobal(global, requestOptions, context)); } /** @@ -1312,8 +1242,7 @@ public Mono> withGlobalWithResponseAsync(String global, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withGlobalWithResponse(String global, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withGlobalSync(global, accept, requestOptions, Context.NONE); + return service.withGlobalSync(global, requestOptions, Context.NONE); } /** @@ -1329,8 +1258,7 @@ public Response withGlobalWithResponse(String global, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withIfWithResponseAsync(String ifParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withIf(ifParameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withIf(ifParameter, requestOptions, context)); } /** @@ -1346,8 +1274,7 @@ public Mono> withIfWithResponseAsync(String ifParameter, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withIfWithResponse(String ifParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withIfSync(ifParameter, accept, requestOptions, Context.NONE); + return service.withIfSync(ifParameter, requestOptions, Context.NONE); } /** @@ -1363,8 +1290,7 @@ public Response withIfWithResponse(String ifParameter, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withImportWithResponseAsync(String importParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withImport(importParameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withImport(importParameter, requestOptions, context)); } /** @@ -1380,8 +1306,7 @@ public Mono> withImportWithResponseAsync(String importParameter, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withImportWithResponse(String importParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withImportSync(importParameter, accept, requestOptions, Context.NONE); + return service.withImportSync(importParameter, requestOptions, Context.NONE); } /** @@ -1397,8 +1322,7 @@ public Response withImportWithResponse(String importParameter, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withInWithResponseAsync(String in, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withIn(in, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withIn(in, requestOptions, context)); } /** @@ -1414,8 +1338,7 @@ public Mono> withInWithResponseAsync(String in, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withInWithResponse(String in, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withInSync(in, accept, requestOptions, Context.NONE); + return service.withInSync(in, requestOptions, Context.NONE); } /** @@ -1431,8 +1354,7 @@ public Response withInWithResponse(String in, RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withIsWithResponseAsync(String is, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withIs(is, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withIs(is, requestOptions, context)); } /** @@ -1448,8 +1370,7 @@ public Mono> withIsWithResponseAsync(String is, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withIsWithResponse(String is, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withIsSync(is, accept, requestOptions, Context.NONE); + return service.withIsSync(is, requestOptions, Context.NONE); } /** @@ -1465,8 +1386,7 @@ public Response withIsWithResponse(String is, RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withLambdaWithResponseAsync(String lambda, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withLambda(lambda, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withLambda(lambda, requestOptions, context)); } /** @@ -1482,8 +1402,7 @@ public Mono> withLambdaWithResponseAsync(String lambda, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withLambdaWithResponse(String lambda, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withLambdaSync(lambda, accept, requestOptions, Context.NONE); + return service.withLambdaSync(lambda, requestOptions, Context.NONE); } /** @@ -1499,8 +1418,7 @@ public Response withLambdaWithResponse(String lambda, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withNotWithResponseAsync(String not, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withNot(not, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withNot(not, requestOptions, context)); } /** @@ -1516,8 +1434,7 @@ public Mono> withNotWithResponseAsync(String not, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withNotWithResponse(String not, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withNotSync(not, accept, requestOptions, Context.NONE); + return service.withNotSync(not, requestOptions, Context.NONE); } /** @@ -1533,8 +1450,7 @@ public Response withNotWithResponse(String not, RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withOrWithResponseAsync(String or, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withOr(or, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withOr(or, requestOptions, context)); } /** @@ -1550,8 +1466,7 @@ public Mono> withOrWithResponseAsync(String or, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withOrWithResponse(String or, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withOrSync(or, accept, requestOptions, Context.NONE); + return service.withOrSync(or, requestOptions, Context.NONE); } /** @@ -1567,8 +1482,7 @@ public Response withOrWithResponse(String or, RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withPassWithResponseAsync(String pass, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withPass(pass, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withPass(pass, requestOptions, context)); } /** @@ -1584,8 +1498,7 @@ public Mono> withPassWithResponseAsync(String pass, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withPassWithResponse(String pass, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withPassSync(pass, accept, requestOptions, Context.NONE); + return service.withPassSync(pass, requestOptions, Context.NONE); } /** @@ -1601,8 +1514,7 @@ public Response withPassWithResponse(String pass, RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withRaiseWithResponseAsync(String raise, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withRaise(raise, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withRaise(raise, requestOptions, context)); } /** @@ -1618,8 +1530,7 @@ public Mono> withRaiseWithResponseAsync(String raise, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withRaiseWithResponse(String raise, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withRaiseSync(raise, accept, requestOptions, Context.NONE); + return service.withRaiseSync(raise, requestOptions, Context.NONE); } /** @@ -1635,8 +1546,7 @@ public Response withRaiseWithResponse(String raise, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withReturnWithResponseAsync(String returnParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withReturn(returnParameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withReturn(returnParameter, requestOptions, context)); } /** @@ -1652,8 +1562,7 @@ public Mono> withReturnWithResponseAsync(String returnParameter, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withReturnWithResponse(String returnParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withReturnSync(returnParameter, accept, requestOptions, Context.NONE); + return service.withReturnSync(returnParameter, requestOptions, Context.NONE); } /** @@ -1669,8 +1578,7 @@ public Response withReturnWithResponse(String returnParameter, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withTryWithResponseAsync(String tryParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withTry(tryParameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withTry(tryParameter, requestOptions, context)); } /** @@ -1686,8 +1594,7 @@ public Mono> withTryWithResponseAsync(String tryParameter, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withTryWithResponse(String tryParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withTrySync(tryParameter, accept, requestOptions, Context.NONE); + return service.withTrySync(tryParameter, requestOptions, Context.NONE); } /** @@ -1703,8 +1610,7 @@ public Response withTryWithResponse(String tryParameter, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withWhileWithResponseAsync(String whileParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withWhile(whileParameter, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withWhile(whileParameter, requestOptions, context)); } /** @@ -1720,8 +1626,7 @@ public Mono> withWhileWithResponseAsync(String whileParameter, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withWhileWithResponse(String whileParameter, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withWhileSync(whileParameter, accept, requestOptions, Context.NONE); + return service.withWhileSync(whileParameter, requestOptions, Context.NONE); } /** @@ -1737,8 +1642,7 @@ public Response withWhileWithResponse(String whileParameter, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withWithWithResponseAsync(String with, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withWith(with, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withWith(with, requestOptions, context)); } /** @@ -1754,8 +1658,7 @@ public Mono> withWithWithResponseAsync(String with, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withWithWithResponse(String with, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withWithSync(with, accept, requestOptions, Context.NONE); + return service.withWithSync(with, requestOptions, Context.NONE); } /** @@ -1771,8 +1674,7 @@ public Response withWithWithResponse(String with, RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withYieldWithResponseAsync(String yield, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.withYield(yield, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.withYield(yield, requestOptions, context)); } /** @@ -1788,8 +1690,7 @@ public Mono> withYieldWithResponseAsync(String yield, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withYieldWithResponse(String yield, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withYieldSync(yield, accept, requestOptions, Context.NONE); + return service.withYieldSync(yield, requestOptions, Context.NONE); } /** @@ -1806,9 +1707,8 @@ public Response withYieldWithResponse(String yield, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withCancellationTokenWithResponseAsync(String cancellationToken, RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.withCancellationToken(cancellationToken, accept, requestOptions, context)); + .withContext(context -> service.withCancellationToken(cancellationToken, requestOptions, context)); } /** @@ -1824,7 +1724,6 @@ public Mono> withCancellationTokenWithResponseAsync(String cancel */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withCancellationTokenWithResponse(String cancellationToken, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.withCancellationTokenSync(cancellationToken, accept, requestOptions, Context.NONE); + return service.withCancellationTokenSync(cancellationToken, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/BooleanValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/BooleanValuesImpl.java index 1fe41e98f7..f5491cda2e 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/BooleanValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/BooleanValuesImpl.java @@ -64,7 +64,7 @@ public interface BooleanValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/boolean") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/boolean") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/boolean") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/DatetimeValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/DatetimeValuesImpl.java index bf57043843..23fc8a8a32 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/DatetimeValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/DatetimeValuesImpl.java @@ -64,7 +64,7 @@ public interface DatetimeValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/datetime") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/datetime") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/datetime") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/DurationValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/DurationValuesImpl.java index 2ad8d29b75..76cacdd710 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/DurationValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/DurationValuesImpl.java @@ -64,7 +64,7 @@ public interface DurationValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/duration") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/duration") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/duration") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/Float32ValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/Float32ValuesImpl.java index 9ff1844849..f76500d8f5 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/Float32ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/Float32ValuesImpl.java @@ -64,7 +64,7 @@ public interface Float32ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/float32") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/float32") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/float32") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/Int32ValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/Int32ValuesImpl.java index 93c087d948..7abdd7ba1f 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/Int32ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/Int32ValuesImpl.java @@ -64,7 +64,7 @@ public interface Int32ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/int32") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/int32") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/int32") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/Int64ValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/Int64ValuesImpl.java index 5001f0f289..1acefeb409 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/Int64ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/Int64ValuesImpl.java @@ -64,7 +64,7 @@ public interface Int64ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/int64") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/int64") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/int64") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/ModelValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/ModelValuesImpl.java index b1e3161b47..62ea7c7061 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/ModelValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/ModelValuesImpl.java @@ -64,7 +64,7 @@ public interface ModelValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/model") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/model") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/model") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -176,8 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -205,7 +205,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/NullableBooleanValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/NullableBooleanValuesImpl.java index 568cdaf7d4..dbd68b10a9 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/NullableBooleanValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/NullableBooleanValuesImpl.java @@ -64,7 +64,7 @@ public interface NullableBooleanValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/nullable-boolean") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/nullable-boolean") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/nullable-boolean") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/NullableFloatValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/NullableFloatValuesImpl.java index 7ec91a5d72..f8b29edffe 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/NullableFloatValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/NullableFloatValuesImpl.java @@ -64,7 +64,7 @@ public interface NullableFloatValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/nullable-float") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/nullable-float") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/nullable-float") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/NullableInt32ValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/NullableInt32ValuesImpl.java index 2ea543029e..0fb9ab3586 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/NullableInt32ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/NullableInt32ValuesImpl.java @@ -64,7 +64,7 @@ public interface NullableInt32ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/nullable-int32") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/nullable-int32") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/nullable-int32") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/NullableModelValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/NullableModelValuesImpl.java index 1a7aa50cb1..76b06b3e8d 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/NullableModelValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/NullableModelValuesImpl.java @@ -64,7 +64,7 @@ public interface NullableModelValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/nullable-model") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/nullable-model") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/nullable-model") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -176,8 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -205,7 +205,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/NullableStringValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/NullableStringValuesImpl.java index 14d3526cf2..46748cc964 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/NullableStringValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/NullableStringValuesImpl.java @@ -64,7 +64,7 @@ public interface NullableStringValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/nullable-string") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/nullable-string") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/nullable-string") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/StringValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/StringValuesImpl.java index ef7552c5d1..e8d96abd38 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/StringValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/StringValuesImpl.java @@ -64,7 +64,7 @@ public interface StringValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/string") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/string") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/string") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/UnknownValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/UnknownValuesImpl.java index b79b8875f7..3fb3a49567 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/UnknownValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/UnknownValuesImpl.java @@ -64,7 +64,7 @@ public interface UnknownValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/array/unknown") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/array/unknown") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/array/unknown") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/BooleanValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/BooleanValuesImpl.java index fef9ecf811..54dcdb8e2d 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/BooleanValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/BooleanValuesImpl.java @@ -64,7 +64,7 @@ public interface BooleanValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/boolean") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/boolean") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/dictionary/boolean") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/DatetimeValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/DatetimeValuesImpl.java index 2e7fddb5c3..ea55d7e8af 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/DatetimeValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/DatetimeValuesImpl.java @@ -64,7 +64,7 @@ public interface DatetimeValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/datetime") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/datetime") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/dictionary/datetime") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/DurationValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/DurationValuesImpl.java index 112a1695e8..bed505de4e 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/DurationValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/DurationValuesImpl.java @@ -64,7 +64,7 @@ public interface DurationValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/duration") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/duration") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/dictionary/duration") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/Float32ValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/Float32ValuesImpl.java index aa131f6908..bdf89ed2f5 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/Float32ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/Float32ValuesImpl.java @@ -64,7 +64,7 @@ public interface Float32ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/float32") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/float32") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/dictionary/float32") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/Int32ValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/Int32ValuesImpl.java index 9abf4cc57e..a4f1e9d61c 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/Int32ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/Int32ValuesImpl.java @@ -64,7 +64,7 @@ public interface Int32ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/int32") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/int32") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/dictionary/int32") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/Int64ValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/Int64ValuesImpl.java index 383b89c568..168df55ef0 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/Int64ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/Int64ValuesImpl.java @@ -64,7 +64,7 @@ public interface Int64ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/int64") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/int64") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/dictionary/int64") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/ModelValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/ModelValuesImpl.java index 0a2c47ac81..be1e1e900c 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/ModelValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/ModelValuesImpl.java @@ -64,7 +64,7 @@ public interface ModelValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/model") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/model") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/dictionary/model") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -176,8 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -205,7 +205,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/NullableFloatValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/NullableFloatValuesImpl.java index c280de87dc..c9de0c5e27 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/NullableFloatValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/NullableFloatValuesImpl.java @@ -64,7 +64,7 @@ public interface NullableFloatValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/nullable-float") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/nullable-float") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/dictionary/nullable-float") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/RecursiveModelValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/RecursiveModelValuesImpl.java index e2cb88c8a2..eb9cf58a84 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/RecursiveModelValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/RecursiveModelValuesImpl.java @@ -64,7 +64,7 @@ public interface RecursiveModelValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/model/recursive") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/model/recursive") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/dictionary/model/recursive") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -176,8 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -205,7 +205,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/StringValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/StringValuesImpl.java index f175afc089..84dcefbc08 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/StringValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/StringValuesImpl.java @@ -64,7 +64,7 @@ public interface StringValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/string") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/string") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/dictionary/string") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/UnknownValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/UnknownValuesImpl.java index db4156cabc..7726abff65 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/UnknownValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/UnknownValuesImpl.java @@ -64,7 +64,7 @@ public interface UnknownValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/dictionary/unknown") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/dictionary/unknown") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/dictionary/unknown") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/enums/extensible/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/enums/extensible/implementation/StringOperationsImpl.java index cd5194e3e2..1bd58d59f1 100644 --- a/typespec-tests/src/main/java/com/type/enums/extensible/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/enums/extensible/implementation/StringOperationsImpl.java @@ -64,7 +64,7 @@ public interface StringOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getKnownValue(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getKnownValue(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/enum/extensible/string/known-value") @@ -73,7 +73,7 @@ Mono> getKnownValue(@HeaderParam("accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getKnownValueSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getKnownValueSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/enum/extensible/string/unknown-value") @@ -82,7 +82,7 @@ Response getKnownValueSync(@HeaderParam("accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getUnknownValue(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getUnknownValue(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/enum/extensible/string/unknown-value") @@ -91,7 +91,7 @@ Mono> getUnknownValue(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getUnknownValueSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getUnknownValueSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/enum/extensible/string/known-value") @@ -100,7 +100,7 @@ Response getUnknownValueSync(@HeaderParam("accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putKnownValue(@HeaderParam("accept") String accept, + Mono> putKnownValue(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/enum/extensible/string/known-value") @@ -109,7 +109,7 @@ Mono> putKnownValue(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putKnownValueSync(@HeaderParam("accept") String accept, + Response putKnownValueSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/enum/extensible/string/unknown-value") @@ -118,7 +118,7 @@ Response putKnownValueSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putUnknownValue(@HeaderParam("accept") String accept, + Mono> putUnknownValue(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/enum/extensible/string/unknown-value") @@ -127,7 +127,7 @@ Mono> putUnknownValue(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putUnknownValueSync(@HeaderParam("accept") String accept, + Response putUnknownValueSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -233,8 +233,8 @@ public Response getUnknownValueWithResponse(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putKnownValueWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putKnownValue(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putKnownValue(contentType, body, requestOptions, context)); } /** @@ -255,8 +255,8 @@ public Mono> putKnownValueWithResponseAsync(BinaryData body, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putKnownValueWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putKnownValueSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putKnownValueSync(contentType, body, requestOptions, Context.NONE); } /** @@ -277,8 +277,8 @@ public Response putKnownValueWithResponse(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putUnknownValueWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putUnknownValue(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putUnknownValue(contentType, body, requestOptions, context)); } /** @@ -299,7 +299,7 @@ public Mono> putUnknownValueWithResponseAsync(BinaryData body, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putUnknownValueWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putUnknownValueSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putUnknownValueSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/enums/fixed/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/enums/fixed/implementation/StringOperationsImpl.java index 62604da0a7..e5b90d1241 100644 --- a/typespec-tests/src/main/java/com/type/enums/fixed/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/enums/fixed/implementation/StringOperationsImpl.java @@ -64,7 +64,7 @@ public interface StringOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getKnownValue(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getKnownValue(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/enum/fixed/string/known-value") @@ -73,7 +73,7 @@ Mono> getKnownValue(@HeaderParam("accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getKnownValueSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getKnownValueSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/enum/fixed/string/known-value") @@ -82,7 +82,7 @@ Response getKnownValueSync(@HeaderParam("accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putKnownValue(@HeaderParam("accept") String accept, + Mono> putKnownValue(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/enum/fixed/string/known-value") @@ -91,7 +91,7 @@ Mono> putKnownValue(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putKnownValueSync(@HeaderParam("accept") String accept, + Response putKnownValueSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/enum/fixed/string/unknown-value") @@ -100,7 +100,7 @@ Response putKnownValueSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putUnknownValue(@HeaderParam("accept") String accept, + Mono> putUnknownValue(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/enum/fixed/string/unknown-value") @@ -109,7 +109,7 @@ Mono> putUnknownValue(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putUnknownValueSync(@HeaderParam("accept") String accept, + Response putUnknownValueSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -173,8 +173,8 @@ public Response getKnownValueWithResponse(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putKnownValueWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putKnownValue(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putKnownValue(contentType, body, requestOptions, context)); } /** @@ -195,8 +195,8 @@ public Mono> putKnownValueWithResponseAsync(BinaryData body, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putKnownValueWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putKnownValueSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putKnownValueSync(contentType, body, requestOptions, Context.NONE); } /** @@ -217,8 +217,8 @@ public Response putKnownValueWithResponse(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putUnknownValueWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putUnknownValue(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putUnknownValue(contentType, body, requestOptions, context)); } /** @@ -239,7 +239,7 @@ public Mono> putUnknownValueWithResponseAsync(BinaryData body, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putUnknownValueWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putUnknownValueSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putUnknownValueSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/model/empty/implementation/EmptyClientImpl.java b/typespec-tests/src/main/java/com/type/model/empty/implementation/EmptyClientImpl.java index d71e6ad6dc..38edf448b7 100644 --- a/typespec-tests/src/main/java/com/type/model/empty/implementation/EmptyClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/empty/implementation/EmptyClientImpl.java @@ -111,7 +111,7 @@ public interface EmptyClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putEmpty(@HeaderParam("accept") String accept, + Mono> putEmpty(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/empty/alone") @@ -120,7 +120,7 @@ Mono> putEmpty(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putEmptySync(@HeaderParam("accept") String accept, + Response putEmptySync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/empty/alone") @@ -129,7 +129,7 @@ Response putEmptySync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getEmpty(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getEmpty(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/empty/alone") @@ -138,7 +138,7 @@ Mono> getEmpty(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getEmptySync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getEmptySync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/model/empty/round-trip") @@ -147,8 +147,9 @@ Response getEmptySync(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> postRoundTripEmpty(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> postRoundTripEmpty(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/type/model/empty/round-trip") @ExpectedResponses({ 200 }) @@ -156,8 +157,9 @@ Mono> postRoundTripEmpty(@HeaderParam("accept") String acce @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postRoundTripEmptySync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response postRoundTripEmptySync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -178,8 +180,8 @@ Response postRoundTripEmptySync(@HeaderParam("accept") String accept */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putEmpty(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putEmpty(contentType, input, requestOptions, context)); } /** @@ -200,8 +202,8 @@ public Mono> putEmptyWithResponseAsync(BinaryData input, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putEmptyWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putEmptySync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putEmptySync(contentType, input, requestOptions, Context.NONE); } /** @@ -273,8 +275,10 @@ public Response getEmptyWithResponse(RequestOptions requestOptions) @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postRoundTripEmptyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.postRoundTripEmpty(accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.postRoundTripEmpty(contentType, accept, body, requestOptions, context)); } /** @@ -301,7 +305,8 @@ public Mono> postRoundTripEmptyWithResponseAsync(BinaryData */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postRoundTripEmptyWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.postRoundTripEmptySync(accept, body, requestOptions, Context.NONE); + return service.postRoundTripEmptySync(contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/model/flatten/implementation/FlattenClientImpl.java b/typespec-tests/src/main/java/com/type/model/flatten/implementation/FlattenClientImpl.java index c3eac4fd0f..78c29caa76 100644 --- a/typespec-tests/src/main/java/com/type/model/flatten/implementation/FlattenClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/flatten/implementation/FlattenClientImpl.java @@ -109,8 +109,9 @@ public interface FlattenClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putFlattenModel(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> putFlattenModel(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Put("/type/model/flatten/flattenModel") @ExpectedResponses({ 200 }) @@ -118,8 +119,9 @@ Mono> putFlattenModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putFlattenModelSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response putFlattenModelSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Put("/type/model/flatten/nestedFlattenModel") @ExpectedResponses({ 200 }) @@ -127,8 +129,9 @@ Response putFlattenModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putNestedFlattenModel(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> putNestedFlattenModel(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Put("/type/model/flatten/nestedFlattenModel") @ExpectedResponses({ 200 }) @@ -136,8 +139,9 @@ Mono> putNestedFlattenModel(@HeaderParam("accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putNestedFlattenModelSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response putNestedFlattenModelSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); } /** @@ -178,8 +182,10 @@ Response putNestedFlattenModelSync(@HeaderParam("accept") String acc @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putFlattenModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putFlattenModel(accept, input, requestOptions, context)); + return FluxUtil + .withContext(context -> service.putFlattenModel(contentType, accept, input, requestOptions, context)); } /** @@ -218,8 +224,9 @@ public Mono> putFlattenModelWithResponseAsync(BinaryData in */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putFlattenModelWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.putFlattenModelSync(accept, input, requestOptions, Context.NONE); + return service.putFlattenModelSync(contentType, accept, input, requestOptions, Context.NONE); } /** @@ -266,8 +273,10 @@ public Response putFlattenModelWithResponse(BinaryData input, Reques @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNestedFlattenModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putNestedFlattenModel(accept, input, requestOptions, context)); + return FluxUtil + .withContext(context -> service.putNestedFlattenModel(contentType, accept, input, requestOptions, context)); } /** @@ -312,7 +321,8 @@ public Mono> putNestedFlattenModelWithResponseAsync(BinaryD */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putNestedFlattenModelWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.putNestedFlattenModelSync(accept, input, requestOptions, Context.NONE); + return service.putNestedFlattenModelSync(contentType, accept, input, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorAsyncClient.java b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorAsyncClient.java index f75a57ccab..9220524eb4 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorAsyncClient.java @@ -105,7 +105,8 @@ public Mono> putExtensibleModelWithResponse(BinaryData input, Req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model omitting the discriminator along with {@link Response} on successful completion of {@link Mono}. + * @return test extensible enum type for discriminator along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -130,8 +131,8 @@ public Mono> putExtensibleModelWithResponse(BinaryData input, Req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model containing discriminator value never defined along with {@link Response} on successful completion - * of {@link Mono}. + * @return test extensible enum type for discriminator along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -205,7 +206,8 @@ public Mono> putFixedModelWithResponse(BinaryData input, RequestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model omitting the discriminator along with {@link Response} on successful completion of {@link Mono}. + * @return test fixed enum type for discriminator along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -229,8 +231,8 @@ public Mono> getFixedModelMissingDiscriminatorWithResponse( * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model containing discriminator value never defined along with {@link Response} on successful completion - * of {@link Mono}. + * @return test fixed enum type for discriminator along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -285,7 +287,7 @@ public Mono putExtensibleModel(Dog input) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a model omitting the discriminator on successful completion of {@link Mono}. + * @return test extensible enum type for discriminator on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -304,7 +306,7 @@ public Mono getExtensibleModelMissingDiscriminator() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a model containing discriminator value never defined on successful completion of {@link Mono}. + * @return test extensible enum type for discriminator on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -362,7 +364,7 @@ public Mono putFixedModel(Snake input) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a model omitting the discriminator on successful completion of {@link Mono}. + * @return test fixed enum type for discriminator on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -381,7 +383,7 @@ public Mono getFixedModelMissingDiscriminator() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a model containing discriminator value never defined on successful completion of {@link Mono}. + * @return test fixed enum type for discriminator on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorClient.java b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorClient.java index 5ab61e86e0..3ab5802713 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorClient.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorClient.java @@ -102,7 +102,7 @@ public Response putExtensibleModelWithResponse(BinaryData input, RequestOp * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model omitting the discriminator along with {@link Response}. + * @return test extensible enum type for discriminator along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -126,7 +126,7 @@ public Response getExtensibleModelMissingDiscriminatorWithResponse(R * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model containing discriminator value never defined along with {@link Response}. + * @return test extensible enum type for discriminator along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -199,7 +199,7 @@ public Response putFixedModelWithResponse(BinaryData input, RequestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model omitting the discriminator along with {@link Response}. + * @return test fixed enum type for discriminator along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -223,7 +223,7 @@ public Response getFixedModelMissingDiscriminatorWithResponse(Reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model containing discriminator value never defined along with {@link Response}. + * @return test fixed enum type for discriminator along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -276,7 +276,7 @@ public void putExtensibleModel(Dog input) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a model omitting the discriminator. + * @return test extensible enum type for discriminator. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -294,7 +294,7 @@ public Dog getExtensibleModelMissingDiscriminator() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a model containing discriminator value never defined. + * @return test extensible enum type for discriminator. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -349,7 +349,7 @@ public void putFixedModel(Snake input) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a model omitting the discriminator. + * @return test fixed enum type for discriminator. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -367,7 +367,7 @@ public Snake getFixedModelMissingDiscriminator() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a model containing discriminator value never defined. + * @return test fixed enum type for discriminator. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/implementation/EnumDiscriminatorClientImpl.java b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/implementation/EnumDiscriminatorClientImpl.java index fd4879ceef..a7209ae879 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/implementation/EnumDiscriminatorClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/implementation/EnumDiscriminatorClientImpl.java @@ -112,7 +112,7 @@ public interface EnumDiscriminatorClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getExtensibleModel(@HeaderParam("accept") String accept, + Mono> getExtensibleModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/extensible-enum") @@ -121,7 +121,7 @@ Mono> getExtensibleModel(@HeaderParam("accept") String acce @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getExtensibleModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getExtensibleModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-discriminator/extensible-enum") @@ -130,7 +130,7 @@ Response getExtensibleModelSync(@HeaderParam("accept") String accept @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putExtensibleModel(@HeaderParam("accept") String accept, + Mono> putExtensibleModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-discriminator/extensible-enum") @@ -139,7 +139,7 @@ Mono> putExtensibleModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putExtensibleModelSync(@HeaderParam("accept") String accept, + Response putExtensibleModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/extensible-enum/missingdiscriminator") @@ -148,7 +148,7 @@ Response putExtensibleModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getExtensibleModelMissingDiscriminator(@HeaderParam("accept") String accept, + Mono> getExtensibleModelMissingDiscriminator(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/extensible-enum/missingdiscriminator") @@ -157,7 +157,7 @@ Mono> getExtensibleModelMissingDiscriminator(@HeaderParam(" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getExtensibleModelMissingDiscriminatorSync(@HeaderParam("accept") String accept, + Response getExtensibleModelMissingDiscriminatorSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/extensible-enum/wrongdiscriminator") @@ -166,7 +166,7 @@ Response getExtensibleModelMissingDiscriminatorSync(@HeaderParam("ac @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getExtensibleModelWrongDiscriminator(@HeaderParam("accept") String accept, + Mono> getExtensibleModelWrongDiscriminator(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/extensible-enum/wrongdiscriminator") @@ -175,7 +175,7 @@ Mono> getExtensibleModelWrongDiscriminator(@HeaderParam("ac @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getExtensibleModelWrongDiscriminatorSync(@HeaderParam("accept") String accept, + Response getExtensibleModelWrongDiscriminatorSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/fixed-enum") @@ -184,7 +184,7 @@ Response getExtensibleModelWrongDiscriminatorSync(@HeaderParam("acce @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getFixedModel(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getFixedModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/fixed-enum") @@ -193,7 +193,7 @@ Mono> getFixedModel(@HeaderParam("accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getFixedModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getFixedModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-discriminator/fixed-enum") @@ -202,7 +202,7 @@ Response getFixedModelSync(@HeaderParam("accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putFixedModel(@HeaderParam("accept") String accept, + Mono> putFixedModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-discriminator/fixed-enum") @@ -211,7 +211,7 @@ Mono> putFixedModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putFixedModelSync(@HeaderParam("accept") String accept, + Response putFixedModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/fixed-enum/missingdiscriminator") @@ -220,7 +220,7 @@ Response putFixedModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getFixedModelMissingDiscriminator(@HeaderParam("accept") String accept, + Mono> getFixedModelMissingDiscriminator(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/fixed-enum/missingdiscriminator") @@ -229,7 +229,7 @@ Mono> getFixedModelMissingDiscriminator(@HeaderParam("accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getFixedModelMissingDiscriminatorSync(@HeaderParam("accept") String accept, + Response getFixedModelMissingDiscriminatorSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/fixed-enum/wrongdiscriminator") @@ -238,7 +238,7 @@ Response getFixedModelMissingDiscriminatorSync(@HeaderParam("accept" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getFixedModelWrongDiscriminator(@HeaderParam("accept") String accept, + Mono> getFixedModelWrongDiscriminator(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/fixed-enum/wrongdiscriminator") @@ -247,7 +247,7 @@ Mono> getFixedModelWrongDiscriminator(@HeaderParam("accept" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getFixedModelWrongDiscriminatorSync(@HeaderParam("accept") String accept, + Response getFixedModelWrongDiscriminatorSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -321,8 +321,8 @@ public Response getExtensibleModelWithResponse(RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putExtensibleModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putExtensibleModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putExtensibleModel(contentType, input, requestOptions, context)); } /** @@ -346,8 +346,8 @@ public Mono> putExtensibleModelWithResponseAsync(BinaryData input */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putExtensibleModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putExtensibleModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putExtensibleModelSync(contentType, input, requestOptions, Context.NONE); } /** @@ -366,7 +366,8 @@ public Response putExtensibleModelWithResponse(BinaryData input, RequestOp * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model omitting the discriminator along with {@link Response} on successful completion of {@link Mono}. + * @return test extensible enum type for discriminator along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> @@ -392,7 +393,7 @@ public Response putExtensibleModelWithResponse(BinaryData input, RequestOp * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model omitting the discriminator along with {@link Response}. + * @return test extensible enum type for discriminator along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getExtensibleModelMissingDiscriminatorWithResponse(RequestOptions requestOptions) { @@ -416,8 +417,8 @@ public Response getExtensibleModelMissingDiscriminatorWithResponse(R * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model containing discriminator value never defined along with {@link Response} on successful completion - * of {@link Mono}. + * @return test extensible enum type for discriminator along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> @@ -443,7 +444,7 @@ public Response getExtensibleModelMissingDiscriminatorWithResponse(R * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model containing discriminator value never defined along with {@link Response}. + * @return test extensible enum type for discriminator along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getExtensibleModelWrongDiscriminatorWithResponse(RequestOptions requestOptions) { @@ -521,8 +522,8 @@ public Response getFixedModelWithResponse(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putFixedModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putFixedModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putFixedModel(contentType, input, requestOptions, context)); } /** @@ -546,8 +547,8 @@ public Mono> putFixedModelWithResponseAsync(BinaryData input, Req */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putFixedModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putFixedModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putFixedModelSync(contentType, input, requestOptions, Context.NONE); } /** @@ -566,7 +567,8 @@ public Response putFixedModelWithResponse(BinaryData input, RequestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model omitting the discriminator along with {@link Response} on successful completion of {@link Mono}. + * @return test fixed enum type for discriminator along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> @@ -592,7 +594,7 @@ public Response putFixedModelWithResponse(BinaryData input, RequestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model omitting the discriminator along with {@link Response}. + * @return test fixed enum type for discriminator along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getFixedModelMissingDiscriminatorWithResponse(RequestOptions requestOptions) { @@ -616,8 +618,8 @@ public Response getFixedModelMissingDiscriminatorWithResponse(Reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model containing discriminator value never defined along with {@link Response} on successful completion - * of {@link Mono}. + * @return test fixed enum type for discriminator along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getFixedModelWrongDiscriminatorWithResponseAsync(RequestOptions requestOptions) { @@ -642,7 +644,7 @@ public Mono> getFixedModelWrongDiscriminatorWithResponseAsy * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a model containing discriminator value never defined along with {@link Response}. + * @return test fixed enum type for discriminator along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getFixedModelWrongDiscriminatorWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/enumnesteddiscriminator/implementation/EnumNestedDiscriminatorClientImpl.java b/typespec-tests/src/main/java/com/type/model/inheritance/enumnesteddiscriminator/implementation/EnumNestedDiscriminatorClientImpl.java index 92fe6ffd6d..eec907b6e9 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/enumnesteddiscriminator/implementation/EnumNestedDiscriminatorClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/enumnesteddiscriminator/implementation/EnumNestedDiscriminatorClientImpl.java @@ -112,7 +112,7 @@ public interface EnumNestedDiscriminatorClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getModel(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/model") @@ -121,7 +121,7 @@ Mono> getModel(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-nested-discriminator/model") @@ -130,7 +130,7 @@ Response getModelSync(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putModel(@HeaderParam("accept") String accept, + Mono> putModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-nested-discriminator/model") @@ -139,7 +139,7 @@ Mono> putModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putModelSync(@HeaderParam("accept") String accept, + Response putModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/recursivemodel") @@ -148,7 +148,7 @@ Response putModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getRecursiveModel(@HeaderParam("accept") String accept, + Mono> getRecursiveModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/recursivemodel") @@ -157,7 +157,7 @@ Mono> getRecursiveModel(@HeaderParam("accept") String accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getRecursiveModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getRecursiveModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-nested-discriminator/recursivemodel") @@ -166,7 +166,7 @@ Response getRecursiveModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putRecursiveModel(@HeaderParam("accept") String accept, + Mono> putRecursiveModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-nested-discriminator/recursivemodel") @@ -175,7 +175,7 @@ Mono> putRecursiveModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putRecursiveModelSync(@HeaderParam("accept") String accept, + Response putRecursiveModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/missingdiscriminator") @@ -184,7 +184,7 @@ Response putRecursiveModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getMissingDiscriminator(@HeaderParam("accept") String accept, + Mono> getMissingDiscriminator(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/missingdiscriminator") @@ -193,7 +193,7 @@ Mono> getMissingDiscriminator(@HeaderParam("accept") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getMissingDiscriminatorSync(@HeaderParam("accept") String accept, + Response getMissingDiscriminatorSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/wrongdiscriminator") @@ -202,7 +202,7 @@ Response getMissingDiscriminatorSync(@HeaderParam("accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getWrongDiscriminator(@HeaderParam("accept") String accept, + Mono> getWrongDiscriminator(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/wrongdiscriminator") @@ -211,7 +211,7 @@ Mono> getWrongDiscriminator(@HeaderParam("accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getWrongDiscriminatorSync(@HeaderParam("accept") String accept, + Response getWrongDiscriminatorSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -286,8 +286,8 @@ public Response getModelWithResponse(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putModel(contentType, input, requestOptions, context)); } /** @@ -311,8 +311,8 @@ public Mono> putModelWithResponseAsync(BinaryData input, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putModelSync(contentType, input, requestOptions, Context.NONE); } /** @@ -386,8 +386,8 @@ public Response getRecursiveModelWithResponse(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putRecursiveModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putRecursiveModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putRecursiveModel(contentType, input, requestOptions, context)); } /** @@ -411,8 +411,8 @@ public Mono> putRecursiveModelWithResponseAsync(BinaryData input, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putRecursiveModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putRecursiveModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putRecursiveModelSync(contentType, input, requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/nesteddiscriminator/implementation/NestedDiscriminatorClientImpl.java b/typespec-tests/src/main/java/com/type/model/inheritance/nesteddiscriminator/implementation/NestedDiscriminatorClientImpl.java index 0872049d53..b6b85a870f 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/nesteddiscriminator/implementation/NestedDiscriminatorClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/nesteddiscriminator/implementation/NestedDiscriminatorClientImpl.java @@ -112,7 +112,7 @@ public interface NestedDiscriminatorClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getModel(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/model") @@ -121,7 +121,7 @@ Mono> getModel(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/nested-discriminator/model") @@ -130,7 +130,7 @@ Response getModelSync(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putModel(@HeaderParam("accept") String accept, + Mono> putModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/nested-discriminator/model") @@ -139,7 +139,7 @@ Mono> putModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putModelSync(@HeaderParam("accept") String accept, + Response putModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/recursivemodel") @@ -148,7 +148,7 @@ Response putModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getRecursiveModel(@HeaderParam("accept") String accept, + Mono> getRecursiveModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/recursivemodel") @@ -157,7 +157,7 @@ Mono> getRecursiveModel(@HeaderParam("accept") String accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getRecursiveModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getRecursiveModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/nested-discriminator/recursivemodel") @@ -166,7 +166,7 @@ Response getRecursiveModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putRecursiveModel(@HeaderParam("accept") String accept, + Mono> putRecursiveModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/nested-discriminator/recursivemodel") @@ -175,7 +175,7 @@ Mono> putRecursiveModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putRecursiveModelSync(@HeaderParam("accept") String accept, + Response putRecursiveModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/missingdiscriminator") @@ -184,7 +184,7 @@ Response putRecursiveModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getMissingDiscriminator(@HeaderParam("accept") String accept, + Mono> getMissingDiscriminator(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/missingdiscriminator") @@ -193,7 +193,7 @@ Mono> getMissingDiscriminator(@HeaderParam("accept") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getMissingDiscriminatorSync(@HeaderParam("accept") String accept, + Response getMissingDiscriminatorSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/wrongdiscriminator") @@ -202,7 +202,7 @@ Response getMissingDiscriminatorSync(@HeaderParam("accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getWrongDiscriminator(@HeaderParam("accept") String accept, + Mono> getWrongDiscriminator(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/wrongdiscriminator") @@ -211,7 +211,7 @@ Mono> getWrongDiscriminator(@HeaderParam("accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getWrongDiscriminatorSync(@HeaderParam("accept") String accept, + Response getWrongDiscriminatorSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -286,8 +286,8 @@ public Response getModelWithResponse(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putModel(contentType, input, requestOptions, context)); } /** @@ -311,8 +311,8 @@ public Mono> putModelWithResponseAsync(BinaryData input, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putModelSync(contentType, input, requestOptions, Context.NONE); } /** @@ -386,8 +386,8 @@ public Response getRecursiveModelWithResponse(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putRecursiveModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putRecursiveModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putRecursiveModel(contentType, input, requestOptions, context)); } /** @@ -411,8 +411,8 @@ public Mono> putRecursiveModelWithResponseAsync(BinaryData input, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putRecursiveModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putRecursiveModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putRecursiveModelSync(contentType, input, requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/notdiscriminated/implementation/NotDiscriminatedClientImpl.java b/typespec-tests/src/main/java/com/type/model/inheritance/notdiscriminated/implementation/NotDiscriminatedClientImpl.java index 95a7d97592..e1917b4818 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/notdiscriminated/implementation/NotDiscriminatedClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/notdiscriminated/implementation/NotDiscriminatedClientImpl.java @@ -113,7 +113,7 @@ public interface NotDiscriminatedClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> postValid(@HeaderParam("accept") String accept, + Mono> postValid(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Post("/type/model/inheritance/not-discriminated/valid") @@ -122,7 +122,7 @@ Mono> postValid(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postValidSync(@HeaderParam("accept") String accept, + Response postValidSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/not-discriminated/valid") @@ -131,7 +131,7 @@ Response postValidSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getValid(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getValid(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/not-discriminated/valid") @@ -140,7 +140,7 @@ Mono> getValid(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getValidSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getValidSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/not-discriminated/valid") @@ -149,8 +149,9 @@ Response getValidSync(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putValid(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> putValid(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/not-discriminated/valid") @ExpectedResponses({ 200 }) @@ -158,8 +159,9 @@ Mono> putValid(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putValidSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response putValidSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); } /** @@ -184,8 +186,8 @@ Response putValidSync(@HeaderParam("accept") String accept, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postValidWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.postValid(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.postValid(contentType, input, requestOptions, context)); } /** @@ -210,8 +212,8 @@ public Mono> postValidWithResponseAsync(BinaryData input, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postValidWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.postValidSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.postValidSync(contentType, input, requestOptions, Context.NONE); } /** @@ -298,8 +300,9 @@ public Response getValidWithResponse(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putValidWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(accept, input, requestOptions, context)); + return FluxUtil.withContext(context -> service.putValid(contentType, accept, input, requestOptions, context)); } /** @@ -334,7 +337,8 @@ public Mono> putValidWithResponseAsync(BinaryData input, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putValidWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.putValidSync(accept, input, requestOptions, Context.NONE); + return service.putValidSync(contentType, accept, input, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/recursive/implementation/RecursiveClientImpl.java b/typespec-tests/src/main/java/com/type/model/inheritance/recursive/implementation/RecursiveClientImpl.java index 977d2a16db..c322a2eabe 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/recursive/implementation/RecursiveClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/recursive/implementation/RecursiveClientImpl.java @@ -111,8 +111,8 @@ public interface RecursiveClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/recursive") @ExpectedResponses({ 204 }) @@ -120,8 +120,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/recursive") @ExpectedResponses({ 200 }) @@ -129,7 +129,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/recursive") @@ -138,7 +138,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -165,8 +165,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, input, requestOptions, context)); } /** @@ -192,8 +192,8 @@ public Mono> putWithResponseAsync(BinaryData input, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, input, requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/singlediscriminator/implementation/SingleDiscriminatorClientImpl.java b/typespec-tests/src/main/java/com/type/model/inheritance/singlediscriminator/implementation/SingleDiscriminatorClientImpl.java index d3b10c2328..fa7e8515da 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/singlediscriminator/implementation/SingleDiscriminatorClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/singlediscriminator/implementation/SingleDiscriminatorClientImpl.java @@ -112,7 +112,7 @@ public interface SingleDiscriminatorClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getModel(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/model") @@ -121,7 +121,7 @@ Mono> getModel(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/single-discriminator/model") @@ -130,7 +130,7 @@ Response getModelSync(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putModel(@HeaderParam("accept") String accept, + Mono> putModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/single-discriminator/model") @@ -139,7 +139,7 @@ Mono> putModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putModelSync(@HeaderParam("accept") String accept, + Response putModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/recursivemodel") @@ -148,7 +148,7 @@ Response putModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getRecursiveModel(@HeaderParam("accept") String accept, + Mono> getRecursiveModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/recursivemodel") @@ -157,7 +157,7 @@ Mono> getRecursiveModel(@HeaderParam("accept") String accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getRecursiveModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getRecursiveModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/single-discriminator/recursivemodel") @@ -166,7 +166,7 @@ Response getRecursiveModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putRecursiveModel(@HeaderParam("accept") String accept, + Mono> putRecursiveModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/single-discriminator/recursivemodel") @@ -175,7 +175,7 @@ Mono> putRecursiveModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putRecursiveModelSync(@HeaderParam("accept") String accept, + Response putRecursiveModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/missingdiscriminator") @@ -184,7 +184,7 @@ Response putRecursiveModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getMissingDiscriminator(@HeaderParam("accept") String accept, + Mono> getMissingDiscriminator(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/missingdiscriminator") @@ -193,7 +193,7 @@ Mono> getMissingDiscriminator(@HeaderParam("accept") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getMissingDiscriminatorSync(@HeaderParam("accept") String accept, + Response getMissingDiscriminatorSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/wrongdiscriminator") @@ -202,7 +202,7 @@ Response getMissingDiscriminatorSync(@HeaderParam("accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getWrongDiscriminator(@HeaderParam("accept") String accept, + Mono> getWrongDiscriminator(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/wrongdiscriminator") @@ -211,7 +211,7 @@ Mono> getWrongDiscriminator(@HeaderParam("accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getWrongDiscriminatorSync(@HeaderParam("accept") String accept, + Response getWrongDiscriminatorSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/legacy-model") @@ -220,7 +220,7 @@ Response getWrongDiscriminatorSync(@HeaderParam("accept") String acc @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getLegacyModel(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getLegacyModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/legacy-model") @@ -229,7 +229,7 @@ Mono> getLegacyModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getLegacyModelSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getLegacyModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -304,8 +304,8 @@ public Response getModelWithResponse(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putModel(contentType, input, requestOptions, context)); } /** @@ -329,8 +329,8 @@ public Mono> putModelWithResponseAsync(BinaryData input, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putModelSync(contentType, input, requestOptions, Context.NONE); } /** @@ -404,8 +404,8 @@ public Response getRecursiveModelWithResponse(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putRecursiveModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putRecursiveModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putRecursiveModel(contentType, input, requestOptions, context)); } /** @@ -429,8 +429,8 @@ public Mono> putRecursiveModelWithResponseAsync(BinaryData input, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putRecursiveModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putRecursiveModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putRecursiveModelSync(contentType, input, requestOptions, Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/type/model/usage/implementation/UsageClientImpl.java b/typespec-tests/src/main/java/com/type/model/usage/implementation/UsageClientImpl.java index 033a927fc0..49ac156331 100644 --- a/typespec-tests/src/main/java/com/type/model/usage/implementation/UsageClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/usage/implementation/UsageClientImpl.java @@ -110,7 +110,7 @@ public interface UsageClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> input(@HeaderParam("accept") String accept, + Mono> input(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Post("/type/model/usage/input") @@ -119,8 +119,8 @@ Mono> input(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response inputSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData input, - RequestOptions requestOptions, Context context); + Response inputSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/usage/output") @ExpectedResponses({ 200 }) @@ -128,7 +128,7 @@ Response inputSync(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> output(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> output(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/usage/output") @@ -137,7 +137,7 @@ Mono> output(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response outputSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response outputSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/model/usage/input-output") @@ -146,8 +146,9 @@ Response outputSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> inputAndOutput(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> inputAndOutput(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/type/model/usage/input-output") @ExpectedResponses({ 200 }) @@ -155,8 +156,9 @@ Mono> inputAndOutput(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response inputAndOutputSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response inputAndOutputSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -179,8 +181,8 @@ Response inputAndOutputSync(@HeaderParam("accept") String accept, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> inputWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.input(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.input(contentType, input, requestOptions, context)); } /** @@ -203,8 +205,8 @@ public Mono> inputWithResponseAsync(BinaryData input, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response inputWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.inputSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.inputSync(contentType, input, requestOptions, Context.NONE); } /** @@ -283,8 +285,10 @@ public Response outputWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> inputAndOutputWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.inputAndOutput(accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.inputAndOutput(contentType, accept, body, requestOptions, context)); } /** @@ -315,7 +319,8 @@ public Mono> inputAndOutputWithResponseAsync(BinaryData bod */ @ServiceMethod(returns = ReturnType.SINGLE) public Response inputAndOutputWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.inputAndOutputSync(accept, body, requestOptions, Context.NONE); + return service.inputAndOutputSync(contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/model/visibility/implementation/VisibilityClientImpl.java b/typespec-tests/src/main/java/com/type/model/visibility/implementation/VisibilityClientImpl.java index 9c7fb72e81..f611891806 100644 --- a/typespec-tests/src/main/java/com/type/model/visibility/implementation/VisibilityClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/visibility/implementation/VisibilityClientImpl.java @@ -115,8 +115,9 @@ public interface VisibilityClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getModel(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> getModel(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Get("/type/model/visibility") @ExpectedResponses({ 200 }) @@ -124,8 +125,9 @@ Mono> getModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getModelSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response getModelSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Head("/type/model/visibility") @ExpectedResponses({ 200 }) @@ -133,7 +135,7 @@ Response getModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> headModel(@HeaderParam("accept") String accept, + Mono> headModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Head("/type/model/visibility") @@ -142,7 +144,7 @@ Mono> headModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response headModelSync(@HeaderParam("accept") String accept, + Response headModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/visibility") @@ -151,7 +153,7 @@ Response headModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putModel(@HeaderParam("accept") String accept, + Mono> putModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/visibility") @@ -160,7 +162,7 @@ Mono> putModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putModelSync(@HeaderParam("accept") String accept, + Response putModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Patch("/type/model/visibility") @@ -169,7 +171,7 @@ Response putModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> patchModel(@HeaderParam("accept") String accept, + Mono> patchModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Patch("/type/model/visibility") @@ -178,7 +180,7 @@ Mono> patchModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response patchModelSync(@HeaderParam("accept") String accept, + Response patchModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Post("/type/model/visibility") @@ -187,7 +189,7 @@ Response patchModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> postModel(@HeaderParam("accept") String accept, + Mono> postModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Post("/type/model/visibility") @@ -196,7 +198,7 @@ Mono> postModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postModelSync(@HeaderParam("accept") String accept, + Response postModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Delete("/type/model/visibility") @@ -205,7 +207,7 @@ Response postModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteModel(@HeaderParam("accept") String accept, + Mono> deleteModel(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Delete("/type/model/visibility") @@ -214,7 +216,7 @@ Mono> deleteModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteModelSync(@HeaderParam("accept") String accept, + Response deleteModelSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); } @@ -263,8 +265,9 @@ Response deleteModelSync(@HeaderParam("accept") String accept, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getModel(accept, input, requestOptions, context)); + return FluxUtil.withContext(context -> service.getModel(contentType, accept, input, requestOptions, context)); } /** @@ -311,8 +314,9 @@ public Mono> getModelWithResponseAsync(BinaryData input, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getModelWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.getModelSync(accept, input, requestOptions, Context.NONE); + return service.getModelSync(contentType, accept, input, requestOptions, Context.NONE); } /** @@ -343,8 +347,8 @@ public Response getModelWithResponse(BinaryData input, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> headModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.headModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.headModel(contentType, input, requestOptions, context)); } /** @@ -375,8 +379,8 @@ public Mono> headModelWithResponseAsync(BinaryData input, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response headModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.headModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.headModelSync(contentType, input, requestOptions, Context.NONE); } /** @@ -407,8 +411,8 @@ public Response headModelWithResponse(BinaryData input, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putModel(contentType, input, requestOptions, context)); } /** @@ -439,8 +443,8 @@ public Mono> putModelWithResponseAsync(BinaryData input, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putModelSync(contentType, input, requestOptions, Context.NONE); } /** @@ -471,8 +475,8 @@ public Response putModelWithResponse(BinaryData input, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patchModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.patchModel(contentType, input, requestOptions, context)); } /** @@ -503,8 +507,8 @@ public Mono> patchModelWithResponseAsync(BinaryData input, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response patchModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.patchModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.patchModelSync(contentType, input, requestOptions, Context.NONE); } /** @@ -535,8 +539,8 @@ public Response patchModelWithResponse(BinaryData input, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.postModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.postModel(contentType, input, requestOptions, context)); } /** @@ -567,8 +571,8 @@ public Mono> postModelWithResponseAsync(BinaryData input, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.postModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.postModelSync(contentType, input, requestOptions, Context.NONE); } /** @@ -599,8 +603,8 @@ public Response postModelWithResponse(BinaryData input, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.deleteModel(accept, input, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.deleteModel(contentType, input, requestOptions, context)); } /** @@ -631,7 +635,7 @@ public Mono> deleteModelWithResponseAsync(BinaryData input, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteModelWithResponse(BinaryData input, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.deleteModelSync(accept, input, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.deleteModelSync(contentType, input, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatAsyncClient.java index 0a77172f15..6bb710ebf5 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatAsyncClient.java @@ -57,7 +57,8 @@ public final class ExtendsDifferentSpreadFloatAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from a model that spread Record<float32> with the different known property type + * along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +102,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model extends from a model that spread Record<float32> with the different known property type + * on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatClient.java index a18b3d3fc5..bc2422ccb7 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatClient.java @@ -55,7 +55,8 @@ public final class ExtendsDifferentSpreadFloatClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from a model that spread Record<float32> with the different known property type + * along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model extends from a model that spread Record<float32> with the different known property type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayAsyncClient.java index 8e539dc46c..f002e61953 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayAsyncClient.java @@ -63,7 +63,8 @@ public final class ExtendsDifferentSpreadModelArrayAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from a model that spread Record<ModelForRecord[]> with the different known + * property type along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -113,7 +114,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model extends from a model that spread Record<ModelForRecord[]> with the different known + * property type on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayClient.java index c9341fbd75..19967ec10b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayClient.java @@ -61,7 +61,8 @@ public final class ExtendsDifferentSpreadModelArrayClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from a model that spread Record<ModelForRecord[]> with the different known + * property type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -111,7 +112,8 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model extends from a model that spread Record<ModelForRecord[]> with the different known + * property type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelAsyncClient.java index edeaef6e63..7bd1089729 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelAsyncClient.java @@ -59,7 +59,8 @@ public final class ExtendsDifferentSpreadModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from a model that spread Record<ModelForRecord> with the different known property + * type along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -105,7 +106,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model extends from a model that spread Record<ModelForRecord> with the different known property + * type on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelClient.java index 3ef771373b..a4de285a70 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelClient.java @@ -57,7 +57,8 @@ public final class ExtendsDifferentSpreadModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from a model that spread Record<ModelForRecord> with the different known property + * type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -103,7 +104,8 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model extends from a model that spread Record<ModelForRecord> with the different known property + * type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringAsyncClient.java index 79c7ee9f46..714c54aed9 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringAsyncClient.java @@ -57,7 +57,8 @@ public final class ExtendsDifferentSpreadStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from a model that spread Record<string> with the different known property type + * along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +102,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model extends from a model that spread Record<string> with the different known property type on + * successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringClient.java index c110a4e66e..956a1b7d23 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringClient.java @@ -55,7 +55,8 @@ public final class ExtendsDifferentSpreadStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from a model that spread Record<string> with the different known property type + * along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model extends from a model that spread Record<string> with the different known property type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatAsyncClient.java index 165efe0962..f730ea2bb2 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatAsyncClient.java @@ -56,7 +56,8 @@ public final class ExtendsFloatAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from Record<float32> type along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model extends from Record<float32> type on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatClient.java index 2344a7bcc7..13a6671339 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatClient.java @@ -54,7 +54,7 @@ public final class ExtendsFloatClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from Record<float32> type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model extends from Record<float32> type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayAsyncClient.java index aee6c3bdfc..9261fc56a2 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayAsyncClient.java @@ -62,7 +62,8 @@ public final class ExtendsModelArrayAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from Record<ModelForRecord[]> type along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -111,7 +112,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model extends from Record<ModelForRecord[]> type on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayClient.java index 112640784b..9fd0bb8f8c 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayClient.java @@ -60,7 +60,7 @@ public final class ExtendsModelArrayClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from Record<ModelForRecord[]> type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -109,7 +109,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model extends from Record<ModelForRecord[]> type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelAsyncClient.java index 3e2c8a262b..93a7496c97 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelAsyncClient.java @@ -58,7 +58,8 @@ public final class ExtendsModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from Record<ModelForRecord> type along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -103,7 +104,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model extends from Record<ModelForRecord> type on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelClient.java index 350b125c5b..929d4454c8 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelClient.java @@ -56,7 +56,7 @@ public final class ExtendsModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from Record<ModelForRecord> type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +101,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model extends from Record<ModelForRecord> type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringAsyncClient.java index 631556ec37..cd7eab90a1 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringAsyncClient.java @@ -56,7 +56,8 @@ public final class ExtendsStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from Record<string> type along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model extends from Record<string> type on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringClient.java index 18ef0b0b98..5b64a375ac 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringClient.java @@ -54,7 +54,7 @@ public final class ExtendsStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from Record<string> type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model extends from Record<string> type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownAsyncClient.java index a3971293d0..17fedcb062 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownAsyncClient.java @@ -56,7 +56,8 @@ public final class ExtendsUnknownAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from Record<unknown> type along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model extends from Record<unknown> type on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownClient.java index d1223a9711..7470e09e3c 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownClient.java @@ -54,7 +54,7 @@ public final class ExtendsUnknownClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from Record<unknown> type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model extends from Record<unknown> type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedAsyncClient.java index 47555089a1..62eba489a9 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedAsyncClient.java @@ -58,7 +58,8 @@ public final class ExtendsUnknownDerivedAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from a type that extends from Record<unknown> along with {@link Response} on + * successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -103,7 +104,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model extends from a type that extends from Record<unknown> on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedClient.java index a711f89a99..d8a5cc01c5 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedClient.java @@ -56,7 +56,7 @@ public final class ExtendsUnknownDerivedClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from a type that extends from Record<unknown> along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +101,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model extends from a type that extends from Record<unknown>. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedAsyncClient.java index 2996ebdb51..226d004e8b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedAsyncClient.java @@ -57,7 +57,8 @@ public final class ExtendsUnknownDiscriminatedAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from Record<unknown> with a discriminator along with {@link Response} on + * successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +102,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model extends from Record<unknown> with a discriminator on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedClient.java index 8c65533253..25288a4269 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedClient.java @@ -55,7 +55,7 @@ public final class ExtendsUnknownDiscriminatedClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from Record<unknown> with a discriminator along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +99,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model extends from Record<unknown> with a discriminator. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatAsyncClient.java index f0b5bec866..e092c6732f 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatAsyncClient.java @@ -56,7 +56,8 @@ public final class IsFloatAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model is from Record<float32> type along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model is from Record<float32> type on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatClient.java index 59f59264a0..62521ba1db 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatClient.java @@ -54,7 +54,7 @@ public final class IsFloatClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model is from Record<float32> type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model is from Record<float32> type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayAsyncClient.java index dc5b7a138c..0f41954adf 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayAsyncClient.java @@ -62,7 +62,8 @@ public final class IsModelArrayAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model is from Record<ModelForRecord[]> type along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -111,7 +112,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model is from Record<ModelForRecord[]> type on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayClient.java index ed99323bec..247008401b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayClient.java @@ -60,7 +60,7 @@ public final class IsModelArrayClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model is from Record<ModelForRecord[]> type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -109,7 +109,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model is from Record<ModelForRecord[]> type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelAsyncClient.java index 245ff40887..25e851b3ff 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelAsyncClient.java @@ -58,7 +58,8 @@ public final class IsModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model is from Record<ModelForRecord> type along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -103,7 +104,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model is from Record<ModelForRecord> type on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelClient.java index cb9bb36ef3..c38f983cc6 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelClient.java @@ -56,7 +56,7 @@ public final class IsModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model is from Record<ModelForRecord> type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +101,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model is from Record<ModelForRecord> type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringAsyncClient.java index 4388e9f9a7..90ba3dc461 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringAsyncClient.java @@ -56,7 +56,8 @@ public final class IsStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model is from Record<string> type along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model is from Record<string> type on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringClient.java index 54f77899d5..5cc8e95486 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringClient.java @@ -54,7 +54,7 @@ public final class IsStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model is from Record<string> type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model is from Record<string> type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownAsyncClient.java index 56fb6113f7..71a28db9ec 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownAsyncClient.java @@ -56,7 +56,8 @@ public final class IsUnknownAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model is from Record<unknown> type along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model is from Record<unknown> type on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownClient.java index e5fde6da37..0990ca7125 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownClient.java @@ -54,7 +54,7 @@ public final class IsUnknownClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model is from Record<unknown> type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model is from Record<unknown> type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedAsyncClient.java index 6527d2fd23..3b65a75c16 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedAsyncClient.java @@ -58,7 +58,8 @@ public final class IsUnknownDerivedAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from a type that is Record<unknown> type along with {@link Response} on + * successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -103,7 +104,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model extends from a type that is Record<unknown> type on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedClient.java index ff945769c1..3fd6631f2e 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedClient.java @@ -56,7 +56,7 @@ public final class IsUnknownDerivedClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from a type that is Record<unknown> type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +101,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model extends from a type that is Record<unknown> type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedAsyncClient.java index 33cd143e8a..926dac37f4 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedAsyncClient.java @@ -57,7 +57,8 @@ public final class IsUnknownDiscriminatedAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model is Record<unknown> with a discriminator along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +102,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model is Record<unknown> with a discriminator on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedClient.java index 8d336689cc..6830a100e9 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedClient.java @@ -55,7 +55,7 @@ public final class IsUnknownDiscriminatedClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model is Record<unknown> with a discriminator along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +99,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model is Record<unknown> with a discriminator. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadAsyncClient.java index 4a7f13d101..c922f38890 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadAsyncClient.java @@ -56,7 +56,8 @@ public final class MultipleSpreadAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<string> and Record<float32> along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<string> and Record<float32> on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadClient.java index 695adb7ab4..0537e3ddcf 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadClient.java @@ -54,7 +54,7 @@ public final class MultipleSpreadClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<string> and Record<float32> along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<string> and Record<float32>. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatAsyncClient.java index 52c264e60c..fb314eb760 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatAsyncClient.java @@ -56,7 +56,8 @@ public final class SpreadDifferentFloatAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<float32> with the different known property type along with {@link Response} + * on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<float32> with the different known property type on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatClient.java index cf800c43fe..f88fff8d92 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatClient.java @@ -54,7 +54,8 @@ public final class SpreadDifferentFloatClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<float32> with the different known property type along with + * {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +98,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<float32> with the different known property type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayAsyncClient.java index 90fbf5a45e..e286ae7d94 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayAsyncClient.java @@ -60,7 +60,8 @@ public final class SpreadDifferentModelArrayAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<ModelForRecord[]> with the different known property type along with + * {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -107,7 +108,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<ModelForRecord[]> with the different known property type on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayClient.java index 75c931ef47..cfd2094235 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayClient.java @@ -58,7 +58,8 @@ public final class SpreadDifferentModelArrayClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<ModelForRecord[]> with the different known property type along with + * {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -105,7 +106,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<ModelForRecord[]> with the different known property type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelAsyncClient.java index dd78d0eafa..d587b7f673 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelAsyncClient.java @@ -58,7 +58,8 @@ public final class SpreadDifferentModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<ModelForRecord> with the different known property type along with + * {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -103,7 +104,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<ModelForRecord> with the different known property type on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelClient.java index 2de9b57e67..3c8399d490 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelClient.java @@ -56,7 +56,8 @@ public final class SpreadDifferentModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<ModelForRecord> with the different known property type along with + * {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +102,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<ModelForRecord> with the different known property type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringAsyncClient.java index 9a5b404239..be6d3a5fe5 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringAsyncClient.java @@ -56,7 +56,8 @@ public final class SpreadDifferentStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<string> with the different known property type along with {@link Response} + * on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<string> with the different known property type on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringClient.java index c052f4d6b2..19d4ba0b53 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringClient.java @@ -54,7 +54,7 @@ public final class SpreadDifferentStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<string> with the different known property type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<string> with the different known property type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatAsyncClient.java index 4491b1cea4..aea11ced99 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatAsyncClient.java @@ -56,7 +56,8 @@ public final class SpreadFloatAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<float32> with the same known property type along with {@link Response} on + * successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<float32> with the same known property type on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatClient.java index 844165116e..d47074a53f 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatClient.java @@ -54,7 +54,7 @@ public final class SpreadFloatClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<float32> with the same known property type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<float32> with the same known property type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayAsyncClient.java index bfb87faa8f..21c8cb7745 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayAsyncClient.java @@ -62,7 +62,7 @@ public final class SpreadModelArrayAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -111,7 +111,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the response body on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayClient.java index d869e8b9df..5dd8466491 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayClient.java @@ -60,7 +60,7 @@ public final class SpreadModelArrayClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the response body along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -109,7 +109,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the response. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelAsyncClient.java index c1250d5eec..8ce7cdb6c7 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelAsyncClient.java @@ -58,7 +58,8 @@ public final class SpreadModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<ModelForRecord> with the same known property type along with + * {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -103,7 +104,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<ModelForRecord> with the same known property type on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelClient.java index ed489d4347..4c46cfe548 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelClient.java @@ -56,7 +56,8 @@ public final class SpreadModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<ModelForRecord> with the same known property type along with + * {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +102,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<ModelForRecord> with the same known property type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionAsyncClient.java index 7baae2dcb8..4a8f20819b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionAsyncClient.java @@ -56,7 +56,8 @@ public final class SpreadRecordDiscriminatedUnionAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<WidgetData> along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<WidgetData> on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionClient.java index 641f7c8498..6e397cd71a 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionClient.java @@ -54,7 +54,7 @@ public final class SpreadRecordDiscriminatedUnionClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<WidgetData> along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<WidgetData>. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2AsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2AsyncClient.java index 25d072990b..1b655db476 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2AsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2AsyncClient.java @@ -56,7 +56,8 @@ public final class SpreadRecordNonDiscriminatedUnion2AsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<WidgetData2 | WidgetData1> along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<WidgetData2 | WidgetData1> on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2Client.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2Client.java index 25af9e4463..a6a9f04145 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2Client.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2Client.java @@ -54,7 +54,7 @@ public final class SpreadRecordNonDiscriminatedUnion2Client { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<WidgetData2 | WidgetData1> along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<WidgetData2 | WidgetData1>. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3AsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3AsyncClient.java index 067ee6ee43..1dbabff923 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3AsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3AsyncClient.java @@ -56,7 +56,8 @@ public final class SpreadRecordNonDiscriminatedUnion3AsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<WidgetData2[] | WidgetData1> along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<WidgetData2[] | WidgetData1> on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3Client.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3Client.java index d14844fa24..6fac9d6a5b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3Client.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3Client.java @@ -54,7 +54,7 @@ public final class SpreadRecordNonDiscriminatedUnion3Client { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<WidgetData2[] | WidgetData1> along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<WidgetData2[] | WidgetData1>. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionAsyncClient.java index 637b3d680f..77cc859c3c 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionAsyncClient.java @@ -56,7 +56,8 @@ public final class SpreadRecordNonDiscriminatedUnionAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<WidgetData0 | WidgetData1> along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<WidgetData0 | WidgetData1> on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionClient.java index 96fda8ee04..c8012b543b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionClient.java @@ -54,7 +54,7 @@ public final class SpreadRecordNonDiscriminatedUnionClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<WidgetData0 | WidgetData1> along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<WidgetData0 | WidgetData1>. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionAsyncClient.java index f59998aac8..70a66e9ed6 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionAsyncClient.java @@ -56,7 +56,8 @@ public final class SpreadRecordUnionAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<string | float32> along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<string | float32> on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionClient.java index c8eaa17b0a..5a995d9fa3 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionClient.java @@ -54,7 +54,7 @@ public final class SpreadRecordUnionClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<string | float32> along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<string | float32>. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringAsyncClient.java index 51c27dd0e2..5336b072b3 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringAsyncClient.java @@ -56,7 +56,8 @@ public final class SpreadStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<string> with the same known property type along with {@link Response} on + * successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +100,8 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return the model spread Record<string> with the same known property type on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringClient.java index ccd1774615..cfa9d95e6a 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringClient.java @@ -54,7 +54,7 @@ public final class SpreadStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<string> with the same known property type along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return the model spread Record<string> with the same known property type. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadFloatsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadFloatsImpl.java index 6fa9cb37c8..946a56caa5 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadFloatsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadFloatsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsDifferentSpreadFloatsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsDifferentSpreadFloat") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadFloat") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadFloat") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -114,7 +114,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from a model that spread Record<float32> with the different known property type + * along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -141,7 +142,8 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from a model that spread Record<float32> with the different known property type + * along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -173,8 +175,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -201,7 +203,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelArraysImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelArraysImpl.java index e8609caff6..2224e88ced 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelArraysImpl.java @@ -64,7 +64,7 @@ public interface ExtendsDifferentSpreadModelArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsDifferentSpreadModelArray") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadModelArray") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadModelArray") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -120,7 +120,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from a model that spread Record<ModelForRecord[]> with the different known + * property type along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -153,7 +154,8 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from a model that spread Record<ModelForRecord[]> with the different known + * property type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -191,8 +193,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -225,7 +227,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelsImpl.java index 303776b348..7df490a68a 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsDifferentSpreadModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsDifferentSpreadModel") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadModel") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadModel") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -116,7 +116,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from a model that spread Record<ModelForRecord> with the different known property + * type along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -145,7 +146,8 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from a model that spread Record<ModelForRecord> with the different known property + * type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -179,8 +181,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -209,7 +211,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadStringsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadStringsImpl.java index 29f8e4e6af..a4e516d9f8 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadStringsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsDifferentSpreadStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsDifferentSpreadString") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadString") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadString") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -114,7 +114,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from a model that spread Record<string> with the different known property type + * along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -141,7 +142,8 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from a model that spread Record<string> with the different known property type + * along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -173,8 +175,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -201,7 +203,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsFloatsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsFloatsImpl.java index 61cc2601f4..8dce92e7f6 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsFloatsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsFloatsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsFloatsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsRecordFloat") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordFloat") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordFloat") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from Record<float32> type along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from Record<float32> type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelArraysImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelArraysImpl.java index d4037271c3..2afe79bda0 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelArraysImpl.java @@ -64,7 +64,7 @@ public interface ExtendsModelArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsRecordModelArray") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordModelArray") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordModelArray") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -119,7 +119,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from Record<ModelForRecord[]> type along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -151,7 +152,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from Record<ModelForRecord[]> type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -188,8 +189,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -221,7 +222,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelsImpl.java index 954e26e129..1c63df2d2f 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsRecordModel") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordModel") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordModel") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -115,7 +115,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from Record<ModelForRecord> type along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -143,7 +144,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from Record<ModelForRecord> type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -176,8 +177,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -205,7 +206,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsStringsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsStringsImpl.java index 3d3cbbade3..e91ac0bf9f 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsStringsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsRecordString") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordString") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordString") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from Record<string> type along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from Record<string> type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDerivedsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDerivedsImpl.java index d4a55cf5ad..ad3970029c 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDerivedsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDerivedsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsUnknownDerivedsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsRecordUnknownDerived") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordUnknownDerived") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordUnknownDerived") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -115,7 +115,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from a type that extends from Record<unknown> along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -143,7 +144,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from a type that extends from Record<unknown> along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -176,8 +177,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -205,7 +206,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDiscriminatedsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDiscriminatedsImpl.java index 96798c5a1a..287ba0ef13 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDiscriminatedsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDiscriminatedsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsUnknownDiscriminatedsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsUnknownDiscriminated") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsUnknownDiscriminated") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsUnknownDiscriminated") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -114,7 +114,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from Record<unknown> with a discriminator along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -141,7 +142,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from Record<unknown> with a discriminator along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -173,8 +174,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -201,7 +202,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownsImpl.java index c58713b6fc..3399b10f12 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownsImpl.java @@ -64,7 +64,7 @@ public interface ExtendsUnknownsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsRecordUnknown") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordUnknown") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordUnknown") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from Record<unknown> type along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from Record<unknown> type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsFloatsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsFloatsImpl.java index e276967a22..a9c9d63f2d 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsFloatsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsFloatsImpl.java @@ -63,7 +63,7 @@ public interface IsFloatsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isRecordFloat") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordFloat") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordFloat") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -112,7 +112,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model is from Record<float32> type along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -138,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model is from Record<float32> type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -169,8 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -196,7 +197,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelArraysImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelArraysImpl.java index 7125390719..98824cb300 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelArraysImpl.java @@ -64,7 +64,7 @@ public interface IsModelArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isRecordModelArray") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordModelArray") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordModelArray") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -119,7 +119,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model is from Record<ModelForRecord[]> type along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -151,7 +152,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model is from Record<ModelForRecord[]> type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -188,8 +189,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -221,7 +222,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelsImpl.java index 774c6d7a12..f2ca76a184 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelsImpl.java @@ -63,7 +63,7 @@ public interface IsModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isRecordModel") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordModel") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordModel") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -114,7 +114,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model is from Record<ModelForRecord> type along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -142,7 +143,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model is from Record<ModelForRecord> type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -175,8 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -204,7 +205,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsStringsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsStringsImpl.java index fb3f27c469..c47ae7c73d 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsStringsImpl.java @@ -64,7 +64,7 @@ public interface IsStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isRecordstring") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordstring") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordstring") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model is from Record<string> type along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model is from Record<string> type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDerivedsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDerivedsImpl.java index bc84462e01..e25c66368b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDerivedsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDerivedsImpl.java @@ -64,7 +64,7 @@ public interface IsUnknownDerivedsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isRecordUnknownDerived") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordUnknownDerived") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordUnknownDerived") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -115,7 +115,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model extends from a type that is Record<unknown> type along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -143,7 +144,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model extends from a type that is Record<unknown> type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -176,8 +177,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -205,7 +206,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDiscriminatedsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDiscriminatedsImpl.java index 22e4b82f69..03c85f799c 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDiscriminatedsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDiscriminatedsImpl.java @@ -64,7 +64,7 @@ public interface IsUnknownDiscriminatedsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isUnknownDiscriminated") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isUnknownDiscriminated") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isUnknownDiscriminated") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -114,7 +114,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model is Record<unknown> with a discriminator along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -141,7 +142,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model is Record<unknown> with a discriminator along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -173,8 +174,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -201,7 +202,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownsImpl.java index 785aa71b46..01f14ff39c 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownsImpl.java @@ -64,7 +64,7 @@ public interface IsUnknownsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isRecordUnknown") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordUnknown") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordUnknown") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model is from Record<unknown> type along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model is from Record<unknown> type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/MultipleSpreadsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/MultipleSpreadsImpl.java index dbbfe181bc..2d18a071fb 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/MultipleSpreadsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/MultipleSpreadsImpl.java @@ -64,7 +64,7 @@ public interface MultipleSpreadsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/multipleSpreadRecord") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/multipleSpreadRecord") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/multipleSpreadRecord") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<string> and Record<float32> along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<string> and Record<float32> along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentFloatsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentFloatsImpl.java index 656068de0d..bc2e7bdc53 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentFloatsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentFloatsImpl.java @@ -64,7 +64,7 @@ public interface SpreadDifferentFloatsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadDifferentRecordFloat") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordFloat") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordFloat") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<float32> with the different known property type along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,8 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<float32> with the different known property type along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +172,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +199,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelArraysImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelArraysImpl.java index 49fc1bc88b..fd3e7daac7 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelArraysImpl.java @@ -64,7 +64,7 @@ public interface SpreadDifferentModelArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadDifferentRecordModelArray") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordModelArray") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordModelArray") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -117,7 +117,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<ModelForRecord[]> with the different known property type along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -147,7 +148,8 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<ModelForRecord[]> with the different known property type along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -182,8 +184,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -213,7 +215,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelsImpl.java index 26370c64d6..28515b154d 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelsImpl.java @@ -64,7 +64,7 @@ public interface SpreadDifferentModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadDifferentRecordModel") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordModel") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordModel") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -115,7 +115,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<ModelForRecord> with the different known property type along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -143,7 +144,8 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<ModelForRecord> with the different known property type along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -176,8 +178,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -205,7 +207,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentStringsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentStringsImpl.java index 99142402ab..5666b47ca9 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentStringsImpl.java @@ -64,7 +64,7 @@ public interface SpreadDifferentStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadDifferentRecordString") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordString") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordString") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<string> with the different known property type along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<string> with the different known property type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadFloatsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadFloatsImpl.java index 6aabfef3d0..01300615b0 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadFloatsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadFloatsImpl.java @@ -64,7 +64,7 @@ public interface SpreadFloatsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordFloat") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordFloat") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordFloat") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<float32> with the same known property type along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<float32> with the same known property type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelArraysImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelArraysImpl.java index 90f5c8d51f..2fe8d8ed8a 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelArraysImpl.java @@ -64,7 +64,7 @@ public interface SpreadModelArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordModelArray") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordModelArray") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordModelArray") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -119,7 +119,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -151,7 +151,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -188,8 +188,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -221,7 +221,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelsImpl.java index 6697295534..16f2061cba 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelsImpl.java @@ -64,7 +64,7 @@ public interface SpreadModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordModel") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordModel") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordModel") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -115,7 +115,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<ModelForRecord> with the same known property type along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -143,7 +144,8 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<ModelForRecord> with the same known property type along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -176,8 +178,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -205,7 +207,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordDiscriminatedUnionsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordDiscriminatedUnionsImpl.java index eb6455fc95..95322abccc 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordDiscriminatedUnionsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordDiscriminatedUnionsImpl.java @@ -64,7 +64,7 @@ public interface SpreadRecordDiscriminatedUnionsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordDiscriminatedUnion") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordDiscriminatedUnion") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordDiscriminatedUnion") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<WidgetData> along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<WidgetData> along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion2sImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion2sImpl.java index f4b04508f0..eaa2c35421 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion2sImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion2sImpl.java @@ -64,7 +64,7 @@ public interface SpreadRecordNonDiscriminatedUnion2sService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion2") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion2") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion2") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<WidgetData2 | WidgetData1> along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<WidgetData2 | WidgetData1> along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion3sImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion3sImpl.java index 84d395ac98..80628db295 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion3sImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion3sImpl.java @@ -64,7 +64,7 @@ public interface SpreadRecordNonDiscriminatedUnion3sService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion3") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion3") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion3") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<WidgetData2[] | WidgetData1> along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<WidgetData2[] | WidgetData1> along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnionsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnionsImpl.java index c01713dd82..36ac49fea4 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnionsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnionsImpl.java @@ -64,7 +64,7 @@ public interface SpreadRecordNonDiscriminatedUnionsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<WidgetData0 | WidgetData1> along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<WidgetData0 | WidgetData1> along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordUnionsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordUnionsImpl.java index 0ec58862d2..2992f99561 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordUnionsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordUnionsImpl.java @@ -64,7 +64,7 @@ public interface SpreadRecordUnionsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordUnion") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordUnion") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordUnion") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<string | float32> along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<string | float32> along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadStringsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadStringsImpl.java index 71c0892436..434a600f5e 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadStringsImpl.java @@ -64,7 +64,7 @@ public interface SpreadStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordString") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordString") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordString") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -113,7 +113,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return the model spread Record<string> with the same known property type along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return the model spread Record<string> with the same known property type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -170,8 +171,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -197,7 +198,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/BytesAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/BytesAsyncClient.java index dc15c34de7..f64a4f3790 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/BytesAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/BytesAsyncClient.java @@ -55,8 +55,8 @@ public final class BytesAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return template type for testing models with nullable property along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -80,8 +80,8 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return template type for testing models with nullable property along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -147,7 +147,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return template type for testing models with nullable property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -166,7 +166,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return template type for testing models with nullable property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/BytesClient.java b/typespec-tests/src/main/java/com/type/property/nullable/BytesClient.java index d8ae75cd3b..b49fb83f3a 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/BytesClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/BytesClient.java @@ -53,7 +53,7 @@ public final class BytesClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return template type for testing models with nullable property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return template type for testing models with nullable property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -143,7 +143,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return template type for testing models with nullable property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public BytesProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return template type for testing models with nullable property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteAsyncClient.java index 85e397e71a..33c181cee0 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteAsyncClient.java @@ -57,8 +57,8 @@ public final class CollectionsByteAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with collection bytes properties along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -84,7 +84,7 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with collection bytes properties along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -155,7 +155,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with collection bytes properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -174,7 +174,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with collection bytes properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteClient.java b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteClient.java index 058ede5f10..f1f918e423 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteClient.java @@ -55,7 +55,7 @@ public final class CollectionsByteClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with collection bytes properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -81,7 +81,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with collection bytes properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -151,7 +151,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with collection bytes properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -169,7 +169,7 @@ public CollectionsByteProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with collection bytes properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelAsyncClient.java index a0aca8862f..9f5b5bceaa 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelAsyncClient.java @@ -59,8 +59,8 @@ public final class CollectionsModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with collection models properties along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -88,7 +88,7 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with collection models properties along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -163,7 +163,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with collection models properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -182,7 +182,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with collection models properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelClient.java b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelClient.java index ce1d4f5cc9..75aa3bbe2e 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelClient.java @@ -57,7 +57,7 @@ public final class CollectionsModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with collection models properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -85,7 +85,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with collection models properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -159,7 +159,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with collection models properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -177,7 +177,7 @@ public CollectionsModelProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with collection models properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringAsyncClient.java index a7a9cfdb5f..327312e43b 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringAsyncClient.java @@ -57,8 +57,8 @@ public final class CollectionsStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with collection string properties along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -84,7 +84,7 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with collection string properties along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -155,7 +155,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with collection string properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -174,7 +174,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with collection string properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringClient.java b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringClient.java index 3329a9e430..9344eb47fd 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringClient.java @@ -55,7 +55,7 @@ public final class CollectionsStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with collection string properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -81,7 +81,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with collection string properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -151,7 +151,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with collection string properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -169,7 +169,7 @@ public CollectionsStringProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with collection string properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationAsyncClient.java index ef61ca233d..2c4fe80d38 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationAsyncClient.java @@ -55,8 +55,7 @@ public final class DatetimeOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -80,8 +79,7 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -147,7 +145,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with a datetime property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -166,7 +164,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with a datetime property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationClient.java b/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationClient.java index dfeb42ff6e..fe7be8ddbb 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationClient.java @@ -53,7 +53,7 @@ public final class DatetimeOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with a datetime property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with a datetime property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -143,7 +143,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with a datetime property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public DatetimeProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with a datetime property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationAsyncClient.java index 3766704382..45db0da472 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationAsyncClient.java @@ -55,8 +55,7 @@ public final class DurationOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -80,8 +79,7 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -147,7 +145,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with a duration property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -166,7 +164,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with a duration property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationClient.java b/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationClient.java index e3a7cd47fb..2ba1cc33b0 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationClient.java @@ -53,7 +53,7 @@ public final class DurationOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with a duration property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with a duration property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -143,7 +143,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with a duration property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public DurationProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with a duration property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/StringOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/StringOperationAsyncClient.java index 64cc982cfb..11befcbcb2 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/StringOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/StringOperationAsyncClient.java @@ -55,8 +55,8 @@ public final class StringOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return template type for testing models with nullable property along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -80,8 +80,8 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return template type for testing models with nullable property along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -147,7 +147,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return template type for testing models with nullable property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -166,7 +166,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return template type for testing models with nullable property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/StringOperationClient.java b/typespec-tests/src/main/java/com/type/property/nullable/StringOperationClient.java index 3ec28d6f8a..cde6151b68 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/StringOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/StringOperationClient.java @@ -53,7 +53,7 @@ public final class StringOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return template type for testing models with nullable property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return template type for testing models with nullable property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -143,7 +143,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return template type for testing models with nullable property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public StringProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return template type for testing models with nullable property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/BytesImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/BytesImpl.java index 3f437a5bda..aa8586ce95 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/BytesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/BytesImpl.java @@ -63,7 +63,7 @@ public interface BytesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/bytes/non-null") @@ -72,7 +72,7 @@ Mono> getNonNull(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/bytes/null") @@ -81,7 +81,7 @@ Response getNonNullSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/bytes/null") @@ -90,7 +90,7 @@ Mono> getNull(@HeaderParam("accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/bytes/non-null") @@ -100,8 +100,7 @@ Response getNullSync(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/bytes/non-null") @ExpectedResponses({ 204 }) @@ -110,8 +109,7 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/bytes/null") @ExpectedResponses({ 204 }) @@ -120,8 +118,7 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/bytes/null") @ExpectedResponses({ 204 }) @@ -130,8 +127,7 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -150,8 +146,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return template type for testing models with nullable property along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -175,7 +171,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return template type for testing models with nullable property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -199,8 +195,8 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return template type for testing models with nullable property along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync(RequestOptions requestOptions) { @@ -224,7 +220,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return template type for testing models with nullable property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { @@ -254,9 +250,7 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.patchNonNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); } /** @@ -281,8 +275,7 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNonNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); } /** @@ -307,8 +300,7 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); } /** @@ -333,7 +325,6 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNullSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsBytesImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsBytesImpl.java index 22e07f33ff..cf1dff1bd6 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsBytesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsBytesImpl.java @@ -64,7 +64,7 @@ public interface CollectionsBytesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/bytes/non-null") @@ -73,7 +73,7 @@ Mono> getNonNull(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/bytes/null") @@ -82,7 +82,7 @@ Response getNonNullSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/bytes/null") @@ -91,7 +91,7 @@ Mono> getNull(@HeaderParam("accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/bytes/non-null") @@ -101,8 +101,7 @@ Response getNullSync(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/bytes/non-null") @ExpectedResponses({ 204 }) @@ -111,8 +110,7 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/bytes/null") @ExpectedResponses({ 204 }) @@ -121,8 +119,7 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/bytes/null") @ExpectedResponses({ 204 }) @@ -131,8 +128,7 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -153,8 +149,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with collection bytes properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -180,7 +176,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with collection bytes properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -206,7 +202,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with collection bytes properties along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -233,7 +229,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with collection bytes properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { @@ -265,9 +261,7 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.patchNonNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); } /** @@ -294,8 +288,7 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNonNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); } /** @@ -322,8 +315,7 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); } /** @@ -350,7 +342,6 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNullSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsModelsImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsModelsImpl.java index 1e72392d36..02b4152448 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsModelsImpl.java @@ -64,7 +64,7 @@ public interface CollectionsModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/model/non-null") @@ -73,7 +73,7 @@ Mono> getNonNull(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/model/null") @@ -82,7 +82,7 @@ Response getNonNullSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/model/null") @@ -91,7 +91,7 @@ Mono> getNull(@HeaderParam("accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/model/non-null") @@ -101,8 +101,7 @@ Response getNullSync(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/model/non-null") @ExpectedResponses({ 204 }) @@ -111,8 +110,7 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/model/null") @ExpectedResponses({ 204 }) @@ -121,8 +119,7 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/model/null") @ExpectedResponses({ 204 }) @@ -131,8 +128,7 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -155,8 +151,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with collection models properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -184,7 +180,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with collection models properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -212,7 +208,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with collection models properties along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -241,7 +237,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with collection models properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { @@ -275,9 +271,7 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.patchNonNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); } /** @@ -306,8 +300,7 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNonNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); } /** @@ -336,8 +329,7 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); } /** @@ -366,7 +358,6 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNullSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsStringsImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsStringsImpl.java index ed96a21925..fcc1ad2fb4 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsStringsImpl.java @@ -64,7 +64,7 @@ public interface CollectionsStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/string/non-null") @@ -73,7 +73,7 @@ Mono> getNonNull(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/string/null") @@ -82,7 +82,7 @@ Response getNonNullSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/string/null") @@ -91,7 +91,7 @@ Mono> getNull(@HeaderParam("accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/string/non-null") @@ -101,8 +101,7 @@ Response getNullSync(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/string/non-null") @ExpectedResponses({ 204 }) @@ -111,8 +110,7 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/string/null") @ExpectedResponses({ 204 }) @@ -121,8 +119,7 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/string/null") @ExpectedResponses({ 204 }) @@ -131,8 +128,7 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -153,8 +149,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with collection string properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -180,7 +176,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with collection string properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -206,7 +202,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with collection string properties along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -233,7 +229,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with collection string properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { @@ -265,9 +261,7 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.patchNonNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); } /** @@ -294,8 +288,7 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNonNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); } /** @@ -322,8 +315,7 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); } /** @@ -350,7 +342,6 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNullSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/DatetimeOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/DatetimeOperationsImpl.java index 0b112670da..dd878296a1 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/DatetimeOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/DatetimeOperationsImpl.java @@ -64,7 +64,7 @@ public interface DatetimeOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/datetime/non-null") @@ -73,7 +73,7 @@ Mono> getNonNull(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/datetime/null") @@ -82,7 +82,7 @@ Response getNonNullSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/datetime/null") @@ -91,7 +91,7 @@ Mono> getNull(@HeaderParam("accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/datetime/non-null") @@ -101,8 +101,7 @@ Response getNullSync(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/datetime/non-null") @ExpectedResponses({ 204 }) @@ -111,8 +110,7 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/datetime/null") @ExpectedResponses({ 204 }) @@ -121,8 +119,7 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/datetime/null") @ExpectedResponses({ 204 }) @@ -131,8 +128,7 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -151,8 +147,7 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -176,7 +171,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with a datetime property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -200,8 +195,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync(RequestOptions requestOptions) { @@ -225,7 +219,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with a datetime property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { @@ -255,9 +249,7 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.patchNonNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); } /** @@ -282,8 +274,7 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNonNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); } /** @@ -308,8 +299,7 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); } /** @@ -334,7 +324,6 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNullSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/DurationOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/DurationOperationsImpl.java index 7c427c03ea..e75328f6e6 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/DurationOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/DurationOperationsImpl.java @@ -64,7 +64,7 @@ public interface DurationOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/duration/non-null") @@ -73,7 +73,7 @@ Mono> getNonNull(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/duration/null") @@ -82,7 +82,7 @@ Response getNonNullSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/duration/null") @@ -91,7 +91,7 @@ Mono> getNull(@HeaderParam("accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/duration/non-null") @@ -101,8 +101,7 @@ Response getNullSync(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/duration/non-null") @ExpectedResponses({ 204 }) @@ -111,8 +110,7 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/duration/null") @ExpectedResponses({ 204 }) @@ -121,8 +119,7 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/duration/null") @ExpectedResponses({ 204 }) @@ -131,8 +128,7 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -151,8 +147,7 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -176,7 +171,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with a duration property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -200,8 +195,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync(RequestOptions requestOptions) { @@ -225,7 +219,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with a duration property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { @@ -255,9 +249,7 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.patchNonNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); } /** @@ -282,8 +274,7 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNonNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); } /** @@ -308,8 +299,7 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); } /** @@ -334,7 +324,6 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNullSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/StringOperationsImpl.java index 34b813d183..ec8367b3db 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/StringOperationsImpl.java @@ -64,7 +64,7 @@ public interface StringOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/string/non-null") @@ -73,7 +73,7 @@ Mono> getNonNull(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/string/null") @@ -82,7 +82,7 @@ Response getNonNullSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/string/null") @@ -91,7 +91,7 @@ Mono> getNull(@HeaderParam("accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/string/non-null") @@ -101,8 +101,7 @@ Response getNullSync(@HeaderParam("accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/string/non-null") @ExpectedResponses({ 204 }) @@ -111,8 +110,7 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/string/null") @ExpectedResponses({ 204 }) @@ -121,8 +119,7 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/string/null") @ExpectedResponses({ 204 }) @@ -131,8 +128,7 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -151,8 +147,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return template type for testing models with nullable property along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -176,7 +172,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return template type for testing models with nullable property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -200,8 +196,8 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return template type for testing models with nullable property along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync(RequestOptions requestOptions) { @@ -225,7 +221,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return template type for testing models with nullable property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { @@ -255,9 +251,7 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.patchNonNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); } /** @@ -282,8 +276,7 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNonNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); } /** @@ -308,8 +301,7 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); } /** @@ -334,7 +326,6 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return service.patchNullSync(contentType, accept, body, requestOptions, Context.NONE); + return service.patchNullSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralAsyncClient.java index 1b744de174..8534963817 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralAsyncClient.java @@ -53,8 +53,7 @@ public final class BooleanLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with boolean literal property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,8 +76,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with boolean literal property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +140,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with boolean literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +159,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with boolean literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralClient.java index aedbc41fb2..74914b4234 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralClient.java @@ -51,7 +51,7 @@ public final class BooleanLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with boolean literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with boolean literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with boolean literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public BooleanLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with boolean literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/BytesAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/BytesAsyncClient.java index ff4076bdd3..77463eb8d0 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/BytesAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/BytesAsyncClient.java @@ -53,8 +53,8 @@ public final class BytesAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return template type for testing models with optional property along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,8 +77,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return template type for testing models with optional property along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return template type for testing models with optional property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return template type for testing models with optional property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/BytesClient.java b/typespec-tests/src/main/java/com/type/property/optional/BytesClient.java index e9a0400de8..3f1d304a49 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/BytesClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/BytesClient.java @@ -51,7 +51,7 @@ public final class BytesClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return template type for testing models with optional property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return template type for testing models with optional property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return template type for testing models with optional property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public BytesProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return template type for testing models with optional property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteAsyncClient.java index 82c01f6a28..9e103e5ff0 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteAsyncClient.java @@ -55,8 +55,8 @@ public final class CollectionsByteAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with collection bytes properties along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -81,7 +81,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with collection bytes properties along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -150,7 +150,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with collection bytes properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -169,7 +169,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with collection bytes properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteClient.java b/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteClient.java index 082eef861c..4014a913d2 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteClient.java @@ -53,7 +53,7 @@ public final class CollectionsByteClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with collection bytes properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -78,7 +78,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with collection bytes properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -146,7 +146,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with collection bytes properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -164,7 +164,7 @@ public CollectionsByteProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with collection bytes properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelAsyncClient.java index baf2f7a094..3d18da19c9 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelAsyncClient.java @@ -57,8 +57,8 @@ public final class CollectionsModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with collection models properties along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -85,7 +85,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with collection models properties along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -158,7 +158,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with collection models properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -177,7 +177,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with collection models properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelClient.java b/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelClient.java index 4a2f838215..e87c26318c 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelClient.java @@ -55,7 +55,7 @@ public final class CollectionsModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with collection models properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -82,7 +82,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with collection models properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -154,7 +154,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with collection models properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -172,7 +172,7 @@ public CollectionsModelProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with collection models properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationAsyncClient.java index 76b0916466..5f9bf2a733 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationAsyncClient.java @@ -53,8 +53,7 @@ public final class DatetimeOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,8 +76,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +140,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with a datetime property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +159,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with a datetime property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationClient.java b/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationClient.java index 7707ac2dd6..885825653d 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationClient.java @@ -51,7 +51,7 @@ public final class DatetimeOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with a datetime property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with a datetime property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with a datetime property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public DatetimeProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with a datetime property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/DurationOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/DurationOperationAsyncClient.java index 2e0543ca46..f4fd693b7e 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/DurationOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/DurationOperationAsyncClient.java @@ -53,8 +53,7 @@ public final class DurationOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,8 +76,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +140,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with a duration property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +159,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with a duration property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/DurationOperationClient.java b/typespec-tests/src/main/java/com/type/property/optional/DurationOperationClient.java index 276c91e42c..efd15214f2 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/DurationOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/DurationOperationClient.java @@ -51,7 +51,7 @@ public final class DurationOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with a duration property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with a duration property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with a duration property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public DurationProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with a duration property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralAsyncClient.java index a2a5e7e831..61d6a2a257 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralAsyncClient.java @@ -53,8 +53,7 @@ public final class FloatLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with float literal property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,8 +76,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with float literal property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +140,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with float literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +159,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with float literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralClient.java index 55497ed2ce..4233398ad7 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralClient.java @@ -51,7 +51,7 @@ public final class FloatLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with float literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with float literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with float literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public FloatLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with float literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/IntLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/IntLiteralAsyncClient.java index 9054c2ff21..3873765e2f 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/IntLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/IntLiteralAsyncClient.java @@ -53,8 +53,7 @@ public final class IntLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with int literal property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,8 +76,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with int literal property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +140,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with int literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +159,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with int literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/IntLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/IntLiteralClient.java index 9df5a7c453..cb552f3f0d 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/IntLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/IntLiteralClient.java @@ -51,7 +51,7 @@ public final class IntLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with int literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with int literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with int literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public IntLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with int literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalAsyncClient.java index 9f9d8c40f4..5fee690f7d 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalAsyncClient.java @@ -54,8 +54,8 @@ public final class RequiredAndOptionalAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with required and optional properties along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -79,8 +79,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return only the required properties along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with required and optional properties along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -146,7 +146,7 @@ public Mono> putRequiredOnlyWithResponse(BinaryData body, Request * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with required and optional properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -165,7 +165,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return only the required properties on successful completion of {@link Mono}. + * @return model with required and optional properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalClient.java b/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalClient.java index f617bed9c6..50a64367b6 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalClient.java @@ -52,7 +52,7 @@ public final class RequiredAndOptionalClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with required and optional properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -76,7 +76,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return only the required properties along with {@link Response}. + * @return model with required and optional properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +142,7 @@ public Response putRequiredOnlyWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with required and optional properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -160,7 +160,7 @@ public RequiredAndOptionalProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return only the required properties. + * @return model with required and optional properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/StringLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/StringLiteralAsyncClient.java index 8738ca2114..2c08498887 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/StringLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/StringLiteralAsyncClient.java @@ -53,8 +53,7 @@ public final class StringLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with string literal property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,8 +76,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with string literal property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +140,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with string literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +159,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with string literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/StringLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/StringLiteralClient.java index 9d9edb2a08..20eed2ab15 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/StringLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/StringLiteralClient.java @@ -51,7 +51,7 @@ public final class StringLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with string literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with string literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with string literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public StringLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with string literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/StringOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/StringOperationAsyncClient.java index ccb6ab14d8..83834191d0 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/StringOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/StringOperationAsyncClient.java @@ -53,8 +53,8 @@ public final class StringOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return template type for testing models with optional property along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,8 +77,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return template type for testing models with optional property along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return template type for testing models with optional property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return template type for testing models with optional property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/StringOperationClient.java b/typespec-tests/src/main/java/com/type/property/optional/StringOperationClient.java index f5a89b6b7c..a7bdf1b616 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/StringOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/StringOperationClient.java @@ -51,7 +51,7 @@ public final class StringOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return template type for testing models with optional property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return template type for testing models with optional property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return template type for testing models with optional property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public StringProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return template type for testing models with optional property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralAsyncClient.java index c1a677f4f3..62f49dcf5b 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralAsyncClient.java @@ -53,8 +53,8 @@ public final class UnionFloatLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with union of float literal property along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with union of float literal property along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -142,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with union of float literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with union of float literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralClient.java index d73101ed7b..20952bd2d5 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralClient.java @@ -51,7 +51,7 @@ public final class UnionFloatLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with union of float literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with union of float literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with union of float literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public UnionFloatLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with union of float literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralAsyncClient.java index 0d026ff1c4..f64106a9af 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralAsyncClient.java @@ -53,8 +53,8 @@ public final class UnionIntLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with union of int literal property along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with union of int literal property along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -142,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with union of int literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with union of int literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralClient.java index 0e32a129ab..41c429f898 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralClient.java @@ -51,7 +51,7 @@ public final class UnionIntLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with union of int literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with union of int literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with union of int literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public UnionIntLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with union of int literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralAsyncClient.java index 34e9fd00fa..743b330b69 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralAsyncClient.java @@ -53,8 +53,8 @@ public final class UnionStringLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with union of string literal property along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with union of string literal property along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -142,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with union of string literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with union of string literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralClient.java index c2965da697..21f0905b88 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralClient.java @@ -51,7 +51,7 @@ public final class UnionStringLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with union of string literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with union of string literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with union of string literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public UnionStringLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with union of string literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/BooleanLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/BooleanLiteralsImpl.java index e72269c7a3..143140fb62 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/BooleanLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/BooleanLiteralsImpl.java @@ -64,7 +64,7 @@ public interface BooleanLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/boolean/literal/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/boolean/literal/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/boolean/literal/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/boolean/literal/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/boolean/literal/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/boolean/literal/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/boolean/literal/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,7 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with boolean literal property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +169,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with boolean literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,8 +192,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with boolean literal property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -217,7 +215,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with boolean literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +243,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -269,8 +267,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -293,8 +291,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -317,7 +315,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/BytesImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/BytesImpl.java index 7cfd63358e..313b3ebeca 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/BytesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/BytesImpl.java @@ -63,7 +63,7 @@ public interface BytesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/bytes/all") @@ -72,7 +72,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/bytes/default") @@ -81,7 +81,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/bytes/default") @@ -90,7 +90,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/bytes/all") @@ -99,7 +99,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/bytes/all") @@ -108,8 +108,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/bytes/default") @ExpectedResponses({ 204 }) @@ -117,7 +117,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/bytes/default") @@ -126,7 +126,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -145,8 +145,8 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return template type for testing models with optional property along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -169,7 +169,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return template type for testing models with optional property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -192,8 +192,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return template type for testing models with optional property along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -216,7 +216,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return template type for testing models with optional property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -244,8 +244,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -268,8 +268,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -292,8 +292,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -316,7 +316,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsBytesImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsBytesImpl.java index 2e9533b065..f91daebff6 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsBytesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsBytesImpl.java @@ -64,7 +64,7 @@ public interface CollectionsBytesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/collections/bytes/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/collections/bytes/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/collections/bytes/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/bytes/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/bytes/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/bytes/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/bytes/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -148,8 +148,8 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with collection bytes properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -174,7 +174,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with collection bytes properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -199,7 +199,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with collection bytes properties along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -225,7 +225,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with collection bytes properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -255,8 +255,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -281,8 +281,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -307,8 +307,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -333,7 +333,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsModelsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsModelsImpl.java index d85f5175ea..5ed7dfb397 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsModelsImpl.java @@ -64,7 +64,7 @@ public interface CollectionsModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/collections/model/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/collections/model/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/collections/model/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/model/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/model/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/model/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/model/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -150,8 +150,8 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with collection models properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -178,7 +178,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with collection models properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -205,7 +205,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with collection models properties along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -233,7 +233,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with collection models properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -265,8 +265,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -293,8 +293,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -321,8 +321,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -349,7 +349,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/DatetimeOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/DatetimeOperationsImpl.java index 320cafafdf..17e8959364 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/DatetimeOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/DatetimeOperationsImpl.java @@ -64,7 +64,7 @@ public interface DatetimeOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/datetime/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/datetime/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/datetime/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/datetime/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/datetime/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/datetime/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/datetime/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,7 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +169,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with a datetime property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,8 +192,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -217,7 +215,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with a datetime property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +243,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -269,8 +267,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -293,8 +291,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -317,7 +315,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/DurationOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/DurationOperationsImpl.java index 226ab461ae..8442600b73 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/DurationOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/DurationOperationsImpl.java @@ -64,7 +64,7 @@ public interface DurationOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/duration/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/duration/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/duration/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/duration/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/duration/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/duration/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/duration/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,7 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +169,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with a duration property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,8 +192,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -217,7 +215,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with a duration property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +243,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -269,8 +267,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -293,8 +291,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -317,7 +315,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/FloatLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/FloatLiteralsImpl.java index 0a8453db4e..cf21e52173 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/FloatLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/FloatLiteralsImpl.java @@ -64,7 +64,7 @@ public interface FloatLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/float/literal/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/float/literal/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/float/literal/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/float/literal/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/float/literal/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/float/literal/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/float/literal/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,7 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with float literal property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +169,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with float literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,8 +192,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with float literal property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -217,7 +215,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with float literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +243,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -269,8 +267,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -293,8 +291,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -317,7 +315,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/IntLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/IntLiteralsImpl.java index 8597087a7e..806ab7b2db 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/IntLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/IntLiteralsImpl.java @@ -64,7 +64,7 @@ public interface IntLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/int/literal/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/int/literal/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/int/literal/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/int/literal/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/int/literal/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/int/literal/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/int/literal/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,7 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with int literal property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +169,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with int literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,8 +192,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with int literal property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -217,7 +215,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with int literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +243,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -269,8 +267,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -293,8 +291,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -317,7 +315,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/RequiredAndOptionalsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/RequiredAndOptionalsImpl.java index 4e41231942..f52f9ee63f 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/RequiredAndOptionalsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/RequiredAndOptionalsImpl.java @@ -64,7 +64,7 @@ public interface RequiredAndOptionalsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/requiredAndOptional/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/requiredAndOptional/requiredOnly") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getRequiredOnly(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getRequiredOnly(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/requiredAndOptional/requiredOnly") @@ -91,7 +91,7 @@ Mono> getRequiredOnly(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getRequiredOnlySync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getRequiredOnlySync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/requiredAndOptional/all") @@ -100,7 +100,7 @@ Response getRequiredOnlySync(@HeaderParam("accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/requiredAndOptional/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/requiredAndOptional/requiredOnly") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putRequiredOnly(@HeaderParam("accept") String accept, + Mono> putRequiredOnly(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/requiredAndOptional/requiredOnly") @@ -127,7 +127,7 @@ Mono> putRequiredOnly(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putRequiredOnlySync(@HeaderParam("accept") String accept, + Response putRequiredOnlySync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -147,8 +147,8 @@ Response putRequiredOnlySync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with required and optional properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -172,7 +172,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with required and optional properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -196,8 +196,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return only the required properties along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with required and optional properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getRequiredOnlyWithResponseAsync(RequestOptions requestOptions) { @@ -221,7 +221,7 @@ public Mono> getRequiredOnlyWithResponseAsync(RequestOption * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return only the required properties along with {@link Response}. + * @return model with required and optional properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getRequiredOnlyWithResponse(RequestOptions requestOptions) { @@ -250,8 +250,8 @@ public Response getRequiredOnlyWithResponse(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -275,8 +275,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -300,8 +300,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putRequiredOnlyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putRequiredOnly(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putRequiredOnly(contentType, body, requestOptions, context)); } /** @@ -325,7 +325,7 @@ public Mono> putRequiredOnlyWithResponseAsync(BinaryData body, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putRequiredOnlyWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putRequiredOnlySync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putRequiredOnlySync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/StringLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/StringLiteralsImpl.java index 7dbf99b700..ec3e600a90 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/StringLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/StringLiteralsImpl.java @@ -64,7 +64,7 @@ public interface StringLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/string/literal/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/string/literal/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/string/literal/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/literal/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/literal/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/literal/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/literal/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,7 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with string literal property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +169,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with string literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,8 +192,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with string literal property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -217,7 +215,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with string literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +243,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -269,8 +267,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -293,8 +291,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -317,7 +315,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/StringOperationsImpl.java index 77f6591e40..7bacd8c514 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/StringOperationsImpl.java @@ -64,7 +64,7 @@ public interface StringOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/string/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/string/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/string/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,8 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return template type for testing models with optional property along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return template type for testing models with optional property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,8 +193,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return template type for testing models with optional property along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -217,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return template type for testing models with optional property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +245,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -269,8 +269,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -293,8 +293,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -317,7 +317,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionFloatLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionFloatLiteralsImpl.java index 4decf810ac..f379ffee75 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionFloatLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionFloatLiteralsImpl.java @@ -64,7 +64,7 @@ public interface UnionFloatLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/float/literal/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/float/literal/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/float/literal/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/float/literal/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/float/literal/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/float/literal/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/float/literal/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,8 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with union of float literal property along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with union of float literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,7 +193,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with union of float literal property along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -217,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with union of float literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +245,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -269,8 +269,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -293,8 +293,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -317,7 +317,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionIntLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionIntLiteralsImpl.java index 791550d174..1c00e0d2de 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionIntLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionIntLiteralsImpl.java @@ -64,7 +64,7 @@ public interface UnionIntLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/int/literal/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/int/literal/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/int/literal/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/int/literal/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/int/literal/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/int/literal/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/int/literal/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,8 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with union of int literal property along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with union of int literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,7 +193,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with union of int literal property along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -217,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with union of int literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +245,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -269,8 +269,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -293,8 +293,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -317,7 +317,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionStringLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionStringLiteralsImpl.java index 08636166f8..720046c77e 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionStringLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionStringLiteralsImpl.java @@ -64,7 +64,7 @@ public interface UnionStringLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/string/literal/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/string/literal/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/string/literal/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/string/literal/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/string/literal/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/string/literal/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/string/literal/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,8 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with union of string literal property along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with union of string literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,7 +193,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of + * @return model with union of string literal property along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -217,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with union of string literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +245,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -269,8 +269,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -293,8 +293,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -317,7 +317,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralAsyncClient.java index b6af04d1cb..7ea1a5c8a1 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralAsyncClient.java @@ -53,7 +53,8 @@ public final class BooleanLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a boolean literal property along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +94,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a boolean literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralClient.java index 6b0a528a29..b53578427c 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralClient.java @@ -51,7 +51,7 @@ public final class BooleanLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a boolean literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a boolean literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationAsyncClient.java index ab3775f865..54561c7fd1 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationAsyncClient.java @@ -53,7 +53,7 @@ public final class BooleanOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a boolean property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a boolean property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationClient.java index d4e7f5dd02..ecc3bc534a 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationClient.java @@ -51,7 +51,7 @@ public final class BooleanOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a boolean property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a boolean property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/BytesAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/BytesAsyncClient.java index dd79a17a7b..86659fd345 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/BytesAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/BytesAsyncClient.java @@ -53,7 +53,7 @@ public final class BytesAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a bytes property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a bytes property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/BytesClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/BytesClient.java index d3615f65a8..7cab3afc83 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/BytesClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/BytesClient.java @@ -51,7 +51,7 @@ public final class BytesClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a bytes property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a bytes property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntAsyncClient.java index 2828e55a22..3dec4784d4 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntAsyncClient.java @@ -55,7 +55,8 @@ public final class CollectionsIntAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with collection int properties along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +98,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with collection int properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntClient.java index 0d3b0442ec..1bed50f153 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntClient.java @@ -53,7 +53,7 @@ public final class CollectionsIntClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with collection int properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -95,7 +95,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with collection int properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelAsyncClient.java index b193658be3..a7da97ea3a 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelAsyncClient.java @@ -57,7 +57,8 @@ public final class CollectionsModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with collection model properties along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +102,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with collection model properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelClient.java index 5ba3a996dc..a986c997f8 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelClient.java @@ -55,7 +55,7 @@ public final class CollectionsModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with collection model properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +99,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with collection model properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringAsyncClient.java index c4d33d5d27..a9d54433db 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringAsyncClient.java @@ -55,7 +55,8 @@ public final class CollectionsStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with collection string properties along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +98,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with collection string properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringClient.java index 18405b33ee..4a487152c9 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringClient.java @@ -53,7 +53,7 @@ public final class CollectionsStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with collection string properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -95,7 +95,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with collection string properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationAsyncClient.java index 421c87f118..1f8bfa429b 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationAsyncClient.java @@ -53,7 +53,7 @@ public final class DatetimeOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a datetime property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationClient.java index 4c2c29ea5e..277b42911d 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationClient.java @@ -51,7 +51,7 @@ public final class DatetimeOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a datetime property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a datetime property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128AsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128AsyncClient.java index bbb25640c2..94daa62ddb 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128AsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128AsyncClient.java @@ -53,7 +53,7 @@ public final class Decimal128AsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a decimal128 property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a decimal128 property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128Client.java b/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128Client.java index 6b2e7e0b79..0ac47c1ded 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128Client.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128Client.java @@ -51,7 +51,7 @@ public final class Decimal128Client { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a decimal128 property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a decimal128 property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalAsyncClient.java index 10495283a2..f253962734 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalAsyncClient.java @@ -53,7 +53,7 @@ public final class DecimalAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a decimal property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a decimal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalClient.java index f3f2223231..e4aa41eeb3 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalClient.java @@ -51,7 +51,7 @@ public final class DecimalClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a decimal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a decimal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringAsyncClient.java index b776f2e001..5a6e624202 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringAsyncClient.java @@ -55,7 +55,8 @@ public final class DictionaryStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with dictionary string properties along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +98,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with dictionary string properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringClient.java index 0b7e9ca739..7f2e2591bf 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringClient.java @@ -53,7 +53,7 @@ public final class DictionaryStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with dictionary string properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -95,7 +95,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with dictionary string properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationAsyncClient.java index bf23710596..24c091cfe9 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationAsyncClient.java @@ -53,7 +53,7 @@ public final class DurationOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a duration property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationClient.java index f8452ab301..e8fa93f4a6 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationClient.java @@ -51,7 +51,7 @@ public final class DurationOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a duration property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a duration property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/EnumAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/EnumAsyncClient.java index 6c8d1e4a54..46fc873bd9 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/EnumAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/EnumAsyncClient.java @@ -53,7 +53,7 @@ public final class EnumAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with enum properties along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with enum properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/EnumClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/EnumClient.java index a80ef76bef..a78d401355 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/EnumClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/EnumClient.java @@ -51,7 +51,7 @@ public final class EnumClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with enum properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with enum properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumAsyncClient.java index f7dec5b955..ba6d0b4e22 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumAsyncClient.java @@ -53,7 +53,8 @@ public final class ExtensibleEnumAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with extensible enum properties along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +94,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with extensible enum properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumClient.java index d5085c2041..01f24dea69 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumClient.java @@ -51,7 +51,7 @@ public final class ExtensibleEnumClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with extensible enum properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with extensible enum properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralAsyncClient.java index 8079183e5b..a12cb1ed4d 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralAsyncClient.java @@ -53,7 +53,7 @@ public final class FloatLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a float literal property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a float literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralClient.java index 2ff74c5840..e907cf285d 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralClient.java @@ -51,7 +51,7 @@ public final class FloatLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a float literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a float literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationAsyncClient.java index a2ce50e823..41b46e42ac 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationAsyncClient.java @@ -53,7 +53,7 @@ public final class FloatOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a float property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a float property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationClient.java index fb2acae468..09e4aae6e0 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationClient.java @@ -51,7 +51,7 @@ public final class FloatOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a float property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a float property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/IntAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/IntAsyncClient.java index 58bfa7d20b..4c2a143444 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/IntAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/IntAsyncClient.java @@ -53,7 +53,7 @@ public final class IntAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a int property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a int property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/IntClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/IntClient.java index 5af2cc2da9..7f48765be2 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/IntClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/IntClient.java @@ -51,7 +51,7 @@ public final class IntClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a int property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a int property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralAsyncClient.java index 5e47bc9325..b1f73f525a 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralAsyncClient.java @@ -53,7 +53,7 @@ public final class IntLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a int literal property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a int literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralClient.java index 60d67a57bf..5b62bfb073 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralClient.java @@ -51,7 +51,7 @@ public final class IntLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a int literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a int literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/ModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/ModelAsyncClient.java index c75310c16e..1f3d71a101 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/ModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/ModelAsyncClient.java @@ -55,7 +55,7 @@ public final class ModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with model properties along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with model properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/ModelClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/ModelClient.java index 9e9cba4588..33482c584f 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/ModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/ModelClient.java @@ -53,7 +53,7 @@ public final class ModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with model properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -95,7 +95,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with model properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/NeverAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/NeverAsyncClient.java index a2dfced927..f2d32f8de0 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/NeverAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/NeverAsyncClient.java @@ -51,7 +51,7 @@ public final class NeverAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a property never along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -89,7 +89,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a property never on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/NeverClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/NeverClient.java index 27bb34204f..f10cb31915 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/NeverClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/NeverClient.java @@ -49,7 +49,7 @@ public final class NeverClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a property never along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -87,7 +87,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a property never. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralAsyncClient.java index 89e6d85cc4..c1c31f6ace 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralAsyncClient.java @@ -53,7 +53,8 @@ public final class StringLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a string literal property along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +94,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a string literal property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralClient.java index 6e7d29ce62..b8a866bf31 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralClient.java @@ -51,7 +51,7 @@ public final class StringLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a string literal property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a string literal property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationAsyncClient.java index f1208deeb2..7bfda94e60 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationAsyncClient.java @@ -53,7 +53,7 @@ public final class StringOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a string property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a string property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationClient.java index a11dfddc54..973bd04706 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationClient.java @@ -51,7 +51,7 @@ public final class StringOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a string property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a string property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueAsyncClient.java index 52d1903389..d1d37dc0e3 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueAsyncClient.java @@ -53,7 +53,8 @@ public final class UnionEnumValueAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return template type for testing models with specific properties along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +94,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return template type for testing models with specific properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueClient.java index a1503da5fc..4359412b99 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueClient.java @@ -51,7 +51,7 @@ public final class UnionEnumValueClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return template type for testing models with specific properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return template type for testing models with specific properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralAsyncClient.java index 160e23a08e..fafbea83e6 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralAsyncClient.java @@ -53,7 +53,8 @@ public final class UnionFloatLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a union of float literal as property along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +94,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a union of float literal as property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralClient.java index 5ce4c1c405..bf3e7c9f76 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralClient.java @@ -51,7 +51,7 @@ public final class UnionFloatLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a union of float literal as property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a union of float literal as property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralAsyncClient.java index 4855784b53..44058432f4 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralAsyncClient.java @@ -53,7 +53,8 @@ public final class UnionIntLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a union of int literal as property along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +94,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a union of int literal as property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralClient.java index d570a5aa5e..bcd8faac8d 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralClient.java @@ -51,7 +51,7 @@ public final class UnionIntLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a union of int literal as property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a union of int literal as property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralAsyncClient.java index e64dcb9244..d2536e8fd3 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralAsyncClient.java @@ -53,7 +53,8 @@ public final class UnionStringLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a union of string literal as property along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +94,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a union of string literal as property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralClient.java index 933d39b0bd..f866ff1935 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralClient.java @@ -51,7 +51,7 @@ public final class UnionStringLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a union of string literal as property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a union of string literal as property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayAsyncClient.java index 770b3d5ee5..81777dc7a3 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayAsyncClient.java @@ -53,7 +53,8 @@ public final class UnknownArrayAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a property unknown, and the data is an array along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +94,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a property unknown, and the data is an array on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayClient.java index a085998120..ffea6edef3 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayClient.java @@ -51,7 +51,7 @@ public final class UnknownArrayClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a property unknown, and the data is an array along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a property unknown, and the data is an array. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictAsyncClient.java index 9460b676df..33aa735c73 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictAsyncClient.java @@ -53,7 +53,8 @@ public final class UnknownDictAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a property unknown, and the data is a dictionnary along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +94,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a property unknown, and the data is a dictionnary on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictClient.java index 754d29a11e..9bd638e063 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictClient.java @@ -51,7 +51,7 @@ public final class UnknownDictClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a property unknown, and the data is a dictionnary along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a property unknown, and the data is a dictionnary. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntAsyncClient.java index 6dab5dae36..9188e43b98 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntAsyncClient.java @@ -53,7 +53,8 @@ public final class UnknownIntAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a property unknown, and the data is a int32 along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +94,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a property unknown, and the data is a int32 on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntClient.java index 1e8e38cbd0..fbfec46200 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntClient.java @@ -51,7 +51,7 @@ public final class UnknownIntClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a property unknown, and the data is a int32 along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a property unknown, and the data is a int32. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringAsyncClient.java index e8a87af736..bde5f700b1 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringAsyncClient.java @@ -53,7 +53,8 @@ public final class UnknownStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a property unknown, and the data is a string along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +94,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call on successful completion of {@link Mono}. + * @return model with a property unknown, and the data is a string on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringClient.java index f4f9faf52f..9e3cdf893d 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringClient.java @@ -51,7 +51,7 @@ public final class UnknownStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a property unknown, and the data is a string along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call. + * @return model with a property unknown, and the data is a string. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanLiteralsImpl.java index f044a6712f..cee9d8137b 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanLiteralsImpl.java @@ -64,7 +64,7 @@ public interface BooleanLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/boolean/literal") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/boolean/literal") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/boolean/literal") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a boolean literal property along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +134,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a boolean literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +162,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +186,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanOperationsImpl.java index 7bc544aa60..0ce856b063 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanOperationsImpl.java @@ -64,7 +64,7 @@ public interface BooleanOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/boolean") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/boolean") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/boolean") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a boolean property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a boolean property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BytesImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BytesImpl.java index 97617c9762..b353b6ca1f 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BytesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BytesImpl.java @@ -63,7 +63,7 @@ public interface BytesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/bytes") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/bytes") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/bytes") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -109,7 +109,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a bytes property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -132,7 +132,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a bytes property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -160,8 +160,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -184,7 +184,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsIntsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsIntsImpl.java index 8b66c952ac..71d5e18e86 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsIntsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsIntsImpl.java @@ -64,7 +64,7 @@ public interface CollectionsIntsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/collections/int") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/collections/int") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/collections/int") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -112,7 +112,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with collection int properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -137,7 +138,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with collection int properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -167,8 +168,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -193,7 +194,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsModelsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsModelsImpl.java index a37cc3bed6..be7b84a2e9 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsModelsImpl.java @@ -64,7 +64,7 @@ public interface CollectionsModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/collections/model") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/collections/model") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/collections/model") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -114,7 +114,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with collection model properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -141,7 +142,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with collection model properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -173,8 +174,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -201,7 +202,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsStringsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsStringsImpl.java index a762c83dd6..64e85967d3 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsStringsImpl.java @@ -64,7 +64,7 @@ public interface CollectionsStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/collections/string") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/collections/string") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/collections/string") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -112,7 +112,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with collection string properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -137,7 +138,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with collection string properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -167,8 +168,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -193,7 +194,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DatetimeOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DatetimeOperationsImpl.java index d8e9cd6481..79029e9a84 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DatetimeOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DatetimeOperationsImpl.java @@ -64,7 +64,7 @@ public interface DatetimeOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/datetime") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/datetime") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/datetime") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a datetime property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/Decimal128sImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/Decimal128sImpl.java index 2e5bb88c9d..05e75e74bd 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/Decimal128sImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/Decimal128sImpl.java @@ -64,7 +64,7 @@ public interface Decimal128sService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/decimal128") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/decimal128") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/decimal128") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a decimal128 property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a decimal128 property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DecimalsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DecimalsImpl.java index ed97eb861f..f285e90d4c 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DecimalsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DecimalsImpl.java @@ -63,7 +63,7 @@ public interface DecimalsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/decimal") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/decimal") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/decimal") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -109,7 +109,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a decimal property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -132,7 +132,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a decimal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -160,8 +160,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -184,7 +184,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DictionaryStringsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DictionaryStringsImpl.java index ba0e9667f8..7e3d7a3d41 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DictionaryStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DictionaryStringsImpl.java @@ -64,7 +64,7 @@ public interface DictionaryStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/dictionary/string") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/dictionary/string") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/dictionary/string") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -112,7 +112,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with dictionary string properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -137,7 +138,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with dictionary string properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -167,8 +168,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -193,7 +194,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DurationOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DurationOperationsImpl.java index 1103d13826..ab3c63609b 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DurationOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DurationOperationsImpl.java @@ -64,7 +64,7 @@ public interface DurationOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/duration") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/duration") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/duration") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a duration property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/EnumsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/EnumsImpl.java index d46ce8bb8c..9ba8a4c9aa 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/EnumsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/EnumsImpl.java @@ -63,7 +63,7 @@ public interface EnumsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/enum") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/enum") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/enum") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -109,7 +109,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with enum properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -132,7 +132,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with enum properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -160,8 +160,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -184,7 +184,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ExtensibleEnumsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ExtensibleEnumsImpl.java index 9c571604fa..6551f029e0 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ExtensibleEnumsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ExtensibleEnumsImpl.java @@ -64,7 +64,7 @@ public interface ExtensibleEnumsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/extensible-enum") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/extensible-enum") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/extensible-enum") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with extensible enum properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +134,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with extensible enum properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +162,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +186,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatLiteralsImpl.java index f7774bca94..f436f4672c 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatLiteralsImpl.java @@ -64,7 +64,7 @@ public interface FloatLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/float/literal") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/float/literal") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/float/literal") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a float literal property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a float literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatOperationsImpl.java index d0706e6297..696c4d14e2 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatOperationsImpl.java @@ -64,7 +64,7 @@ public interface FloatOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/float") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/float") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/float") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a float property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a float property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntLiteralsImpl.java index 0b47e87d0f..ce4f6e5349 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntLiteralsImpl.java @@ -64,7 +64,7 @@ public interface IntLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/int/literal") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/int/literal") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/int/literal") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a int literal property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a int literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntsImpl.java index b74d365f10..ae53179952 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntsImpl.java @@ -63,7 +63,7 @@ public interface IntsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/int") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/int") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/int") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -109,7 +109,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a int property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -132,7 +132,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a int property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -160,8 +160,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -184,7 +184,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ModelsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ModelsImpl.java index 475388e54f..fcfd26085f 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ModelsImpl.java @@ -63,7 +63,7 @@ public interface ModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/model") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/model") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/model") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -111,7 +111,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with model properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -136,7 +136,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with model properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -166,8 +166,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -192,7 +192,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/NeversImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/NeversImpl.java index 0ee5812b2a..8a65c8dfaf 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/NeversImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/NeversImpl.java @@ -63,7 +63,7 @@ public interface NeversService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/never") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/never") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/never") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -107,7 +107,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a property never along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -128,7 +128,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a property never along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -154,8 +154,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -176,7 +176,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringLiteralsImpl.java index 925cfbc34b..601e00a543 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringLiteralsImpl.java @@ -64,7 +64,7 @@ public interface StringLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/string/literal") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/string/literal") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/string/literal") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a string literal property along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +134,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a string literal property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +162,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +186,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringOperationsImpl.java index 0a14991592..8d4b4f8d66 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringOperationsImpl.java @@ -64,7 +64,7 @@ public interface StringOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/string") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/string") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/string") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a string property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a string property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionEnumValuesImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionEnumValuesImpl.java index d134e37823..a9f141ae34 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionEnumValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionEnumValuesImpl.java @@ -64,7 +64,7 @@ public interface UnionEnumValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/union-enum-value") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union-enum-value") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union-enum-value") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return template type for testing models with specific properties along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +134,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return template type for testing models with specific properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +162,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +186,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionFloatLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionFloatLiteralsImpl.java index 2ef0c1534b..6c300f3fa4 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionFloatLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionFloatLiteralsImpl.java @@ -64,7 +64,7 @@ public interface UnionFloatLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/union/float/literal") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union/float/literal") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union/float/literal") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a union of float literal as property along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +134,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a union of float literal as property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +162,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +186,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionIntLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionIntLiteralsImpl.java index d624ac99a0..177386cc3d 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionIntLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionIntLiteralsImpl.java @@ -64,7 +64,7 @@ public interface UnionIntLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/union/int/literal") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union/int/literal") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union/int/literal") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a union of int literal as property along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +134,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a union of int literal as property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +162,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +186,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionStringLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionStringLiteralsImpl.java index e30da4628a..3e64d4b24a 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionStringLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionStringLiteralsImpl.java @@ -64,7 +64,7 @@ public interface UnionStringLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/union/string/literal") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union/string/literal") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union/string/literal") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a union of string literal as property along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +134,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a union of string literal as property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +162,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +186,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownArraysImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownArraysImpl.java index 62b57490e1..878b12995e 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownArraysImpl.java @@ -64,7 +64,7 @@ public interface UnknownArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/unknown/array") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/array") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/array") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a property unknown, and the data is an array along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +134,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a property unknown, and the data is an array along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +162,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +186,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownDictsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownDictsImpl.java index c13ddac04c..d4a64ff56b 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownDictsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownDictsImpl.java @@ -64,7 +64,7 @@ public interface UnknownDictsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/unknown/dict") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/dict") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/dict") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a property unknown, and the data is a dictionnary along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +134,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a property unknown, and the data is a dictionnary along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +162,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +186,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownIntsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownIntsImpl.java index 18af3c5879..26ae4cdf1d 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownIntsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownIntsImpl.java @@ -64,7 +64,7 @@ public interface UnknownIntsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/unknown/int") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/int") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/int") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a property unknown, and the data is a int32 along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +134,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a property unknown, and the data is a int32 along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +162,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +186,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownStringsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownStringsImpl.java index cc8277e2f2..4e3dc3355c 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownStringsImpl.java @@ -64,7 +64,7 @@ public interface UnknownStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/value-types/unknown/string") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/string") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/string") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -110,7 +110,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response} on successful completion of {@link Mono}. + * @return model with a property unknown, and the data is a string along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +134,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return call along with {@link Response}. + * @return model with a property unknown, and the data is a string along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -161,8 +162,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -185,7 +186,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/BooleanOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/scalar/BooleanOperationAsyncClient.java index d5d00b8319..a972f827b1 100644 --- a/typespec-tests/src/main/java/com/type/scalar/BooleanOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/scalar/BooleanOperationAsyncClient.java @@ -50,7 +50,8 @@ public final class BooleanOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return boolean value along with {@link Response} on successful completion of {@link Mono}. + * @return boolean with `true` and `false` values along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -88,7 +89,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return boolean value on successful completion of {@link Mono}. + * @return boolean with `true` and `false` values on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/scalar/BooleanOperationClient.java b/typespec-tests/src/main/java/com/type/scalar/BooleanOperationClient.java index b3765fc21e..58777e320d 100644 --- a/typespec-tests/src/main/java/com/type/scalar/BooleanOperationClient.java +++ b/typespec-tests/src/main/java/com/type/scalar/BooleanOperationClient.java @@ -48,7 +48,7 @@ public final class BooleanOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return boolean value along with {@link Response}. + * @return boolean with `true` and `false` values along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -86,7 +86,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return boolean value. + * @return boolean with `true` and `false` values. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/scalar/StringOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/scalar/StringOperationAsyncClient.java index a08bd9dfcd..b0bcf6b3c5 100644 --- a/typespec-tests/src/main/java/com/type/scalar/StringOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/scalar/StringOperationAsyncClient.java @@ -50,7 +50,7 @@ public final class StringOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return string value along with {@link Response} on successful completion of {@link Mono}. + * @return a sequence of textual characters along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -88,7 +88,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string value on successful completion of {@link Mono}. + * @return a sequence of textual characters on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/scalar/StringOperationClient.java b/typespec-tests/src/main/java/com/type/scalar/StringOperationClient.java index f3b4f77150..a79d03671f 100644 --- a/typespec-tests/src/main/java/com/type/scalar/StringOperationClient.java +++ b/typespec-tests/src/main/java/com/type/scalar/StringOperationClient.java @@ -48,7 +48,7 @@ public final class StringOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return string value along with {@link Response}. + * @return a sequence of textual characters along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -86,7 +86,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return string value. + * @return a sequence of textual characters. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/scalar/UnknownAsyncClient.java b/typespec-tests/src/main/java/com/type/scalar/UnknownAsyncClient.java index 1a0c97e690..4628e26fd2 100644 --- a/typespec-tests/src/main/java/com/type/scalar/UnknownAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/scalar/UnknownAsyncClient.java @@ -50,7 +50,7 @@ public final class UnknownAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return unknown value along with {@link Response} on successful completion of {@link Mono}. + * @return anything along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -88,7 +88,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return unknown value on successful completion of {@link Mono}. + * @return anything on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/scalar/UnknownClient.java b/typespec-tests/src/main/java/com/type/scalar/UnknownClient.java index 6a09092ec3..1df551ca87 100644 --- a/typespec-tests/src/main/java/com/type/scalar/UnknownClient.java +++ b/typespec-tests/src/main/java/com/type/scalar/UnknownClient.java @@ -48,7 +48,7 @@ public final class UnknownClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return unknown value along with {@link Response}. + * @return anything along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -86,7 +86,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return unknown value. + * @return anything. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/BooleanOperationsImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/BooleanOperationsImpl.java index 85a5e4540d..0b93ca47a7 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/BooleanOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/BooleanOperationsImpl.java @@ -64,7 +64,7 @@ public interface BooleanOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/boolean") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/scalar/boolean") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/scalar/boolean") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -108,7 +108,8 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return boolean value along with {@link Response} on successful completion of {@link Mono}. + * @return boolean with `true` and `false` values along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -129,7 +130,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return boolean value along with {@link Response}. + * @return boolean with `true` and `false` values along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -155,8 +156,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -177,7 +178,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128TypesImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128TypesImpl.java index 7888d3acb3..ead3edeadf 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128TypesImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128TypesImpl.java @@ -66,7 +66,7 @@ public interface Decimal128TypesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> responseBody(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> responseBody(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal128/response_body") @@ -75,7 +75,7 @@ Mono> responseBody(@HeaderParam("accept") String accept, Re @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response responseBodySync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response responseBodySync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/scalar/decimal128/resquest_body") @@ -84,7 +84,7 @@ Response responseBodySync(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> requestBody(@HeaderParam("accept") String accept, + Mono> requestBody(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/scalar/decimal128/resquest_body") @@ -93,7 +93,7 @@ Mono> requestBody(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requestBodySync(@HeaderParam("accept") String accept, + Response requestBodySync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal128/request_parameter") @@ -102,8 +102,8 @@ Response requestBodySync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> requestParameter(@QueryParam("value") BigDecimal value, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> requestParameter(@QueryParam("value") BigDecimal value, RequestOptions requestOptions, + Context context); @Get("/type/scalar/decimal128/request_parameter") @ExpectedResponses({ 204 }) @@ -111,8 +111,8 @@ Mono> requestParameter(@QueryParam("value") BigDecimal value, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requestParameterSync(@QueryParam("value") BigDecimal value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response requestParameterSync(@QueryParam("value") BigDecimal value, RequestOptions requestOptions, + Context context); } /** @@ -175,8 +175,8 @@ public Response responseBodyWithResponse(RequestOptions requestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> requestBodyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.requestBody(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.requestBody(contentType, body, requestOptions, context)); } /** @@ -197,8 +197,8 @@ public Mono> requestBodyWithResponseAsync(BinaryData body, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response requestBodyWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.requestBodySync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.requestBodySync(contentType, body, requestOptions, Context.NONE); } /** @@ -214,8 +214,7 @@ public Response requestBodyWithResponse(BinaryData body, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> requestParameterWithResponseAsync(BigDecimal value, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.requestParameter(value, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.requestParameter(value, requestOptions, context)); } /** @@ -231,7 +230,6 @@ public Mono> requestParameterWithResponseAsync(BigDecimal value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response requestParameterWithResponse(BigDecimal value, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.requestParameterSync(value, accept, requestOptions, Context.NONE); + return service.requestParameterSync(value, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128VerifiesImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128VerifiesImpl.java index 9ab59d8665..873e28ba4e 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128VerifiesImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128VerifiesImpl.java @@ -64,7 +64,7 @@ public interface Decimal128VerifiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> prepareVerify(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> prepareVerify(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal128/prepare_verify") @@ -73,7 +73,7 @@ Mono> prepareVerify(@HeaderParam("accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response prepareVerifySync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response prepareVerifySync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/scalar/decimal128/verify") @@ -82,7 +82,7 @@ Response prepareVerifySync(@HeaderParam("accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> verify(@HeaderParam("accept") String accept, + Mono> verify(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/type/scalar/decimal128/verify") @@ -91,8 +91,8 @@ Mono> verify(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response verifySync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response verifySync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -159,8 +159,8 @@ public Response prepareVerifyWithResponse(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> verifyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.verify(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.verify(contentType, body, requestOptions, context)); } /** @@ -181,7 +181,7 @@ public Mono> verifyWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response verifyWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.verifySync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.verifySync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalTypesImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalTypesImpl.java index e44f5908ad..5773f7981d 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalTypesImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalTypesImpl.java @@ -66,7 +66,7 @@ public interface DecimalTypesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> responseBody(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> responseBody(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal/response_body") @@ -75,7 +75,7 @@ Mono> responseBody(@HeaderParam("accept") String accept, Re @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response responseBodySync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response responseBodySync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/scalar/decimal/resquest_body") @@ -84,7 +84,7 @@ Response responseBodySync(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> requestBody(@HeaderParam("accept") String accept, + Mono> requestBody(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/scalar/decimal/resquest_body") @@ -93,7 +93,7 @@ Mono> requestBody(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requestBodySync(@HeaderParam("accept") String accept, + Response requestBodySync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal/request_parameter") @@ -102,8 +102,8 @@ Response requestBodySync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> requestParameter(@QueryParam("value") BigDecimal value, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + Mono> requestParameter(@QueryParam("value") BigDecimal value, RequestOptions requestOptions, + Context context); @Get("/type/scalar/decimal/request_parameter") @ExpectedResponses({ 204 }) @@ -111,8 +111,8 @@ Mono> requestParameter(@QueryParam("value") BigDecimal value, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requestParameterSync(@QueryParam("value") BigDecimal value, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); + Response requestParameterSync(@QueryParam("value") BigDecimal value, RequestOptions requestOptions, + Context context); } /** @@ -176,8 +176,8 @@ public Response responseBodyWithResponse(RequestOptions requestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> requestBodyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.requestBody(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.requestBody(contentType, body, requestOptions, context)); } /** @@ -198,8 +198,8 @@ public Mono> requestBodyWithResponseAsync(BinaryData body, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response requestBodyWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.requestBodySync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.requestBodySync(contentType, body, requestOptions, Context.NONE); } /** @@ -215,8 +215,7 @@ public Response requestBodyWithResponse(BinaryData body, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> requestParameterWithResponseAsync(BigDecimal value, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.requestParameter(value, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.requestParameter(value, requestOptions, context)); } /** @@ -232,7 +231,6 @@ public Mono> requestParameterWithResponseAsync(BigDecimal value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response requestParameterWithResponse(BigDecimal value, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.requestParameterSync(value, accept, requestOptions, Context.NONE); + return service.requestParameterSync(value, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalVerifiesImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalVerifiesImpl.java index 4917636063..c1981b7463 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalVerifiesImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalVerifiesImpl.java @@ -64,7 +64,7 @@ public interface DecimalVerifiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> prepareVerify(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> prepareVerify(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal/prepare_verify") @@ -73,7 +73,7 @@ Mono> prepareVerify(@HeaderParam("accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response prepareVerifySync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response prepareVerifySync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/scalar/decimal/verify") @@ -82,7 +82,7 @@ Response prepareVerifySync(@HeaderParam("accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> verify(@HeaderParam("accept") String accept, + Mono> verify(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/type/scalar/decimal/verify") @@ -91,8 +91,8 @@ Mono> verify(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response verifySync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response verifySync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -159,8 +159,8 @@ public Response prepareVerifyWithResponse(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> verifyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.verify(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.verify(contentType, body, requestOptions, context)); } /** @@ -181,7 +181,7 @@ public Mono> verifyWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response verifyWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.verifySync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.verifySync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/StringOperationsImpl.java index 577df014e4..08ecfcdc44 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/StringOperationsImpl.java @@ -64,7 +64,7 @@ public interface StringOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/string") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/scalar/string") @@ -82,8 +82,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/scalar/string") @ExpectedResponses({ 204 }) @@ -91,8 +91,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -108,7 +108,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return string value along with {@link Response} on successful completion of {@link Mono}. + * @return a sequence of textual characters along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -129,7 +129,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return string value along with {@link Response}. + * @return a sequence of textual characters along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -155,8 +155,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -177,7 +177,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/UnknownsImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/UnknownsImpl.java index fdd5fea491..a58950e0b2 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/UnknownsImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/UnknownsImpl.java @@ -63,7 +63,7 @@ public interface UnknownsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/unknown") @@ -72,7 +72,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/scalar/unknown") @@ -81,8 +81,8 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> put(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/scalar/unknown") @ExpectedResponses({ 204 }) @@ -90,8 +90,8 @@ Mono> put(@HeaderParam("accept") String accept, @BodyParam("appli @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -107,7 +107,7 @@ Response putSync(@HeaderParam("accept") String accept, @BodyParam("applica * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return unknown value along with {@link Response} on successful completion of {@link Mono}. + * @return anything along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -128,7 +128,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return unknown value along with {@link Response}. + * @return anything along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { @@ -154,8 +154,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); } /** @@ -176,7 +176,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/EnumsOnliesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/EnumsOnliesImpl.java index 1e77334931..b212091519 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/EnumsOnliesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/EnumsOnliesImpl.java @@ -64,7 +64,7 @@ public interface EnumsOnliesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/enums-only") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/enums-only") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("accept") String accept, + Mono> send(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest3, RequestOptions requestOptions, Context context); @Post("/type/union/enums-only") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("accept") String accept, + Response sendSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest3, RequestOptions requestOptions, Context context); } @@ -170,8 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest3, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.send(accept, sendRequest3, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.send(contentType, sendRequest3, requestOptions, context)); } /** @@ -197,7 +197,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest3, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest3, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendSync(accept, sendRequest3, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sendSync(contentType, sendRequest3, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/FloatsOnliesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/FloatsOnliesImpl.java index 0d38239585..a59bb71ea2 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/FloatsOnliesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/FloatsOnliesImpl.java @@ -64,7 +64,7 @@ public interface FloatsOnliesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/floats-only") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/floats-only") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("accept") String accept, + Mono> send(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest5, RequestOptions requestOptions, Context context); @Post("/type/union/floats-only") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("accept") String accept, + Response sendSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest5, RequestOptions requestOptions, Context context); } @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest5, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.send(accept, sendRequest5, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.send(contentType, sendRequest5, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest5, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest5, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendSync(accept, sendRequest5, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sendSync(contentType, sendRequest5, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/IntsOnliesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/IntsOnliesImpl.java index a83f054fc6..99d90d9646 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/IntsOnliesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/IntsOnliesImpl.java @@ -64,7 +64,7 @@ public interface IntsOnliesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/ints-only") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/ints-only") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("accept") String accept, + Mono> send(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest6, RequestOptions requestOptions, Context context); @Post("/type/union/ints-only") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("accept") String accept, + Response sendSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest6, RequestOptions requestOptions, Context context); } @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest6, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.send(accept, sendRequest6, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.send(contentType, sendRequest6, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest6, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest6, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendSync(accept, sendRequest6, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sendSync(contentType, sendRequest6, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/MixedLiteralsImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/MixedLiteralsImpl.java index 0009929c23..24bff76dff 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/MixedLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/MixedLiteralsImpl.java @@ -64,7 +64,7 @@ public interface MixedLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/mixed-literals") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/mixed-literals") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("accept") String accept, + Mono> send(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest1, RequestOptions requestOptions, Context context); @Post("/type/union/mixed-literals") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("accept") String accept, + Response sendSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest1, RequestOptions requestOptions, Context context); } @@ -176,8 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest1, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.send(accept, sendRequest1, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.send(contentType, sendRequest1, requestOptions, context)); } /** @@ -205,7 +205,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest1, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest1, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendSync(accept, sendRequest1, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sendSync(contentType, sendRequest1, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/MixedTypesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/MixedTypesImpl.java index cfa98f8b9f..aafe11c1b4 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/MixedTypesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/MixedTypesImpl.java @@ -64,7 +64,7 @@ public interface MixedTypesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/mixed-types") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/mixed-types") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("accept") String accept, + Mono> send(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest, RequestOptions requestOptions, Context context); @Post("/type/union/mixed-types") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("accept") String accept, + Response sendSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest, RequestOptions requestOptions, Context context); } @@ -185,8 +185,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.send(accept, sendRequest, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.send(contentType, sendRequest, requestOptions, context)); } /** @@ -217,7 +217,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendSync(accept, sendRequest, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sendSync(contentType, sendRequest, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/ModelsOnliesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/ModelsOnliesImpl.java index b4e16f01c6..769705e92e 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/ModelsOnliesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/ModelsOnliesImpl.java @@ -64,7 +64,7 @@ public interface ModelsOnliesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/models-only") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/models-only") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("accept") String accept, + Mono> send(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest4, RequestOptions requestOptions, Context context); @Post("/type/union/models-only") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("accept") String accept, + Response sendSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest4, RequestOptions requestOptions, Context context); } @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest4, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.send(accept, sendRequest4, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.send(contentType, sendRequest4, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest4, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest4, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendSync(accept, sendRequest4, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sendSync(contentType, sendRequest4, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/StringAndArraysImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/StringAndArraysImpl.java index 82db1f931b..72ad57f6c0 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/StringAndArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/StringAndArraysImpl.java @@ -64,7 +64,7 @@ public interface StringAndArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/string-and-array") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/string-and-array") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("accept") String accept, + Mono> send(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest2, RequestOptions requestOptions, Context context); @Post("/type/union/string-and-array") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("accept") String accept, + Response sendSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest2, RequestOptions requestOptions, Context context); } @@ -170,8 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest2, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.send(accept, sendRequest2, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.send(contentType, sendRequest2, requestOptions, context)); } /** @@ -197,7 +197,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest2, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest2, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendSync(accept, sendRequest2, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sendSync(contentType, sendRequest2, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/StringExtensibleNamedsImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/StringExtensibleNamedsImpl.java index 8066f73f79..b52c1fd016 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/StringExtensibleNamedsImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/StringExtensibleNamedsImpl.java @@ -64,7 +64,7 @@ public interface StringExtensibleNamedsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/string-extensible-named") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/string-extensible-named") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("accept") String accept, + Mono> send(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest7, RequestOptions requestOptions, Context context); @Post("/type/union/string-extensible-named") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("accept") String accept, + Response sendSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest7, RequestOptions requestOptions, Context context); } @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest7, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.send(accept, sendRequest7, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.send(contentType, sendRequest7, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest7, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest7, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendSync(accept, sendRequest7, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sendSync(contentType, sendRequest7, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/StringExtensiblesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/StringExtensiblesImpl.java index ed83e7409a..91d254d8b4 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/StringExtensiblesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/StringExtensiblesImpl.java @@ -64,7 +64,7 @@ public interface StringExtensiblesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/string-extensible") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/string-extensible") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("accept") String accept, + Mono> send(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest8, RequestOptions requestOptions, Context context); @Post("/type/union/string-extensible") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("accept") String accept, + Response sendSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest8, RequestOptions requestOptions, Context context); } @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest8, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.send(accept, sendRequest8, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.send(contentType, sendRequest8, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest8, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest8, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendSync(accept, sendRequest8, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sendSync(contentType, sendRequest8, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/StringsOnliesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/StringsOnliesImpl.java index 58d503544e..a1f5912b78 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/StringsOnliesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/StringsOnliesImpl.java @@ -64,7 +64,7 @@ public interface StringsOnliesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/union/strings-only") @@ -73,7 +73,7 @@ Mono> get(@HeaderParam("accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/union/strings-only") @@ -82,7 +82,7 @@ Response getSync(@HeaderParam("accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("accept") String accept, + Mono> send(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest9, RequestOptions requestOptions, Context context); @Post("/type/union/strings-only") @@ -91,7 +91,7 @@ Mono> send(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("accept") String accept, + Response sendSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest9, RequestOptions requestOptions, Context context); } @@ -161,8 +161,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest9, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.send(accept, sendRequest9, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.send(contentType, sendRequest9, requestOptions, context)); } /** @@ -185,7 +185,7 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest9, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest9, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sendSync(accept, sendRequest9, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.sendSync(contentType, sendRequest9, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/versioning/added/implementation/AddedClientImpl.java b/typespec-tests/src/main/java/com/versioning/added/implementation/AddedClientImpl.java index ea3c2305cd..76f0d27904 100644 --- a/typespec-tests/src/main/java/com/versioning/added/implementation/AddedClientImpl.java +++ b/typespec-tests/src/main/java/com/versioning/added/implementation/AddedClientImpl.java @@ -184,8 +184,9 @@ public interface AddedClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> v1(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("header-v2") String headerV2, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("header-v2") String headerV2, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/v1") @ExpectedResponses({ 200 }) @@ -194,8 +195,9 @@ Mono> v1(@HostParam("endpoint") String endpoint, @HostParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response v1Sync(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("header-v2") String headerV2, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("header-v2") String headerV2, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/v2") @ExpectedResponses({ 200 }) @@ -204,8 +206,8 @@ Response v1Sync(@HostParam("endpoint") String endpoint, @HostParam(" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> v2(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/v2") @ExpectedResponses({ 200 }) @@ -214,8 +216,8 @@ Mono> v2(@HostParam("endpoint") String endpoint, @HostParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response v2Sync(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -252,9 +254,10 @@ Response v2Sync(@HostParam("endpoint") String endpoint, @HostParam(" @ServiceMethod(returns = ReturnType.SINGLE) public Mono> v1WithResponseAsync(String headerV2, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.v1(this.getEndpoint(), this.getVersion(), headerV2, accept, body, - requestOptions, context)); + return FluxUtil.withContext(context -> service.v1(this.getEndpoint(), this.getVersion(), headerV2, contentType, + accept, body, requestOptions, context)); } /** @@ -290,9 +293,10 @@ public Mono> v1WithResponseAsync(String headerV2, BinaryDat */ @ServiceMethod(returns = ReturnType.SINGLE) public Response v1WithResponse(String headerV2, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.v1Sync(this.getEndpoint(), this.getVersion(), headerV2, accept, body, requestOptions, - Context.NONE); + return service.v1Sync(this.getEndpoint(), this.getVersion(), headerV2, contentType, accept, body, + requestOptions, Context.NONE); } /** @@ -327,9 +331,10 @@ public Response v1WithResponse(String headerV2, BinaryData body, Req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> v2WithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.v2(this.getEndpoint(), this.getVersion(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.v2(this.getEndpoint(), this.getVersion(), contentType, accept, + body, requestOptions, context)); } /** @@ -364,7 +369,9 @@ public Mono> v2WithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response v2WithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.v2Sync(this.getEndpoint(), this.getVersion(), accept, body, requestOptions, Context.NONE); + return service.v2Sync(this.getEndpoint(), this.getVersion(), contentType, accept, body, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/versioning/added/implementation/InterfaceV2sImpl.java b/typespec-tests/src/main/java/com/versioning/added/implementation/InterfaceV2sImpl.java index 31d6ad0d3c..a032c93597 100644 --- a/typespec-tests/src/main/java/com/versioning/added/implementation/InterfaceV2sImpl.java +++ b/typespec-tests/src/main/java/com/versioning/added/implementation/InterfaceV2sImpl.java @@ -75,8 +75,9 @@ public interface InterfaceV2sService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> v2InInterface(@HostParam("endpoint") String endpoint, - @HostParam("version") String version, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HostParam("version") String version, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/interface-v2/v2") @ExpectedResponses({ 200 }) @@ -85,8 +86,9 @@ Mono> v2InInterface(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response v2InInterfaceSync(@HostParam("endpoint") String endpoint, - @HostParam("version") String version, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HostParam("version") String version, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -121,9 +123,10 @@ Response v2InInterfaceSync(@HostParam("endpoint") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> v2InInterfaceWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.v2InInterface(this.client.getEndpoint(), - this.client.getVersion(), accept, body, requestOptions, context)); + this.client.getVersion(), contentType, accept, body, requestOptions, context)); } /** @@ -158,8 +161,9 @@ public Mono> v2InInterfaceWithResponseAsync(BinaryData body */ @ServiceMethod(returns = ReturnType.SINGLE) public Response v2InInterfaceWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.v2InInterfaceSync(this.client.getEndpoint(), this.client.getVersion(), accept, body, + return service.v2InInterfaceSync(this.client.getEndpoint(), this.client.getVersion(), contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/versioning/madeoptional/implementation/MadeOptionalClientImpl.java b/typespec-tests/src/main/java/com/versioning/madeoptional/implementation/MadeOptionalClientImpl.java index 11b87890d5..fc57f6064f 100644 --- a/typespec-tests/src/main/java/com/versioning/madeoptional/implementation/MadeOptionalClientImpl.java +++ b/typespec-tests/src/main/java/com/versioning/madeoptional/implementation/MadeOptionalClientImpl.java @@ -171,8 +171,8 @@ public interface MadeOptionalClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> test(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/test") @ExpectedResponses({ 200 }) @@ -181,8 +181,8 @@ Mono> test(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response testSync(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -222,9 +222,10 @@ Response testSync(@HostParam("endpoint") String endpoint, @HostParam */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> testWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.test(this.getEndpoint(), this.getVersion(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.test(this.getEndpoint(), this.getVersion(), contentType, accept, + body, requestOptions, context)); } /** @@ -264,7 +265,9 @@ public Mono> testWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response testWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.testSync(this.getEndpoint(), this.getVersion(), accept, body, requestOptions, Context.NONE); + return service.testSync(this.getEndpoint(), this.getVersion(), contentType, accept, body, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/versioning/removed/implementation/RemovedClientImpl.java b/typespec-tests/src/main/java/com/versioning/removed/implementation/RemovedClientImpl.java index 75be98281d..74936454ac 100644 --- a/typespec-tests/src/main/java/com/versioning/removed/implementation/RemovedClientImpl.java +++ b/typespec-tests/src/main/java/com/versioning/removed/implementation/RemovedClientImpl.java @@ -169,8 +169,8 @@ public interface RemovedClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> v2(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/v2") @ExpectedResponses({ 200 }) @@ -179,8 +179,8 @@ Mono> v2(@HostParam("endpoint") String endpoint, @HostParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response v2Sync(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -215,9 +215,10 @@ Response v2Sync(@HostParam("endpoint") String endpoint, @HostParam(" */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> v2WithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.v2(this.getEndpoint(), this.getVersion(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.v2(this.getEndpoint(), this.getVersion(), contentType, accept, + body, requestOptions, context)); } /** @@ -252,7 +253,9 @@ public Mono> v2WithResponseAsync(BinaryData body, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response v2WithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.v2Sync(this.getEndpoint(), this.getVersion(), accept, body, requestOptions, Context.NONE); + return service.v2Sync(this.getEndpoint(), this.getVersion(), contentType, accept, body, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/versioning/renamedfrom/implementation/NewInterfacesImpl.java b/typespec-tests/src/main/java/com/versioning/renamedfrom/implementation/NewInterfacesImpl.java index 3efaf2c5a5..4f6dd02c68 100644 --- a/typespec-tests/src/main/java/com/versioning/renamedfrom/implementation/NewInterfacesImpl.java +++ b/typespec-tests/src/main/java/com/versioning/renamedfrom/implementation/NewInterfacesImpl.java @@ -75,8 +75,9 @@ public interface NewInterfacesService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> newOpInNewInterface(@HostParam("endpoint") String endpoint, - @HostParam("version") String version, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HostParam("version") String version, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/interface/test") @ExpectedResponses({ 200 }) @@ -85,8 +86,9 @@ Mono> newOpInNewInterface(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response newOpInNewInterfaceSync(@HostParam("endpoint") String endpoint, - @HostParam("version") String version, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @HostParam("version") String version, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -122,9 +124,10 @@ Response newOpInNewInterfaceSync(@HostParam("endpoint") String endpo @ServiceMethod(returns = ReturnType.SINGLE) public Mono> newOpInNewInterfaceWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.newOpInNewInterface(this.client.getEndpoint(), - this.client.getVersion(), accept, body, requestOptions, context)); + this.client.getVersion(), contentType, accept, body, requestOptions, context)); } /** @@ -159,8 +162,9 @@ public Mono> newOpInNewInterfaceWithResponseAsync(BinaryDat */ @ServiceMethod(returns = ReturnType.SINGLE) public Response newOpInNewInterfaceWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.newOpInNewInterfaceSync(this.client.getEndpoint(), this.client.getVersion(), accept, body, - requestOptions, Context.NONE); + return service.newOpInNewInterfaceSync(this.client.getEndpoint(), this.client.getVersion(), contentType, accept, + body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/versioning/renamedfrom/implementation/RenamedFromClientImpl.java b/typespec-tests/src/main/java/com/versioning/renamedfrom/implementation/RenamedFromClientImpl.java index 8cb793c44a..4b3e777ef4 100644 --- a/typespec-tests/src/main/java/com/versioning/renamedfrom/implementation/RenamedFromClientImpl.java +++ b/typespec-tests/src/main/java/com/versioning/renamedfrom/implementation/RenamedFromClientImpl.java @@ -186,8 +186,9 @@ public interface RenamedFromClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> newOp(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @QueryParam("newQuery") String newQuery, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("newQuery") String newQuery, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/test") @ExpectedResponses({ 200 }) @@ -196,8 +197,9 @@ Mono> newOp(@HostParam("endpoint") String endpoint, @HostPa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response newOpSync(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @QueryParam("newQuery") String newQuery, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("newQuery") String newQuery, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -234,9 +236,10 @@ Response newOpSync(@HostParam("endpoint") String endpoint, @HostPara @ServiceMethod(returns = ReturnType.SINGLE) public Mono> newOpWithResponseAsync(String newQuery, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.newOp(this.getEndpoint(), this.getVersion(), newQuery, accept, - body, requestOptions, context)); + return FluxUtil.withContext(context -> service.newOp(this.getEndpoint(), this.getVersion(), newQuery, + contentType, accept, body, requestOptions, context)); } /** @@ -272,8 +275,9 @@ public Mono> newOpWithResponseAsync(String newQuery, Binary */ @ServiceMethod(returns = ReturnType.SINGLE) public Response newOpWithResponse(String newQuery, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.newOpSync(this.getEndpoint(), this.getVersion(), newQuery, accept, body, requestOptions, - Context.NONE); + return service.newOpSync(this.getEndpoint(), this.getVersion(), newQuery, contentType, accept, body, + requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/versioning/returntypechangedfrom/implementation/ReturnTypeChangedFromClientImpl.java b/typespec-tests/src/main/java/com/versioning/returntypechangedfrom/implementation/ReturnTypeChangedFromClientImpl.java index 58e80a8662..ac32c99f2e 100644 --- a/typespec-tests/src/main/java/com/versioning/returntypechangedfrom/implementation/ReturnTypeChangedFromClientImpl.java +++ b/typespec-tests/src/main/java/com/versioning/returntypechangedfrom/implementation/ReturnTypeChangedFromClientImpl.java @@ -172,8 +172,8 @@ public interface ReturnTypeChangedFromClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> test(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/test") @ExpectedResponses({ 200 }) @@ -182,8 +182,8 @@ Mono> test(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response testSync(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -210,9 +210,10 @@ Response testSync(@HostParam("endpoint") String endpoint, @HostParam */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> testWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.test(this.getEndpoint(), this.getVersion(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.test(this.getEndpoint(), this.getVersion(), contentType, accept, + body, requestOptions, context)); } /** @@ -239,7 +240,9 @@ public Mono> testWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response testWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.testSync(this.getEndpoint(), this.getVersion(), accept, body, requestOptions, Context.NONE); + return service.testSync(this.getEndpoint(), this.getVersion(), contentType, accept, body, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/versioning/typechangedfrom/implementation/TypeChangedFromClientImpl.java b/typespec-tests/src/main/java/com/versioning/typechangedfrom/implementation/TypeChangedFromClientImpl.java index b11f99fc16..76874be3a0 100644 --- a/typespec-tests/src/main/java/com/versioning/typechangedfrom/implementation/TypeChangedFromClientImpl.java +++ b/typespec-tests/src/main/java/com/versioning/typechangedfrom/implementation/TypeChangedFromClientImpl.java @@ -172,8 +172,9 @@ public interface TypeChangedFromClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> test(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @QueryParam("param") String param, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("param") String param, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/test") @ExpectedResponses({ 200 }) @@ -182,8 +183,9 @@ Mono> test(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response testSync(@HostParam("endpoint") String endpoint, @HostParam("version") String version, - @QueryParam("param") String param, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @QueryParam("param") String param, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -218,9 +220,10 @@ Response testSync(@HostParam("endpoint") String endpoint, @HostParam @ServiceMethod(returns = ReturnType.SINGLE) public Mono> testWithResponseAsync(String param, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.test(this.getEndpoint(), this.getVersion(), param, accept, body, - requestOptions, context)); + return FluxUtil.withContext(context -> service.test(this.getEndpoint(), this.getVersion(), param, contentType, + accept, body, requestOptions, context)); } /** @@ -254,8 +257,9 @@ public Mono> testWithResponseAsync(String param, BinaryData */ @ServiceMethod(returns = ReturnType.SINGLE) public Response testWithResponse(String param, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.testSync(this.getEndpoint(), this.getVersion(), param, accept, body, requestOptions, + return service.testSync(this.getEndpoint(), this.getVersion(), param, contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSend.java b/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSend.java index 19756261ce..599899249b 100644 --- a/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSend.java +++ b/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSend.java @@ -7,13 +7,14 @@ import com.azure.core.util.Configuration; import com.cadl.flatten.FlattenClient; import com.cadl.flatten.FlattenClientBuilder; +import com.cadl.flatten.models.User; public class FlattenOpSend { public static void main(String[] args) { FlattenClient flattenClient = new FlattenClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")).buildClient(); // BEGIN:com.cadl.flatten.generated.send.flattenopsend - flattenClient.send("myRequiredId", null, null); + flattenClient.send("myRequiredId", "myRequiredInput", new User("myOptionalUser")); // END:com.cadl.flatten.generated.send.flattenopsend } } diff --git a/typespec-tests/src/test/java/com/cadl/server/generated/HttpbinClientTestBase.java b/typespec-tests/src/test/java/com/cadl/server/generated/HttpbinClientTestBase.java index 133ae7c4f3..ff715afeaf 100644 --- a/typespec-tests/src/test/java/com/cadl/server/generated/HttpbinClientTestBase.java +++ b/typespec-tests/src/test/java/com/cadl/server/generated/HttpbinClientTestBase.java @@ -29,6 +29,7 @@ protected void beforeTest() { HttpbinClientBuilder httpbinClientbuilder = new HttpbinClientBuilder().domain(Configuration.getGlobalConfiguration().get("DOMAIN", "domain")) .tld(Configuration.getGlobalConfiguration().get("TLD", "tld")) + .relativePath(Configuration.getGlobalConfiguration().get("RELATIVEPATH", "relativepath")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -40,6 +41,7 @@ protected void beforeTest() { ContosoClientBuilder contosoClientbuilder = new ContosoClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .apiVersion(Configuration.getGlobalConfiguration().get("APIVERSION", "apiversion")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/client/naming/NamingTests.java b/typespec-tests/src/test/java/com/client/naming/NamingTests.java index 6d6c83a638..5ebb4b78c5 100644 --- a/typespec-tests/src/test/java/com/client/naming/NamingTests.java +++ b/typespec-tests/src/test/java/com/client/naming/NamingTests.java @@ -17,7 +17,7 @@ public class NamingTests { private final NamingClient client = new NamingClientBuilder().buildClient(); // client name should be "ClientModel", currently a bug in TCGC - private final ClientModelClient modelClient = new NamingClientBuilder().buildClientModelClient(); + private final ModelClient modelClient = new NamingClientBuilder().buildModelClient(); private final UnionEnumClient enumClient = new NamingClientBuilder().buildUnionEnumClient(); diff --git a/typespec-tests/src/test/java/com/client/naming/generated/NamingClientTestBase.java b/typespec-tests/src/test/java/com/client/naming/generated/NamingClientTestBase.java index 966f8e88d1..755c1c3625 100644 --- a/typespec-tests/src/test/java/com/client/naming/generated/NamingClientTestBase.java +++ b/typespec-tests/src/test/java/com/client/naming/generated/NamingClientTestBase.java @@ -13,7 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; -import com.client.naming.ClientModelClient; +import com.client.naming.ModelClient; import com.client.naming.NamingClient; import com.client.naming.NamingClientBuilder; import com.client.naming.UnionEnumClient; @@ -21,7 +21,7 @@ class NamingClientTestBase extends TestProxyTestBase { protected NamingClient namingClient; - protected ClientModelClient clientModelClient; + protected ModelClient modelClient; protected UnionEnumClient unionEnumClient; @@ -36,14 +36,14 @@ protected void beforeTest() { } namingClient = namingClientbuilder.buildClient(); - NamingClientBuilder clientModelClientbuilder = new NamingClientBuilder().httpClient(HttpClient.createDefault()) + NamingClientBuilder modelClientbuilder = new NamingClientBuilder().httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { - clientModelClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + modelClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { - clientModelClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + modelClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); } - clientModelClient = clientModelClientbuilder.buildClientModelClient(); + modelClient = modelClientbuilder.buildModelClient(); NamingClientBuilder unionEnumClientbuilder = new NamingClientBuilder().httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); diff --git a/typespec-tests/src/test/java/com/resiliency/servicedriven/generated/ResiliencyServiceDrivenClientTestBase.java b/typespec-tests/src/test/java/com/resiliency/servicedriven/generated/ResiliencyServiceDrivenClientTestBase.java index b42cd18d88..085cfca3e4 100644 --- a/typespec-tests/src/test/java/com/resiliency/servicedriven/generated/ResiliencyServiceDrivenClientTestBase.java +++ b/typespec-tests/src/test/java/com/resiliency/servicedriven/generated/ResiliencyServiceDrivenClientTestBase.java @@ -27,6 +27,7 @@ protected void beforeTest() { .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) .serviceDeploymentVersion( Configuration.getGlobalConfiguration().get("SERVICEDEPLOYMENTVERSION", "servicedeploymentversion")) + .apiVersion(Configuration.getGlobalConfiguration().get("APIVERSION", "apiversion")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/resiliency/servicedriven/v1/generated/ResiliencyServiceDrivenClientTestBase.java b/typespec-tests/src/test/java/com/resiliency/servicedriven/v1/generated/ResiliencyServiceDrivenClientTestBase.java index eec959eb94..c4d1be8a6a 100644 --- a/typespec-tests/src/test/java/com/resiliency/servicedriven/v1/generated/ResiliencyServiceDrivenClientTestBase.java +++ b/typespec-tests/src/test/java/com/resiliency/servicedriven/v1/generated/ResiliencyServiceDrivenClientTestBase.java @@ -27,6 +27,7 @@ protected void beforeTest() { .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) .serviceDeploymentVersion( Configuration.getGlobalConfiguration().get("SERVICEDEPLOYMENTVERSION", "servicedeploymentversion")) + .apiVersion(Configuration.getGlobalConfiguration().get("APIVERSION", "apiversion")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/server/path/multiple/generated/MultipleClientTestBase.java b/typespec-tests/src/test/java/com/server/path/multiple/generated/MultipleClientTestBase.java index a1e5597656..09b7923b1f 100644 --- a/typespec-tests/src/test/java/com/server/path/multiple/generated/MultipleClientTestBase.java +++ b/typespec-tests/src/test/java/com/server/path/multiple/generated/MultipleClientTestBase.java @@ -24,6 +24,7 @@ class MultipleClientTestBase extends TestProxyTestBase { protected void beforeTest() { MultipleClientBuilder multipleClientbuilder = new MultipleClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .apiVersion(Configuration.getGlobalConfiguration().get("APIVERSION", "apiversion")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { From 5d58dd57e8541a7958f85ccdb8bbd010a23a2ecc Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Wed, 17 Jul 2024 12:01:40 +0800 Subject: [PATCH 19/90] regen --- .../ChildResourcesInterfacesClientImpl.java | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java index a45991e2f2..76b5437c46 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java @@ -131,10 +131,10 @@ Mono>> actionWithoutBody(@QueryParam("api-version") St @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByTopLevelArmResource(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> listByTopLevelArmResource(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -1134,10 +1134,6 @@ public void actionWithoutBody(String resourceGroupName, String topLevelArmResour @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelArmResourceSinglePageAsync(String resourceGroupName, String topLevelArmResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1152,9 +1148,8 @@ private Mono> listByTopLevelArmResourceSingleP } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByTopLevelArmResource(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context)) + .withContext(context -> service.listByTopLevelArmResource(this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1175,10 +1170,6 @@ private Mono> listByTopLevelArmResourceSingleP @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelArmResourceSinglePageAsync(String resourceGroupName, String topLevelArmResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1194,8 +1185,8 @@ private Mono> listByTopLevelArmResourceSingleP final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByTopLevelArmResource(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context) + .listByTopLevelArmResource(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1271,6 +1262,8 @@ public PagedIterable listByTopLevelArmResource(String resour } /** + * List ChildResource resources by TopLevelArmResource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. From e2fd61bbaf89359c4cf273de6d1f49de4c3926cc Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Thu, 18 Jul 2024 17:34:13 +0800 Subject: [PATCH 20/90] use sdkResponse.description and do not use initializationProperty.type.serverUrl for arm --- typespec-extension/src/code-model-builder.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 457258c2b8..9961450522 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -552,7 +552,7 @@ export class CodeModelBuilder { // preprocess group-etag-headers this.options["group-etag-headers"] = this.options["group-etag-headers"] ?? true; - const sdkPackage = this.sdkContext.experimental_sdkPackage; + const sdkPackage = this.sdkContext.sdkPackage; for (const client of sdkPackage.clients) { if (client.initialization.access !== "public") { // do not generate client for internal client which is operation group continue; @@ -590,7 +590,9 @@ export class CodeModelBuilder { let hostParameters: Parameter[] = []; client.initialization.properties.forEach((initializationProperty) => { if (initializationProperty.kind === "endpoint") { - baseUri = initializationProperty.type.serverUrl; + if (!this.isArm()) { + baseUri = initializationProperty.type.serverUrl; + } hostParameters = this.processHostParametersFromSdkType(initializationProperty.type.templateArguments); codeModelClient.addGlobalParameters(hostParameters); } @@ -2616,7 +2618,7 @@ export class CodeModelBuilder { language: { default: { name: op.language.default.name + "Response", - description: this.getResponseDescription(sdkResponse.__raw), + description: sdkResponse.description, }, }, }); @@ -2641,7 +2643,7 @@ export class CodeModelBuilder { language: { default: { name: op.language.default.name + "Response", - description: this.getResponseDescription(sdkResponse.__raw), + description: sdkResponse.description, }, }, }); @@ -2657,7 +2659,7 @@ export class CodeModelBuilder { language: { default: { name: op.language.default.name + "Response", - description: this.getResponseDescription(sdkResponse.__raw), + description: sdkResponse.description, }, }, }); From ed1c710c6b85932f5dd4539b71e358f1515b1c53 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Thu, 18 Jul 2024 17:34:53 +0800 Subject: [PATCH 21/90] regen --- .../azure/core/basic/BasicAsyncClient.java | 36 ++-- .../basic/TwoModelsAsPageItemAsyncClient.java | 12 +- .../AzureExampleClientImpl.java | 16 +- .../ManagedIdentityManager.java | 1 - .../fluent/ManagedIdentityClient.java | 7 - ...ManagedIdentityTrackedResourcesClient.java | 5 +- .../ManagedIdentityClientBuilder.java | 18 +- .../ManagedIdentityClientImpl.java | 18 +- ...gedIdentityTrackedResourcesClientImpl.java | 92 ++++----- .../ManagedIdentityTrackedResources.java | 11 +- .../NestedProxyResourcesClientImpl.java | 157 +++++--------- .../TopLevelTrackedResourcesClientImpl.java | 195 ++++++------------ ...ExtensionResourceInterfacesClientImpl.java | 150 +++++--------- .../ChildResourcesInterfacesClientImpl.java | 189 ++++++----------- ...mTemplateResourceInterfacesClientImpl.java | 2 +- .../implementation/OperationsClientImpl.java | 2 +- ...pLevelArmResourceInterfacesClientImpl.java | 2 +- .../implementation/FishesClientImpl.java | 2 +- .../TopLevelArmResourcesClientImpl.java | 2 +- .../models/SendLongRequest.java | 12 +- .../models/UploadTodoRequest.java | 8 +- .../cadl/flatten/models/SendLongOptions.java | 6 +- ...Status.java => SendLongRequestStatus.java} | 18 +- .../com/cadl/flatten/models/TodoItem.java | 10 +- .../flatten/models/UploadTodoOptions.java | 6 +- .../ProtocolAndConvenientAsyncClient.java | 6 +- .../cadl/response/ResponseAsyncClient.java | 12 +- .../EtagHeadersAsyncClient.java | 6 +- .../versioning/VersioningAsyncClient.java | 12 +- .../payload/pageable/PageableAsyncClient.java | 6 +- .../implementation/VisibilityClientImpl.java | 17 +- .../optional/PlaindateAsyncClient.java | 10 +- .../property/optional/PlaindateClient.java | 8 +- .../optional/PlaintimeAsyncClient.java | 10 +- .../property/optional/PlaintimeClient.java | 8 +- .../implementation/PlaindatesImpl.java | 44 ++-- .../implementation/PlaintimesImpl.java | 44 ++-- .../flatten/generated/FlattenOpSendLong.java | 6 +- .../generated/FlattenOpSendLongTests.java | 6 +- 39 files changed, 455 insertions(+), 717 deletions(-) rename typespec-tests/src/main/java/com/cadl/flatten/models/{TodoItemStatus.java => SendLongRequestStatus.java} (62%) diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/BasicAsyncClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/BasicAsyncClient.java index df0a5187a0..0bac5bba4f 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/BasicAsyncClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/BasicAsyncClient.java @@ -541,10 +541,10 @@ public PagedFlux list(Integer top, Integer skip, List orderBy, Str } } PagedFlux pagedFluxResponse = list(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -573,10 +573,10 @@ public PagedFlux list() { // Generated convenience method for list RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = list(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -603,10 +603,10 @@ public PagedFlux listWithPage() { // Generated convenience method for listWithPage RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = listWithPage(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -639,10 +639,10 @@ public PagedFlux listWithParameters(ListItemInputBody bodyInput, ListItemI requestOptions.addQueryParam("another", another.toString(), false); } PagedFlux pagedFluxResponse = listWithParameters(BinaryData.fromObject(bodyInput), requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -671,10 +671,10 @@ public PagedFlux listWithParameters(ListItemInputBody bodyInput) { // Generated convenience method for listWithParameters RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = listWithParameters(BinaryData.fromObject(bodyInput), requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -701,10 +701,10 @@ public PagedFlux listWithCustomPageModel() { // Generated convenience method for listWithCustomPageModel RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = listWithCustomPageModel(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/TwoModelsAsPageItemAsyncClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/TwoModelsAsPageItemAsyncClient.java index 1cf52d0326..3727c9aa92 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/TwoModelsAsPageItemAsyncClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/TwoModelsAsPageItemAsyncClient.java @@ -106,10 +106,10 @@ public PagedFlux listFirstItem() { // Generated convenience method for listFirstItem RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = listFirstItem(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -137,10 +137,10 @@ public PagedFlux listSecondItem() { // Generated convenience method for listSecondItem RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = listSecondItem(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() diff --git a/typespec-tests/src/main/java/com/_specs_/azure/example/basic/implementation/AzureExampleClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/example/basic/implementation/AzureExampleClientImpl.java index eab336edd8..f7e9e9cdb6 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/example/basic/implementation/AzureExampleClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/example/basic/implementation/AzureExampleClientImpl.java @@ -135,8 +135,8 @@ public interface AzureExampleClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> basicAction(@QueryParam("api-version") String apiVersion, @QueryParam("query-param") String queryParam, @HeaderParam("header-param") String headerParam, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/azure/example/basic/basic") @ExpectedResponses({ 200 }) @@ -146,8 +146,8 @@ Mono> basicAction(@QueryParam("api-version") String apiVers @UnexpectedResponseExceptionType(HttpResponseException.class) Response basicActionSync(@QueryParam("api-version") String apiVersion, @QueryParam("query-param") String queryParam, @HeaderParam("header-param") String headerParam, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -203,9 +203,10 @@ Response basicActionSync(@QueryParam("api-version") String apiVersio @ServiceMethod(returns = ReturnType.SINGLE) public Mono> basicActionWithResponseAsync(String queryParam, String headerParam, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.basicAction(this.getServiceVersion().getVersion(), queryParam, - headerParam, accept, body, requestOptions, context)); + headerParam, contentType, accept, body, requestOptions, context)); } /** @@ -261,8 +262,9 @@ public Mono> basicActionWithResponseAsync(String queryParam @ServiceMethod(returns = ReturnType.SINGLE) public Response basicActionWithResponse(String queryParam, String headerParam, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.basicActionSync(this.getServiceVersion().getVersion(), queryParam, headerParam, accept, body, - requestOptions, Context.NONE); + return service.basicActionSync(this.getServiceVersion().getVersion(), queryParam, headerParam, contentType, + accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/ManagedIdentityManager.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/ManagedIdentityManager.java index 20036c52da..dd42caa8da 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/ManagedIdentityManager.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/ManagedIdentityManager.java @@ -47,7 +47,6 @@ private ManagedIdentityManager(HttpPipeline httpPipeline, AzureProfile profile, Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); this.clientObject = new ManagedIdentityClientBuilder().pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) .buildClient(); diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/ManagedIdentityClient.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/ManagedIdentityClient.java index c19097c9f5..032634dc9a 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/ManagedIdentityClient.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/ManagedIdentityClient.java @@ -11,13 +11,6 @@ * The interface for ManagedIdentityClient class. */ public interface ManagedIdentityClient { - /** - * Gets Server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - /** * Gets Version parameter. * diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/ManagedIdentityTrackedResourcesClient.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/ManagedIdentityTrackedResourcesClient.java index 208c9fc223..283a13eff0 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/ManagedIdentityTrackedResourcesClient.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/ManagedIdentityTrackedResourcesClient.java @@ -23,7 +23,8 @@ public interface ManagedIdentityTrackedResourcesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ManagedIdentityTrackedResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse(String resourceGroupName, @@ -37,7 +38,7 @@ Response getByResourceGroupWithResponse(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ManagedIdentityTrackedResource. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. */ @ServiceMethod(returns = ReturnType.SINGLE) ManagedIdentityTrackedResourceInner getByResourceGroup(String resourceGroupName, diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityClientBuilder.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityClientBuilder.java index 6ef09dff90..d53a199fae 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityClientBuilder.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityClientBuilder.java @@ -19,22 +19,6 @@ */ @ServiceClientBuilder(serviceClients = { ManagedIdentityClientImpl.class }) public final class ManagedIdentityClientBuilder { - /* - * Server parameter - */ - private String endpoint; - - /** - * Sets Server parameter. - * - * @param endpoint the endpoint value. - * @return the ManagedIdentityClientBuilder. - */ - public ManagedIdentityClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - /* * The ID of the target subscription. The value must be an UUID. */ @@ -131,7 +115,7 @@ public ManagedIdentityClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); ManagedIdentityClientImpl client = new ManagedIdentityClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId); + localDefaultPollInterval, localEnvironment, this.subscriptionId); return client; } } diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityClientImpl.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityClientImpl.java index 817cf50246..ee35af6cc2 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityClientImpl.java @@ -39,20 +39,6 @@ */ @ServiceClient(builder = ManagedIdentityClientBuilder.class) public final class ManagedIdentityClientImpl implements ManagedIdentityClient { - /** - * Server parameter. - */ - private final String endpoint; - - /** - * Gets Server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - /** * Version parameter. */ @@ -144,15 +130,13 @@ public ManagedIdentityTrackedResourcesClient getManagedIdentityTrackedResources( * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param endpoint Server parameter. * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ ManagedIdentityClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.endpoint = endpoint; this.subscriptionId = subscriptionId; this.apiVersion = "2023-12-01-preview"; this.managedIdentityTrackedResources = new ManagedIdentityTrackedResourcesClientImpl(this); diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityTrackedResourcesClientImpl.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityTrackedResourcesClientImpl.java index cc106bfcbe..a8066cc96b 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityTrackedResourcesClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityTrackedResourcesClientImpl.java @@ -10,7 +10,6 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; @@ -64,34 +63,30 @@ public interface ManagedIdentityTrackedResourcesService { @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.CommonTypes.ManagedIdentity/managedIdentityTrackedResources/{managedIdentityTrackedResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + Mono> getByResourceGroup( @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("managedIdentityTrackedResourceName") String managedIdentityTrackedResourceName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.CommonTypes.ManagedIdentity/managedIdentityTrackedResources/{managedIdentityTrackedResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createWithSystemAssigned( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("managedIdentityTrackedResourceName") String managedIdentityTrackedResourceName, - @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") ManagedIdentityTrackedResourceInner resource, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.CommonTypes.ManagedIdentity/managedIdentityTrackedResources/{managedIdentityTrackedResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> updateWithUserAssignedAndSystemAssigned( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("managedIdentityTrackedResourceName") String managedIdentityTrackedResourceName, - @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") ManagedIdentityTrackedResourceInner properties, Context context); } @@ -103,15 +98,12 @@ Mono> updateWithUserAssignedAndSys * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ManagedIdentityTrackedResource along with {@link Response} on successful completion of {@link Mono}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String managedIdentityTrackedResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -126,9 +118,9 @@ Mono> updateWithUserAssignedAndSys } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, managedIdentityTrackedResourceName, accept, - context)) + .withContext( + context -> service.getByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, managedIdentityTrackedResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -141,15 +133,12 @@ Mono> updateWithUserAssignedAndSys * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ManagedIdentityTrackedResource along with {@link Response} on successful completion of {@link Mono}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( String resourceGroupName, String managedIdentityTrackedResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -164,8 +153,8 @@ private Mono> getByResourceGroupWi } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, managedIdentityTrackedResourceName, accept, context); + return service.getByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, managedIdentityTrackedResourceName, accept, context); } /** @@ -176,7 +165,8 @@ private Mono> getByResourceGroupWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ManagedIdentityTrackedResource on successful completion of {@link Mono}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, @@ -194,7 +184,8 @@ private Mono getByResourceGroupAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ManagedIdentityTrackedResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, @@ -211,7 +202,7 @@ public Response getByResourceGroupWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ManagedIdentityTrackedResource. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. */ @ServiceMethod(returns = ReturnType.SINGLE) public ManagedIdentityTrackedResourceInner getByResourceGroup(String resourceGroupName, @@ -236,10 +227,6 @@ public ManagedIdentityTrackedResourceInner getByResourceGroup(String resourceGro private Mono> createWithSystemAssignedWithResponseAsync( String resourceGroupName, String managedIdentityTrackedResourceName, ManagedIdentityTrackedResourceInner resource) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -257,11 +244,12 @@ private Mono> createWithSystemAssi } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createWithSystemAssigned(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - managedIdentityTrackedResourceName, accept, resource, context)) + .withContext(context -> service.createWithSystemAssigned(this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, managedIdentityTrackedResourceName, contentType, + accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -282,10 +270,6 @@ private Mono> createWithSystemAssi private Mono> createWithSystemAssignedWithResponseAsync( String resourceGroupName, String managedIdentityTrackedResourceName, ManagedIdentityTrackedResourceInner resource, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -303,11 +287,11 @@ private Mono> createWithSystemAssi } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createWithSystemAssigned(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, managedIdentityTrackedResourceName, accept, resource, - context); + return service.createWithSystemAssigned(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, managedIdentityTrackedResourceName, contentType, accept, resource, context); } /** @@ -383,10 +367,6 @@ public ManagedIdentityTrackedResourceInner createWithSystemAssigned(String resou private Mono> updateWithUserAssignedAndSystemAssignedWithResponseAsync(String resourceGroupName, String managedIdentityTrackedResourceName, ManagedIdentityTrackedResourceInner properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -404,11 +384,12 @@ public ManagedIdentityTrackedResourceInner createWithSystemAssigned(String resou } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.updateWithUserAssignedAndSystemAssigned(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - managedIdentityTrackedResourceName, accept, properties, context)) + .withContext(context -> service.updateWithUserAssignedAndSystemAssigned(this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, managedIdentityTrackedResourceName, contentType, + accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -430,10 +411,6 @@ public ManagedIdentityTrackedResourceInner createWithSystemAssigned(String resou updateWithUserAssignedAndSystemAssignedWithResponseAsync(String resourceGroupName, String managedIdentityTrackedResourceName, ManagedIdentityTrackedResourceInner properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -451,11 +428,12 @@ public ManagedIdentityTrackedResourceInner createWithSystemAssigned(String resou } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.updateWithUserAssignedAndSystemAssigned(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, managedIdentityTrackedResourceName, accept, properties, - context); + return service.updateWithUserAssignedAndSystemAssigned(this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, managedIdentityTrackedResourceName, contentType, accept, + properties, context); } /** diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/models/ManagedIdentityTrackedResources.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/models/ManagedIdentityTrackedResources.java index 47029516e9..1c281601e9 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/models/ManagedIdentityTrackedResources.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/models/ManagedIdentityTrackedResources.java @@ -20,7 +20,8 @@ public interface ManagedIdentityTrackedResources { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ManagedIdentityTrackedResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ Response getByResourceGroupWithResponse(String resourceGroupName, String managedIdentityTrackedResourceName, Context context); @@ -33,7 +34,7 @@ Response getByResourceGroupWithResponse(String r * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ManagedIdentityTrackedResource. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. */ ManagedIdentityTrackedResource getByResourceGroup(String resourceGroupName, String managedIdentityTrackedResourceName); @@ -45,7 +46,8 @@ ManagedIdentityTrackedResource getByResourceGroup(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ManagedIdentityTrackedResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ ManagedIdentityTrackedResource getById(String id); @@ -57,7 +59,8 @@ ManagedIdentityTrackedResource getByResourceGroup(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ManagedIdentityTrackedResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/NestedProxyResourcesClientImpl.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/NestedProxyResourcesClientImpl.java index f51f2eaa59..ff4e29da9b 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/NestedProxyResourcesClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/NestedProxyResourcesClientImpl.java @@ -11,7 +11,6 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; @@ -75,44 +74,44 @@ public interface NestedProxyResourcesService { @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}/nestedProxyResources/{nextedProxyResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> get(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("accept") String accept, + @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}/nestedProxyResources/{nextedProxyResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrReplace(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrReplace(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("accept") String accept, + @PathParam("nextedProxyResourceName") String nextedProxyResourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") NestedProxyResourceInner resource, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}/nestedProxyResources/{nextedProxyResourceName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("accept") String accept, + @PathParam("nextedProxyResourceName") String nextedProxyResourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") NestedProxyResourceInner properties, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}/nestedProxyResources/{nextedProxyResourceName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("accept") String accept, + @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -120,19 +119,18 @@ Mono>> delete(@HostParam("endpoint") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTopLevelTrackedResource( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTopLevelTrackedResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, + Context context); } /** @@ -144,15 +142,12 @@ Mono> listByTopLevelTrackedResourceNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource along with {@link Response} on successful completion of {@link Mono}. + * @return nested child of Top Level Tracked Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -171,9 +166,8 @@ private Mono> getWithResponseAsync(String res } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, - nextedProxyResourceName, accept, context)) + .withContext(context -> service.get(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -187,15 +181,12 @@ private Mono> getWithResponseAsync(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource along with {@link Response} on successful completion of {@link Mono}. + * @return nested child of Top Level Tracked Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -214,8 +205,8 @@ private Mono> getWithResponseAsync(String res } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, accept, context); + return service.get(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelTrackedResourceName, nextedProxyResourceName, accept, context); } /** @@ -227,7 +218,7 @@ private Mono> getWithResponseAsync(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource on successful completion of {@link Mono}. + * @return nested child of Top Level Tracked Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String topLevelTrackedResourceName, @@ -246,7 +237,7 @@ private Mono getAsync(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource along with {@link Response}. + * @return nested child of Top Level Tracked Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, @@ -264,7 +255,7 @@ public Response getWithResponse(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NestedProxyResource. + * @return nested child of Top Level Tracked Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) public NestedProxyResourceInner get(String resourceGroupName, String topLevelTrackedResourceName, @@ -289,10 +280,6 @@ public NestedProxyResourceInner get(String resourceGroupName, String topLevelTra @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, NestedProxyResourceInner resource) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -314,11 +301,12 @@ private Mono>> createOrReplaceWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.createOrReplace(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, - nextedProxyResourceName, accept, resource, context)) + nextedProxyResourceName, contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -340,10 +328,6 @@ private Mono>> createOrReplaceWithResponseAsync(String private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, NestedProxyResourceInner resource, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -365,11 +349,11 @@ private Mono>> createOrReplaceWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, - accept, resource, context); + return service.createOrReplace(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelTrackedResourceName, nextedProxyResourceName, contentType, accept, resource, context); } /** @@ -559,10 +543,6 @@ public NestedProxyResourceInner createOrReplace(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, NestedProxyResourceInner properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -584,11 +564,12 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, - nextedProxyResourceName, accept, properties, context)) + .withContext(context -> service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, contentType, accept, + properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -610,10 +591,6 @@ private Mono>> updateWithResponseAsync(String resource private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, NestedProxyResourceInner properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -635,10 +612,11 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, accept, properties, context); + return service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelTrackedResourceName, nextedProxyResourceName, contentType, accept, properties, context); } /** @@ -824,10 +802,6 @@ public NestedProxyResourceInner update(String resourceGroupName, String topLevel @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -846,9 +820,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, - nextedProxyResourceName, accept, context)) + .withContext(context -> service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -867,10 +840,6 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -889,8 +858,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, accept, context); + return service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelTrackedResourceName, nextedProxyResourceName, accept, context); } /** @@ -1055,10 +1024,6 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelTrackedResourceSinglePageAsync(String resourceGroupName, String topLevelTrackedResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1073,9 +1038,8 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByTopLevelTrackedResource(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context)) + .withContext(context -> service.listByTopLevelTrackedResource(this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1096,10 +1060,6 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelTrackedResourceSinglePageAsync( String resourceGroupName, String topLevelTrackedResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1115,8 +1075,8 @@ private Mono> listByTopLevelTrackedResou final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByTopLevelTrackedResource(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context) + .listByTopLevelTrackedResource(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1193,6 +1153,8 @@ public PagedIterable listByTopLevelTrackedResource(Str } /** + * List NestedProxyResource resources by TopLevelTrackedResource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1208,19 +1170,16 @@ public PagedIterable listByTopLevelTrackedResource(Str if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listByTopLevelTrackedResourceNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listByTopLevelTrackedResourceNext(nextLink, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** + * List NestedProxyResource resources by TopLevelTrackedResource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1237,13 +1196,9 @@ public PagedIterable listByTopLevelTrackedResource(Str if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByTopLevelTrackedResourceNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listByTopLevelTrackedResourceNext(nextLink, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java index 7ff0863c72..a67373b73b 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java @@ -11,7 +11,6 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; @@ -75,76 +74,73 @@ public interface TopLevelTrackedResourcesService { @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrReplace(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrReplace(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @HeaderParam("accept") String accept, @BodyParam("application/json") TopLevelTrackedResourceInner resource, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") TopLevelTrackedResourceInner resource, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") TopLevelTrackedResourceInner properties, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + Mono> listByResourceGroup( @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("accept") String accept, Context context); + Mono> list(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, + Context context); } /** @@ -155,15 +151,12 @@ Mono> listBySubscriptionNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource along with {@link Response} on successful completion of {@link Mono}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -178,7 +171,7 @@ private Mono> getByResourceGroupWithRespo } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.getByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -192,15 +185,12 @@ private Mono> getByResourceGroupWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource along with {@link Response} on successful completion of {@link Mono}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -215,8 +205,8 @@ private Mono> getByResourceGroupWithRespo } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context); + return service.getByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, accept, context); } /** @@ -227,7 +217,8 @@ private Mono> getByResourceGroupWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource on successful completion of {@link Mono}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, @@ -245,7 +236,8 @@ private Mono getByResourceGroupAsync(String resour * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource along with {@link Response}. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, @@ -261,7 +253,7 @@ public Response getByResourceGroupWithResponse(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TopLevelTrackedResource. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. */ @ServiceMethod(returns = ReturnType.SINGLE) public TopLevelTrackedResourceInner getByResourceGroup(String resourceGroupName, @@ -284,10 +276,6 @@ public TopLevelTrackedResourceInner getByResourceGroup(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, TopLevelTrackedResourceInner resource) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -305,11 +293,12 @@ private Mono>> createOrReplaceWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, resource, - context)) + .withContext( + context -> service.createOrReplace(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -329,10 +318,6 @@ private Mono>> createOrReplaceWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, TopLevelTrackedResourceInner resource, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -350,10 +335,11 @@ private Mono>> createOrReplaceWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, resource, context); + return service.createOrReplace(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelTrackedResourceName, contentType, accept, resource, context); } /** @@ -532,10 +518,6 @@ public TopLevelTrackedResourceInner createOrReplace(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, TopLevelTrackedResourceInner properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -553,11 +535,11 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, properties, - context)) + .withContext(context -> service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, contentType, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -577,10 +559,6 @@ private Mono>> updateWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, TopLevelTrackedResourceInner properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -598,10 +576,11 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, accept, properties, context); + return service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelTrackedResourceName, contentType, accept, properties, context); } /** @@ -777,10 +756,6 @@ public TopLevelTrackedResourceInner update(String resourceGroupName, String topL @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -795,8 +770,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context)) + .withContext(context -> service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -814,10 +789,6 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -832,8 +803,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, accept, context); + return service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelTrackedResourceName, accept, context); } /** @@ -983,10 +954,6 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -997,7 +964,7 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.listByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -1018,10 +985,6 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1033,8 +996,8 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accept, context) + .listByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1112,18 +1075,14 @@ public PagedIterable listByResourceGroup(String re */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) + .withContext( + context -> service.list(this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1141,19 +1100,13 @@ private Mono> listSinglePageAsync() */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, - context) + return service.list(this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1215,6 +1168,8 @@ public PagedIterable list(Context context) { } /** + * List TopLevelTrackedResource resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1229,20 +1184,16 @@ private Mono> listByResourceGroupNex if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listByResourceGroupNext(nextLink, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** + * List TopLevelTrackedResource resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1259,18 +1210,16 @@ private Mono> listByResourceGroupNex if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listByResourceGroupNext(nextLink, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** + * List TopLevelTrackedResource resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1285,20 +1234,16 @@ private Mono> listBySubscriptionNext if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listBySubscriptionNext(nextLink, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** + * List TopLevelTrackedResource resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1315,13 +1260,9 @@ private Mono> listBySubscriptionNext if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listBySubscriptionNext(nextLink, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildExtensionResourceInterfacesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildExtensionResourceInterfacesClientImpl.java index 9acc1ad080..39d51f5e74 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildExtensionResourceInterfacesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildExtensionResourceInterfacesClientImpl.java @@ -11,7 +11,6 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; @@ -76,52 +75,49 @@ public interface ChildExtensionResourceInterfacesService { @Get("/{resourceUri}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childExtensionResources/{childExtensionResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, + Mono> get(@QueryParam("api-version") String apiVersion, + @PathParam("resourceUri") String resourceUri, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @PathParam("childExtensionResourceName") String childExtensionResourceName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/{resourceUri}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childExtensionResources/{childExtensionResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, + Mono>> createOrUpdate(@QueryParam("api-version") String apiVersion, + @PathParam("resourceUri") String resourceUri, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @PathParam("childExtensionResourceName") String childExtensionResourceName, - @HeaderParam("accept") String accept, @BodyParam("application/json") ChildExtensionResourceInner resource, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ChildExtensionResourceInner resource, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/{resourceUri}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childExtensionResources/{childExtensionResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, + Mono> update(@QueryParam("api-version") String apiVersion, + @PathParam("resourceUri") String resourceUri, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @PathParam("childExtensionResourceName") String childExtensionResourceName, - @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") ChildExtensionResourceUpdate properties, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/{resourceUri}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childExtensionResources/{childExtensionResourceName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, + Mono>> delete(@QueryParam("api-version") String apiVersion, + @PathParam("resourceUri") String resourceUri, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @PathParam("childExtensionResourceName") String childExtensionResourceName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childExtensionResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTopLevelArmResource( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("resourceUri") String resourceUri, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, + @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -129,8 +125,8 @@ Mono> listByTopLevelArmResource( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTopLevelArmResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, + Context context); } /** @@ -142,15 +138,12 @@ Mono> listByTopLevelArmResourceNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource along with {@link Response} on successful completion of {@link Mono}. + * @return extensionResource of Top Level Arm Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -164,8 +157,8 @@ private Mono> getWithResponseAsync(String } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - topLevelArmResourceName, childExtensionResourceName, accept, context)) + .withContext(context -> service.get(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, + childExtensionResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -179,15 +172,12 @@ private Mono> getWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource along with {@link Response} on successful completion of {@link Mono}. + * @return extensionResource of Top Level Arm Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -201,7 +191,7 @@ private Mono> getWithResponseAsync(String } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, topLevelArmResourceName, + return service.get(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, childExtensionResourceName, accept, context); } @@ -214,7 +204,7 @@ private Mono> getWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource on successful completion of {@link Mono}. + * @return extensionResource of Top Level Arm Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceUri, String topLevelArmResourceName, @@ -233,7 +223,7 @@ private Mono getAsync(String resourceUri, String to * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource along with {@link Response}. + * @return extensionResource of Top Level Arm Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceUri, String topLevelArmResourceName, @@ -250,7 +240,7 @@ public Response getWithResponse(String resourceUri, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildExtensionResource. + * @return extensionResource of Top Level Arm Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) public ChildExtensionResourceInner get(String resourceUri, String topLevelArmResourceName, @@ -275,10 +265,6 @@ public ChildExtensionResourceInner get(String resourceUri, String topLevelArmRes @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, ChildExtensionResourceInner resource) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -295,10 +281,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - resourceUri, topLevelArmResourceName, childExtensionResourceName, accept, resource, context)) + .withContext(context -> service.createOrUpdate(this.client.getApiVersion(), resourceUri, + topLevelArmResourceName, childExtensionResourceName, contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -320,10 +307,6 @@ private Mono>> createOrUpdateWithResponseAsync(String private Mono>> createOrUpdateWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, ChildExtensionResourceInner resource, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -340,10 +323,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - topLevelArmResourceName, childExtensionResourceName, accept, resource, context); + return service.createOrUpdate(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, + childExtensionResourceName, contentType, accept, resource, context); } /** @@ -531,10 +515,6 @@ public ChildExtensionResourceInner createOrUpdate(String resourceUri, String top @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, ChildExtensionResourceUpdate properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -551,10 +531,11 @@ private Mono> updateWithResponseAsync(Stri } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - topLevelArmResourceName, childExtensionResourceName, accept, properties, context)) + .withContext(context -> service.update(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, + childExtensionResourceName, contentType, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -576,10 +557,6 @@ private Mono> updateWithResponseAsync(Stri private Mono> updateWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, ChildExtensionResourceUpdate properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -596,10 +573,11 @@ private Mono> updateWithResponseAsync(Stri } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - topLevelArmResourceName, childExtensionResourceName, accept, properties, context); + return service.update(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, + childExtensionResourceName, contentType, accept, properties, context); } /** @@ -674,10 +652,6 @@ public ChildExtensionResourceInner update(String resourceUri, String topLevelArm @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -691,8 +665,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - topLevelArmResourceName, childExtensionResourceName, accept, context)) + .withContext(context -> service.delete(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, + childExtensionResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -711,10 +685,6 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -728,8 +698,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - topLevelArmResourceName, childExtensionResourceName, accept, context); + return service.delete(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, + childExtensionResourceName, accept, context); } /** @@ -893,10 +863,6 @@ public void delete(String resourceUri, String topLevelArmResourceName, String ch @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelArmResourceSinglePageAsync(String resourceUri, String topLevelArmResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -906,8 +872,8 @@ public void delete(String resourceUri, String topLevelArmResourceName, String ch } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByTopLevelArmResource(this.client.getEndpoint(), - this.client.getApiVersion(), resourceUri, topLevelArmResourceName, accept, context)) + .withContext(context -> service.listByTopLevelArmResource(this.client.getApiVersion(), resourceUri, + topLevelArmResourceName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -928,10 +894,6 @@ public void delete(String resourceUri, String topLevelArmResourceName, String ch @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelArmResourceSinglePageAsync(String resourceUri, String topLevelArmResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -942,8 +904,8 @@ public void delete(String resourceUri, String topLevelArmResourceName, String ch final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByTopLevelArmResource(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - topLevelArmResourceName, accept, context) + .listByTopLevelArmResource(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, accept, + context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1018,6 +980,8 @@ public PagedIterable listByTopLevelArmResource(Stri } /** + * List ChildExtensionResource resources by TopLevelArmResource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1033,20 +997,16 @@ public PagedIterable listByTopLevelArmResource(Stri if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByTopLevelArmResourceNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listByTopLevelArmResourceNext(nextLink, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** + * List ChildExtensionResource resources by TopLevelArmResource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1063,13 +1023,9 @@ public PagedIterable listByTopLevelArmResource(Stri if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByTopLevelArmResourceNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listByTopLevelArmResourceNext(nextLink, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java index ecbd02657b..b67637983d 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java @@ -11,7 +11,6 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Post; @@ -77,65 +76,65 @@ public interface ChildResourcesInterfacesService { @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources/{childResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> get(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("accept") String accept, + @PathParam("childResourceName") String childResourceName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources/{childResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("accept") String accept, - @BodyParam("application/json") ChildResourceInner resource, Context context); + @PathParam("childResourceName") String childResourceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ChildResourceInner resource, + Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources/{childResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> update(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("accept") String accept, - @BodyParam("application/json") ChildResourceUpdate properties, Context context); + @PathParam("childResourceName") String childResourceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ChildResourceUpdate properties, + Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources/{childResourceName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("accept") String accept, + @PathParam("childResourceName") String childResourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByTopLevelArmResource(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> listByTopLevelArmResource(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("accept") String accept, + @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources/{childResourceName}/actionWithoutBody") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> actionWithoutBody(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono>> actionWithoutBody(@QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, - @PathParam("childResourceName") String childResourceName, @HeaderParam("accept") String accept, + @PathParam("childResourceName") String childResourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -143,8 +142,8 @@ Mono>> actionWithoutBody(@HostParam("endpoint") String @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTopLevelArmResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, + Context context); } /** @@ -156,15 +155,12 @@ Mono> listByTopLevelArmResourceNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource along with {@link Response} on successful completion of {@link Mono}. + * @return subresource of Top Level Arm Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -183,9 +179,8 @@ private Mono> getWithResponseAsync(String resourceG } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, - context)) + .withContext(context -> service.get(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, childResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -199,15 +194,12 @@ private Mono> getWithResponseAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource along with {@link Response} on successful completion of {@link Mono}. + * @return subresource of Top Level Arm Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -226,8 +218,8 @@ private Mono> getWithResponseAsync(String resourceG } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, childResourceName, accept, context); + return service.get(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, childResourceName, accept, context); } /** @@ -239,7 +231,7 @@ private Mono> getWithResponseAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource on successful completion of {@link Mono}. + * @return subresource of Top Level Arm Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String topLevelArmResourceName, @@ -258,7 +250,7 @@ private Mono getAsync(String resourceGroupName, String topLe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource along with {@link Response}. + * @return subresource of Top Level Arm Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String topLevelArmResourceName, @@ -275,7 +267,7 @@ public Response getWithResponse(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a ChildResource. + * @return subresource of Top Level Arm Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) public ChildResourceInner get(String resourceGroupName, String topLevelArmResourceName, String childResourceName) { @@ -298,10 +290,6 @@ public ChildResourceInner get(String resourceGroupName, String topLevelArmResour @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, ChildResourceInner resource) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -323,11 +311,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, - resource, context)) + .withContext(context -> service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, childResourceName, contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -348,10 +336,6 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, ChildResourceInner resource, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -373,11 +357,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, - resource, context); + return service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, childResourceName, contentType, accept, resource, context); } /** @@ -559,10 +543,6 @@ public ChildResourceInner createOrUpdate(String resourceGroupName, String topLev @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, ChildResourceUpdate properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -584,11 +564,12 @@ private Mono> updateWithResponseAsync(String resour } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, - properties, context)) + .withContext(context -> service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, childResourceName, contentType, accept, properties, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -609,10 +590,6 @@ private Mono> updateWithResponseAsync(String resour @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, ChildResourceUpdate properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -634,10 +611,11 @@ private Mono> updateWithResponseAsync(String resour } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, childResourceName, accept, properties, context); + return service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, childResourceName, contentType, accept, properties, context); } /** @@ -712,10 +690,6 @@ public ChildResourceInner update(String resourceGroupName, String topLevelArmRes @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -734,9 +708,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, - context)) + .withContext(context -> service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, childResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -755,10 +728,6 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -777,8 +746,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, childResourceName, accept, context); + return service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, childResourceName, accept, context); } /** @@ -941,10 +910,6 @@ public void delete(String resourceGroupName, String topLevelArmResourceName, Str @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelArmResourceSinglePageAsync(String resourceGroupName, String topLevelArmResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -959,9 +924,8 @@ private Mono> listByTopLevelArmResourceSingleP } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByTopLevelArmResource(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context)) + .withContext(context -> service.listByTopLevelArmResource(this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -982,10 +946,6 @@ private Mono> listByTopLevelArmResourceSingleP @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelArmResourceSinglePageAsync(String resourceGroupName, String topLevelArmResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1001,8 +961,8 @@ private Mono> listByTopLevelArmResourceSingleP final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByTopLevelArmResource(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context) + .listByTopLevelArmResource(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + topLevelArmResourceName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1091,10 +1051,6 @@ public PagedIterable listByTopLevelArmResource(String resour @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> actionWithoutBodyWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1113,9 +1069,9 @@ private Mono>> actionWithoutBodyWithResponseAsync(Stri } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.actionWithoutBody(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, - context)) + .withContext( + context -> service.actionWithoutBody(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, childResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1134,10 +1090,6 @@ private Mono>> actionWithoutBodyWithResponseAsync(Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> actionWithoutBodyWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1156,9 +1108,8 @@ private Mono>> actionWithoutBodyWithResponseAsync(Stri } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.actionWithoutBody(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, - context); + return service.actionWithoutBody(this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, childResourceName, accept, context); } /** @@ -1311,6 +1262,8 @@ public void actionWithoutBody(String resourceGroupName, String topLevelArmResour } /** + * List ChildResource resources by TopLevelArmResource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1325,20 +1278,16 @@ private Mono> listByTopLevelArmResourceNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByTopLevelArmResourceNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listByTopLevelArmResourceNext(nextLink, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** + * List ChildResource resources by TopLevelArmResource + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1355,13 +1304,9 @@ private Mono> listByTopLevelArmResourceNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByTopLevelArmResourceNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listByTopLevelArmResourceNext(nextLink, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/CustomTemplateResourceInterfacesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/CustomTemplateResourceInterfacesClientImpl.java index 39dd40eb5f..b8a6f254ec 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/CustomTemplateResourceInterfacesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/CustomTemplateResourceInterfacesClientImpl.java @@ -60,7 +60,7 @@ public final class CustomTemplateResourceInterfacesClientImpl implements CustomT * The interface defining all the services for ArmResourceProviderClientCustomTemplateResourceInterfaces to be used * by the proxy service to perform REST calls. */ - @Host("https://management.azure.com") + @Host("{endpoint}") @ServiceInterface(name = "ArmResourceProviderC") public interface CustomTemplateResourceInterfacesService { @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/customTemplateResources/{customTemplateResourceName}") diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/OperationsClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/OperationsClientImpl.java index 617d380ddd..a7978429e9 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/OperationsClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/OperationsClientImpl.java @@ -58,7 +58,7 @@ public final class OperationsClientImpl implements OperationsClient { * The interface defining all the services for ArmResourceProviderClientOperations to be used by the proxy service * to perform REST calls. */ - @Host("https://management.azure.com") + @Host("{endpoint}") @ServiceInterface(name = "ArmResourceProviderC") public interface OperationsService { @Headers({ "Content-Type: application/json" }) diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java index 602ccd66dd..bf2c298339 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java @@ -70,7 +70,7 @@ public final class TopLevelArmResourceInterfacesClientImpl implements TopLevelAr * The interface defining all the services for ArmResourceProviderClientTopLevelArmResourceInterfaces to be used by * the proxy service to perform REST calls. */ - @Host("https://management.azure.com") + @Host("{endpoint}") @ServiceInterface(name = "ArmResourceProviderC") public interface TopLevelArmResourceInterfacesService { @Headers({ "Content-Type: application/json" }) diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java index e62b2f2549..0ff1a6c2fd 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java @@ -52,7 +52,7 @@ public final class FishesClientImpl implements FishesClient { * The interface defining all the services for ArmStreamStyleSerializationClientFishes to be used by the proxy * service to perform REST calls. */ - @Host("https://management.azure.com") + @Host("{endpoint}") @ServiceInterface(name = "ArmStreamStyleSerial") public interface FishesService { @Headers({ "Content-Type: application/json" }) diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/TopLevelArmResourcesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/TopLevelArmResourcesClientImpl.java index 32ab73105b..0f0cbba748 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/TopLevelArmResourcesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/TopLevelArmResourcesClientImpl.java @@ -59,7 +59,7 @@ public final class TopLevelArmResourcesClientImpl implements TopLevelArmResource * The interface defining all the services for ArmStreamStyleSerializationClientTopLevelArmResources to be used by * the proxy service to perform REST calls. */ - @Host("https://management.azure.com") + @Host("{endpoint}") @ServiceInterface(name = "ArmStreamStyleSerial") public interface TopLevelArmResourcesService { @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmStreamStyleSerialization/topLevelArmResources/{topLevelArmResourceName}") diff --git a/typespec-tests/src/main/java/com/cadl/flatten/implementation/models/SendLongRequest.java b/typespec-tests/src/main/java/com/cadl/flatten/implementation/models/SendLongRequest.java index a54496adac..9b55f3f82f 100644 --- a/typespec-tests/src/main/java/com/cadl/flatten/implementation/models/SendLongRequest.java +++ b/typespec-tests/src/main/java/com/cadl/flatten/implementation/models/SendLongRequest.java @@ -10,7 +10,7 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.cadl.flatten.models.TodoItemStatus; +import com.cadl.flatten.models.SendLongRequestStatus; import com.cadl.flatten.models.User; import java.io.IOException; @@ -71,7 +71,7 @@ public final class SendLongRequest implements JsonSerializable * The status of the todo item */ @Generated - private final TodoItemStatus status; + private final SendLongRequestStatus status; /* * The _dummy property. @@ -94,7 +94,7 @@ public final class SendLongRequest implements JsonSerializable * @param status the status value to set. */ @Generated - public SendLongRequest(String input, int dataInt, String title, TodoItemStatus status) { + public SendLongRequest(String input, int dataInt, String title, SendLongRequestStatus status) { this.input = input; this.dataInt = dataInt; this.title = title; @@ -247,7 +247,7 @@ public SendLongRequest setDescription(String description) { * @return the status value. */ @Generated - public TodoItemStatus getStatus() { + public SendLongRequestStatus getStatus() { return this.status; } @@ -319,7 +319,7 @@ public static SendLongRequest fromJson(JsonReader jsonReader) throws IOException String input = null; int dataInt = 0; String title = null; - TodoItemStatus status = null; + SendLongRequestStatus status = null; User user = null; Integer dataIntOptional = null; Long dataLong = null; @@ -337,7 +337,7 @@ public static SendLongRequest fromJson(JsonReader jsonReader) throws IOException } else if ("title".equals(fieldName)) { title = reader.getString(); } else if ("status".equals(fieldName)) { - status = TodoItemStatus.fromString(reader.getString()); + status = SendLongRequestStatus.fromString(reader.getString()); } else if ("user".equals(fieldName)) { user = User.fromJson(reader); } else if ("dataIntOptional".equals(fieldName)) { diff --git a/typespec-tests/src/main/java/com/cadl/flatten/implementation/models/UploadTodoRequest.java b/typespec-tests/src/main/java/com/cadl/flatten/implementation/models/UploadTodoRequest.java index 4ea65b1663..a1b964c195 100644 --- a/typespec-tests/src/main/java/com/cadl/flatten/implementation/models/UploadTodoRequest.java +++ b/typespec-tests/src/main/java/com/cadl/flatten/implementation/models/UploadTodoRequest.java @@ -6,7 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.cadl.flatten.models.TodoItemStatus; +import com.cadl.flatten.models.SendLongRequestStatus; /** * The UploadTodoRequest model. @@ -29,7 +29,7 @@ public final class UploadTodoRequest { * The status of the todo item */ @Generated - private final TodoItemStatus status; + private final SendLongRequestStatus status; /* * The _dummy property. @@ -62,7 +62,7 @@ public final class UploadTodoRequest { * @param status the status value to set. */ @Generated - public UploadTodoRequest(String title, TodoItemStatus status) { + public UploadTodoRequest(String title, SendLongRequestStatus status) { this.title = title; this.status = status; } @@ -105,7 +105,7 @@ public UploadTodoRequest setDescription(String description) { * @return the status value. */ @Generated - public TodoItemStatus getStatus() { + public SendLongRequestStatus getStatus() { return this.status; } diff --git a/typespec-tests/src/main/java/com/cadl/flatten/models/SendLongOptions.java b/typespec-tests/src/main/java/com/cadl/flatten/models/SendLongOptions.java index e0ba60feeb..bcf385491b 100644 --- a/typespec-tests/src/main/java/com/cadl/flatten/models/SendLongOptions.java +++ b/typespec-tests/src/main/java/com/cadl/flatten/models/SendLongOptions.java @@ -76,7 +76,7 @@ public final class SendLongOptions { * The status of the todo item */ @Generated - private final TodoItemStatus status; + private final SendLongRequestStatus status; /* * The _dummy property. @@ -94,7 +94,7 @@ public final class SendLongOptions { * @param status the status value to set. */ @Generated - public SendLongOptions(String name, String input, int dataInt, String title, TodoItemStatus status) { + public SendLongOptions(String name, String input, int dataInt, String title, SendLongRequestStatus status) { this.name = name; this.input = input; this.dataInt = dataInt; @@ -280,7 +280,7 @@ public SendLongOptions setDescription(String description) { * @return the status value. */ @Generated - public TodoItemStatus getStatus() { + public SendLongRequestStatus getStatus() { return this.status; } diff --git a/typespec-tests/src/main/java/com/cadl/flatten/models/TodoItemStatus.java b/typespec-tests/src/main/java/com/cadl/flatten/models/SendLongRequestStatus.java similarity index 62% rename from typespec-tests/src/main/java/com/cadl/flatten/models/TodoItemStatus.java rename to typespec-tests/src/main/java/com/cadl/flatten/models/SendLongRequestStatus.java index dd5546b06d..774868e924 100644 --- a/typespec-tests/src/main/java/com/cadl/flatten/models/TodoItemStatus.java +++ b/typespec-tests/src/main/java/com/cadl/flatten/models/SendLongRequestStatus.java @@ -5,9 +5,9 @@ package com.cadl.flatten.models; /** - * Defines values for TodoItemStatus. + * Defines values for SendLongRequestStatus. */ -public enum TodoItemStatus { +public enum SendLongRequestStatus { /** * Enum value NotStarted. */ @@ -24,26 +24,26 @@ public enum TodoItemStatus { COMPLETED("Completed"); /** - * The actual serialized value for a TodoItemStatus instance. + * The actual serialized value for a SendLongRequestStatus instance. */ private final String value; - TodoItemStatus(String value) { + SendLongRequestStatus(String value) { this.value = value; } /** - * Parses a serialized value to a TodoItemStatus instance. + * Parses a serialized value to a SendLongRequestStatus instance. * * @param value the serialized value to parse. - * @return the parsed TodoItemStatus object, or null if unable to parse. + * @return the parsed SendLongRequestStatus object, or null if unable to parse. */ - public static TodoItemStatus fromString(String value) { + public static SendLongRequestStatus fromString(String value) { if (value == null) { return null; } - TodoItemStatus[] items = TodoItemStatus.values(); - for (TodoItemStatus item : items) { + SendLongRequestStatus[] items = SendLongRequestStatus.values(); + for (SendLongRequestStatus item : items) { if (item.toString().equalsIgnoreCase(value)) { return item; } diff --git a/typespec-tests/src/main/java/com/cadl/flatten/models/TodoItem.java b/typespec-tests/src/main/java/com/cadl/flatten/models/TodoItem.java index 3d4fd03727..d3b4ec61f8 100644 --- a/typespec-tests/src/main/java/com/cadl/flatten/models/TodoItem.java +++ b/typespec-tests/src/main/java/com/cadl/flatten/models/TodoItem.java @@ -41,7 +41,7 @@ public final class TodoItem implements JsonSerializable { * The status of the todo item */ @Generated - private final TodoItemStatus status; + private final SendLongRequestStatus status; /* * When the todo item was created. @@ -74,7 +74,7 @@ public final class TodoItem implements JsonSerializable { * @param status the status value to set. */ @Generated - private TodoItem(String title, TodoItemStatus status) { + private TodoItem(String title, SendLongRequestStatus status) { this.title = title; this.status = status; } @@ -115,7 +115,7 @@ public String getDescription() { * @return the status value. */ @Generated - public TodoItemStatus getStatus() { + public SendLongRequestStatus getStatus() { return this.status; } @@ -187,7 +187,7 @@ public static TodoItem fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { long id = 0L; String title = null; - TodoItemStatus status = null; + SendLongRequestStatus status = null; OffsetDateTime createdAt = null; OffsetDateTime updatedAt = null; String description = null; @@ -202,7 +202,7 @@ public static TodoItem fromJson(JsonReader jsonReader) throws IOException { } else if ("title".equals(fieldName)) { title = reader.getString(); } else if ("status".equals(fieldName)) { - status = TodoItemStatus.fromString(reader.getString()); + status = SendLongRequestStatus.fromString(reader.getString()); } else if ("createdAt".equals(fieldName)) { createdAt = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); diff --git a/typespec-tests/src/main/java/com/cadl/flatten/models/UploadTodoOptions.java b/typespec-tests/src/main/java/com/cadl/flatten/models/UploadTodoOptions.java index e61bcb6023..f05e56c243 100644 --- a/typespec-tests/src/main/java/com/cadl/flatten/models/UploadTodoOptions.java +++ b/typespec-tests/src/main/java/com/cadl/flatten/models/UploadTodoOptions.java @@ -28,7 +28,7 @@ public final class UploadTodoOptions { * The status of the todo item */ @Generated - private final TodoItemStatus status; + private final SendLongRequestStatus status; /* * The _dummy property. @@ -61,7 +61,7 @@ public final class UploadTodoOptions { * @param status the status value to set. */ @Generated - public UploadTodoOptions(String title, TodoItemStatus status) { + public UploadTodoOptions(String title, SendLongRequestStatus status) { this.title = title; this.status = status; } @@ -104,7 +104,7 @@ public UploadTodoOptions setDescription(String description) { * @return the status value. */ @Generated - public TodoItemStatus getStatus() { + public SendLongRequestStatus getStatus() { return this.status; } diff --git a/typespec-tests/src/main/java/com/cadl/protocolandconvenient/ProtocolAndConvenientAsyncClient.java b/typespec-tests/src/main/java/com/cadl/protocolandconvenient/ProtocolAndConvenientAsyncClient.java index 3822cd98a1..52ed37be78 100644 --- a/typespec-tests/src/main/java/com/cadl/protocolandconvenient/ProtocolAndConvenientAsyncClient.java +++ b/typespec-tests/src/main/java/com/cadl/protocolandconvenient/ProtocolAndConvenientAsyncClient.java @@ -338,10 +338,10 @@ public PagedFlux list() { // Generated convenience method for list RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = list(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() diff --git a/typespec-tests/src/main/java/com/cadl/response/ResponseAsyncClient.java b/typespec-tests/src/main/java/com/cadl/response/ResponseAsyncClient.java index 5c2b7a571d..7eddb6844c 100644 --- a/typespec-tests/src/main/java/com/cadl/response/ResponseAsyncClient.java +++ b/typespec-tests/src/main/java/com/cadl/response/ResponseAsyncClient.java @@ -450,10 +450,10 @@ public PagedFlux listStrings() { // Generated convenience method for listStrings RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = listStrings(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -480,10 +480,10 @@ public PagedFlux listIntegers() { // Generated convenience method for listIntegers RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = listIntegers(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() diff --git a/typespec-tests/src/main/java/com/cadl/specialheaders/EtagHeadersAsyncClient.java b/typespec-tests/src/main/java/com/cadl/specialheaders/EtagHeadersAsyncClient.java index c32a81e9ba..df0a0267d5 100644 --- a/typespec-tests/src/main/java/com/cadl/specialheaders/EtagHeadersAsyncClient.java +++ b/typespec-tests/src/main/java/com/cadl/specialheaders/EtagHeadersAsyncClient.java @@ -323,10 +323,10 @@ public PagedFlux listWithEtag() { // Generated convenience method for listWithEtag RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = listWithEtag(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() diff --git a/typespec-tests/src/main/java/com/cadl/versioning/VersioningAsyncClient.java b/typespec-tests/src/main/java/com/cadl/versioning/VersioningAsyncClient.java index d7016ff8b4..5050cafeea 100644 --- a/typespec-tests/src/main/java/com/cadl/versioning/VersioningAsyncClient.java +++ b/typespec-tests/src/main/java/com/cadl/versioning/VersioningAsyncClient.java @@ -233,10 +233,10 @@ public PagedFlux list(List select, String expand) { requestOptions.addQueryParam("expand", expand, false); } PagedFlux pagedFluxResponse = list(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -263,10 +263,10 @@ public PagedFlux list() { // Generated convenience method for list RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = list(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() diff --git a/typespec-tests/src/main/java/com/payload/pageable/PageableAsyncClient.java b/typespec-tests/src/main/java/com/payload/pageable/PageableAsyncClient.java index 8ccb1f5ac4..1aab73bd48 100644 --- a/typespec-tests/src/main/java/com/payload/pageable/PageableAsyncClient.java +++ b/typespec-tests/src/main/java/com/payload/pageable/PageableAsyncClient.java @@ -86,10 +86,10 @@ public PagedFlux list() { // Generated convenience method for list RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = list(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() diff --git a/typespec-tests/src/main/java/com/type/model/visibility/implementation/VisibilityClientImpl.java b/typespec-tests/src/main/java/com/type/model/visibility/implementation/VisibilityClientImpl.java index e8074e6cf1..c1d9aec0b1 100644 --- a/typespec-tests/src/main/java/com/type/model/visibility/implementation/VisibilityClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/visibility/implementation/VisibilityClientImpl.java @@ -225,8 +225,9 @@ Response deleteModelSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putReadOnlyModel(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> putReadOnlyModel(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Put("/type/model/visibility/readonlyroundtrip") @ExpectedResponses({ 200 }) @@ -234,8 +235,9 @@ Mono> putReadOnlyModel(@HeaderParam("accept") String accept @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putReadOnlyModelSync(@HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response putReadOnlyModelSync(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); } /** @@ -697,8 +699,10 @@ public Response deleteModelWithResponse(BinaryData input, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putReadOnlyModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putReadOnlyModel(accept, input, requestOptions, context)); + return FluxUtil + .withContext(context -> service.putReadOnlyModel(contentType, accept, input, requestOptions, context)); } /** @@ -739,7 +743,8 @@ public Mono> putReadOnlyModelWithResponseAsync(BinaryData i */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putReadOnlyModelWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.putReadOnlyModelSync(accept, input, requestOptions, Context.NONE); + return service.putReadOnlyModelSync(contentType, accept, input, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/PlaindateAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/PlaindateAsyncClient.java index 6210590add..294f787275 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/PlaindateAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/PlaindateAsyncClient.java @@ -53,8 +53,7 @@ public final class PlaindateAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with a plaindate property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,8 +76,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with a plaindate property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +140,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with a plaindate property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +159,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with a plaindate property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/PlaindateClient.java b/typespec-tests/src/main/java/com/type/property/optional/PlaindateClient.java index bda2345686..bb1e942e5b 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/PlaindateClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/PlaindateClient.java @@ -51,7 +51,7 @@ public final class PlaindateClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with a plaindate property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with a plaindate property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with a plaindate property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public PlaindateProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with a plaindate property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/PlaintimeAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/PlaintimeAsyncClient.java index 46bdaa531b..1c21f48420 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/PlaintimeAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/PlaintimeAsyncClient.java @@ -53,8 +53,7 @@ public final class PlaintimeAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with a plaintime property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,8 +76,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with a plaintime property along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +140,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model on successful completion of {@link Mono}. + * @return model with a plaintime property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +159,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object on successful completion of {@link Mono}. + * @return model with a plaintime property on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/PlaintimeClient.java b/typespec-tests/src/main/java/com/type/property/optional/PlaintimeClient.java index cb22664ef4..eff17736ca 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/PlaintimeClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/PlaintimeClient.java @@ -51,7 +51,7 @@ public final class PlaintimeClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with a plaintime property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with a plaintime property along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return all properties in the model. + * @return model with a plaintime property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public PlainTimeProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return models that will return the default object. + * @return model with a plaintime property. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/PlaindatesImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/PlaindatesImpl.java index 7ce3f3f2a8..e3853a6d45 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/PlaindatesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/PlaindatesImpl.java @@ -64,7 +64,7 @@ public interface PlaindatesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/plaindate/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/plaindate/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/plaindate/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/plaindate/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/plaindate/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/plaindate/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/plaindate/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,7 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with a plaindate property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +169,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with a plaindate property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,8 +192,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with a plaindate property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -217,7 +215,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with a plaindate property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +243,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -269,8 +267,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -293,8 +291,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -317,7 +315,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/PlaintimesImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/PlaintimesImpl.java index ef47c4f55c..a417730aa3 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/PlaintimesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/PlaintimesImpl.java @@ -64,7 +64,7 @@ public interface PlaintimesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/plaintime/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/plaintime/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/plaintime/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/plaintime/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/plaintime/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/plaintime/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/plaintime/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -146,8 +146,7 @@ Response putDefaultSync(@HeaderParam("accept") String accept, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response} on successful completion - * of {@link Mono}. + * @return model with a plaintime property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +169,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return all properties in the model along with {@link Response}. + * @return model with a plaintime property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,8 +192,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response} on successful completion of - * {@link Mono}. + * @return model with a plaintime property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -217,7 +215,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return models that will return the default object along with {@link Response}. + * @return model with a plaintime property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { @@ -245,8 +243,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -269,8 +267,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -293,8 +291,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -317,7 +315,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSendLong.java b/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSendLong.java index 4a373d51f4..6b6fbdc40d 100644 --- a/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSendLong.java +++ b/typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSendLong.java @@ -8,7 +8,7 @@ import com.cadl.flatten.FlattenClient; import com.cadl.flatten.FlattenClientBuilder; import com.cadl.flatten.models.SendLongOptions; -import com.cadl.flatten.models.TodoItemStatus; +import com.cadl.flatten.models.SendLongRequestStatus; import com.cadl.flatten.models.User; public class FlattenOpSendLong { @@ -16,8 +16,8 @@ public static void main(String[] args) { FlattenClient flattenClient = new FlattenClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")).buildClient(); // BEGIN:com.cadl.flatten.generated.sendlong.flattenopsendlong - flattenClient - .sendLong(new SendLongOptions("myRequiredId", "myRequiredInput", 11, "title", TodoItemStatus.NOT_STARTED) + flattenClient.sendLong( + new SendLongOptions("myRequiredId", "myRequiredInput", 11, "title", SendLongRequestStatus.NOT_STARTED) .setFilter("name=myName") .setUser(new User("myOptionalUser")) .setDataIntOptional(12) diff --git a/typespec-tests/src/test/java/com/cadl/flatten/generated/FlattenOpSendLongTests.java b/typespec-tests/src/test/java/com/cadl/flatten/generated/FlattenOpSendLongTests.java index 40b0180e71..7c24c40b4f 100644 --- a/typespec-tests/src/test/java/com/cadl/flatten/generated/FlattenOpSendLongTests.java +++ b/typespec-tests/src/test/java/com/cadl/flatten/generated/FlattenOpSendLongTests.java @@ -5,7 +5,7 @@ package com.cadl.flatten.generated; import com.cadl.flatten.models.SendLongOptions; -import com.cadl.flatten.models.TodoItemStatus; +import com.cadl.flatten.models.SendLongRequestStatus; import com.cadl.flatten.models.User; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -16,8 +16,8 @@ public final class FlattenOpSendLongTests extends FlattenClientTestBase { @Disabled public void testFlattenOpSendLongTests() { // method invocation - flattenClient - .sendLong(new SendLongOptions("myRequiredId", "myRequiredInput", 11, "title", TodoItemStatus.NOT_STARTED) + flattenClient.sendLong( + new SendLongOptions("myRequiredId", "myRequiredInput", 11, "title", SendLongRequestStatus.NOT_STARTED) .setFilter("name=myName") .setUser(new User("myOptionalUser")) .setDataIntOptional(12) From fab83439bbe26307b7b8f67741e077aa093510b3 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Tue, 23 Jul 2024 15:40:33 +0800 Subject: [PATCH 22/90] handle hierarchical client name --- typespec-extension/src/code-model-builder.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 9961450522..435e1b5c4b 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -619,9 +619,9 @@ export class CodeModelBuilder { } // operations under operation groups - const subClients = this.listSubClientsUnderClient(client, true); + const subClients = this.listSubClientsUnderClient(client, true, true); for (const subClient of subClients) { - const serviceMethods = this.listServiceMethodsUnderClient(subClient, true); + const serviceMethods = this.listServiceMethodsUnderClient(subClient, false); // operation group with no operation is skipped if (serviceMethods.length > 0) { // TODO: haoling get name from group path @@ -679,14 +679,17 @@ export class CodeModelBuilder { } } - private listSubClientsUnderClient(client: SdkClientType, includeNestedOperationGroups: boolean): SdkClientType[] { + private listSubClientsUnderClient(client: SdkClientType, includeNestedOperationGroups: boolean, isRootClient: boolean): SdkClientType[] { const operationGroups: SdkClientType[] = []; for (const method of client.methods) { if (method.kind === "clientaccessor") { const subClient = method.response; + if (!isRootClient) { // if it is not root client, append the parent client's name + subClient.name = this.removeClientSuffix(client.name) + this.removeClientSuffix(pascalCase(subClient.name)); + } operationGroups.push(subClient); if (includeNestedOperationGroups) { - for (const operationGroup of this.listSubClientsUnderClient(subClient, includeNestedOperationGroups)) { + for (const operationGroup of this.listSubClientsUnderClient(subClient, includeNestedOperationGroups, false)) { operationGroups.push(operationGroup); } } @@ -713,6 +716,10 @@ export class CodeModelBuilder { return methods; } + private removeClientSuffix(clientName: string): string { + return clientName.endsWith("Client") ? clientName.slice(0, -6) : clientName; + } + // private processClients(): SdkClient[] { // const sdkPackage = this.sdkContext.experimental_sdkPackage; // const clients = listClients(this.sdkContext); From 0af2c5ced902b74eaa3198a2f87df8cdee6e29fb Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Tue, 23 Jul 2024 15:40:55 +0800 Subject: [PATCH 23/90] regen --- .../service/implementation/BarsImpl.java | 27 +++++-------- .../service/implementation/BazFoosImpl.java | 14 +++---- .../implementation/ClientAClientImpl.java | 35 +++++++--------- .../implementation/ClientBClientImpl.java | 37 +++++++---------- .../service/implementation/FoosImpl.java | 27 +++++-------- .../service/implementation/Group1sImpl.java | 40 +++++++------------ .../service/implementation/Group2sImpl.java | 40 +++++++------------ .../service/implementation/GroupsImpl.java | 37 +++++++---------- .../service/implementation/QuxBarsImpl.java | 14 +++---- .../service/implementation/QuxesImpl.java | 14 +++---- .../RenamedOperationClientImpl.java | 35 +++++++--------- .../ServiceClientClientImpl.java | 21 ++++------ 12 files changed, 130 insertions(+), 211 deletions(-) diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/BarsImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/BarsImpl.java index 310679abf4..cbaaebe088 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/BarsImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/BarsImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -62,7 +61,7 @@ public interface BarsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> five(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/five") @ExpectedResponses({ 204 }) @@ -71,7 +70,7 @@ Mono> five(@HostParam("endpoint") String endpoint, @HostParam("cl @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response fiveSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/six") @ExpectedResponses({ 204 }) @@ -80,7 +79,7 @@ Response fiveSync(@HostParam("endpoint") String endpoint, @HostParam("clie @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> six(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/six") @ExpectedResponses({ 204 }) @@ -89,7 +88,7 @@ Mono> six(@HostParam("endpoint") String endpoint, @HostParam("cli @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response sixSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -104,9 +103,8 @@ Response sixSync(@HostParam("endpoint") String endpoint, @HostParam("clien */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fiveWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.five(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.five(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -121,9 +119,7 @@ public Mono> fiveWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fiveWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.fiveSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.fiveSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } /** @@ -138,9 +134,8 @@ public Response fiveWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sixWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.six(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.six(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -155,8 +150,6 @@ public Mono> sixWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sixWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sixSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.sixSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/BazFoosImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/BazFoosImpl.java index 93f545ee85..4fec7b0a1c 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/BazFoosImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/BazFoosImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -62,7 +61,7 @@ public interface BazFoosService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> seven(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/seven") @ExpectedResponses({ 204 }) @@ -71,7 +70,7 @@ Mono> seven(@HostParam("endpoint") String endpoint, @HostParam("c @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response sevenSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -86,9 +85,8 @@ Response sevenSync(@HostParam("endpoint") String endpoint, @HostParam("cli */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sevenWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.seven(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.seven(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -103,8 +101,6 @@ public Mono> sevenWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sevenWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sevenSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.sevenSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/ClientAClientImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/ClientAClientImpl.java index b0d94bf2d0..0522be5c4f 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/ClientAClientImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/ClientAClientImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -147,7 +146,7 @@ public interface ClientAClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedOne(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/one") @ExpectedResponses({ 204 }) @@ -156,7 +155,7 @@ Mono> renamedOne(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedOneSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/three") @ExpectedResponses({ 204 }) @@ -165,7 +164,7 @@ Response renamedOneSync(@HostParam("endpoint") String endpoint, @HostParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedThree(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/three") @ExpectedResponses({ 204 }) @@ -174,7 +173,7 @@ Mono> renamedThree(@HostParam("endpoint") String endpoint, @HostP @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedThreeSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/five") @ExpectedResponses({ 204 }) @@ -183,7 +182,7 @@ Response renamedThreeSync(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedFive(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/five") @ExpectedResponses({ 204 }) @@ -192,7 +191,7 @@ Mono> renamedFive(@HostParam("endpoint") String endpoint, @HostPa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedFiveSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -207,9 +206,8 @@ Response renamedFiveSync(@HostParam("endpoint") String endpoint, @HostPara */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedOneWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.renamedOne(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.renamedOne(this.getEndpoint(), this.getClient(), requestOptions, context)); } /** @@ -224,8 +222,7 @@ public Mono> renamedOneWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedOneWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.renamedOneSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); + return service.renamedOneSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); } /** @@ -240,9 +237,8 @@ public Response renamedOneWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedThreeWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext( - context -> service.renamedThree(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); + context -> service.renamedThree(this.getEndpoint(), this.getClient(), requestOptions, context)); } /** @@ -257,8 +253,7 @@ public Mono> renamedThreeWithResponseAsync(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedThreeWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.renamedThreeSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); + return service.renamedThreeSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); } /** @@ -273,9 +268,8 @@ public Response renamedThreeWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedFiveWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.renamedFive(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.renamedFive(this.getEndpoint(), this.getClient(), requestOptions, context)); } /** @@ -290,7 +284,6 @@ public Mono> renamedFiveWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedFiveWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.renamedFiveSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); + return service.renamedFiveSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/ClientBClientImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/ClientBClientImpl.java index 15a1ba56f1..e52b68219d 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/ClientBClientImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/ClientBClientImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -147,7 +146,7 @@ public interface ClientBClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedTwo(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/two") @ExpectedResponses({ 204 }) @@ -156,7 +155,7 @@ Mono> renamedTwo(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedTwoSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/four") @ExpectedResponses({ 204 }) @@ -165,7 +164,7 @@ Response renamedTwoSync(@HostParam("endpoint") String endpoint, @HostParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedFour(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/four") @ExpectedResponses({ 204 }) @@ -174,7 +173,7 @@ Mono> renamedFour(@HostParam("endpoint") String endpoint, @HostPa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedFourSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/six") @ExpectedResponses({ 204 }) @@ -183,7 +182,7 @@ Response renamedFourSync(@HostParam("endpoint") String endpoint, @HostPara @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedSix(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/six") @ExpectedResponses({ 204 }) @@ -192,7 +191,7 @@ Mono> renamedSix(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedSixSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -207,9 +206,8 @@ Response renamedSixSync(@HostParam("endpoint") String endpoint, @HostParam */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedTwoWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.renamedTwo(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.renamedTwo(this.getEndpoint(), this.getClient(), requestOptions, context)); } /** @@ -224,8 +222,7 @@ public Mono> renamedTwoWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedTwoWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.renamedTwoSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); + return service.renamedTwoSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); } /** @@ -240,9 +237,8 @@ public Response renamedTwoWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedFourWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.renamedFour(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.renamedFour(this.getEndpoint(), this.getClient(), requestOptions, context)); } /** @@ -257,8 +253,7 @@ public Mono> renamedFourWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedFourWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.renamedFourSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); + return service.renamedFourSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); } /** @@ -273,9 +268,8 @@ public Response renamedFourWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedSixWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.renamedSix(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.renamedSix(this.getEndpoint(), this.getClient(), requestOptions, context)); } /** @@ -290,7 +284,6 @@ public Mono> renamedSixWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedSixWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.renamedSixSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); + return service.renamedSixSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/FoosImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/FoosImpl.java index 424e5a6589..e83cf6bf78 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/FoosImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/FoosImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -62,7 +61,7 @@ public interface FoosService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> three(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/three") @ExpectedResponses({ 204 }) @@ -71,7 +70,7 @@ Mono> three(@HostParam("endpoint") String endpoint, @HostParam("c @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response threeSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/four") @ExpectedResponses({ 204 }) @@ -80,7 +79,7 @@ Response threeSync(@HostParam("endpoint") String endpoint, @HostParam("cli @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> four(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/four") @ExpectedResponses({ 204 }) @@ -89,7 +88,7 @@ Mono> four(@HostParam("endpoint") String endpoint, @HostParam("cl @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response fourSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -104,9 +103,8 @@ Response fourSync(@HostParam("endpoint") String endpoint, @HostParam("clie */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> threeWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.three(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.three(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -121,9 +119,7 @@ public Mono> threeWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response threeWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.threeSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.threeSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } /** @@ -138,9 +134,8 @@ public Response threeWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fourWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.four(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.four(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -155,8 +150,6 @@ public Mono> fourWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fourWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.fourSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.fourSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/Group1sImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/Group1sImpl.java index 68238b8d42..bdd1938e5b 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/Group1sImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/Group1sImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -62,7 +61,7 @@ public interface Group1sService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> one(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/one") @ExpectedResponses({ 204 }) @@ -71,7 +70,7 @@ Mono> one(@HostParam("endpoint") String endpoint, @HostParam("cli @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response oneSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/three") @ExpectedResponses({ 204 }) @@ -80,7 +79,7 @@ Response oneSync(@HostParam("endpoint") String endpoint, @HostParam("clien @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> three(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/three") @ExpectedResponses({ 204 }) @@ -89,7 +88,7 @@ Mono> three(@HostParam("endpoint") String endpoint, @HostParam("c @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response threeSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/four") @ExpectedResponses({ 204 }) @@ -98,7 +97,7 @@ Response threeSync(@HostParam("endpoint") String endpoint, @HostParam("cli @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> four(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/four") @ExpectedResponses({ 204 }) @@ -107,7 +106,7 @@ Mono> four(@HostParam("endpoint") String endpoint, @HostParam("cl @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response fourSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -122,9 +121,8 @@ Response fourSync(@HostParam("endpoint") String endpoint, @HostParam("clie */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> oneWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.one(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.one(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -139,9 +137,7 @@ public Mono> oneWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response oneWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.oneSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.oneSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } /** @@ -156,9 +152,8 @@ public Response oneWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> threeWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.three(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.three(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -173,9 +168,7 @@ public Mono> threeWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response threeWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.threeSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.threeSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } /** @@ -190,9 +183,8 @@ public Response threeWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fourWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.four(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.four(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -207,8 +199,6 @@ public Mono> fourWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fourWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.fourSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.fourSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/Group2sImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/Group2sImpl.java index 44db47a66c..01e5b55919 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/Group2sImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/Group2sImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -62,7 +61,7 @@ public interface Group2sService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> two(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/two") @ExpectedResponses({ 204 }) @@ -71,7 +70,7 @@ Mono> two(@HostParam("endpoint") String endpoint, @HostParam("cli @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response twoSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/five") @ExpectedResponses({ 204 }) @@ -80,7 +79,7 @@ Response twoSync(@HostParam("endpoint") String endpoint, @HostParam("clien @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> five(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/five") @ExpectedResponses({ 204 }) @@ -89,7 +88,7 @@ Mono> five(@HostParam("endpoint") String endpoint, @HostParam("cl @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response fiveSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/six") @ExpectedResponses({ 204 }) @@ -98,7 +97,7 @@ Response fiveSync(@HostParam("endpoint") String endpoint, @HostParam("clie @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> six(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/six") @ExpectedResponses({ 204 }) @@ -107,7 +106,7 @@ Mono> six(@HostParam("endpoint") String endpoint, @HostParam("cli @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response sixSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -122,9 +121,8 @@ Response sixSync(@HostParam("endpoint") String endpoint, @HostParam("clien */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> twoWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.two(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.two(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -139,9 +137,7 @@ public Mono> twoWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response twoWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.twoSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.twoSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } /** @@ -156,9 +152,8 @@ public Response twoWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fiveWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.five(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.five(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -173,9 +168,7 @@ public Mono> fiveWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fiveWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.fiveSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.fiveSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } /** @@ -190,9 +183,8 @@ public Response fiveWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sixWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.six(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.six(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -207,8 +199,6 @@ public Mono> sixWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sixWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sixSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.sixSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/GroupsImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/GroupsImpl.java index a2b4164e04..3d53989732 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/GroupsImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/GroupsImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -62,7 +61,7 @@ public interface GroupsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedTwo(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/two") @ExpectedResponses({ 204 }) @@ -71,7 +70,7 @@ Mono> renamedTwo(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedTwoSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/four") @ExpectedResponses({ 204 }) @@ -80,7 +79,7 @@ Response renamedTwoSync(@HostParam("endpoint") String endpoint, @HostParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedFour(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/four") @ExpectedResponses({ 204 }) @@ -89,7 +88,7 @@ Mono> renamedFour(@HostParam("endpoint") String endpoint, @HostPa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedFourSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/six") @ExpectedResponses({ 204 }) @@ -98,7 +97,7 @@ Response renamedFourSync(@HostParam("endpoint") String endpoint, @HostPara @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedSix(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/six") @ExpectedResponses({ 204 }) @@ -107,7 +106,7 @@ Mono> renamedSix(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedSixSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -122,9 +121,8 @@ Response renamedSixSync(@HostParam("endpoint") String endpoint, @HostParam */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedTwoWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.renamedTwo(this.client.getEndpoint(), this.client.getClient(), - accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.renamedTwo(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -139,9 +137,7 @@ public Mono> renamedTwoWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedTwoWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.renamedTwoSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.renamedTwoSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } /** @@ -156,9 +152,8 @@ public Response renamedTwoWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedFourWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext(context -> service.renamedFour(this.client.getEndpoint(), this.client.getClient(), - accept, requestOptions, context)); + requestOptions, context)); } /** @@ -173,8 +168,7 @@ public Mono> renamedFourWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedFourWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.renamedFourSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, + return service.renamedFourSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } @@ -190,9 +184,8 @@ public Response renamedFourWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedSixWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.renamedSix(this.client.getEndpoint(), this.client.getClient(), - accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.renamedSix(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -207,8 +200,6 @@ public Mono> renamedSixWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedSixWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.renamedSixSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.renamedSixSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/QuxBarsImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/QuxBarsImpl.java index 04b716e90d..c1fd91c812 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/QuxBarsImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/QuxBarsImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -62,7 +61,7 @@ public interface QuxBarsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> nine(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/nine") @ExpectedResponses({ 204 }) @@ -71,7 +70,7 @@ Mono> nine(@HostParam("endpoint") String endpoint, @HostParam("cl @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response nineSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -86,9 +85,8 @@ Response nineSync(@HostParam("endpoint") String endpoint, @HostParam("clie */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> nineWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.nine(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.nine(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -103,8 +101,6 @@ public Mono> nineWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response nineWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.nineSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.nineSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/QuxesImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/QuxesImpl.java index 4ef2e29bea..7ef995cdaf 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/QuxesImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/QuxesImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -62,7 +61,7 @@ public interface QuxesService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> eight(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/eight") @ExpectedResponses({ 204 }) @@ -71,7 +70,7 @@ Mono> eight(@HostParam("endpoint") String endpoint, @HostParam("c @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response eightSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -86,9 +85,8 @@ Response eightSync(@HostParam("endpoint") String endpoint, @HostParam("cli */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> eightWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.eight(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.eight(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -103,8 +101,6 @@ public Mono> eightWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response eightWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.eightSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.eightSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/RenamedOperationClientImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/RenamedOperationClientImpl.java index 2c13fe09ce..a0727fb3f3 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/RenamedOperationClientImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/RenamedOperationClientImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -164,7 +163,7 @@ public interface RenamedOperationClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedOne(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/one") @ExpectedResponses({ 204 }) @@ -173,7 +172,7 @@ Mono> renamedOne(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedOneSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/three") @ExpectedResponses({ 204 }) @@ -182,7 +181,7 @@ Response renamedOneSync(@HostParam("endpoint") String endpoint, @HostParam @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedThree(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/three") @ExpectedResponses({ 204 }) @@ -191,7 +190,7 @@ Mono> renamedThree(@HostParam("endpoint") String endpoint, @HostP @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedThreeSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/five") @ExpectedResponses({ 204 }) @@ -200,7 +199,7 @@ Response renamedThreeSync(@HostParam("endpoint") String endpoint, @HostPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> renamedFive(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/five") @ExpectedResponses({ 204 }) @@ -209,7 +208,7 @@ Mono> renamedFive(@HostParam("endpoint") String endpoint, @HostPa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response renamedFiveSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -224,9 +223,8 @@ Response renamedFiveSync(@HostParam("endpoint") String endpoint, @HostPara */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedOneWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.renamedOne(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.renamedOne(this.getEndpoint(), this.getClient(), requestOptions, context)); } /** @@ -241,8 +239,7 @@ public Mono> renamedOneWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedOneWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.renamedOneSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); + return service.renamedOneSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); } /** @@ -257,9 +254,8 @@ public Response renamedOneWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedThreeWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext( - context -> service.renamedThree(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); + context -> service.renamedThree(this.getEndpoint(), this.getClient(), requestOptions, context)); } /** @@ -274,8 +270,7 @@ public Mono> renamedThreeWithResponseAsync(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedThreeWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.renamedThreeSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); + return service.renamedThreeSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); } /** @@ -290,9 +285,8 @@ public Response renamedThreeWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renamedFiveWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.renamedFive(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.renamedFive(this.getEndpoint(), this.getClient(), requestOptions, context)); } /** @@ -307,7 +301,6 @@ public Mono> renamedFiveWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response renamedFiveWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.renamedFiveSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); + return service.renamedFiveSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/ServiceClientClientImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/ServiceClientClientImpl.java index 83b972b012..ffe7896433 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/ServiceClientClientImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/ServiceClientClientImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -224,7 +223,7 @@ public interface ServiceClientClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> one(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/one") @ExpectedResponses({ 204 }) @@ -233,7 +232,7 @@ Mono> one(@HostParam("endpoint") String endpoint, @HostParam("cli @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response oneSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/two") @ExpectedResponses({ 204 }) @@ -242,7 +241,7 @@ Response oneSync(@HostParam("endpoint") String endpoint, @HostParam("clien @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> two(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/two") @ExpectedResponses({ 204 }) @@ -251,7 +250,7 @@ Mono> two(@HostParam("endpoint") String endpoint, @HostParam("cli @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response twoSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -266,9 +265,8 @@ Response twoSync(@HostParam("endpoint") String endpoint, @HostParam("clien */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> oneWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.one(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); + .withContext(context -> service.one(this.getEndpoint(), this.getClient(), requestOptions, context)); } /** @@ -283,8 +281,7 @@ public Mono> oneWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response oneWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.oneSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); + return service.oneSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); } /** @@ -299,9 +296,8 @@ public Response oneWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> twoWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.two(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); + .withContext(context -> service.two(this.getEndpoint(), this.getClient(), requestOptions, context)); } /** @@ -316,7 +312,6 @@ public Mono> twoWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response twoWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.twoSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); + return service.twoSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); } } From cead43e9c9e5b4168c3b220d1f085929904e8307 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 29 Jul 2024 15:36:25 +0800 Subject: [PATCH 24/90] update api version filtering part --- typespec-extension/src/code-model-builder.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index bb091ced4f..03afbba8cf 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -586,9 +586,9 @@ export class CodeModelBuilder { } codeModelClient.apiVersions = []; - for (const version of this.getFilteredApiVersions( - this.apiVersion, - versioning.getVersions(), + for (const version of this.getFilteredApiVersionsFromString( + this.apiVersionString, + versions, this.options["service-version-exclude-preview"], )) { const apiVersion = new ApiVersion(); @@ -870,13 +870,13 @@ export class CodeModelBuilder { pinnedApiVersion: string | undefined, versions: string[], excludePreview: boolean = false, - ): Version[] { + ): string[] { if (!pinnedApiVersion) { return versions; } return versions .slice(0, versions.indexOf(pinnedApiVersion) + 1) - .filter((version) => !excludePreview || !isStable(pinnedApiVersion) || isStable(version)); + .filter((version) => !excludePreview || pinnedApiVersion.includes("preview") || !version.includes("preview")); } /** From ab74bad4c423c0d37ce3ac929d05413769394b1d Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Tue, 30 Jul 2024 15:07:23 +0800 Subject: [PATCH 25/90] merge summary with description --- .../main/java/com/azure/autorest/mapper/ClientMethodMapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javagen/src/main/java/com/azure/autorest/mapper/ClientMethodMapper.java b/javagen/src/main/java/com/azure/autorest/mapper/ClientMethodMapper.java index 5e6a43dea7..b8971c190f 100644 --- a/javagen/src/main/java/com/azure/autorest/mapper/ClientMethodMapper.java +++ b/javagen/src/main/java/com/azure/autorest/mapper/ClientMethodMapper.java @@ -1594,7 +1594,7 @@ protected static String returnTypeDescription(Operation operation, IType returnT String description = null; // try the description of the operation if (operation.getLanguage() != null && operation.getLanguage().getDefault() != null) { - String operationDescription = operation.getLanguage().getDefault().getDescription(); + String operationDescription = SchemaUtil.mergeSummaryWithDescription(operation.getSummary(), operation.getLanguage().getDefault().getDescription()); if (!CoreUtils.isNullOrEmpty(operationDescription)) { if (operationDescription.toLowerCase().startsWith("get ") || operationDescription.toLowerCase().startsWith("gets ")) { int startIndex = operationDescription.indexOf(" ") + 1; From 9e5146e7e931973a8c1c1d78a9b7bf4c909db772 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Tue, 30 Jul 2024 16:08:16 +0800 Subject: [PATCH 26/90] skip content-type header if body is optional --- typespec-extension/src/code-model-builder.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 03afbba8cf..3abf1cf547 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -1014,16 +1014,21 @@ export class CodeModelBuilder { clientContext.hostParameters.forEach((it) => codeModelOperation.addParameter(it)); // path/query/header parameters for (let param of httpOperation.parameters) { - // if it's paged operation with request body, remove content-type header added by TCGC, as next link call should not have content type header + // if it's paged operation with request body, skip content-type header added by TCGC, as next link call should not have content type header if ((sdkMethod.kind === "paging" || sdkMethod.kind === "lropaging") && httpOperation.bodyParam) { if (param.serializedName.toLocaleLowerCase() === "content-type") { continue; } } + // if the request body is optional, skip content-type header added by TCGC + if (httpOperation.bodyParam && httpOperation.bodyParam.optional) { + if (param.serializedName.toLocaleLowerCase() === "content-type") { + continue; + } + } this.processParameterFromSdkType(codeModelOperation, param, clientContext); } - // "accept" header - // this.addAcceptHeaderParameterFromSdkType(codeModelOperation, httpOperation.responses); + // body if (httpOperation.bodyParam && httpOperation.__raw && sdkMethod.__raw && httpOperation.bodyParam.type.__raw) { // let bodyType = httpOperation.bodyParam.type; From 032a3153805180fdaa1a50a439dae95ca76e23c0 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Tue, 30 Jul 2024 16:09:04 +0800 Subject: [PATCH 27/90] regen --- .../azure/core/basic/BasicAsyncClient.java | 8 ++- .../_specs_/azure/core/basic/BasicClient.java | 8 ++- .../basic/implementation/BasicClientImpl.java | 8 ++- .../azure/core/model/ModelAsyncClient.java | 4 +- .../_specs_/azure/core/model/ModelClient.java | 4 +- .../AzureCoreEmbeddingVectorsImpl.java | 4 +- .../azure/core/scalar/ScalarAsyncClient.java | 6 +- .../azure/core/scalar/ScalarClient.java | 4 +- .../AzureLocationScalarsImpl.java | 5 +- .../azure/core/traits/TraitsAsyncClient.java | 7 ++- .../azure/core/traits/TraitsClient.java | 6 +- .../implementation/TraitsClientImpl.java | 5 +- ...ManagedIdentityTrackedResourcesClient.java | 5 +- ...gedIdentityTrackedResourcesClientImpl.java | 14 ++--- .../ManagedIdentityTrackedResources.java | 11 ++-- .../fluent/NestedProxyResourcesClient.java | 4 +- .../TopLevelTrackedResourcesClient.java | 5 +- .../NestedProxyResourcesClientImpl.java | 12 ++-- .../TopLevelTrackedResourcesClientImpl.java | 14 ++--- .../models/NestedProxyResources.java | 8 +-- .../models/TopLevelTrackedResources.java | 11 ++-- .../XmsClientRequestIdAsyncClient.java | 5 +- .../XmsClientRequestIdClient.java | 2 +- .../XmsClientRequestIdClientImpl.java | 5 +- ...hildExtensionResourceInterfacesClient.java | 4 +- .../ChildResourcesInterfacesClient.java | 4 +- .../TopLevelArmResourceInterfacesClient.java | 5 +- ...ExtensionResourceInterfacesClientImpl.java | 12 ++-- .../ChildResourcesInterfacesClientImpl.java | 12 ++-- ...pLevelArmResourceInterfacesClientImpl.java | 14 ++--- .../ChildExtensionResourceInterfaces.java | 8 +-- .../models/ChildResourcesInterfaces.java | 8 +-- .../models/TopLevelArmResourceInterfaces.java | 11 ++-- .../implementation/FishesClientImpl.java | 35 +++--------- .../cadl/optional/OptionalAsyncClient.java | 2 + .../com/cadl/optional/OptionalClient.java | 2 + .../implementation/OptionalOpsImpl.java | 21 ++++--- .../java/com/cadl/patch/PatchAsyncClient.java | 8 +++ .../main/java/com/cadl/patch/PatchClient.java | 8 +++ .../patch/implementation/PatchesImpl.java | 32 +++++++---- .../EtagHeadersOptionalBodyAsyncClient.java | 2 + .../EtagHeadersOptionalBodyClient.java | 2 + .../EtagHeadersOptionalBodiesImpl.java | 22 +++---- ...lient.java => ClientModelAsyncClient.java} | 10 ++-- ...odelClient.java => ClientModelClient.java} | 10 ++-- .../client/naming/NamingClientBuilder.java | 20 +++---- ...{ModelsImpl.java => ClientModelsImpl.java} | 21 +++---- .../implementation/NamingClientImpl.java | 14 ++--- .../OptionalExplicitAsyncClient.java | 16 ++++++ .../OptionalExplicitClient.java | 16 ++++++ .../implementation/OptionalExplicitsImpl.java | 57 +++++++++++++------ .../JsonMergePatchAsyncClient.java | 8 +++ .../jsonmergepatch/JsonMergePatchClient.java | 8 +++ .../JsonMergePatchClientImpl.java | 31 +++++++--- .../multipart/models/ComplexPartsRequest.java | 6 +- .../models/JsonArrayPartsRequest.java | 6 +- .../EnumDiscriminatorAsyncClient.java | 22 ++++--- .../EnumDiscriminatorClient.java | 16 +++--- .../EnumDiscriminatorClientImpl.java | 22 ++++--- ...xtendsDifferentSpreadFloatAsyncClient.java | 6 +- .../ExtendsDifferentSpreadFloatClient.java | 5 +- ...sDifferentSpreadModelArrayAsyncClient.java | 6 +- ...xtendsDifferentSpreadModelArrayClient.java | 6 +- ...xtendsDifferentSpreadModelAsyncClient.java | 6 +- .../ExtendsDifferentSpreadModelClient.java | 6 +- ...tendsDifferentSpreadStringAsyncClient.java | 6 +- .../ExtendsDifferentSpreadStringClient.java | 5 +- .../ExtendsFloatAsyncClient.java | 5 +- .../ExtendsFloatClient.java | 4 +- .../ExtendsModelArrayAsyncClient.java | 5 +- .../ExtendsModelArrayClient.java | 4 +- .../ExtendsModelAsyncClient.java | 5 +- .../ExtendsModelClient.java | 4 +- .../ExtendsStringAsyncClient.java | 5 +- .../ExtendsStringClient.java | 4 +- .../ExtendsUnknownAsyncClient.java | 5 +- .../ExtendsUnknownClient.java | 4 +- .../ExtendsUnknownDerivedAsyncClient.java | 6 +- .../ExtendsUnknownDerivedClient.java | 4 +- ...xtendsUnknownDiscriminatedAsyncClient.java | 6 +- .../ExtendsUnknownDiscriminatedClient.java | 4 +- .../IsFloatAsyncClient.java | 5 +- .../additionalproperties/IsFloatClient.java | 4 +- .../IsModelArrayAsyncClient.java | 5 +- .../IsModelArrayClient.java | 4 +- .../IsModelAsyncClient.java | 5 +- .../additionalproperties/IsModelClient.java | 4 +- .../IsStringAsyncClient.java | 5 +- .../additionalproperties/IsStringClient.java | 4 +- .../IsUnknownAsyncClient.java | 5 +- .../additionalproperties/IsUnknownClient.java | 4 +- .../IsUnknownDerivedAsyncClient.java | 6 +- .../IsUnknownDerivedClient.java | 4 +- .../IsUnknownDiscriminatedAsyncClient.java | 5 +- .../IsUnknownDiscriminatedClient.java | 4 +- .../MultipleSpreadAsyncClient.java | 5 +- .../MultipleSpreadClient.java | 4 +- .../SpreadDifferentFloatAsyncClient.java | 6 +- .../SpreadDifferentFloatClient.java | 5 +- .../SpreadDifferentModelArrayAsyncClient.java | 6 +- .../SpreadDifferentModelArrayClient.java | 5 +- .../SpreadDifferentModelAsyncClient.java | 6 +- .../SpreadDifferentModelClient.java | 5 +- .../SpreadDifferentStringAsyncClient.java | 6 +- .../SpreadDifferentStringClient.java | 4 +- .../SpreadFloatAsyncClient.java | 6 +- .../SpreadFloatClient.java | 4 +- .../SpreadModelArrayAsyncClient.java | 4 +- .../SpreadModelArrayClient.java | 4 +- .../SpreadModelAsyncClient.java | 6 +- .../SpreadModelClient.java | 5 +- ...adRecordDiscriminatedUnionAsyncClient.java | 5 +- .../SpreadRecordDiscriminatedUnionClient.java | 4 +- ...cordNonDiscriminatedUnion2AsyncClient.java | 5 +- ...eadRecordNonDiscriminatedUnion2Client.java | 4 +- ...cordNonDiscriminatedUnion3AsyncClient.java | 5 +- ...eadRecordNonDiscriminatedUnion3Client.java | 4 +- ...ecordNonDiscriminatedUnionAsyncClient.java | 5 +- ...readRecordNonDiscriminatedUnionClient.java | 4 +- .../SpreadRecordUnionAsyncClient.java | 5 +- .../SpreadRecordUnionClient.java | 4 +- .../SpreadStringAsyncClient.java | 6 +- .../SpreadStringClient.java | 4 +- .../ExtendsDifferentSpreadFloatsImpl.java | 6 +- ...ExtendsDifferentSpreadModelArraysImpl.java | 6 +- .../ExtendsDifferentSpreadModelsImpl.java | 6 +- .../ExtendsDifferentSpreadStringsImpl.java | 6 +- .../implementation/ExtendsFloatsImpl.java | 5 +- .../ExtendsModelArraysImpl.java | 5 +- .../implementation/ExtendsModelsImpl.java | 5 +- .../implementation/ExtendsStringsImpl.java | 5 +- .../ExtendsUnknownDerivedsImpl.java | 5 +- .../ExtendsUnknownDiscriminatedsImpl.java | 5 +- .../implementation/ExtendsUnknownsImpl.java | 5 +- .../implementation/IsFloatsImpl.java | 5 +- .../implementation/IsModelArraysImpl.java | 5 +- .../implementation/IsModelsImpl.java | 5 +- .../implementation/IsStringsImpl.java | 5 +- .../implementation/IsUnknownDerivedsImpl.java | 5 +- .../IsUnknownDiscriminatedsImpl.java | 5 +- .../implementation/IsUnknownsImpl.java | 5 +- .../implementation/MultipleSpreadsImpl.java | 5 +- .../SpreadDifferentFloatsImpl.java | 6 +- .../SpreadDifferentModelArraysImpl.java | 6 +- .../SpreadDifferentModelsImpl.java | 6 +- .../SpreadDifferentStringsImpl.java | 5 +- .../implementation/SpreadFloatsImpl.java | 5 +- .../implementation/SpreadModelArraysImpl.java | 4 +- .../implementation/SpreadModelsImpl.java | 6 +- .../SpreadRecordDiscriminatedUnionsImpl.java | 5 +- ...readRecordNonDiscriminatedUnion2sImpl.java | 5 +- ...readRecordNonDiscriminatedUnion3sImpl.java | 5 +- ...preadRecordNonDiscriminatedUnionsImpl.java | 5 +- .../SpreadRecordUnionsImpl.java | 5 +- .../implementation/SpreadStringsImpl.java | 5 +- .../property/nullable/BytesAsyncClient.java | 12 ++-- .../type/property/nullable/BytesClient.java | 8 +-- .../nullable/CollectionsByteAsyncClient.java | 10 ++-- .../nullable/CollectionsByteClient.java | 8 +-- .../nullable/CollectionsModelAsyncClient.java | 10 ++-- .../nullable/CollectionsModelClient.java | 8 +-- .../CollectionsStringAsyncClient.java | 10 ++-- .../nullable/CollectionsStringClient.java | 8 +-- .../DatetimeOperationAsyncClient.java | 10 ++-- .../nullable/DatetimeOperationClient.java | 8 +-- .../DurationOperationAsyncClient.java | 10 ++-- .../nullable/DurationOperationClient.java | 8 +-- .../nullable/StringOperationAsyncClient.java | 12 ++-- .../nullable/StringOperationClient.java | 8 +-- .../nullable/implementation/BytesImpl.java | 12 ++-- .../implementation/CollectionsBytesImpl.java | 10 ++-- .../implementation/CollectionsModelsImpl.java | 10 ++-- .../CollectionsStringsImpl.java | 10 ++-- .../DatetimeOperationsImpl.java | 10 ++-- .../DurationOperationsImpl.java | 10 ++-- .../implementation/StringOperationsImpl.java | 12 ++-- .../optional/BooleanLiteralAsyncClient.java | 10 ++-- .../optional/BooleanLiteralClient.java | 8 +-- .../property/optional/BytesAsyncClient.java | 12 ++-- .../type/property/optional/BytesClient.java | 8 +-- .../optional/CollectionsByteAsyncClient.java | 10 ++-- .../optional/CollectionsByteClient.java | 8 +-- .../optional/CollectionsModelAsyncClient.java | 10 ++-- .../optional/CollectionsModelClient.java | 8 +-- .../DatetimeOperationAsyncClient.java | 10 ++-- .../optional/DatetimeOperationClient.java | 8 +-- .../DurationOperationAsyncClient.java | 10 ++-- .../optional/DurationOperationClient.java | 8 +-- .../optional/FloatLiteralAsyncClient.java | 10 ++-- .../property/optional/FloatLiteralClient.java | 8 +-- .../optional/IntLiteralAsyncClient.java | 10 ++-- .../property/optional/IntLiteralClient.java | 8 +-- .../optional/PlainDateAsyncClient.java | 10 ++-- .../property/optional/PlainDateClient.java | 8 +-- .../optional/PlainTimeAsyncClient.java | 10 ++-- .../property/optional/PlainTimeClient.java | 8 +-- .../RequiredAndOptionalAsyncClient.java | 12 ++-- .../optional/RequiredAndOptionalClient.java | 8 +-- .../optional/StringLiteralAsyncClient.java | 10 ++-- .../optional/StringLiteralClient.java | 8 +-- .../optional/StringOperationAsyncClient.java | 12 ++-- .../optional/StringOperationClient.java | 8 +-- .../UnionFloatLiteralAsyncClient.java | 10 ++-- .../optional/UnionFloatLiteralClient.java | 8 +-- .../optional/UnionIntLiteralAsyncClient.java | 10 ++-- .../optional/UnionIntLiteralClient.java | 8 +-- .../UnionStringLiteralAsyncClient.java | 10 ++-- .../optional/UnionStringLiteralClient.java | 8 +-- .../implementation/BooleanLiteralsImpl.java | 10 ++-- .../optional/implementation/BytesImpl.java | 12 ++-- .../implementation/CollectionsBytesImpl.java | 10 ++-- .../implementation/CollectionsModelsImpl.java | 10 ++-- .../DatetimeOperationsImpl.java | 10 ++-- .../DurationOperationsImpl.java | 10 ++-- .../implementation/FloatLiteralsImpl.java | 10 ++-- .../implementation/IntLiteralsImpl.java | 10 ++-- .../implementation/PlainDatesImpl.java | 34 +++++------ .../implementation/PlainTimesImpl.java | 34 +++++------ .../RequiredAndOptionalsImpl.java | 12 ++-- .../implementation/StringLiteralsImpl.java | 10 ++-- .../implementation/StringOperationsImpl.java | 12 ++-- .../UnionFloatLiteralsImpl.java | 10 ++-- .../implementation/UnionIntLiteralsImpl.java | 10 ++-- .../UnionStringLiteralsImpl.java | 10 ++-- .../valuetypes/BooleanLiteralAsyncClient.java | 5 +- .../valuetypes/BooleanLiteralClient.java | 4 +- .../BooleanOperationAsyncClient.java | 4 +- .../valuetypes/BooleanOperationClient.java | 4 +- .../property/valuetypes/BytesAsyncClient.java | 4 +- .../type/property/valuetypes/BytesClient.java | 4 +- .../valuetypes/CollectionsIntAsyncClient.java | 5 +- .../valuetypes/CollectionsIntClient.java | 4 +- .../CollectionsModelAsyncClient.java | 5 +- .../valuetypes/CollectionsModelClient.java | 4 +- .../CollectionsStringAsyncClient.java | 5 +- .../valuetypes/CollectionsStringClient.java | 4 +- .../DatetimeOperationAsyncClient.java | 4 +- .../valuetypes/DatetimeOperationClient.java | 4 +- .../valuetypes/Decimal128AsyncClient.java | 4 +- .../property/valuetypes/Decimal128Client.java | 4 +- .../valuetypes/DecimalAsyncClient.java | 4 +- .../property/valuetypes/DecimalClient.java | 4 +- .../DictionaryStringAsyncClient.java | 5 +- .../valuetypes/DictionaryStringClient.java | 4 +- .../DurationOperationAsyncClient.java | 4 +- .../valuetypes/DurationOperationClient.java | 4 +- .../property/valuetypes/EnumAsyncClient.java | 4 +- .../type/property/valuetypes/EnumClient.java | 4 +- .../valuetypes/ExtensibleEnumAsyncClient.java | 5 +- .../valuetypes/ExtensibleEnumClient.java | 4 +- .../valuetypes/FloatLiteralAsyncClient.java | 4 +- .../valuetypes/FloatLiteralClient.java | 4 +- .../valuetypes/FloatOperationAsyncClient.java | 4 +- .../valuetypes/FloatOperationClient.java | 4 +- .../property/valuetypes/IntAsyncClient.java | 4 +- .../type/property/valuetypes/IntClient.java | 4 +- .../valuetypes/IntLiteralAsyncClient.java | 4 +- .../property/valuetypes/IntLiteralClient.java | 4 +- .../property/valuetypes/ModelAsyncClient.java | 4 +- .../type/property/valuetypes/ModelClient.java | 4 +- .../property/valuetypes/NeverAsyncClient.java | 4 +- .../type/property/valuetypes/NeverClient.java | 4 +- .../valuetypes/StringLiteralAsyncClient.java | 5 +- .../valuetypes/StringLiteralClient.java | 4 +- .../StringOperationAsyncClient.java | 4 +- .../valuetypes/StringOperationClient.java | 4 +- .../valuetypes/UnionEnumValueAsyncClient.java | 5 +- .../valuetypes/UnionEnumValueClient.java | 4 +- .../UnionFloatLiteralAsyncClient.java | 5 +- .../valuetypes/UnionFloatLiteralClient.java | 4 +- .../UnionIntLiteralAsyncClient.java | 5 +- .../valuetypes/UnionIntLiteralClient.java | 4 +- .../UnionStringLiteralAsyncClient.java | 5 +- .../valuetypes/UnionStringLiteralClient.java | 4 +- .../valuetypes/UnknownArrayAsyncClient.java | 5 +- .../valuetypes/UnknownArrayClient.java | 4 +- .../valuetypes/UnknownDictAsyncClient.java | 5 +- .../valuetypes/UnknownDictClient.java | 4 +- .../valuetypes/UnknownIntAsyncClient.java | 5 +- .../property/valuetypes/UnknownIntClient.java | 4 +- .../valuetypes/UnknownStringAsyncClient.java | 5 +- .../valuetypes/UnknownStringClient.java | 4 +- .../implementation/BooleanLiteralsImpl.java | 5 +- .../implementation/BooleanOperationsImpl.java | 4 +- .../valuetypes/implementation/BytesImpl.java | 4 +- .../implementation/CollectionsIntsImpl.java | 5 +- .../implementation/CollectionsModelsImpl.java | 5 +- .../CollectionsStringsImpl.java | 5 +- .../DatetimeOperationsImpl.java | 4 +- .../implementation/Decimal128sImpl.java | 4 +- .../implementation/DecimalsImpl.java | 4 +- .../implementation/DictionaryStringsImpl.java | 5 +- .../DurationOperationsImpl.java | 4 +- .../valuetypes/implementation/EnumsImpl.java | 4 +- .../implementation/ExtensibleEnumsImpl.java | 5 +- .../implementation/FloatLiteralsImpl.java | 4 +- .../implementation/FloatOperationsImpl.java | 4 +- .../implementation/IntLiteralsImpl.java | 4 +- .../valuetypes/implementation/IntsImpl.java | 4 +- .../valuetypes/implementation/ModelsImpl.java | 4 +- .../valuetypes/implementation/NeversImpl.java | 4 +- .../implementation/StringLiteralsImpl.java | 5 +- .../implementation/StringOperationsImpl.java | 4 +- .../implementation/UnionEnumValuesImpl.java | 5 +- .../UnionFloatLiteralsImpl.java | 5 +- .../implementation/UnionIntLiteralsImpl.java | 5 +- .../UnionStringLiteralsImpl.java | 5 +- .../implementation/UnknownArraysImpl.java | 5 +- .../implementation/UnknownDictsImpl.java | 5 +- .../implementation/UnknownIntsImpl.java | 5 +- .../implementation/UnknownStringsImpl.java | 5 +- .../scalar/BooleanOperationAsyncClient.java | 5 +- .../type/scalar/BooleanOperationClient.java | 4 +- .../scalar/StringOperationAsyncClient.java | 4 +- .../type/scalar/StringOperationClient.java | 4 +- .../com/type/scalar/UnknownAsyncClient.java | 4 +- .../java/com/type/scalar/UnknownClient.java | 4 +- .../implementation/BooleanOperationsImpl.java | 5 +- .../implementation/StringOperationsImpl.java | 4 +- .../scalar/implementation/UnknownsImpl.java | 4 +- .../generated/NamingClientTestBase.java | 12 ++-- 321 files changed, 1136 insertions(+), 1142 deletions(-) rename typespec-tests/src/main/java/com/client/naming/{ModelAsyncClient.java => ClientModelAsyncClient.java} (95%) rename typespec-tests/src/main/java/com/client/naming/{ModelClient.java => ClientModelClient.java} (95%) rename typespec-tests/src/main/java/com/client/naming/implementation/{ModelsImpl.java => ClientModelsImpl.java} (93%) diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/BasicAsyncClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/BasicAsyncClient.java index 0bac5bba4f..bce8593c40 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/BasicAsyncClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/BasicAsyncClient.java @@ -182,7 +182,9 @@ public Mono> createOrReplaceWithResponse(int id, BinaryData * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a User along with {@link Response} on successful completion of {@link Mono}. + * @return a user. + * + * Gets a User along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -474,7 +476,9 @@ public Mono createOrReplace(int id, User resource) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a User on successful completion of {@link Mono}. + * @return a user. + * + * Gets a User on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/BasicClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/BasicClient.java index 44c324b815..9522ef313d 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/BasicClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/BasicClient.java @@ -175,7 +175,9 @@ public Response createOrReplaceWithResponse(int id, BinaryData resou * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a User along with {@link Response}. + * @return a user. + * + * Gets a User along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -465,7 +467,9 @@ public User createOrReplace(int id, User resource) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a User. + * @return a user. + * + * Gets a User. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java index 26c2bada24..23021e6f3d 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java @@ -652,7 +652,9 @@ public Response createOrReplaceWithResponse(int id, BinaryData resou * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a User along with {@link Response} on successful completion of {@link Mono}. + * @return a user. + * + * Gets a User along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(int id, RequestOptions requestOptions) { @@ -688,7 +690,9 @@ public Mono> getWithResponseAsync(int id, RequestOptions re * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a User along with {@link Response}. + * @return a user. + * + * Gets a User along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(int id, RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/model/ModelAsyncClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/model/ModelAsyncClient.java index 30f35000cc..1f518dac04 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/model/ModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/model/ModelAsyncClient.java @@ -55,7 +55,7 @@ public final class ModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return an embedding vector along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -131,7 +131,7 @@ public Mono> postWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @return an embedding vector on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/model/ModelClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/model/ModelClient.java index fcb1dd933c..170aadb44c 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/model/ModelClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/model/ModelClient.java @@ -53,7 +53,7 @@ public final class ModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. + * @return an embedding vector along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -129,7 +129,7 @@ public Response postWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return an embedding vector. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/model/implementation/AzureCoreEmbeddingVectorsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/model/implementation/AzureCoreEmbeddingVectorsImpl.java index e28bb5970b..3942e716fe 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/model/implementation/AzureCoreEmbeddingVectorsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/model/implementation/AzureCoreEmbeddingVectorsImpl.java @@ -141,7 +141,7 @@ Response postSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return an embedding vector along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -164,7 +164,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. + * @return an embedding vector along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarAsyncClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarAsyncClient.java index 01d5fd9490..a7cb562f8e 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarAsyncClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarAsyncClient.java @@ -51,8 +51,7 @@ public final class ScalarAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents an Azure geography region where supported resource providers live along with {@link Response} - * on successful completion of {@link Mono}. + * @return azureLocation value along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,8 +155,7 @@ public Mono> queryWithResponse(String region, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an Azure geography region where supported resource providers live on successful completion of - * {@link Mono}. + * @return azureLocation value on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarClient.java index 5361d1c5eb..593f5fd1ea 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarClient.java @@ -49,7 +49,7 @@ public final class ScalarClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents an Azure geography region where supported resource providers live along with {@link Response}. + * @return azureLocation value along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -153,7 +153,7 @@ public Response queryWithResponse(String region, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an Azure geography region where supported resource providers live. + * @return azureLocation value. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/implementation/AzureLocationScalarsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/implementation/AzureLocationScalarsImpl.java index d53a790ae7..4371e52b86 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/implementation/AzureLocationScalarsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/implementation/AzureLocationScalarsImpl.java @@ -174,8 +174,7 @@ Response headerMethodSync(@HeaderParam("region") String region, RequestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents an Azure geography region where supported resource providers live along with {@link Response} - * on successful completion of {@link Mono}. + * @return azureLocation value along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -196,7 +195,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents an Azure geography region where supported resource providers live along with {@link Response}. + * @return azureLocation value along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsAsyncClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsAsyncClient.java index 2bd5b4d778..68f22bd50e 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsAsyncClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsAsyncClient.java @@ -76,7 +76,8 @@ public final class TraitsAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sample Model along with {@link Response} on successful completion of {@link Mono}. + * @return a resource, sending and receiving headers along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -139,7 +140,7 @@ public Mono> repeatableActionWithResponse(int id, BinaryDat * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sample Model on successful completion of {@link Mono}. + * @return a resource, sending and receiving headers on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -179,7 +180,7 @@ public Mono smokeTest(int id, String foo, RequestConditions requestConditi * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sample Model on successful completion of {@link Mono}. + * @return a resource, sending and receiving headers on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsClient.java b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsClient.java index f4ab2a4d75..ef9927aafb 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsClient.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsClient.java @@ -74,7 +74,7 @@ public final class TraitsClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sample Model along with {@link Response}. + * @return a resource, sending and receiving headers along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -136,7 +136,7 @@ public Response repeatableActionWithResponse(int id, BinaryData body * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sample Model. + * @return a resource, sending and receiving headers. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -175,7 +175,7 @@ public User smokeTest(int id, String foo, RequestConditions requestConditions) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sample Model. + * @return a resource, sending and receiving headers. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/implementation/TraitsClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/implementation/TraitsClientImpl.java index cfc6be6f60..e685d76646 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/implementation/TraitsClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/implementation/TraitsClientImpl.java @@ -205,7 +205,8 @@ Response repeatableActionSync(@QueryParam("api-version") String apiV * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sample Model along with {@link Response} on successful completion of {@link Mono}. + * @return a resource, sending and receiving headers along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> smokeTestWithResponseAsync(int id, String foo, RequestOptions requestOptions) { @@ -246,7 +247,7 @@ public Mono> smokeTestWithResponseAsync(int id, String foo, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return sample Model along with {@link Response}. + * @return a resource, sending and receiving headers along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response smokeTestWithResponse(int id, String foo, RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/ManagedIdentityTrackedResourcesClient.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/ManagedIdentityTrackedResourcesClient.java index 283a13eff0..208c9fc223 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/ManagedIdentityTrackedResourcesClient.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/ManagedIdentityTrackedResourcesClient.java @@ -23,8 +23,7 @@ public interface ManagedIdentityTrackedResourcesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. + * @return a ManagedIdentityTrackedResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse(String resourceGroupName, @@ -38,7 +37,7 @@ Response getByResourceGroupWithResponse(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + * @return a ManagedIdentityTrackedResource. */ @ServiceMethod(returns = ReturnType.SINGLE) ManagedIdentityTrackedResourceInner getByResourceGroup(String resourceGroupName, diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityTrackedResourcesClientImpl.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityTrackedResourcesClientImpl.java index a8066cc96b..19f0b36bc9 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityTrackedResourcesClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityTrackedResourcesClientImpl.java @@ -98,8 +98,7 @@ Mono> updateWithUserAssignedAndSys * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response} on successful completion of {@link Mono}. + * @return a ManagedIdentityTrackedResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> @@ -133,8 +132,7 @@ Mono> updateWithUserAssignedAndSys * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response} on successful completion of {@link Mono}. + * @return a ManagedIdentityTrackedResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -165,8 +163,7 @@ private Mono> getByResourceGroupWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type on - * successful completion of {@link Mono}. + * @return a ManagedIdentityTrackedResource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, @@ -184,8 +181,7 @@ private Mono getByResourceGroupAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. + * @return a ManagedIdentityTrackedResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, @@ -202,7 +198,7 @@ public Response getByResourceGroupWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + * @return a ManagedIdentityTrackedResource. */ @ServiceMethod(returns = ReturnType.SINGLE) public ManagedIdentityTrackedResourceInner getByResourceGroup(String resourceGroupName, diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/models/ManagedIdentityTrackedResources.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/models/ManagedIdentityTrackedResources.java index 1c281601e9..47029516e9 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/models/ManagedIdentityTrackedResources.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/models/ManagedIdentityTrackedResources.java @@ -20,8 +20,7 @@ public interface ManagedIdentityTrackedResources { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. + * @return a ManagedIdentityTrackedResource along with {@link Response}. */ Response getByResourceGroupWithResponse(String resourceGroupName, String managedIdentityTrackedResourceName, Context context); @@ -34,7 +33,7 @@ Response getByResourceGroupWithResponse(String r * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + * @return a ManagedIdentityTrackedResource. */ ManagedIdentityTrackedResource getByResourceGroup(String resourceGroupName, String managedIdentityTrackedResourceName); @@ -46,8 +45,7 @@ ManagedIdentityTrackedResource getByResourceGroup(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. + * @return a ManagedIdentityTrackedResource along with {@link Response}. */ ManagedIdentityTrackedResource getById(String id); @@ -59,8 +57,7 @@ ManagedIdentityTrackedResource getByResourceGroup(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. + * @return a ManagedIdentityTrackedResource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/NestedProxyResourcesClient.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/NestedProxyResourcesClient.java index b733e926bf..a363155ee0 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/NestedProxyResourcesClient.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/NestedProxyResourcesClient.java @@ -27,7 +27,7 @@ public interface NestedProxyResourcesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested child of Top Level Tracked Resource along with {@link Response}. + * @return a NestedProxyResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String resourceGroupName, String topLevelTrackedResourceName, @@ -42,7 +42,7 @@ Response getWithResponse(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested child of Top Level Tracked Resource. + * @return a NestedProxyResource. */ @ServiceMethod(returns = ReturnType.SINGLE) NestedProxyResourceInner get(String resourceGroupName, String topLevelTrackedResourceName, diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/TopLevelTrackedResourcesClient.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/TopLevelTrackedResourcesClient.java index 25516cc366..4a7a5a5848 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/TopLevelTrackedResourcesClient.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/TopLevelTrackedResourcesClient.java @@ -26,8 +26,7 @@ public interface TopLevelTrackedResourcesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. + * @return a TopLevelTrackedResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse(String resourceGroupName, @@ -41,7 +40,7 @@ Response getByResourceGroupWithResponse(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + * @return a TopLevelTrackedResource. */ @ServiceMethod(returns = ReturnType.SINGLE) TopLevelTrackedResourceInner getByResourceGroup(String resourceGroupName, String topLevelTrackedResourceName); diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/NestedProxyResourcesClientImpl.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/NestedProxyResourcesClientImpl.java index ff4e29da9b..fdf9d9a01f 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/NestedProxyResourcesClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/NestedProxyResourcesClientImpl.java @@ -142,8 +142,7 @@ Mono> listByTopLevelTrackedResourceNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested child of Top Level Tracked Resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return a NestedProxyResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, @@ -181,8 +180,7 @@ private Mono> getWithResponseAsync(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested child of Top Level Tracked Resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return a NestedProxyResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, @@ -218,7 +216,7 @@ private Mono> getWithResponseAsync(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested child of Top Level Tracked Resource on successful completion of {@link Mono}. + * @return a NestedProxyResource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String topLevelTrackedResourceName, @@ -237,7 +235,7 @@ private Mono getAsync(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested child of Top Level Tracked Resource along with {@link Response}. + * @return a NestedProxyResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, @@ -255,7 +253,7 @@ public Response getWithResponse(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested child of Top Level Tracked Resource. + * @return a NestedProxyResource. */ @ServiceMethod(returns = ReturnType.SINGLE) public NestedProxyResourceInner get(String resourceGroupName, String topLevelTrackedResourceName, diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java index a67373b73b..48c70ca0e2 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java @@ -151,8 +151,7 @@ Mono> listBySubscriptionNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response} on successful completion of {@link Mono}. + * @return a TopLevelTrackedResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, @@ -185,8 +184,7 @@ private Mono> getByResourceGroupWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response} on successful completion of {@link Mono}. + * @return a TopLevelTrackedResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, @@ -217,8 +215,7 @@ private Mono> getByResourceGroupWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type on - * successful completion of {@link Mono}. + * @return a TopLevelTrackedResource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, @@ -236,8 +233,7 @@ private Mono getByResourceGroupAsync(String resour * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. + * @return a TopLevelTrackedResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, @@ -253,7 +249,7 @@ public Response getByResourceGroupWithResponse(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + * @return a TopLevelTrackedResource. */ @ServiceMethod(returns = ReturnType.SINGLE) public TopLevelTrackedResourceInner getByResourceGroup(String resourceGroupName, diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/models/NestedProxyResources.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/models/NestedProxyResources.java index c3e0edda4d..36603839d6 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/models/NestedProxyResources.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/models/NestedProxyResources.java @@ -22,7 +22,7 @@ public interface NestedProxyResources { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested child of Top Level Tracked Resource along with {@link Response}. + * @return a NestedProxyResource along with {@link Response}. */ Response getWithResponse(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, Context context); @@ -36,7 +36,7 @@ Response getWithResponse(String resourceGroupName, String t * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested child of Top Level Tracked Resource. + * @return a NestedProxyResource. */ NestedProxyResource get(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName); @@ -101,7 +101,7 @@ PagedIterable listByTopLevelTrackedResource(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested child of Top Level Tracked Resource along with {@link Response}. + * @return a NestedProxyResource along with {@link Response}. */ NestedProxyResource getById(String id); @@ -113,7 +113,7 @@ PagedIterable listByTopLevelTrackedResource(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nested child of Top Level Tracked Resource along with {@link Response}. + * @return a NestedProxyResource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/models/TopLevelTrackedResources.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/models/TopLevelTrackedResources.java index 2b92f8a61a..e251c82128 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/models/TopLevelTrackedResources.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/models/TopLevelTrackedResources.java @@ -21,8 +21,7 @@ public interface TopLevelTrackedResources { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. + * @return a TopLevelTrackedResource along with {@link Response}. */ Response getByResourceGroupWithResponse(String resourceGroupName, String topLevelTrackedResourceName, Context context); @@ -35,7 +34,7 @@ Response getByResourceGroupWithResponse(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + * @return a TopLevelTrackedResource. */ TopLevelTrackedResource getByResourceGroup(String resourceGroupName, String topLevelTrackedResourceName); @@ -116,8 +115,7 @@ Response getByResourceGroupWithResponse(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. + * @return a TopLevelTrackedResource along with {@link Response}. */ TopLevelTrackedResource getById(String id); @@ -129,8 +127,7 @@ Response getByResourceGroupWithResponse(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. + * @return a TopLevelTrackedResource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdAsyncClient.java b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdAsyncClient.java index 3c6de2a5b3..e67c748929 100644 --- a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdAsyncClient.java +++ b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdAsyncClient.java @@ -44,7 +44,8 @@ public final class XmsClientRequestIdAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return operation with azure `x-ms-client-request-id` header along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -60,7 +61,7 @@ public Mono> getWithResponse(RequestOptions requestOptions) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return operation with azure `x-ms-client-request-id` header on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClient.java b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClient.java index fdb5f059c3..b5db477c0b 100644 --- a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClient.java +++ b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClient.java @@ -42,7 +42,7 @@ public final class XmsClientRequestIdClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. + * @return operation with azure `x-ms-client-request-id` header along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/implementation/XmsClientRequestIdClientImpl.java b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/implementation/XmsClientRequestIdClientImpl.java index 8f39bcfef8..41b9820341 100644 --- a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/implementation/XmsClientRequestIdClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/implementation/XmsClientRequestIdClientImpl.java @@ -127,7 +127,8 @@ public interface XmsClientRequestIdClientService { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return operation with azure `x-ms-client-request-id` header along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -142,7 +143,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOptions) * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. + * @return operation with azure `x-ms-client-request-id` header along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildExtensionResourceInterfacesClient.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildExtensionResourceInterfacesClient.java index 2a25d598ce..e5295fe97c 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildExtensionResourceInterfacesClient.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildExtensionResourceInterfacesClient.java @@ -28,7 +28,7 @@ public interface ChildExtensionResourceInterfacesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extensionResource of Top Level Arm Resource along with {@link Response}. + * @return a ChildExtensionResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String resourceUri, String topLevelArmResourceName, @@ -43,7 +43,7 @@ Response getWithResponse(String resourceUri, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extensionResource of Top Level Arm Resource. + * @return a ChildExtensionResource. */ @ServiceMethod(returns = ReturnType.SINGLE) ChildExtensionResourceInner get(String resourceUri, String topLevelArmResourceName, diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildResourcesInterfacesClient.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildResourcesInterfacesClient.java index 7b0b515c17..c06553db4f 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildResourcesInterfacesClient.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ChildResourcesInterfacesClient.java @@ -28,7 +28,7 @@ public interface ChildResourcesInterfacesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subresource of Top Level Arm Resource along with {@link Response}. + * @return a ChildResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String resourceGroupName, String topLevelArmResourceName, @@ -43,7 +43,7 @@ Response getWithResponse(String resourceGroupName, String to * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subresource of Top Level Arm Resource. + * @return a ChildResource. */ @ServiceMethod(returns = ReturnType.SINGLE) ChildResourceInner get(String resourceGroupName, String topLevelArmResourceName, String childResourceName); diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java index ddc0e6c51a..96977bf126 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java @@ -28,8 +28,7 @@ public interface TopLevelArmResourceInterfacesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. + * @return a TopLevelArmResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse(String resourceGroupName, @@ -43,7 +42,7 @@ Response getByResourceGroupWithResponse(String resourc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + * @return a TopLevelArmResource. */ @ServiceMethod(returns = ReturnType.SINGLE) TopLevelArmResourceInner getByResourceGroup(String resourceGroupName, String topLevelArmResourceName); diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildExtensionResourceInterfacesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildExtensionResourceInterfacesClientImpl.java index 39d51f5e74..c37eae6307 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildExtensionResourceInterfacesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildExtensionResourceInterfacesClientImpl.java @@ -138,8 +138,7 @@ Mono> listByTopLevelArmResourceNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extensionResource of Top Level Arm Resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return a ChildExtensionResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceUri, @@ -172,8 +171,7 @@ private Mono> getWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extensionResource of Top Level Arm Resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return a ChildExtensionResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceUri, @@ -204,7 +202,7 @@ private Mono> getWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extensionResource of Top Level Arm Resource on successful completion of {@link Mono}. + * @return a ChildExtensionResource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceUri, String topLevelArmResourceName, @@ -223,7 +221,7 @@ private Mono getAsync(String resourceUri, String to * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extensionResource of Top Level Arm Resource along with {@link Response}. + * @return a ChildExtensionResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceUri, String topLevelArmResourceName, @@ -240,7 +238,7 @@ public Response getWithResponse(String resourceUri, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extensionResource of Top Level Arm Resource. + * @return a ChildExtensionResource. */ @ServiceMethod(returns = ReturnType.SINGLE) public ChildExtensionResourceInner get(String resourceUri, String topLevelArmResourceName, diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java index b67637983d..ca32112b71 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java @@ -155,8 +155,7 @@ Mono> listByTopLevelArmResourceNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subresource of Top Level Arm Resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return a ChildResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, @@ -194,8 +193,7 @@ private Mono> getWithResponseAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subresource of Top Level Arm Resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return a ChildResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, @@ -231,7 +229,7 @@ private Mono> getWithResponseAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subresource of Top Level Arm Resource on successful completion of {@link Mono}. + * @return a ChildResource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String topLevelArmResourceName, @@ -250,7 +248,7 @@ private Mono getAsync(String resourceGroupName, String topLe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subresource of Top Level Arm Resource along with {@link Response}. + * @return a ChildResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String topLevelArmResourceName, @@ -267,7 +265,7 @@ public Response getWithResponse(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subresource of Top Level Arm Resource. + * @return a ChildResource. */ @ServiceMethod(returns = ReturnType.SINGLE) public ChildResourceInner get(String resourceGroupName, String topLevelArmResourceName, String childResourceName) { diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java index bf2c298339..29537d3ee0 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java @@ -164,8 +164,7 @@ Mono> listBySubscriptionNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response} on successful completion of {@link Mono}. + * @return a TopLevelArmResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, @@ -198,8 +197,7 @@ private Mono> getByResourceGroupWithResponseA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response} on successful completion of {@link Mono}. + * @return a TopLevelArmResource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, @@ -230,8 +228,7 @@ private Mono> getByResourceGroupWithResponseA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type on - * successful completion of {@link Mono}. + * @return a TopLevelArmResource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, @@ -249,8 +246,7 @@ private Mono getByResourceGroupAsync(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. + * @return a TopLevelArmResource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, @@ -266,7 +262,7 @@ public Response getByResourceGroupWithResponse(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + * @return a TopLevelArmResource. */ @ServiceMethod(returns = ReturnType.SINGLE) public TopLevelArmResourceInner getByResourceGroup(String resourceGroupName, String topLevelArmResourceName) { diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildExtensionResourceInterfaces.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildExtensionResourceInterfaces.java index eb5252573f..2c917a5c3f 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildExtensionResourceInterfaces.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildExtensionResourceInterfaces.java @@ -22,7 +22,7 @@ public interface ChildExtensionResourceInterfaces { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extensionResource of Top Level Arm Resource along with {@link Response}. + * @return a ChildExtensionResource along with {@link Response}. */ Response getWithResponse(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, Context context); @@ -36,7 +36,7 @@ Response getWithResponse(String resourceUri, String topL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extensionResource of Top Level Arm Resource. + * @return a ChildExtensionResource. */ ChildExtensionResource get(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName); @@ -98,7 +98,7 @@ PagedIterable listByTopLevelArmResource(String resourceU * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extensionResource of Top Level Arm Resource along with {@link Response}. + * @return a ChildExtensionResource along with {@link Response}. */ ChildExtensionResource getById(String id); @@ -110,7 +110,7 @@ PagedIterable listByTopLevelArmResource(String resourceU * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extensionResource of Top Level Arm Resource along with {@link Response}. + * @return a ChildExtensionResource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildResourcesInterfaces.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildResourcesInterfaces.java index fa14eee2a4..36c43f5666 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildResourcesInterfaces.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/ChildResourcesInterfaces.java @@ -22,7 +22,7 @@ public interface ChildResourcesInterfaces { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subresource of Top Level Arm Resource along with {@link Response}. + * @return a ChildResource along with {@link Response}. */ Response getWithResponse(String resourceGroupName, String topLevelArmResourceName, String childResourceName, Context context); @@ -36,7 +36,7 @@ Response getWithResponse(String resourceGroupName, String topLeve * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subresource of Top Level Arm Resource. + * @return a ChildResource. */ ChildResource get(String resourceGroupName, String topLevelArmResourceName, String childResourceName); @@ -124,7 +124,7 @@ void actionWithoutBody(String resourceGroupName, String topLevelArmResourceName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subresource of Top Level Arm Resource along with {@link Response}. + * @return a ChildResource along with {@link Response}. */ ChildResource getById(String id); @@ -136,7 +136,7 @@ void actionWithoutBody(String resourceGroupName, String topLevelArmResourceName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subresource of Top Level Arm Resource along with {@link Response}. + * @return a ChildResource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/TopLevelArmResourceInterfaces.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/TopLevelArmResourceInterfaces.java index abcb77f43c..b084c3eed9 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/TopLevelArmResourceInterfaces.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/models/TopLevelArmResourceInterfaces.java @@ -21,8 +21,7 @@ public interface TopLevelArmResourceInterfaces { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. + * @return a TopLevelArmResource along with {@link Response}. */ Response getByResourceGroupWithResponse(String resourceGroupName, String topLevelArmResourceName, Context context); @@ -35,7 +34,7 @@ Response getByResourceGroupWithResponse(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + * @return a TopLevelArmResource. */ TopLevelArmResource getByResourceGroup(String resourceGroupName, String topLevelArmResourceName); @@ -137,8 +136,7 @@ Response getByResourceGroupWithResponse(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. + * @return a TopLevelArmResource along with {@link Response}. */ TopLevelArmResource getById(String id); @@ -150,8 +148,7 @@ Response getByResourceGroupWithResponse(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete tracked resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. + * @return a TopLevelArmResource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java index f4606230db..3e9ee1cf1e 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java @@ -10,7 +10,6 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -61,15 +60,13 @@ public interface FishesService { @Get("/model") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorException.class) - Mono> getModel(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - Context context); + Mono> getModel(@HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/model") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorMinException.class) - Mono> putModel(@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, - @BodyParam("application/json") FishInner fish, Context context); + Mono> putModel(@HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") FishInner fish, Context context); } /** @@ -82,12 +79,8 @@ Mono> putModel(@HostParam("endpoint") String endpoint, @Head */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getModelWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getModel(this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.getModel(accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -103,13 +96,9 @@ private Mono> getModelWithResponseAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getModelWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getModel(this.client.getEndpoint(), accept, context); + return service.getModel(accept, context); } /** @@ -164,17 +153,14 @@ public FishInner getModel() { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> putModelWithResponseAsync(FishInner fish) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (fish == null) { return Mono.error(new IllegalArgumentException("Parameter fish is required and cannot be null.")); } else { fish.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putModel(this.client.getEndpoint(), accept, fish, context)) + return FluxUtil.withContext(context -> service.putModel(contentType, accept, fish, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -191,18 +177,15 @@ private Mono> putModelWithResponseAsync(FishInner fish) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> putModelWithResponseAsync(FishInner fish, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (fish == null) { return Mono.error(new IllegalArgumentException("Parameter fish is required and cannot be null.")); } else { fish.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.putModel(this.client.getEndpoint(), accept, fish, context); + return service.putModel(contentType, accept, fish, context); } /** diff --git a/typespec-tests/src/main/java/com/cadl/optional/OptionalAsyncClient.java b/typespec-tests/src/main/java/com/cadl/optional/OptionalAsyncClient.java index 4222b964b2..882eeeed25 100644 --- a/typespec-tests/src/main/java/com/cadl/optional/OptionalAsyncClient.java +++ b/typespec-tests/src/main/java/com/cadl/optional/OptionalAsyncClient.java @@ -55,6 +55,8 @@ public final class OptionalAsyncClient { * * * + * * *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
request-header-optionalStringNoThe requestHeaderOptional parameter
* You can add these to a request with {@link RequestOptions#addHeader} diff --git a/typespec-tests/src/main/java/com/cadl/optional/OptionalClient.java b/typespec-tests/src/main/java/com/cadl/optional/OptionalClient.java index 899ca37b27..96ecb5df55 100644 --- a/typespec-tests/src/main/java/com/cadl/optional/OptionalClient.java +++ b/typespec-tests/src/main/java/com/cadl/optional/OptionalClient.java @@ -53,6 +53,8 @@ public final class OptionalClient { * * * + * * *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
request-header-optionalStringNoThe requestHeaderOptional parameter
* You can add these to a request with {@link RequestOptions#addHeader} diff --git a/typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalOpsImpl.java b/typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalOpsImpl.java index 65cb53de0f..df25fa882e 100644 --- a/typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalOpsImpl.java @@ -70,8 +70,7 @@ Mono> put(@HostParam("endpoint") String endpoint, @QueryParam("booleanRequired") boolean booleanRequired, @QueryParam("booleanRequiredNullable") Boolean booleanRequiredNullable, @QueryParam("stringRequired") String stringRequired, - @QueryParam("stringRequiredNullable") String stringRequiredNullable, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @QueryParam("stringRequiredNullable") String stringRequiredNullable, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/optional/put") @@ -85,8 +84,7 @@ Response putSync(@HostParam("endpoint") String endpoint, @QueryParam("booleanRequired") boolean booleanRequired, @QueryParam("booleanRequiredNullable") Boolean booleanRequiredNullable, @QueryParam("stringRequired") String stringRequired, - @QueryParam("stringRequiredNullable") String stringRequiredNullable, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @QueryParam("stringRequiredNullable") String stringRequiredNullable, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -105,6 +103,8 @@ Response putSync(@HostParam("endpoint") String endpoint, * * * + * * *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
request-header-optionalStringNoThe requestHeaderOptional parameter
* You can add these to a request with {@link RequestOptions#addHeader} @@ -188,7 +188,6 @@ Response putSync(@HostParam("endpoint") String endpoint, public Mono> putWithResponseAsync(String requestHeaderRequired, boolean booleanRequired, Boolean booleanRequiredNullable, String stringRequired, String stringRequiredNullable, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { @@ -196,9 +195,9 @@ public Mono> putWithResponseAsync(String requestHeaderRequi requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); } }); - return FluxUtil.withContext(context -> service.put(this.client.getEndpoint(), requestHeaderRequired, - booleanRequired, booleanRequiredNullable, stringRequired, stringRequiredNullable, contentType, accept, - requestOptionsLocal, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), requestHeaderRequired, booleanRequired, + booleanRequiredNullable, stringRequired, stringRequiredNullable, accept, requestOptionsLocal, context)); } /** @@ -216,6 +215,8 @@ public Mono> putWithResponseAsync(String requestHeaderRequi * * * + * * *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
request-header-optionalStringNoThe requestHeaderOptional parameter
* You can add these to a request with {@link RequestOptions#addHeader} @@ -299,7 +300,6 @@ public Mono> putWithResponseAsync(String requestHeaderRequi public Response putWithResponse(String requestHeaderRequired, boolean booleanRequired, Boolean booleanRequiredNullable, String stringRequired, String stringRequiredNullable, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { @@ -308,7 +308,6 @@ public Response putWithResponse(String requestHeaderRequired, boolea } }); return service.putSync(this.client.getEndpoint(), requestHeaderRequired, booleanRequired, - booleanRequiredNullable, stringRequired, stringRequiredNullable, contentType, accept, requestOptionsLocal, - Context.NONE); + booleanRequiredNullable, stringRequired, stringRequiredNullable, accept, requestOptionsLocal, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/patch/PatchAsyncClient.java b/typespec-tests/src/main/java/com/cadl/patch/PatchAsyncClient.java index 698b8f12aa..4dea94aaf7 100644 --- a/typespec-tests/src/main/java/com/cadl/patch/PatchAsyncClient.java +++ b/typespec-tests/src/main/java/com/cadl/patch/PatchAsyncClient.java @@ -119,6 +119,14 @@ public Mono> createOrUpdateResourceWithResponse(BinaryData /** * The createOrUpdateOptionalResource operation. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/merge-patch+json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
diff --git a/typespec-tests/src/main/java/com/cadl/patch/PatchClient.java b/typespec-tests/src/main/java/com/cadl/patch/PatchClient.java
index ed6c380398..05d6446056 100644
--- a/typespec-tests/src/main/java/com/cadl/patch/PatchClient.java
+++ b/typespec-tests/src/main/java/com/cadl/patch/PatchClient.java
@@ -116,6 +116,14 @@ public Response createOrUpdateResourceWithResponse(BinaryData resour
 
     /**
      * The createOrUpdateOptionalResource operation.
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/merge-patch+json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
diff --git a/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchesImpl.java b/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchesImpl.java
index fd130e35dc..4c05f57d8a 100644
--- a/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchesImpl.java
+++ b/typespec-tests/src/main/java/com/cadl/patch/implementation/PatchesImpl.java
@@ -87,8 +87,7 @@ Response createOrUpdateResourceSync(@HostParam("endpoint") String en
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> createOrUpdateOptionalResource(@HostParam("endpoint") String endpoint,
-            @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept,
-            RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Patch("/patch/resource/optional")
         @ExpectedResponses({ 200 })
@@ -97,8 +96,7 @@ Mono> createOrUpdateOptionalResource(@HostParam("endpoint")
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response createOrUpdateOptionalResourceSync(@HostParam("endpoint") String endpoint,
-            @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept,
-            RequestOptions requestOptions, Context context);
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Patch("/patch/fish")
         @ExpectedResponses({ 200 })
@@ -280,6 +278,14 @@ public Response createOrUpdateResourceWithResponse(BinaryData resour
 
     /**
      * The createOrUpdateOptionalResource operation.
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/merge-patch+json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -349,7 +355,6 @@ public Response createOrUpdateResourceWithResponse(BinaryData resour
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> createOrUpdateOptionalResourceWithResponseAsync(RequestOptions requestOptions) {
-        final String contentType = "application/merge-patch+json";
         final String accept = "application/json";
         RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
         requestOptionsLocal.addRequestCallback(requestLocal -> {
@@ -357,12 +362,20 @@ public Mono> createOrUpdateOptionalResourceWithResponseAsyn
                 requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/merge-patch+json");
             }
         });
-        return FluxUtil.withContext(context -> service.createOrUpdateOptionalResource(this.client.getEndpoint(),
-            contentType, accept, requestOptionsLocal, context));
+        return FluxUtil.withContext(context -> service.createOrUpdateOptionalResource(this.client.getEndpoint(), accept,
+            requestOptionsLocal, context));
     }
 
     /**
      * The createOrUpdateOptionalResource operation.
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/merge-patch+json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -432,7 +445,6 @@ public Mono> createOrUpdateOptionalResourceWithResponseAsyn
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response createOrUpdateOptionalResourceWithResponse(RequestOptions requestOptions) {
-        final String contentType = "application/merge-patch+json";
         final String accept = "application/json";
         RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
         requestOptionsLocal.addRequestCallback(requestLocal -> {
@@ -440,8 +452,8 @@ public Response createOrUpdateOptionalResourceWithResponse(RequestOp
                 requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/merge-patch+json");
             }
         });
-        return service.createOrUpdateOptionalResourceSync(this.client.getEndpoint(), contentType, accept,
-            requestOptionsLocal, Context.NONE);
+        return service.createOrUpdateOptionalResourceSync(this.client.getEndpoint(), accept, requestOptionsLocal,
+            Context.NONE);
     }
 
     /**
diff --git a/typespec-tests/src/main/java/com/cadl/specialheaders/EtagHeadersOptionalBodyAsyncClient.java b/typespec-tests/src/main/java/com/cadl/specialheaders/EtagHeadersOptionalBodyAsyncClient.java
index ab66a8d62b..5db8ba0859 100644
--- a/typespec-tests/src/main/java/com/cadl/specialheaders/EtagHeadersOptionalBodyAsyncClient.java
+++ b/typespec-tests/src/main/java/com/cadl/specialheaders/EtagHeadersOptionalBodyAsyncClient.java
@@ -55,6 +55,8 @@ public final class EtagHeadersOptionalBodyAsyncClient {
      * 
      * 
      * 
+     * 
      * 
      * 
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
If-MatchStringNoThe request should only proceed if an entity matches this * string.
If-None-MatchStringNoThe request should only proceed if no entity matches this diff --git a/typespec-tests/src/main/java/com/cadl/specialheaders/EtagHeadersOptionalBodyClient.java b/typespec-tests/src/main/java/com/cadl/specialheaders/EtagHeadersOptionalBodyClient.java index c811a07301..dd54c1264e 100644 --- a/typespec-tests/src/main/java/com/cadl/specialheaders/EtagHeadersOptionalBodyClient.java +++ b/typespec-tests/src/main/java/com/cadl/specialheaders/EtagHeadersOptionalBodyClient.java @@ -53,6 +53,8 @@ public final class EtagHeadersOptionalBodyClient { * * * + * * *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
If-MatchStringNoThe request should only proceed if an entity matches this * string.
If-None-MatchStringNoThe request should only proceed if no entity matches this diff --git a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersOptionalBodiesImpl.java b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersOptionalBodiesImpl.java index aa8e88bcbf..ec32792dc2 100644 --- a/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersOptionalBodiesImpl.java +++ b/typespec-tests/src/main/java/com/cadl/specialheaders/implementation/EtagHeadersOptionalBodiesImpl.java @@ -76,8 +76,8 @@ public interface EtagHeadersOptionalBodiesService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> putWithOptionalBody(@HostParam("endpoint") String endpoint, - @QueryParam("format") String format, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("format") String format, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Put("/etag-headers-optional-body") @ExpectedResponses({ 200 }) @@ -86,8 +86,8 @@ Mono> putWithOptionalBody(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response putWithOptionalBodySync(@HostParam("endpoint") String endpoint, - @QueryParam("format") String format, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("format") String format, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); } /** @@ -103,6 +103,8 @@ Response putWithOptionalBodySync(@HostParam("endpoint") String endpo * * * + * * *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
If-MatchStringNoThe request should only proceed if an entity matches this * string.
If-None-MatchStringNoThe request should only proceed if no entity matches this @@ -147,7 +149,6 @@ Response putWithOptionalBodySync(@HostParam("endpoint") String endpo @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithOptionalBodyWithResponseAsync(String format, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { @@ -155,8 +156,8 @@ public Mono> putWithOptionalBodyWithResponseAsync(String fo requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); } }); - return FluxUtil.withContext(context -> service.putWithOptionalBody(this.client.getEndpoint(), format, - contentType, accept, requestOptionsLocal, context)); + return FluxUtil.withContext(context -> service.putWithOptionalBody(this.client.getEndpoint(), format, accept, + requestOptionsLocal, context)); } /** @@ -172,6 +173,8 @@ public Mono> putWithOptionalBodyWithResponseAsync(String fo * * * + * * *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
If-MatchStringNoThe request should only proceed if an entity matches this * string.
If-None-MatchStringNoThe request should only proceed if no entity matches this @@ -215,7 +218,6 @@ public Mono> putWithOptionalBodyWithResponseAsync(String fo */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithOptionalBodyWithResponse(String format, RequestOptions requestOptions) { - final String contentType = "application/json"; final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback(requestLocal -> { @@ -223,7 +225,7 @@ public Response putWithOptionalBodyWithResponse(String format, Reque requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); } }); - return service.putWithOptionalBodySync(this.client.getEndpoint(), format, contentType, accept, - requestOptionsLocal, Context.NONE); + return service.putWithOptionalBodySync(this.client.getEndpoint(), format, accept, requestOptionsLocal, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/naming/ModelAsyncClient.java b/typespec-tests/src/main/java/com/client/naming/ClientModelAsyncClient.java similarity index 95% rename from typespec-tests/src/main/java/com/client/naming/ModelAsyncClient.java rename to typespec-tests/src/main/java/com/client/naming/ClientModelAsyncClient.java index 4a780a726b..ad6a0fe3df 100644 --- a/typespec-tests/src/main/java/com/client/naming/ModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/client/naming/ClientModelAsyncClient.java @@ -16,7 +16,7 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; -import com.client.naming.implementation.ModelsImpl; +import com.client.naming.implementation.ClientModelsImpl; import com.client.naming.models.ClientModel; import com.client.naming.models.JavaModel; import reactor.core.publisher.Mono; @@ -25,17 +25,17 @@ * Initializes a new instance of the asynchronous NamingClient type. */ @ServiceClient(builder = NamingClientBuilder.class, isAsync = true) -public final class ModelAsyncClient { +public final class ClientModelAsyncClient { @Generated - private final ModelsImpl serviceClient; + private final ClientModelsImpl serviceClient; /** - * Initializes an instance of ModelAsyncClient class. + * Initializes an instance of ClientModelAsyncClient class. * * @param serviceClient the service client implementation. */ @Generated - ModelAsyncClient(ModelsImpl serviceClient) { + ClientModelAsyncClient(ClientModelsImpl serviceClient) { this.serviceClient = serviceClient; } diff --git a/typespec-tests/src/main/java/com/client/naming/ModelClient.java b/typespec-tests/src/main/java/com/client/naming/ClientModelClient.java similarity index 95% rename from typespec-tests/src/main/java/com/client/naming/ModelClient.java rename to typespec-tests/src/main/java/com/client/naming/ClientModelClient.java index dd1a3e5da0..4417a4d8fa 100644 --- a/typespec-tests/src/main/java/com/client/naming/ModelClient.java +++ b/typespec-tests/src/main/java/com/client/naming/ClientModelClient.java @@ -15,7 +15,7 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; -import com.client.naming.implementation.ModelsImpl; +import com.client.naming.implementation.ClientModelsImpl; import com.client.naming.models.ClientModel; import com.client.naming.models.JavaModel; @@ -23,17 +23,17 @@ * Initializes a new instance of the synchronous NamingClient type. */ @ServiceClient(builder = NamingClientBuilder.class) -public final class ModelClient { +public final class ClientModelClient { @Generated - private final ModelsImpl serviceClient; + private final ClientModelsImpl serviceClient; /** - * Initializes an instance of ModelClient class. + * Initializes an instance of ClientModelClient class. * * @param serviceClient the service client implementation. */ @Generated - ModelClient(ModelsImpl serviceClient) { + ClientModelClient(ClientModelsImpl serviceClient) { this.serviceClient = serviceClient; } diff --git a/typespec-tests/src/main/java/com/client/naming/NamingClientBuilder.java b/typespec-tests/src/main/java/com/client/naming/NamingClientBuilder.java index 3fcf4562d5..dfeb2c86c9 100644 --- a/typespec-tests/src/main/java/com/client/naming/NamingClientBuilder.java +++ b/typespec-tests/src/main/java/com/client/naming/NamingClientBuilder.java @@ -42,10 +42,10 @@ @ServiceClientBuilder( serviceClients = { NamingClient.class, - ModelClient.class, + ClientModelClient.class, UnionEnumClient.class, NamingAsyncClient.class, - ModelAsyncClient.class, + ClientModelAsyncClient.class, UnionEnumAsyncClient.class }) public final class NamingClientBuilder implements HttpTrait, ConfigurationTrait { @@ -262,13 +262,13 @@ public NamingAsyncClient buildAsyncClient() { } /** - * Builds an instance of ModelAsyncClient class. + * Builds an instance of ClientModelAsyncClient class. * - * @return an instance of ModelAsyncClient. + * @return an instance of ClientModelAsyncClient. */ @Generated - public ModelAsyncClient buildModelAsyncClient() { - return new ModelAsyncClient(buildInnerClient().getModels()); + public ClientModelAsyncClient buildClientModelAsyncClient() { + return new ClientModelAsyncClient(buildInnerClient().getClientModels()); } /** @@ -292,13 +292,13 @@ public NamingClient buildClient() { } /** - * Builds an instance of ModelClient class. + * Builds an instance of ClientModelClient class. * - * @return an instance of ModelClient. + * @return an instance of ClientModelClient. */ @Generated - public ModelClient buildModelClient() { - return new ModelClient(buildInnerClient().getModels()); + public ClientModelClient buildClientModelClient() { + return new ClientModelClient(buildInnerClient().getClientModels()); } /** diff --git a/typespec-tests/src/main/java/com/client/naming/implementation/ModelsImpl.java b/typespec-tests/src/main/java/com/client/naming/implementation/ClientModelsImpl.java similarity index 93% rename from typespec-tests/src/main/java/com/client/naming/implementation/ModelsImpl.java rename to typespec-tests/src/main/java/com/client/naming/implementation/ClientModelsImpl.java index 7ac45d89d1..5c10848240 100644 --- a/typespec-tests/src/main/java/com/client/naming/implementation/ModelsImpl.java +++ b/typespec-tests/src/main/java/com/client/naming/implementation/ClientModelsImpl.java @@ -26,13 +26,13 @@ import reactor.core.publisher.Mono; /** - * An instance of this class provides access to all the operations defined in Models. + * An instance of this class provides access to all the operations defined in ClientModels. */ -public final class ModelsImpl { +public final class ClientModelsImpl { /** * The proxy service used to perform REST calls. */ - private final ModelsService service; + private final ClientModelsService service; /** * The service client containing this operation class. @@ -40,22 +40,23 @@ public final class ModelsImpl { private final NamingClientImpl client; /** - * Initializes an instance of ModelsImpl. + * Initializes an instance of ClientModelsImpl. * * @param client the instance of the service client containing this operation class. */ - ModelsImpl(NamingClientImpl client) { - this.service = RestProxy.create(ModelsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + ClientModelsImpl(NamingClientImpl client) { + this.service + = RestProxy.create(ClientModelsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for NamingClientModels to be used by the proxy service to perform REST - * calls. + * The interface defining all the services for NamingClientClientModels to be used by the proxy service to perform + * REST calls. */ @Host("http://localhost:3000") - @ServiceInterface(name = "NamingClientModels") - public interface ModelsService { + @ServiceInterface(name = "NamingClientClientMo") + public interface ClientModelsService { @Post("/client/naming/model/client") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) diff --git a/typespec-tests/src/main/java/com/client/naming/implementation/NamingClientImpl.java b/typespec-tests/src/main/java/com/client/naming/implementation/NamingClientImpl.java index 6a21dc908c..948992ce54 100644 --- a/typespec-tests/src/main/java/com/client/naming/implementation/NamingClientImpl.java +++ b/typespec-tests/src/main/java/com/client/naming/implementation/NamingClientImpl.java @@ -71,17 +71,17 @@ public SerializerAdapter getSerializerAdapter() { } /** - * The ModelsImpl object to access its operations. + * The ClientModelsImpl object to access its operations. */ - private final ModelsImpl models; + private final ClientModelsImpl clientModels; /** - * Gets the ModelsImpl object to access its operations. + * Gets the ClientModelsImpl object to access its operations. * - * @return the ModelsImpl object. + * @return the ClientModelsImpl object. */ - public ModelsImpl getModels() { - return this.models; + public ClientModelsImpl getClientModels() { + return this.clientModels; } /** @@ -124,7 +124,7 @@ public NamingClientImpl(HttpPipeline httpPipeline) { public NamingClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; - this.models = new ModelsImpl(this); + this.clientModels = new ClientModelsImpl(this); this.unionEnums = new UnionEnumsImpl(this); this.service = RestProxy.create(NamingClientService.class, this.httpPipeline, this.getSerializerAdapter()); } diff --git a/typespec-tests/src/main/java/com/parameters/bodyoptionality/OptionalExplicitAsyncClient.java b/typespec-tests/src/main/java/com/parameters/bodyoptionality/OptionalExplicitAsyncClient.java index 971f5b8944..3fc48d2233 100644 --- a/typespec-tests/src/main/java/com/parameters/bodyoptionality/OptionalExplicitAsyncClient.java +++ b/typespec-tests/src/main/java/com/parameters/bodyoptionality/OptionalExplicitAsyncClient.java @@ -40,6 +40,14 @@ public final class OptionalExplicitAsyncClient { /** * The set operation. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -63,6 +71,14 @@ public Mono> setWithResponse(RequestOptions requestOptions) {
 
     /**
      * The omit operation.
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
diff --git a/typespec-tests/src/main/java/com/parameters/bodyoptionality/OptionalExplicitClient.java b/typespec-tests/src/main/java/com/parameters/bodyoptionality/OptionalExplicitClient.java
index 78a671dfa4..435a507941 100644
--- a/typespec-tests/src/main/java/com/parameters/bodyoptionality/OptionalExplicitClient.java
+++ b/typespec-tests/src/main/java/com/parameters/bodyoptionality/OptionalExplicitClient.java
@@ -38,6 +38,14 @@ public final class OptionalExplicitClient {
 
     /**
      * The set operation.
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -61,6 +69,14 @@ public Response setWithResponse(RequestOptions requestOptions) {
 
     /**
      * The omit operation.
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
diff --git a/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/OptionalExplicitsImpl.java b/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/OptionalExplicitsImpl.java
index 766827b3df..0a985849b3 100644
--- a/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/OptionalExplicitsImpl.java
+++ b/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/OptionalExplicitsImpl.java
@@ -5,7 +5,6 @@
 package com.parameters.bodyoptionality.implementation;
 
 import com.azure.core.annotation.ExpectedResponses;
-import com.azure.core.annotation.HeaderParam;
 import com.azure.core.annotation.Host;
 import com.azure.core.annotation.Post;
 import com.azure.core.annotation.ReturnType;
@@ -62,8 +61,7 @@ public interface OptionalExplicitsService {
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> set(@HeaderParam("Content-Type") String contentType, RequestOptions requestOptions,
-            Context context);
+        Mono> set(RequestOptions requestOptions, Context context);
 
         @Post("/parameters/body-optionality/optional-explicit/set")
         @ExpectedResponses({ 204 })
@@ -71,8 +69,7 @@ Mono> set(@HeaderParam("Content-Type") String contentType, Reques
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response setSync(@HeaderParam("Content-Type") String contentType, RequestOptions requestOptions,
-            Context context);
+        Response setSync(RequestOptions requestOptions, Context context);
 
         @Post("/parameters/body-optionality/optional-explicit/omit")
         @ExpectedResponses({ 204 })
@@ -80,8 +77,7 @@ Response setSync(@HeaderParam("Content-Type") String contentType, RequestO
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> omit(@HeaderParam("Content-Type") String contentType, RequestOptions requestOptions,
-            Context context);
+        Mono> omit(RequestOptions requestOptions, Context context);
 
         @Post("/parameters/body-optionality/optional-explicit/omit")
         @ExpectedResponses({ 204 })
@@ -89,12 +85,19 @@ Mono> omit(@HeaderParam("Content-Type") String contentType, Reque
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response omitSync(@HeaderParam("Content-Type") String contentType, RequestOptions requestOptions,
-            Context context);
+        Response omitSync(RequestOptions requestOptions, Context context);
     }
 
     /**
      * The set operation.
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -112,18 +115,25 @@ Response omitSync(@HeaderParam("Content-Type") String contentType, Request
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> setWithResponseAsync(RequestOptions requestOptions) {
-        final String contentType = "application/json";
         RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
         requestOptionsLocal.addRequestCallback(requestLocal -> {
             if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) {
                 requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json");
             }
         });
-        return FluxUtil.withContext(context -> service.set(contentType, requestOptionsLocal, context));
+        return FluxUtil.withContext(context -> service.set(requestOptionsLocal, context));
     }
 
     /**
      * The set operation.
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -141,18 +151,25 @@ public Mono> setWithResponseAsync(RequestOptions requestOptions)
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response setWithResponse(RequestOptions requestOptions) {
-        final String contentType = "application/json";
         RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
         requestOptionsLocal.addRequestCallback(requestLocal -> {
             if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) {
                 requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json");
             }
         });
-        return service.setSync(contentType, requestOptionsLocal, Context.NONE);
+        return service.setSync(requestOptionsLocal, Context.NONE);
     }
 
     /**
      * The omit operation.
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -170,18 +187,25 @@ public Response setWithResponse(RequestOptions requestOptions) {
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> omitWithResponseAsync(RequestOptions requestOptions) {
-        final String contentType = "application/json";
         RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
         requestOptionsLocal.addRequestCallback(requestLocal -> {
             if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) {
                 requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json");
             }
         });
-        return FluxUtil.withContext(context -> service.omit(contentType, requestOptionsLocal, context));
+        return FluxUtil.withContext(context -> service.omit(requestOptionsLocal, context));
     }
 
     /**
      * The omit operation.
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -199,13 +223,12 @@ public Mono> omitWithResponseAsync(RequestOptions requestOptions)
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response omitWithResponse(RequestOptions requestOptions) {
-        final String contentType = "application/json";
         RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
         requestOptionsLocal.addRequestCallback(requestLocal -> {
             if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) {
                 requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json");
             }
         });
-        return service.omitSync(contentType, requestOptionsLocal, Context.NONE);
+        return service.omitSync(requestOptionsLocal, Context.NONE);
     }
 }
diff --git a/typespec-tests/src/main/java/com/payload/jsonmergepatch/JsonMergePatchAsyncClient.java b/typespec-tests/src/main/java/com/payload/jsonmergepatch/JsonMergePatchAsyncClient.java
index 3fa9f091ed..ba33191a59 100644
--- a/typespec-tests/src/main/java/com/payload/jsonmergepatch/JsonMergePatchAsyncClient.java
+++ b/typespec-tests/src/main/java/com/payload/jsonmergepatch/JsonMergePatchAsyncClient.java
@@ -169,6 +169,14 @@ public Mono> updateResourceWithResponse(BinaryData body, Re
 
     /**
      * Test content-type: application/merge-patch+json with optional body.
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/merge-patch+json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
diff --git a/typespec-tests/src/main/java/com/payload/jsonmergepatch/JsonMergePatchClient.java b/typespec-tests/src/main/java/com/payload/jsonmergepatch/JsonMergePatchClient.java
index 632d20242b..08acc09d0a 100644
--- a/typespec-tests/src/main/java/com/payload/jsonmergepatch/JsonMergePatchClient.java
+++ b/typespec-tests/src/main/java/com/payload/jsonmergepatch/JsonMergePatchClient.java
@@ -167,6 +167,14 @@ public Response updateResourceWithResponse(BinaryData body, RequestO
 
     /**
      * Test content-type: application/merge-patch+json with optional body.
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/merge-patch+json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
diff --git a/typespec-tests/src/main/java/com/payload/jsonmergepatch/implementation/JsonMergePatchClientImpl.java b/typespec-tests/src/main/java/com/payload/jsonmergepatch/implementation/JsonMergePatchClientImpl.java
index cfe0492c3f..bafff60b14 100644
--- a/typespec-tests/src/main/java/com/payload/jsonmergepatch/implementation/JsonMergePatchClientImpl.java
+++ b/typespec-tests/src/main/java/com/payload/jsonmergepatch/implementation/JsonMergePatchClientImpl.java
@@ -153,8 +153,8 @@ Response updateResourceSync(@HeaderParam("content-type") String cont
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Mono> updateOptionalResource(@HeaderParam("content-type") String contentType,
-            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
+        Mono> updateOptionalResource(@HeaderParam("Accept") String accept,
+            RequestOptions requestOptions, Context context);
 
         @Patch("/json-merge-patch/update/resource/optional")
         @ExpectedResponses({ 200 })
@@ -162,8 +162,8 @@ Mono> updateOptionalResource(@HeaderParam("content-type") S
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response updateOptionalResourceSync(@HeaderParam("content-type") String contentType,
-            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
+        Response updateOptionalResourceSync(@HeaderParam("Accept") String accept,
+            RequestOptions requestOptions, Context context);
     }
 
     /**
@@ -428,6 +428,14 @@ public Response updateResourceWithResponse(BinaryData body, RequestO
 
     /**
      * Test content-type: application/merge-patch+json with optional body.
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/merge-patch+json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -484,7 +492,6 @@ public Response updateResourceWithResponse(BinaryData body, RequestO
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> updateOptionalResourceWithResponseAsync(RequestOptions requestOptions) {
-        final String contentType = "application/merge-patch+json";
         final String accept = "application/json";
         RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
         requestOptionsLocal.addRequestCallback(requestLocal -> {
@@ -492,12 +499,19 @@ public Mono> updateOptionalResourceWithResponseAsync(Reques
                 requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/merge-patch+json");
             }
         });
-        return FluxUtil
-            .withContext(context -> service.updateOptionalResource(contentType, accept, requestOptionsLocal, context));
+        return FluxUtil.withContext(context -> service.updateOptionalResource(accept, requestOptionsLocal, context));
     }
 
     /**
      * Test content-type: application/merge-patch+json with optional body.
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/merge-patch+json".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
{@code
@@ -554,7 +568,6 @@ public Mono> updateOptionalResourceWithResponseAsync(Reques
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response updateOptionalResourceWithResponse(RequestOptions requestOptions) {
-        final String contentType = "application/merge-patch+json";
         final String accept = "application/json";
         RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
         requestOptionsLocal.addRequestCallback(requestLocal -> {
@@ -562,6 +575,6 @@ public Response updateOptionalResourceWithResponse(RequestOptions re
                 requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/merge-patch+json");
             }
         });
-        return service.updateOptionalResourceSync(contentType, accept, requestOptionsLocal, Context.NONE);
+        return service.updateOptionalResourceSync(accept, requestOptionsLocal, Context.NONE);
     }
 }
diff --git a/typespec-tests/src/main/java/com/payload/multipart/models/ComplexPartsRequest.java b/typespec-tests/src/main/java/com/payload/multipart/models/ComplexPartsRequest.java
index 59e2ed120c..d1d44e5398 100644
--- a/typespec-tests/src/main/java/com/payload/multipart/models/ComplexPartsRequest.java
+++ b/typespec-tests/src/main/java/com/payload/multipart/models/ComplexPartsRequest.java
@@ -35,7 +35,7 @@ public final class ComplexPartsRequest {
      * The previousAddresses property.
      */
     @Generated
-    private final List
previousAddresses; + private final List> previousAddresses; /* * The pictures property. @@ -54,7 +54,7 @@ public final class ComplexPartsRequest { */ @Generated public ComplexPartsRequest(String id, Address address, ProfileImageFileDetails profileImage, - List
previousAddresses, List pictures) { + List> previousAddresses, List pictures) { this.id = id; this.address = address; this.profileImage = profileImage; @@ -98,7 +98,7 @@ public ProfileImageFileDetails getProfileImage() { * @return the previousAddresses value. */ @Generated - public List
getPreviousAddresses() { + public List> getPreviousAddresses() { return this.previousAddresses; } diff --git a/typespec-tests/src/main/java/com/payload/multipart/models/JsonArrayPartsRequest.java b/typespec-tests/src/main/java/com/payload/multipart/models/JsonArrayPartsRequest.java index 6af4fba825..cde19fe8d8 100644 --- a/typespec-tests/src/main/java/com/payload/multipart/models/JsonArrayPartsRequest.java +++ b/typespec-tests/src/main/java/com/payload/multipart/models/JsonArrayPartsRequest.java @@ -23,7 +23,7 @@ public final class JsonArrayPartsRequest { * The previousAddresses property. */ @Generated - private final List
previousAddresses; + private final List> previousAddresses; /** * Creates an instance of JsonArrayPartsRequest class. @@ -32,7 +32,7 @@ public final class JsonArrayPartsRequest { * @param previousAddresses the previousAddresses value to set. */ @Generated - public JsonArrayPartsRequest(ProfileImageFileDetails profileImage, List
previousAddresses) { + public JsonArrayPartsRequest(ProfileImageFileDetails profileImage, List> previousAddresses) { this.profileImage = profileImage; this.previousAddresses = previousAddresses; } @@ -53,7 +53,7 @@ public ProfileImageFileDetails getProfileImage() { * @return the previousAddresses value. */ @Generated - public List
getPreviousAddresses() { + public List> getPreviousAddresses() { return this.previousAddresses; } } diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorAsyncClient.java b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorAsyncClient.java index 9220524eb4..f75a57ccab 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorAsyncClient.java @@ -105,8 +105,7 @@ public Mono> putExtensibleModelWithResponse(BinaryData input, Req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test extensible enum type for discriminator along with {@link Response} on successful completion of - * {@link Mono}. + * @return a model omitting the discriminator along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -131,8 +130,8 @@ public Mono> putExtensibleModelWithResponse(BinaryData input, Req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test extensible enum type for discriminator along with {@link Response} on successful completion of - * {@link Mono}. + * @return a model containing discriminator value never defined along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -206,8 +205,7 @@ public Mono> putFixedModelWithResponse(BinaryData input, RequestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test fixed enum type for discriminator along with {@link Response} on successful completion of - * {@link Mono}. + * @return a model omitting the discriminator along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -231,8 +229,8 @@ public Mono> getFixedModelMissingDiscriminatorWithResponse( * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test fixed enum type for discriminator along with {@link Response} on successful completion of - * {@link Mono}. + * @return a model containing discriminator value never defined along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -287,7 +285,7 @@ public Mono putExtensibleModel(Dog input) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return test extensible enum type for discriminator on successful completion of {@link Mono}. + * @return a model omitting the discriminator on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -306,7 +304,7 @@ public Mono getExtensibleModelMissingDiscriminator() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return test extensible enum type for discriminator on successful completion of {@link Mono}. + * @return a model containing discriminator value never defined on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -364,7 +362,7 @@ public Mono putFixedModel(Snake input) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return test fixed enum type for discriminator on successful completion of {@link Mono}. + * @return a model omitting the discriminator on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -383,7 +381,7 @@ public Mono getFixedModelMissingDiscriminator() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return test fixed enum type for discriminator on successful completion of {@link Mono}. + * @return a model containing discriminator value never defined on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorClient.java b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorClient.java index 3ab5802713..5ab61e86e0 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorClient.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorClient.java @@ -102,7 +102,7 @@ public Response putExtensibleModelWithResponse(BinaryData input, RequestOp * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test extensible enum type for discriminator along with {@link Response}. + * @return a model omitting the discriminator along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -126,7 +126,7 @@ public Response getExtensibleModelMissingDiscriminatorWithResponse(R * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test extensible enum type for discriminator along with {@link Response}. + * @return a model containing discriminator value never defined along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -199,7 +199,7 @@ public Response putFixedModelWithResponse(BinaryData input, RequestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test fixed enum type for discriminator along with {@link Response}. + * @return a model omitting the discriminator along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -223,7 +223,7 @@ public Response getFixedModelMissingDiscriminatorWithResponse(Reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test fixed enum type for discriminator along with {@link Response}. + * @return a model containing discriminator value never defined along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -276,7 +276,7 @@ public void putExtensibleModel(Dog input) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return test extensible enum type for discriminator. + * @return a model omitting the discriminator. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -294,7 +294,7 @@ public Dog getExtensibleModelMissingDiscriminator() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return test extensible enum type for discriminator. + * @return a model containing discriminator value never defined. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -349,7 +349,7 @@ public void putFixedModel(Snake input) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return test fixed enum type for discriminator. + * @return a model omitting the discriminator. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -367,7 +367,7 @@ public Snake getFixedModelMissingDiscriminator() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return test fixed enum type for discriminator. + * @return a model containing discriminator value never defined. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/implementation/EnumDiscriminatorClientImpl.java b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/implementation/EnumDiscriminatorClientImpl.java index a7209ae879..084e032e36 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/implementation/EnumDiscriminatorClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/implementation/EnumDiscriminatorClientImpl.java @@ -366,8 +366,7 @@ public Response putExtensibleModelWithResponse(BinaryData input, RequestOp * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test extensible enum type for discriminator along with {@link Response} on successful completion of - * {@link Mono}. + * @return a model omitting the discriminator along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> @@ -393,7 +392,7 @@ public Response putExtensibleModelWithResponse(BinaryData input, RequestOp * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test extensible enum type for discriminator along with {@link Response}. + * @return a model omitting the discriminator along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getExtensibleModelMissingDiscriminatorWithResponse(RequestOptions requestOptions) { @@ -417,8 +416,8 @@ public Response getExtensibleModelMissingDiscriminatorWithResponse(R * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test extensible enum type for discriminator along with {@link Response} on successful completion of - * {@link Mono}. + * @return a model containing discriminator value never defined along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> @@ -444,7 +443,7 @@ public Response getExtensibleModelMissingDiscriminatorWithResponse(R * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test extensible enum type for discriminator along with {@link Response}. + * @return a model containing discriminator value never defined along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getExtensibleModelWrongDiscriminatorWithResponse(RequestOptions requestOptions) { @@ -567,8 +566,7 @@ public Response putFixedModelWithResponse(BinaryData input, RequestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test fixed enum type for discriminator along with {@link Response} on successful completion of - * {@link Mono}. + * @return a model omitting the discriminator along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> @@ -594,7 +592,7 @@ public Response putFixedModelWithResponse(BinaryData input, RequestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test fixed enum type for discriminator along with {@link Response}. + * @return a model omitting the discriminator along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getFixedModelMissingDiscriminatorWithResponse(RequestOptions requestOptions) { @@ -618,8 +616,8 @@ public Response getFixedModelMissingDiscriminatorWithResponse(Reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test fixed enum type for discriminator along with {@link Response} on successful completion of - * {@link Mono}. + * @return a model containing discriminator value never defined along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getFixedModelWrongDiscriminatorWithResponseAsync(RequestOptions requestOptions) { @@ -644,7 +642,7 @@ public Mono> getFixedModelWrongDiscriminatorWithResponseAsy * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test fixed enum type for discriminator along with {@link Response}. + * @return a model containing discriminator value never defined along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getFixedModelWrongDiscriminatorWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatAsyncClient.java index 6bb710ebf5..0a77172f15 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatAsyncClient.java @@ -57,8 +57,7 @@ public final class ExtendsDifferentSpreadFloatAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<float32> with the different known property type - * along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -102,8 +101,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from a model that spread Record<float32> with the different known property type - * on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatClient.java index bc2422ccb7..a18b3d3fc5 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadFloatClient.java @@ -55,8 +55,7 @@ public final class ExtendsDifferentSpreadFloatClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<float32> with the different known property type - * along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from a model that spread Record<float32> with the different known property type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayAsyncClient.java index f002e61953..8e539dc46c 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayAsyncClient.java @@ -63,8 +63,7 @@ public final class ExtendsDifferentSpreadModelArrayAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<ModelForRecord[]> with the different known - * property type along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -114,8 +113,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from a model that spread Record<ModelForRecord[]> with the different known - * property type on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayClient.java index 19967ec10b..c9341fbd75 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelArrayClient.java @@ -61,8 +61,7 @@ public final class ExtendsDifferentSpreadModelArrayClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<ModelForRecord[]> with the different known - * property type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -112,8 +111,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from a model that spread Record<ModelForRecord[]> with the different known - * property type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelAsyncClient.java index 7bd1089729..edeaef6e63 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelAsyncClient.java @@ -59,8 +59,7 @@ public final class ExtendsDifferentSpreadModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<ModelForRecord> with the different known property - * type along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -106,8 +105,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from a model that spread Record<ModelForRecord> with the different known property - * type on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelClient.java index a4de285a70..3ef771373b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadModelClient.java @@ -57,8 +57,7 @@ public final class ExtendsDifferentSpreadModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<ModelForRecord> with the different known property - * type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -104,8 +103,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from a model that spread Record<ModelForRecord> with the different known property - * type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringAsyncClient.java index 714c54aed9..79c7ee9f46 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringAsyncClient.java @@ -57,8 +57,7 @@ public final class ExtendsDifferentSpreadStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<string> with the different known property type - * along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -102,8 +101,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from a model that spread Record<string> with the different known property type on - * successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringClient.java index 956a1b7d23..c110a4e66e 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsDifferentSpreadStringClient.java @@ -55,8 +55,7 @@ public final class ExtendsDifferentSpreadStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<string> with the different known property type - * along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from a model that spread Record<string> with the different known property type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatAsyncClient.java index f730ea2bb2..165efe0962 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatAsyncClient.java @@ -56,8 +56,7 @@ public final class ExtendsFloatAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<float32> type along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from Record<float32> type on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatClient.java index 13a6671339..2344a7bcc7 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsFloatClient.java @@ -54,7 +54,7 @@ public final class ExtendsFloatClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<float32> type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from Record<float32> type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayAsyncClient.java index 9261fc56a2..aee6c3bdfc 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayAsyncClient.java @@ -62,8 +62,7 @@ public final class ExtendsModelArrayAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<ModelForRecord[]> type along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -112,7 +111,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from Record<ModelForRecord[]> type on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayClient.java index 9fd0bb8f8c..112640784b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelArrayClient.java @@ -60,7 +60,7 @@ public final class ExtendsModelArrayClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<ModelForRecord[]> type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -109,7 +109,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from Record<ModelForRecord[]> type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelAsyncClient.java index 93a7496c97..3e2c8a262b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelAsyncClient.java @@ -58,8 +58,7 @@ public final class ExtendsModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<ModelForRecord> type along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -104,7 +103,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from Record<ModelForRecord> type on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelClient.java index 929d4454c8..350b125c5b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsModelClient.java @@ -56,7 +56,7 @@ public final class ExtendsModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<ModelForRecord> type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +101,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from Record<ModelForRecord> type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringAsyncClient.java index cd7eab90a1..631556ec37 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringAsyncClient.java @@ -56,8 +56,7 @@ public final class ExtendsStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<string> type along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from Record<string> type on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringClient.java index 5b64a375ac..18ef0b0b98 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsStringClient.java @@ -54,7 +54,7 @@ public final class ExtendsStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<string> type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from Record<string> type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownAsyncClient.java index 17fedcb062..a3971293d0 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownAsyncClient.java @@ -56,8 +56,7 @@ public final class ExtendsUnknownAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<unknown> type along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from Record<unknown> type on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownClient.java index 7470e09e3c..d1223a9711 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownClient.java @@ -54,7 +54,7 @@ public final class ExtendsUnknownClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<unknown> type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from Record<unknown> type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedAsyncClient.java index 62eba489a9..47555089a1 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedAsyncClient.java @@ -58,8 +58,7 @@ public final class ExtendsUnknownDerivedAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a type that extends from Record<unknown> along with {@link Response} on - * successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -104,8 +103,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from a type that extends from Record<unknown> on successful completion of - * {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedClient.java index d8a5cc01c5..a711f89a99 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDerivedClient.java @@ -56,7 +56,7 @@ public final class ExtendsUnknownDerivedClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a type that extends from Record<unknown> along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +101,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from a type that extends from Record<unknown>. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedAsyncClient.java index 226d004e8b..2996ebdb51 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedAsyncClient.java @@ -57,8 +57,7 @@ public final class ExtendsUnknownDiscriminatedAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<unknown> with a discriminator along with {@link Response} on - * successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -102,8 +101,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from Record<unknown> with a discriminator on successful completion of - * {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedClient.java index 25288a4269..8c65533253 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/ExtendsUnknownDiscriminatedClient.java @@ -55,7 +55,7 @@ public final class ExtendsUnknownDiscriminatedClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<unknown> with a discriminator along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +99,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from Record<unknown> with a discriminator. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatAsyncClient.java index e092c6732f..f0b5bec866 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatAsyncClient.java @@ -56,8 +56,7 @@ public final class IsFloatAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<float32> type along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model is from Record<float32> type on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatClient.java index 62521ba1db..59f59264a0 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsFloatClient.java @@ -54,7 +54,7 @@ public final class IsFloatClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<float32> type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model is from Record<float32> type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayAsyncClient.java index 0f41954adf..dc5b7a138c 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayAsyncClient.java @@ -62,8 +62,7 @@ public final class IsModelArrayAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<ModelForRecord[]> type along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -112,7 +111,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model is from Record<ModelForRecord[]> type on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayClient.java index 247008401b..ed99323bec 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelArrayClient.java @@ -60,7 +60,7 @@ public final class IsModelArrayClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<ModelForRecord[]> type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -109,7 +109,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model is from Record<ModelForRecord[]> type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelAsyncClient.java index 25e851b3ff..245ff40887 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelAsyncClient.java @@ -58,8 +58,7 @@ public final class IsModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<ModelForRecord> type along with {@link Response} on successful completion - * of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -104,7 +103,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model is from Record<ModelForRecord> type on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelClient.java index c38f983cc6..cb9bb36ef3 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsModelClient.java @@ -56,7 +56,7 @@ public final class IsModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<ModelForRecord> type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +101,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model is from Record<ModelForRecord> type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringAsyncClient.java index 90ba3dc461..4388e9f9a7 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringAsyncClient.java @@ -56,8 +56,7 @@ public final class IsStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<string> type along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model is from Record<string> type on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringClient.java index 5cc8e95486..54f77899d5 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsStringClient.java @@ -54,7 +54,7 @@ public final class IsStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<string> type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model is from Record<string> type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownAsyncClient.java index 71a28db9ec..56fb6113f7 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownAsyncClient.java @@ -56,8 +56,7 @@ public final class IsUnknownAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<unknown> type along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model is from Record<unknown> type on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownClient.java index 0990ca7125..e5fde6da37 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownClient.java @@ -54,7 +54,7 @@ public final class IsUnknownClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<unknown> type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model is from Record<unknown> type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedAsyncClient.java index 3b65a75c16..6527d2fd23 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedAsyncClient.java @@ -58,8 +58,7 @@ public final class IsUnknownDerivedAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a type that is Record<unknown> type along with {@link Response} on - * successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -104,8 +103,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from a type that is Record<unknown> type on successful completion of - * {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedClient.java index 3fd6631f2e..ff945769c1 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDerivedClient.java @@ -56,7 +56,7 @@ public final class IsUnknownDerivedClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a type that is Record<unknown> type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,7 +101,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model extends from a type that is Record<unknown> type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedAsyncClient.java index 926dac37f4..33cd143e8a 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedAsyncClient.java @@ -57,8 +57,7 @@ public final class IsUnknownDiscriminatedAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is Record<unknown> with a discriminator along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -102,7 +101,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model is Record<unknown> with a discriminator on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedClient.java index 6830a100e9..8d336689cc 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/IsUnknownDiscriminatedClient.java @@ -55,7 +55,7 @@ public final class IsUnknownDiscriminatedClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is Record<unknown> with a discriminator along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +99,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model is Record<unknown> with a discriminator. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadAsyncClient.java index c922f38890..4a7f13d101 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadAsyncClient.java @@ -56,8 +56,7 @@ public final class MultipleSpreadAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string> and Record<float32> along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<string> and Record<float32> on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadClient.java index 0537e3ddcf..695adb7ab4 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/MultipleSpreadClient.java @@ -54,7 +54,7 @@ public final class MultipleSpreadClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string> and Record<float32> along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<string> and Record<float32>. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatAsyncClient.java index fb314eb760..52c264e60c 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatAsyncClient.java @@ -56,8 +56,7 @@ public final class SpreadDifferentFloatAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<float32> with the different known property type along with {@link Response} - * on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,8 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<float32> with the different known property type on successful completion of - * {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatClient.java index f88fff8d92..cf800c43fe 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentFloatClient.java @@ -54,8 +54,7 @@ public final class SpreadDifferentFloatClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<float32> with the different known property type along with - * {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -98,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<float32> with the different known property type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayAsyncClient.java index e286ae7d94..90fbf5a45e 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayAsyncClient.java @@ -60,8 +60,7 @@ public final class SpreadDifferentModelArrayAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<ModelForRecord[]> with the different known property type along with - * {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -108,8 +107,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<ModelForRecord[]> with the different known property type on successful - * completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayClient.java index cfd2094235..75c931ef47 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelArrayClient.java @@ -58,8 +58,7 @@ public final class SpreadDifferentModelArrayClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<ModelForRecord[]> with the different known property type along with - * {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -106,7 +105,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<ModelForRecord[]> with the different known property type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelAsyncClient.java index d587b7f673..dd78d0eafa 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelAsyncClient.java @@ -58,8 +58,7 @@ public final class SpreadDifferentModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<ModelForRecord> with the different known property type along with - * {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -104,8 +103,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<ModelForRecord> with the different known property type on successful - * completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelClient.java index 3c8399d490..2de9b57e67 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentModelClient.java @@ -56,8 +56,7 @@ public final class SpreadDifferentModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<ModelForRecord> with the different known property type along with - * {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -102,7 +101,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<ModelForRecord> with the different known property type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringAsyncClient.java index be6d3a5fe5..9a5b404239 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringAsyncClient.java @@ -56,8 +56,7 @@ public final class SpreadDifferentStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string> with the different known property type along with {@link Response} - * on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,8 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<string> with the different known property type on successful completion of - * {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringClient.java index 19d4ba0b53..c052f4d6b2 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadDifferentStringClient.java @@ -54,7 +54,7 @@ public final class SpreadDifferentStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string> with the different known property type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<string> with the different known property type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatAsyncClient.java index aea11ced99..4491b1cea4 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatAsyncClient.java @@ -56,8 +56,7 @@ public final class SpreadFloatAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<float32> with the same known property type along with {@link Response} on - * successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,8 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<float32> with the same known property type on successful completion of - * {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatClient.java index d47074a53f..844165116e 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadFloatClient.java @@ -54,7 +54,7 @@ public final class SpreadFloatClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<float32> with the same known property type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<float32> with the same known property type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayAsyncClient.java index 21c8cb7745..bfb87faa8f 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayAsyncClient.java @@ -62,7 +62,7 @@ public final class SpreadModelArrayAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -111,7 +111,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayClient.java index 5dd8466491..d869e8b9df 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelArrayClient.java @@ -60,7 +60,7 @@ public final class SpreadModelArrayClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -109,7 +109,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelAsyncClient.java index 8ce7cdb6c7..c1250d5eec 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelAsyncClient.java @@ -58,8 +58,7 @@ public final class SpreadModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<ModelForRecord> with the same known property type along with - * {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -104,8 +103,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<ModelForRecord> with the same known property type on successful completion - * of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelClient.java index 4c46cfe548..ed489d4347 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadModelClient.java @@ -56,8 +56,7 @@ public final class SpreadModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<ModelForRecord> with the same known property type along with - * {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -102,7 +101,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<ModelForRecord> with the same known property type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionAsyncClient.java index 4a8f20819b..7baae2dcb8 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionAsyncClient.java @@ -56,8 +56,7 @@ public final class SpreadRecordDiscriminatedUnionAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData> along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<WidgetData> on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionClient.java index 6e397cd71a..641f7c8498 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordDiscriminatedUnionClient.java @@ -54,7 +54,7 @@ public final class SpreadRecordDiscriminatedUnionClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData> along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<WidgetData>. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2AsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2AsyncClient.java index 1b655db476..25d072990b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2AsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2AsyncClient.java @@ -56,8 +56,7 @@ public final class SpreadRecordNonDiscriminatedUnion2AsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData2 | WidgetData1> along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<WidgetData2 | WidgetData1> on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2Client.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2Client.java index a6a9f04145..25af9e4463 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2Client.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion2Client.java @@ -54,7 +54,7 @@ public final class SpreadRecordNonDiscriminatedUnion2Client { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData2 | WidgetData1> along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<WidgetData2 | WidgetData1>. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3AsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3AsyncClient.java index 1dbabff923..067ee6ee43 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3AsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3AsyncClient.java @@ -56,8 +56,7 @@ public final class SpreadRecordNonDiscriminatedUnion3AsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData2[] | WidgetData1> along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<WidgetData2[] | WidgetData1> on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3Client.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3Client.java index 6fac9d6a5b..d14844fa24 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3Client.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnion3Client.java @@ -54,7 +54,7 @@ public final class SpreadRecordNonDiscriminatedUnion3Client { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData2[] | WidgetData1> along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<WidgetData2[] | WidgetData1>. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionAsyncClient.java index 77cc859c3c..637b3d680f 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionAsyncClient.java @@ -56,8 +56,7 @@ public final class SpreadRecordNonDiscriminatedUnionAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData0 | WidgetData1> along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<WidgetData0 | WidgetData1> on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionClient.java index c8012b543b..96fda8ee04 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordNonDiscriminatedUnionClient.java @@ -54,7 +54,7 @@ public final class SpreadRecordNonDiscriminatedUnionClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData0 | WidgetData1> along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<WidgetData0 | WidgetData1>. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionAsyncClient.java index 70a66e9ed6..f59998aac8 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionAsyncClient.java @@ -56,8 +56,7 @@ public final class SpreadRecordUnionAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string | float32> along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,7 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<string | float32> on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionClient.java index 5a995d9fa3..c8eaa17b0a 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadRecordUnionClient.java @@ -54,7 +54,7 @@ public final class SpreadRecordUnionClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string | float32> along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<string | float32>. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringAsyncClient.java index 5336b072b3..51c27dd0e2 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringAsyncClient.java @@ -56,8 +56,7 @@ public final class SpreadStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string> with the same known property type along with {@link Response} on - * successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -100,8 +99,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<string> with the same known property type on successful completion of - * {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringClient.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringClient.java index cfa9d95e6a..ccd1774615 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/SpreadStringClient.java @@ -54,7 +54,7 @@ public final class SpreadStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string> with the same known property type along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the model spread Record<string> with the same known property type. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadFloatsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadFloatsImpl.java index 946a56caa5..ffb0197353 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadFloatsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadFloatsImpl.java @@ -114,8 +114,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<float32> with the different known property type - * along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -142,8 +141,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<float32> with the different known property type - * along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelArraysImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelArraysImpl.java index 2224e88ced..b9a2ffa301 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelArraysImpl.java @@ -120,8 +120,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<ModelForRecord[]> with the different known - * property type along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -154,8 +153,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<ModelForRecord[]> with the different known - * property type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelsImpl.java index 7df490a68a..3f59e42f7f 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelsImpl.java @@ -116,8 +116,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<ModelForRecord> with the different known property - * type along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -146,8 +145,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<ModelForRecord> with the different known property - * type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadStringsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadStringsImpl.java index a4e516d9f8..7a2179bcc4 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadStringsImpl.java @@ -114,8 +114,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<string> with the different known property type - * along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -142,8 +141,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a model that spread Record<string> with the different known property type - * along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsFloatsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsFloatsImpl.java index 8dce92e7f6..9ea95e3469 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsFloatsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsFloatsImpl.java @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<float32> type along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<float32> type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelArraysImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelArraysImpl.java index 2afe79bda0..d2a6618961 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelArraysImpl.java @@ -119,8 +119,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<ModelForRecord[]> type along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -152,7 +151,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<ModelForRecord[]> type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelsImpl.java index 1c63df2d2f..e1a0f32006 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelsImpl.java @@ -115,8 +115,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<ModelForRecord> type along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -144,7 +143,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<ModelForRecord> type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsStringsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsStringsImpl.java index e91ac0bf9f..ec90ab0851 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsStringsImpl.java @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<string> type along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<string> type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDerivedsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDerivedsImpl.java index ad3970029c..28306a44ac 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDerivedsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDerivedsImpl.java @@ -115,8 +115,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a type that extends from Record<unknown> along with {@link Response} on - * successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -144,7 +143,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a type that extends from Record<unknown> along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDiscriminatedsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDiscriminatedsImpl.java index 287ba0ef13..c76d93b58d 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDiscriminatedsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDiscriminatedsImpl.java @@ -114,8 +114,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<unknown> with a discriminator along with {@link Response} on - * successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -142,7 +141,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<unknown> with a discriminator along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownsImpl.java index 3399b10f12..9dad3c7556 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownsImpl.java @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<unknown> type along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from Record<unknown> type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsFloatsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsFloatsImpl.java index a9c9d63f2d..8dfe82de6a 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsFloatsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsFloatsImpl.java @@ -112,8 +112,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<float32> type along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -139,7 +138,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<float32> type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelArraysImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelArraysImpl.java index 98824cb300..b31e829d3c 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelArraysImpl.java @@ -119,8 +119,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<ModelForRecord[]> type along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -152,7 +151,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<ModelForRecord[]> type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelsImpl.java index f2ca76a184..85e31cdeef 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelsImpl.java @@ -114,8 +114,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<ModelForRecord> type along with {@link Response} on successful completion - * of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -143,7 +142,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<ModelForRecord> type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsStringsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsStringsImpl.java index c47ae7c73d..c5157a675c 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsStringsImpl.java @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<string> type along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<string> type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDerivedsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDerivedsImpl.java index e25c66368b..eff4ab4bc0 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDerivedsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDerivedsImpl.java @@ -115,8 +115,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a type that is Record<unknown> type along with {@link Response} on - * successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -144,7 +143,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model extends from a type that is Record<unknown> type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDiscriminatedsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDiscriminatedsImpl.java index 03c85f799c..62e8c5db42 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDiscriminatedsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDiscriminatedsImpl.java @@ -114,8 +114,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is Record<unknown> with a discriminator along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -142,7 +141,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is Record<unknown> with a discriminator along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownsImpl.java index 01f14ff39c..3e12bf7921 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownsImpl.java @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<unknown> type along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model is from Record<unknown> type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/MultipleSpreadsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/MultipleSpreadsImpl.java index 2d18a071fb..8a3dbe5b28 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/MultipleSpreadsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/MultipleSpreadsImpl.java @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string> and Record<float32> along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string> and Record<float32> along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentFloatsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentFloatsImpl.java index bc2e7bdc53..f57e7c2327 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentFloatsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentFloatsImpl.java @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<float32> with the different known property type along with {@link Response} - * on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,8 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<float32> with the different known property type along with - * {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelArraysImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelArraysImpl.java index fd3e7daac7..4588c2288b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelArraysImpl.java @@ -117,8 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<ModelForRecord[]> with the different known property type along with - * {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -148,8 +147,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<ModelForRecord[]> with the different known property type along with - * {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelsImpl.java index 28515b154d..edf1540a70 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelsImpl.java @@ -115,8 +115,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<ModelForRecord> with the different known property type along with - * {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -144,8 +143,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<ModelForRecord> with the different known property type along with - * {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentStringsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentStringsImpl.java index 5666b47ca9..37710f6e8a 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentStringsImpl.java @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string> with the different known property type along with {@link Response} - * on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string> with the different known property type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadFloatsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadFloatsImpl.java index 01300615b0..e704c12195 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadFloatsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadFloatsImpl.java @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<float32> with the same known property type along with {@link Response} on - * successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<float32> with the same known property type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelArraysImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelArraysImpl.java index 2fe8d8ed8a..24b3640e1b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelArraysImpl.java @@ -119,7 +119,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -151,7 +151,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelsImpl.java index 16f2061cba..92f6e49681 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelsImpl.java @@ -115,8 +115,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<ModelForRecord> with the same known property type along with - * {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -144,8 +143,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<ModelForRecord> with the same known property type along with - * {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordDiscriminatedUnionsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordDiscriminatedUnionsImpl.java index 95322abccc..181c50a924 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordDiscriminatedUnionsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordDiscriminatedUnionsImpl.java @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData> along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData> along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion2sImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion2sImpl.java index eaa2c35421..a28ff3d370 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion2sImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion2sImpl.java @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData2 | WidgetData1> along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData2 | WidgetData1> along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion3sImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion3sImpl.java index 80628db295..198bace3bd 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion3sImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion3sImpl.java @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData2[] | WidgetData1> along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData2[] | WidgetData1> along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnionsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnionsImpl.java index 36ac49fea4..becaa4329b 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnionsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnionsImpl.java @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData0 | WidgetData1> along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<WidgetData0 | WidgetData1> along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordUnionsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordUnionsImpl.java index 2992f99561..9d128dac44 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordUnionsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordUnionsImpl.java @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string | float32> along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string | float32> along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadStringsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadStringsImpl.java index 434a600f5e..2bb5668e9f 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadStringsImpl.java @@ -113,8 +113,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string> with the same known property type along with {@link Response} on - * successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -140,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the model spread Record<string> with the same known property type along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/nullable/BytesAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/BytesAsyncClient.java index f64a4f3790..dc15c34de7 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/BytesAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/BytesAsyncClient.java @@ -55,8 +55,8 @@ public final class BytesAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -80,8 +80,8 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -147,7 +147,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with nullable property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -166,7 +166,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with nullable property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/BytesClient.java b/typespec-tests/src/main/java/com/type/property/nullable/BytesClient.java index b49fb83f3a..d8ae75cd3b 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/BytesClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/BytesClient.java @@ -53,7 +53,7 @@ public final class BytesClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -143,7 +143,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with nullable property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public BytesProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with nullable property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteAsyncClient.java index 33c181cee0..85e397e71a 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteAsyncClient.java @@ -57,8 +57,8 @@ public final class CollectionsByteAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -84,7 +84,7 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -155,7 +155,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection bytes properties on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -174,7 +174,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection bytes properties on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteClient.java b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteClient.java index f1f918e423..058ede5f10 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsByteClient.java @@ -55,7 +55,7 @@ public final class CollectionsByteClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -81,7 +81,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -151,7 +151,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection bytes properties. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -169,7 +169,7 @@ public CollectionsByteProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection bytes properties. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelAsyncClient.java index 9f5b5bceaa..a0aca8862f 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelAsyncClient.java @@ -59,8 +59,8 @@ public final class CollectionsModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -88,7 +88,7 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -163,7 +163,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection models properties on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -182,7 +182,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection models properties on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelClient.java b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelClient.java index 75aa3bbe2e..ce1d4f5cc9 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsModelClient.java @@ -57,7 +57,7 @@ public final class CollectionsModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -85,7 +85,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -159,7 +159,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection models properties. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -177,7 +177,7 @@ public CollectionsModelProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection models properties. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringAsyncClient.java index 327312e43b..a7a9cfdb5f 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringAsyncClient.java @@ -57,8 +57,8 @@ public final class CollectionsStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection string properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -84,7 +84,7 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection string properties along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -155,7 +155,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection string properties on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -174,7 +174,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection string properties on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringClient.java b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringClient.java index 9344eb47fd..3329a9e430 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/CollectionsStringClient.java @@ -55,7 +55,7 @@ public final class CollectionsStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection string properties along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -81,7 +81,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection string properties along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -151,7 +151,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection string properties. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -169,7 +169,7 @@ public CollectionsStringProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection string properties. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationAsyncClient.java index 2c4fe80d38..ef61ca233d 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationAsyncClient.java @@ -55,7 +55,8 @@ public final class DatetimeOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -79,7 +80,8 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -145,7 +147,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a datetime property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -164,7 +166,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a datetime property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationClient.java b/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationClient.java index fe7be8ddbb..dfeb42ff6e 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/DatetimeOperationClient.java @@ -53,7 +53,7 @@ public final class DatetimeOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -143,7 +143,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a datetime property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public DatetimeProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a datetime property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationAsyncClient.java index 45db0da472..3766704382 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationAsyncClient.java @@ -55,7 +55,8 @@ public final class DurationOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -79,7 +80,8 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -145,7 +147,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a duration property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -164,7 +166,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a duration property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationClient.java b/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationClient.java index 2ba1cc33b0..e3a7cd47fb 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/DurationOperationClient.java @@ -53,7 +53,7 @@ public final class DurationOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -143,7 +143,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a duration property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public DurationProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a duration property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/StringOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/nullable/StringOperationAsyncClient.java index 11befcbcb2..64cc982cfb 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/StringOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/StringOperationAsyncClient.java @@ -55,8 +55,8 @@ public final class StringOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -80,8 +80,8 @@ public Mono> getNonNullWithResponse(RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -147,7 +147,7 @@ public Mono> patchNullWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with nullable property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -166,7 +166,7 @@ public Mono getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with nullable property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/StringOperationClient.java b/typespec-tests/src/main/java/com/type/property/nullable/StringOperationClient.java index cde6151b68..3ec28d6f8a 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/StringOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/StringOperationClient.java @@ -53,7 +53,7 @@ public final class StringOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -143,7 +143,7 @@ public Response patchNullWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with nullable property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public StringProperty getNonNull() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with nullable property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/BytesImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/BytesImpl.java index aa8586ce95..0920e15575 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/BytesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/BytesImpl.java @@ -146,8 +146,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -171,7 +171,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -195,8 +195,8 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync(RequestOptions requestOptions) { @@ -220,7 +220,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsBytesImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsBytesImpl.java index cf1dff1bd6..ea56c0a9ed 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsBytesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsBytesImpl.java @@ -149,8 +149,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -176,7 +176,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -202,7 +202,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -229,7 +229,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsModelsImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsModelsImpl.java index 02b4152448..8dab16f2a0 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsModelsImpl.java @@ -151,8 +151,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -180,7 +180,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -208,7 +208,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -237,7 +237,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsStringsImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsStringsImpl.java index fcc1ad2fb4..6a7da710b3 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsStringsImpl.java @@ -149,8 +149,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection string properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -176,7 +176,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection string properties along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -202,7 +202,7 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection string properties along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -229,7 +229,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection string properties along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/DatetimeOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/DatetimeOperationsImpl.java index dd878296a1..976cd5474b 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/DatetimeOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/DatetimeOperationsImpl.java @@ -147,7 +147,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -171,7 +172,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -195,7 +196,8 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync(RequestOptions requestOptions) { @@ -219,7 +221,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/DurationOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/DurationOperationsImpl.java index e75328f6e6..aa7b89dfd1 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/DurationOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/DurationOperationsImpl.java @@ -147,7 +147,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -171,7 +172,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -195,7 +196,8 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync(RequestOptions requestOptions) { @@ -219,7 +221,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/StringOperationsImpl.java index ec8367b3db..b6582caa2e 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/StringOperationsImpl.java @@ -147,8 +147,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { @@ -172,7 +172,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { @@ -196,8 +196,8 @@ public Response getNonNullWithResponse(RequestOptions requestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync(RequestOptions requestOptions) { @@ -221,7 +221,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with nullable property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralAsyncClient.java index 8534963817..1b744de174 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralAsyncClient.java @@ -53,7 +53,8 @@ public final class BooleanLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with boolean literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -76,7 +77,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with boolean literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -140,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with boolean literal property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -159,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with boolean literal property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralClient.java index 74914b4234..aedbc41fb2 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/BooleanLiteralClient.java @@ -51,7 +51,7 @@ public final class BooleanLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with boolean literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with boolean literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with boolean literal property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public BooleanLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with boolean literal property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/BytesAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/BytesAsyncClient.java index 77463eb8d0..ff4076bdd3 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/BytesAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/BytesAsyncClient.java @@ -53,8 +53,8 @@ public final class BytesAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,8 +77,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with optional property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with optional property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/BytesClient.java b/typespec-tests/src/main/java/com/type/property/optional/BytesClient.java index 3f1d304a49..e9a0400de8 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/BytesClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/BytesClient.java @@ -51,7 +51,7 @@ public final class BytesClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with optional property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public BytesProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with optional property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteAsyncClient.java index 9e103e5ff0..82c01f6a28 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteAsyncClient.java @@ -55,8 +55,8 @@ public final class CollectionsByteAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -81,7 +81,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -150,7 +150,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection bytes properties on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -169,7 +169,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection bytes properties on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteClient.java b/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteClient.java index 4014a913d2..082eef861c 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/CollectionsByteClient.java @@ -53,7 +53,7 @@ public final class CollectionsByteClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -78,7 +78,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -146,7 +146,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection bytes properties. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -164,7 +164,7 @@ public CollectionsByteProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection bytes properties. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelAsyncClient.java index 3d18da19c9..baf2f7a094 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelAsyncClient.java @@ -57,8 +57,8 @@ public final class CollectionsModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -85,7 +85,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -158,7 +158,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection models properties on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -177,7 +177,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection models properties on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelClient.java b/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelClient.java index e87c26318c..4a2f838215 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/CollectionsModelClient.java @@ -55,7 +55,7 @@ public final class CollectionsModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -82,7 +82,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -154,7 +154,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection models properties. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -172,7 +172,7 @@ public CollectionsModelProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection models properties. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationAsyncClient.java index 5f9bf2a733..76b0916466 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationAsyncClient.java @@ -53,7 +53,8 @@ public final class DatetimeOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -76,7 +77,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -140,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a datetime property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -159,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a datetime property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationClient.java b/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationClient.java index 885825653d..7707ac2dd6 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/DatetimeOperationClient.java @@ -51,7 +51,7 @@ public final class DatetimeOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a datetime property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public DatetimeProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a datetime property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/DurationOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/DurationOperationAsyncClient.java index f4fd693b7e..2e0543ca46 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/DurationOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/DurationOperationAsyncClient.java @@ -53,7 +53,8 @@ public final class DurationOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -76,7 +77,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -140,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a duration property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -159,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a duration property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/DurationOperationClient.java b/typespec-tests/src/main/java/com/type/property/optional/DurationOperationClient.java index efd15214f2..276c91e42c 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/DurationOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/DurationOperationClient.java @@ -51,7 +51,7 @@ public final class DurationOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a duration property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public DurationProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a duration property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralAsyncClient.java index 61d6a2a257..a2a5e7e831 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralAsyncClient.java @@ -53,7 +53,8 @@ public final class FloatLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with float literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -76,7 +77,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with float literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -140,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with float literal property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -159,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with float literal property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralClient.java index 4233398ad7..55497ed2ce 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/FloatLiteralClient.java @@ -51,7 +51,7 @@ public final class FloatLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with float literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with float literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with float literal property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public FloatLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with float literal property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/IntLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/IntLiteralAsyncClient.java index 3873765e2f..9054c2ff21 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/IntLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/IntLiteralAsyncClient.java @@ -53,7 +53,8 @@ public final class IntLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with int literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -76,7 +77,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with int literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -140,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with int literal property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -159,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with int literal property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/IntLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/IntLiteralClient.java index cb552f3f0d..9df5a7c453 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/IntLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/IntLiteralClient.java @@ -51,7 +51,7 @@ public final class IntLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with int literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with int literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with int literal property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public IntLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with int literal property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/PlainDateAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/PlainDateAsyncClient.java index 5bc830b907..69a3a90fd7 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/PlainDateAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/PlainDateAsyncClient.java @@ -53,7 +53,8 @@ public final class PlainDateAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a plaindate property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -76,7 +77,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a plaindate property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -140,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a plaindate property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -159,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a plaindate property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/PlainDateClient.java b/typespec-tests/src/main/java/com/type/property/optional/PlainDateClient.java index 905a3adb0e..50abcca5eb 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/PlainDateClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/PlainDateClient.java @@ -51,7 +51,7 @@ public final class PlainDateClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a plaindate property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a plaindate property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a plaindate property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public PlainDateProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a plaindate property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/PlainTimeAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/PlainTimeAsyncClient.java index d41566e9b8..25736b8d8f 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/PlainTimeAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/PlainTimeAsyncClient.java @@ -53,7 +53,8 @@ public final class PlainTimeAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a plaintime property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -76,7 +77,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a plaintime property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -140,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a plaintime property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -159,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a plaintime property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/PlainTimeClient.java b/typespec-tests/src/main/java/com/type/property/optional/PlainTimeClient.java index 15640dda52..1b8d867dc4 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/PlainTimeClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/PlainTimeClient.java @@ -51,7 +51,7 @@ public final class PlainTimeClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a plaintime property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a plaintime property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a plaintime property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public PlainTimeProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a plaintime property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalAsyncClient.java index 5fee690f7d..9f9d8c40f4 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalAsyncClient.java @@ -54,8 +54,8 @@ public final class RequiredAndOptionalAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with required and optional properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -79,8 +79,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with required and optional properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return only the required properties along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -146,7 +146,7 @@ public Mono> putRequiredOnlyWithResponse(BinaryData body, Request * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with required and optional properties on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -165,7 +165,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with required and optional properties on successful completion of {@link Mono}. + * @return models that will return only the required properties on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalClient.java b/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalClient.java index 50a64367b6..f617bed9c6 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/RequiredAndOptionalClient.java @@ -52,7 +52,7 @@ public final class RequiredAndOptionalClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with required and optional properties along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -76,7 +76,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with required and optional properties along with {@link Response}. + * @return models that will return only the required properties along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +142,7 @@ public Response putRequiredOnlyWithResponse(BinaryData body, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with required and optional properties. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -160,7 +160,7 @@ public RequiredAndOptionalProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with required and optional properties. + * @return models that will return only the required properties. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/StringLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/StringLiteralAsyncClient.java index 2c08498887..8738ca2114 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/StringLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/StringLiteralAsyncClient.java @@ -53,7 +53,8 @@ public final class StringLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with string literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -76,7 +77,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with string literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -140,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with string literal property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -159,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with string literal property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/StringLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/StringLiteralClient.java index 20eed2ab15..9d9edb2a08 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/StringLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/StringLiteralClient.java @@ -51,7 +51,7 @@ public final class StringLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with string literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with string literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with string literal property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public StringLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with string literal property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/StringOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/StringOperationAsyncClient.java index 83834191d0..ccb6ab14d8 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/StringOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/StringOperationAsyncClient.java @@ -53,8 +53,8 @@ public final class StringOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,8 +77,8 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -142,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with optional property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with optional property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/StringOperationClient.java b/typespec-tests/src/main/java/com/type/property/optional/StringOperationClient.java index a7bdf1b616..f5a89b6b7c 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/StringOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/StringOperationClient.java @@ -51,7 +51,7 @@ public final class StringOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with optional property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public StringProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with optional property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralAsyncClient.java index 62f49dcf5b..c1a677f4f3 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralAsyncClient.java @@ -53,8 +53,8 @@ public final class UnionFloatLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of float literal property along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of float literal property along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -142,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with union of float literal property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with union of float literal property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralClient.java index 20952bd2d5..d73101ed7b 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/UnionFloatLiteralClient.java @@ -51,7 +51,7 @@ public final class UnionFloatLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of float literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of float literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with union of float literal property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public UnionFloatLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with union of float literal property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralAsyncClient.java index f64106a9af..0d026ff1c4 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralAsyncClient.java @@ -53,8 +53,8 @@ public final class UnionIntLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of int literal property along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of int literal property along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -142,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with union of int literal property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with union of int literal property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralClient.java index 41c429f898..0e32a129ab 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/UnionIntLiteralClient.java @@ -51,7 +51,7 @@ public final class UnionIntLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of int literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of int literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with union of int literal property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public UnionIntLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with union of int literal property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralAsyncClient.java index 743b330b69..34e9fd00fa 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralAsyncClient.java @@ -53,8 +53,8 @@ public final class UnionStringLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of string literal property along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -77,7 +77,7 @@ public Mono> getAllWithResponse(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of string literal property along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -142,7 +142,7 @@ public Mono> putDefaultWithResponse(BinaryData body, RequestOptio * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with union of string literal property on successful completion of {@link Mono}. + * @return models that will return all properties in the model on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -161,7 +161,7 @@ public Mono getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with union of string literal property on successful completion of {@link Mono}. + * @return models that will return the default object on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralClient.java b/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralClient.java index 21f0905b88..c2965da697 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/optional/UnionStringLiteralClient.java @@ -51,7 +51,7 @@ public final class UnionStringLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of string literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -74,7 +74,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of string literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -138,7 +138,7 @@ public Response putDefaultWithResponse(BinaryData body, RequestOptions req * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with union of string literal property. + * @return models that will return all properties in the model. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -156,7 +156,7 @@ public UnionStringLiteralProperty getAll() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with union of string literal property. + * @return models that will return the default object. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/BooleanLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/BooleanLiteralsImpl.java index 143140fb62..f7e8e3bacd 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/BooleanLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/BooleanLiteralsImpl.java @@ -146,7 +146,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with boolean literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -169,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with boolean literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -192,7 +193,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with boolean literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -215,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with boolean literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/BytesImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/BytesImpl.java index 313b3ebeca..e052565927 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/BytesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/BytesImpl.java @@ -145,8 +145,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -169,7 +169,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -192,8 +192,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -216,7 +216,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsBytesImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsBytesImpl.java index f91daebff6..4a43ffed70 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsBytesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsBytesImpl.java @@ -148,8 +148,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -174,7 +174,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -199,7 +199,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -225,7 +225,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection bytes properties along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsModelsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsModelsImpl.java index 5ed7dfb397..9ea2a5c48e 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsModelsImpl.java @@ -150,8 +150,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -178,7 +178,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -205,7 +205,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -233,7 +233,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection models properties along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/DatetimeOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/DatetimeOperationsImpl.java index 17e8959364..a65a9fbbb5 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/DatetimeOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/DatetimeOperationsImpl.java @@ -146,7 +146,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -169,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -192,7 +193,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -215,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/DurationOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/DurationOperationsImpl.java index 8442600b73..a13cc19c3c 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/DurationOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/DurationOperationsImpl.java @@ -146,7 +146,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -169,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -192,7 +193,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -215,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/FloatLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/FloatLiteralsImpl.java index cf21e52173..fbd061c2ba 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/FloatLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/FloatLiteralsImpl.java @@ -146,7 +146,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with float literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -169,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with float literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -192,7 +193,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with float literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -215,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with float literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/IntLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/IntLiteralsImpl.java index 806ab7b2db..09d19ea381 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/IntLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/IntLiteralsImpl.java @@ -146,7 +146,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with int literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -169,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with int literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -192,7 +193,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with int literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -215,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with int literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/PlainDatesImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/PlainDatesImpl.java index 05efad88d1..5064ca2915 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/PlainDatesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/PlainDatesImpl.java @@ -64,7 +64,7 @@ public interface PlainDatesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/plainDate/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/plainDate/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/plainDate/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/plainDate/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/plainDate/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/plainDate/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/plainDate/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -245,8 +245,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -269,8 +269,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -293,8 +293,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -317,7 +317,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/PlainTimesImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/PlainTimesImpl.java index dfd18fb5f3..82c4a44b0c 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/PlainTimesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/PlainTimesImpl.java @@ -64,7 +64,7 @@ public interface PlainTimesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/plainTime/all") @@ -73,7 +73,7 @@ Mono> getAll(@HeaderParam("accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/plainTime/default") @@ -82,7 +82,7 @@ Response getAllSync(@HeaderParam("accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/plainTime/default") @@ -91,7 +91,7 @@ Mono> getDefault(@HeaderParam("accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, + Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/plainTime/all") @@ -100,7 +100,7 @@ Response getDefaultSync(@HeaderParam("accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("accept") String accept, + Mono> putAll(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/plainTime/all") @@ -109,8 +109,8 @@ Mono> putAll(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response putAllSync(@HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/plainTime/default") @ExpectedResponses({ 204 }) @@ -118,7 +118,7 @@ Response putAllSync(@HeaderParam("accept") String accept, @BodyParam("appl @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("accept") String accept, + Mono> putDefault(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/type/property/optional/plainTime/default") @@ -127,7 +127,7 @@ Mono> putDefault(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("accept") String accept, + Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -245,8 +245,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putAll(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); } /** @@ -269,8 +269,8 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putAllSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putAllSync(contentType, body, requestOptions, Context.NONE); } /** @@ -293,8 +293,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(accept, body, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); } /** @@ -317,7 +317,7 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.putDefaultSync(accept, body, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/RequiredAndOptionalsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/RequiredAndOptionalsImpl.java index f52f9ee63f..b8a1857bff 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/RequiredAndOptionalsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/RequiredAndOptionalsImpl.java @@ -147,8 +147,8 @@ Response putRequiredOnlySync(@HeaderParam("Content-Type") String contentTy * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with required and optional properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -172,7 +172,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with required and optional properties along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -196,8 +196,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with required and optional properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return only the required properties along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getRequiredOnlyWithResponseAsync(RequestOptions requestOptions) { @@ -221,7 +221,7 @@ public Mono> getRequiredOnlyWithResponseAsync(RequestOption * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with required and optional properties along with {@link Response}. + * @return models that will return only the required properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getRequiredOnlyWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/StringLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/StringLiteralsImpl.java index ec3e600a90..7e52d91201 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/StringLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/StringLiteralsImpl.java @@ -146,7 +146,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with string literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -169,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with string literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -192,7 +193,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with string literal property along with {@link Response} on successful completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -215,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with string literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/StringOperationsImpl.java index 7bacd8c514..2b1a39629d 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/StringOperationsImpl.java @@ -146,8 +146,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,8 +193,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response} on successful - * completion of {@link Mono}. + * @return models that will return the default object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { @@ -217,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with optional property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionFloatLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionFloatLiteralsImpl.java index f379ffee75..3ecd52230b 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionFloatLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionFloatLiteralsImpl.java @@ -146,8 +146,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of float literal property along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of float literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,7 +193,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of float literal property along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -217,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of float literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionIntLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionIntLiteralsImpl.java index 1c00e0d2de..0bbfd077ab 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionIntLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionIntLiteralsImpl.java @@ -146,8 +146,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of int literal property along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of int literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,7 +193,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of int literal property along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -217,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of int literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionStringLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionStringLiteralsImpl.java index 720046c77e..b4f6fcd356 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionStringLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionStringLiteralsImpl.java @@ -146,8 +146,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of string literal property along with {@link Response} on successful completion of - * {@link Mono}. + * @return models that will return all properties in the model along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { @@ -170,7 +170,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of string literal property along with {@link Response}. + * @return models that will return all properties in the model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { @@ -193,7 +193,7 @@ public Response getAllWithResponse(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of string literal property along with {@link Response} on successful completion of + * @return models that will return the default object along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -217,7 +217,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with union of string literal property along with {@link Response}. + * @return models that will return the default object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralAsyncClient.java index 7ea1a5c8a1..b6af04d1cb 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralAsyncClient.java @@ -53,8 +53,7 @@ public final class BooleanLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a boolean literal property along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -94,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a boolean literal property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralClient.java index b53578427c..6b0a528a29 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanLiteralClient.java @@ -51,7 +51,7 @@ public final class BooleanLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a boolean literal property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a boolean literal property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationAsyncClient.java index 54561c7fd1..ab3775f865 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationAsyncClient.java @@ -53,7 +53,7 @@ public final class BooleanOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a boolean property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a boolean property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationClient.java index ecc3bc534a..d4e7f5dd02 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/BooleanOperationClient.java @@ -51,7 +51,7 @@ public final class BooleanOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a boolean property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a boolean property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/BytesAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/BytesAsyncClient.java index 86659fd345..dd79a17a7b 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/BytesAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/BytesAsyncClient.java @@ -53,7 +53,7 @@ public final class BytesAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a bytes property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a bytes property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/BytesClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/BytesClient.java index 7cab3afc83..d3615f65a8 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/BytesClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/BytesClient.java @@ -51,7 +51,7 @@ public final class BytesClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a bytes property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a bytes property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntAsyncClient.java index 3dec4784d4..2828e55a22 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntAsyncClient.java @@ -55,8 +55,7 @@ public final class CollectionsIntAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection int properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -98,7 +97,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection int properties on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntClient.java index 1bed50f153..0d3b0442ec 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsIntClient.java @@ -53,7 +53,7 @@ public final class CollectionsIntClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection int properties along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -95,7 +95,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection int properties. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelAsyncClient.java index a7da97ea3a..b193658be3 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelAsyncClient.java @@ -57,8 +57,7 @@ public final class CollectionsModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection model properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -102,7 +101,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection model properties on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelClient.java index a986c997f8..5ba3a996dc 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsModelClient.java @@ -55,7 +55,7 @@ public final class CollectionsModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection model properties along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -99,7 +99,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection model properties. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringAsyncClient.java index a9d54433db..c4d33d5d27 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringAsyncClient.java @@ -55,8 +55,7 @@ public final class CollectionsStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection string properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -98,7 +97,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection string properties on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringClient.java index 4a487152c9..18405b33ee 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/CollectionsStringClient.java @@ -53,7 +53,7 @@ public final class CollectionsStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection string properties along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -95,7 +95,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with collection string properties. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationAsyncClient.java index 1f8bfa429b..421c87f118 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationAsyncClient.java @@ -53,7 +53,7 @@ public final class DatetimeOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a datetime property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationClient.java index 277b42911d..4c2c29ea5e 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DatetimeOperationClient.java @@ -51,7 +51,7 @@ public final class DatetimeOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a datetime property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128AsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128AsyncClient.java index 94daa62ddb..bbb25640c2 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128AsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128AsyncClient.java @@ -53,7 +53,7 @@ public final class Decimal128AsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a decimal128 property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a decimal128 property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128Client.java b/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128Client.java index 0ac47c1ded..6b2e7e0b79 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128Client.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/Decimal128Client.java @@ -51,7 +51,7 @@ public final class Decimal128Client { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a decimal128 property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a decimal128 property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalAsyncClient.java index f253962734..10495283a2 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalAsyncClient.java @@ -53,7 +53,7 @@ public final class DecimalAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a decimal property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a decimal property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalClient.java index e4aa41eeb3..f3f2223231 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DecimalClient.java @@ -51,7 +51,7 @@ public final class DecimalClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a decimal property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a decimal property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringAsyncClient.java index 5a6e624202..b776f2e001 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringAsyncClient.java @@ -55,8 +55,7 @@ public final class DictionaryStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with dictionary string properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -98,7 +97,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with dictionary string properties on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringClient.java index 7f2e2591bf..0b7e9ca739 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DictionaryStringClient.java @@ -53,7 +53,7 @@ public final class DictionaryStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with dictionary string properties along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -95,7 +95,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with dictionary string properties. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationAsyncClient.java index 24c091cfe9..bf23710596 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationAsyncClient.java @@ -53,7 +53,7 @@ public final class DurationOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a duration property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationClient.java index e8fa93f4a6..f8452ab301 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/DurationOperationClient.java @@ -51,7 +51,7 @@ public final class DurationOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a duration property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/EnumAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/EnumAsyncClient.java index 46fc873bd9..6c8d1e4a54 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/EnumAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/EnumAsyncClient.java @@ -53,7 +53,7 @@ public final class EnumAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with enum properties along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with enum properties on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/EnumClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/EnumClient.java index a78d401355..a80ef76bef 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/EnumClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/EnumClient.java @@ -51,7 +51,7 @@ public final class EnumClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with enum properties along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with enum properties. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumAsyncClient.java index ba6d0b4e22..f7dec5b955 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumAsyncClient.java @@ -53,8 +53,7 @@ public final class ExtensibleEnumAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with extensible enum properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -94,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with extensible enum properties on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumClient.java index 01f24dea69..d5085c2041 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/ExtensibleEnumClient.java @@ -51,7 +51,7 @@ public final class ExtensibleEnumClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with extensible enum properties along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with extensible enum properties. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralAsyncClient.java index a12cb1ed4d..8079183e5b 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralAsyncClient.java @@ -53,7 +53,7 @@ public final class FloatLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a float literal property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a float literal property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralClient.java index e907cf285d..2ff74c5840 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatLiteralClient.java @@ -51,7 +51,7 @@ public final class FloatLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a float literal property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a float literal property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationAsyncClient.java index 41b46e42ac..a2ce50e823 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationAsyncClient.java @@ -53,7 +53,7 @@ public final class FloatOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a float property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a float property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationClient.java index 09e4aae6e0..fb2acae468 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/FloatOperationClient.java @@ -51,7 +51,7 @@ public final class FloatOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a float property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a float property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/IntAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/IntAsyncClient.java index 4c2a143444..58bfa7d20b 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/IntAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/IntAsyncClient.java @@ -53,7 +53,7 @@ public final class IntAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a int property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a int property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/IntClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/IntClient.java index 7f48765be2..5af2cc2da9 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/IntClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/IntClient.java @@ -51,7 +51,7 @@ public final class IntClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a int property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a int property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralAsyncClient.java index b1f73f525a..5e47bc9325 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralAsyncClient.java @@ -53,7 +53,7 @@ public final class IntLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a int literal property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a int literal property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralClient.java index 5b62bfb073..60d67a57bf 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/IntLiteralClient.java @@ -51,7 +51,7 @@ public final class IntLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a int literal property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a int literal property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/ModelAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/ModelAsyncClient.java index 1f3d71a101..c75310c16e 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/ModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/ModelAsyncClient.java @@ -55,7 +55,7 @@ public final class ModelAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with model properties along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -97,7 +97,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with model properties on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/ModelClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/ModelClient.java index 33482c584f..9e9cba4588 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/ModelClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/ModelClient.java @@ -53,7 +53,7 @@ public final class ModelClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with model properties along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -95,7 +95,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with model properties. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/NeverAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/NeverAsyncClient.java index f2d32f8de0..a2dfced927 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/NeverAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/NeverAsyncClient.java @@ -51,7 +51,7 @@ public final class NeverAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property never along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -89,7 +89,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a property never on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/NeverClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/NeverClient.java index f10cb31915..27bb34204f 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/NeverClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/NeverClient.java @@ -49,7 +49,7 @@ public final class NeverClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property never along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -87,7 +87,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a property never. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralAsyncClient.java index c1c31f6ace..89e6d85cc4 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralAsyncClient.java @@ -53,8 +53,7 @@ public final class StringLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a string literal property along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -94,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a string literal property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralClient.java index b8a866bf31..6e7d29ce62 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/StringLiteralClient.java @@ -51,7 +51,7 @@ public final class StringLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a string literal property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a string literal property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationAsyncClient.java index 7bfda94e60..f1208deeb2 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationAsyncClient.java @@ -53,7 +53,7 @@ public final class StringOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a string property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -93,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a string property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationClient.java index 973bd04706..a11dfddc54 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/StringOperationClient.java @@ -51,7 +51,7 @@ public final class StringOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a string property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a string property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueAsyncClient.java index d1d37dc0e3..52d1903389 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueAsyncClient.java @@ -53,8 +53,7 @@ public final class UnionEnumValueAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with specific properties along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -94,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with specific properties on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueClient.java index 4359412b99..a1503da5fc 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionEnumValueClient.java @@ -51,7 +51,7 @@ public final class UnionEnumValueClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with specific properties along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return template type for testing models with specific properties. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralAsyncClient.java index fafbea83e6..160e23a08e 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralAsyncClient.java @@ -53,8 +53,7 @@ public final class UnionFloatLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a union of float literal as property along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -94,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a union of float literal as property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralClient.java index bf3e7c9f76..5ce4c1c405 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionFloatLiteralClient.java @@ -51,7 +51,7 @@ public final class UnionFloatLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a union of float literal as property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a union of float literal as property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralAsyncClient.java index 44058432f4..4855784b53 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralAsyncClient.java @@ -53,8 +53,7 @@ public final class UnionIntLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a union of int literal as property along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -94,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a union of int literal as property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralClient.java index bcd8faac8d..d570a5aa5e 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionIntLiteralClient.java @@ -51,7 +51,7 @@ public final class UnionIntLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a union of int literal as property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a union of int literal as property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralAsyncClient.java index d2536e8fd3..e64dcb9244 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralAsyncClient.java @@ -53,8 +53,7 @@ public final class UnionStringLiteralAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a union of string literal as property along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -94,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a union of string literal as property on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralClient.java index f866ff1935..933d39b0bd 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnionStringLiteralClient.java @@ -51,7 +51,7 @@ public final class UnionStringLiteralClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a union of string literal as property along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a union of string literal as property. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayAsyncClient.java index 81777dc7a3..770b3d5ee5 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayAsyncClient.java @@ -53,8 +53,7 @@ public final class UnknownArrayAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is an array along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -94,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a property unknown, and the data is an array on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayClient.java index ffea6edef3..a085998120 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownArrayClient.java @@ -51,7 +51,7 @@ public final class UnknownArrayClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is an array along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a property unknown, and the data is an array. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictAsyncClient.java index 33aa735c73..9460b676df 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictAsyncClient.java @@ -53,8 +53,7 @@ public final class UnknownDictAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is a dictionnary along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -94,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a property unknown, and the data is a dictionnary on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictClient.java index 9bd638e063..754d29a11e 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownDictClient.java @@ -51,7 +51,7 @@ public final class UnknownDictClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is a dictionnary along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a property unknown, and the data is a dictionnary. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntAsyncClient.java index 9188e43b98..6dab5dae36 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntAsyncClient.java @@ -53,8 +53,7 @@ public final class UnknownIntAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is a int32 along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -94,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a property unknown, and the data is a int32 on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntClient.java index fbfec46200..1e8e38cbd0 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownIntClient.java @@ -51,7 +51,7 @@ public final class UnknownIntClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is a int32 along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a property unknown, and the data is a int32. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringAsyncClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringAsyncClient.java index bde5f700b1..e8a87af736 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringAsyncClient.java @@ -53,8 +53,7 @@ public final class UnknownStringAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is a string along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -94,7 +93,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a property unknown, and the data is a string on successful completion of {@link Mono}. + * @return call on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringClient.java b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringClient.java index 9e3cdf893d..f4f9faf52f 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringClient.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/UnknownStringClient.java @@ -51,7 +51,7 @@ public final class UnknownStringClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is a string along with {@link Response}. + * @return call along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -91,7 +91,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model with a property unknown, and the data is a string. + * @return call. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanLiteralsImpl.java index cee9d8137b..84b132272b 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanLiteralsImpl.java @@ -110,8 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a boolean literal property along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -134,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a boolean literal property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanOperationsImpl.java index 0ce856b063..33efd5ea7f 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanOperationsImpl.java @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a boolean property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a boolean property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BytesImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BytesImpl.java index b353b6ca1f..c6c8425e0f 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BytesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BytesImpl.java @@ -109,7 +109,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a bytes property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -132,7 +132,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a bytes property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsIntsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsIntsImpl.java index 71d5e18e86..b5716fa66a 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsIntsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsIntsImpl.java @@ -112,8 +112,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection int properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -138,7 +137,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection int properties along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsModelsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsModelsImpl.java index be7b84a2e9..76dde40f63 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsModelsImpl.java @@ -114,8 +114,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection model properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -142,7 +141,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection model properties along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsStringsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsStringsImpl.java index 64e85967d3..d9a9898b95 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsStringsImpl.java @@ -112,8 +112,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection string properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -138,7 +137,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with collection string properties along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DatetimeOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DatetimeOperationsImpl.java index 79029e9a84..08e7321b44 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DatetimeOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DatetimeOperationsImpl.java @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a datetime property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/Decimal128sImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/Decimal128sImpl.java index 05e75e74bd..10faa32c73 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/Decimal128sImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/Decimal128sImpl.java @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a decimal128 property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a decimal128 property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DecimalsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DecimalsImpl.java index f285e90d4c..578fed4876 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DecimalsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DecimalsImpl.java @@ -109,7 +109,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a decimal property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -132,7 +132,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a decimal property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DictionaryStringsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DictionaryStringsImpl.java index 7e3d7a3d41..f693e7fd90 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DictionaryStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DictionaryStringsImpl.java @@ -112,8 +112,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with dictionary string properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -138,7 +137,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with dictionary string properties along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DurationOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DurationOperationsImpl.java index ab3c63609b..9d9b8271e2 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DurationOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DurationOperationsImpl.java @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a duration property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/EnumsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/EnumsImpl.java index 9ba8a4c9aa..2e57c215e7 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/EnumsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/EnumsImpl.java @@ -109,7 +109,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with enum properties along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -132,7 +132,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with enum properties along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ExtensibleEnumsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ExtensibleEnumsImpl.java index 6551f029e0..1fb5320647 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ExtensibleEnumsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ExtensibleEnumsImpl.java @@ -110,8 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with extensible enum properties along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -134,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with extensible enum properties along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatLiteralsImpl.java index f436f4672c..c91c14688e 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatLiteralsImpl.java @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a float literal property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a float literal property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatOperationsImpl.java index 696c4d14e2..836996e73e 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatOperationsImpl.java @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a float property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a float property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntLiteralsImpl.java index ce4f6e5349..462b651c2f 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntLiteralsImpl.java @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a int literal property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a int literal property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntsImpl.java index ae53179952..8630ec5e99 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntsImpl.java @@ -109,7 +109,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a int property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -132,7 +132,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a int property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ModelsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ModelsImpl.java index fcfd26085f..abed839362 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ModelsImpl.java @@ -111,7 +111,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with model properties along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -136,7 +136,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with model properties along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/NeversImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/NeversImpl.java index 8a65c8dfaf..a773522602 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/NeversImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/NeversImpl.java @@ -107,7 +107,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property never along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -128,7 +128,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property never along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringLiteralsImpl.java index 601e00a543..6ab7abcf0d 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringLiteralsImpl.java @@ -110,8 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a string literal property along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -134,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a string literal property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringOperationsImpl.java index 8d4b4f8d66..0c8bfe3696 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringOperationsImpl.java @@ -110,7 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a string property along with {@link Response} on successful completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -133,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a string property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionEnumValuesImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionEnumValuesImpl.java index a9f141ae34..7cef9087a4 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionEnumValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionEnumValuesImpl.java @@ -110,8 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with specific properties along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -134,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return template type for testing models with specific properties along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionFloatLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionFloatLiteralsImpl.java index 6c300f3fa4..f47119d3de 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionFloatLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionFloatLiteralsImpl.java @@ -110,8 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a union of float literal as property along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -134,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a union of float literal as property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionIntLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionIntLiteralsImpl.java index 177386cc3d..6746a3f1e7 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionIntLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionIntLiteralsImpl.java @@ -110,8 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a union of int literal as property along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -134,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a union of int literal as property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionStringLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionStringLiteralsImpl.java index 3e64d4b24a..ec6ed3fadf 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionStringLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionStringLiteralsImpl.java @@ -110,8 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a union of string literal as property along with {@link Response} on successful completion of - * {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -134,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a union of string literal as property along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownArraysImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownArraysImpl.java index 878b12995e..9c9de29705 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownArraysImpl.java @@ -110,8 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is an array along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -134,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is an array along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownDictsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownDictsImpl.java index d4a64ff56b..3e9cd0d034 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownDictsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownDictsImpl.java @@ -110,8 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is a dictionnary along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -134,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is a dictionnary along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownIntsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownIntsImpl.java index 26ae4cdf1d..006f8823f5 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownIntsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownIntsImpl.java @@ -110,8 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is a int32 along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -134,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is a int32 along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownStringsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownStringsImpl.java index 4e3dc3355c..79b9b09940 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownStringsImpl.java @@ -110,8 +110,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is a string along with {@link Response} on successful - * completion of {@link Mono}. + * @return call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -134,7 +133,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return model with a property unknown, and the data is a string along with {@link Response}. + * @return call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/scalar/BooleanOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/scalar/BooleanOperationAsyncClient.java index a972f827b1..d5d00b8319 100644 --- a/typespec-tests/src/main/java/com/type/scalar/BooleanOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/scalar/BooleanOperationAsyncClient.java @@ -50,8 +50,7 @@ public final class BooleanOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return boolean with `true` and `false` values along with {@link Response} on successful completion of - * {@link Mono}. + * @return boolean value along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -89,7 +88,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return boolean with `true` and `false` values on successful completion of {@link Mono}. + * @return boolean value on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/scalar/BooleanOperationClient.java b/typespec-tests/src/main/java/com/type/scalar/BooleanOperationClient.java index 58777e320d..b3765fc21e 100644 --- a/typespec-tests/src/main/java/com/type/scalar/BooleanOperationClient.java +++ b/typespec-tests/src/main/java/com/type/scalar/BooleanOperationClient.java @@ -48,7 +48,7 @@ public final class BooleanOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return boolean with `true` and `false` values along with {@link Response}. + * @return boolean value along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -86,7 +86,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return boolean with `true` and `false` values. + * @return boolean value. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/scalar/StringOperationAsyncClient.java b/typespec-tests/src/main/java/com/type/scalar/StringOperationAsyncClient.java index b0bcf6b3c5..a08bd9dfcd 100644 --- a/typespec-tests/src/main/java/com/type/scalar/StringOperationAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/scalar/StringOperationAsyncClient.java @@ -50,7 +50,7 @@ public final class StringOperationAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a sequence of textual characters along with {@link Response} on successful completion of {@link Mono}. + * @return string value along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -88,7 +88,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a sequence of textual characters on successful completion of {@link Mono}. + * @return string value on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/scalar/StringOperationClient.java b/typespec-tests/src/main/java/com/type/scalar/StringOperationClient.java index a79d03671f..f3b4f77150 100644 --- a/typespec-tests/src/main/java/com/type/scalar/StringOperationClient.java +++ b/typespec-tests/src/main/java/com/type/scalar/StringOperationClient.java @@ -48,7 +48,7 @@ public final class StringOperationClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a sequence of textual characters along with {@link Response}. + * @return string value along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -86,7 +86,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a sequence of textual characters. + * @return string value. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/scalar/UnknownAsyncClient.java b/typespec-tests/src/main/java/com/type/scalar/UnknownAsyncClient.java index 4628e26fd2..1a0c97e690 100644 --- a/typespec-tests/src/main/java/com/type/scalar/UnknownAsyncClient.java +++ b/typespec-tests/src/main/java/com/type/scalar/UnknownAsyncClient.java @@ -50,7 +50,7 @@ public final class UnknownAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return anything along with {@link Response} on successful completion of {@link Mono}. + * @return unknown value along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -88,7 +88,7 @@ public Mono> putWithResponse(BinaryData body, RequestOptions requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return anything on successful completion of {@link Mono}. + * @return unknown value on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/scalar/UnknownClient.java b/typespec-tests/src/main/java/com/type/scalar/UnknownClient.java index 1df551ca87..6a09092ec3 100644 --- a/typespec-tests/src/main/java/com/type/scalar/UnknownClient.java +++ b/typespec-tests/src/main/java/com/type/scalar/UnknownClient.java @@ -48,7 +48,7 @@ public final class UnknownClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return anything along with {@link Response}. + * @return unknown value along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -86,7 +86,7 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return anything. + * @return unknown value. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/BooleanOperationsImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/BooleanOperationsImpl.java index 0b93ca47a7..9ca2085290 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/BooleanOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/BooleanOperationsImpl.java @@ -108,8 +108,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return boolean with `true` and `false` values along with {@link Response} on successful completion of - * {@link Mono}. + * @return boolean value along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -130,7 +129,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return boolean with `true` and `false` values along with {@link Response}. + * @return boolean value along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/StringOperationsImpl.java index 08ecfcdc44..876bc0937a 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/StringOperationsImpl.java @@ -108,7 +108,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a sequence of textual characters along with {@link Response} on successful completion of {@link Mono}. + * @return string value along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -129,7 +129,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a sequence of textual characters along with {@link Response}. + * @return string value along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/UnknownsImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/UnknownsImpl.java index a58950e0b2..0ffb66e5aa 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/UnknownsImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/UnknownsImpl.java @@ -107,7 +107,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return anything along with {@link Response} on successful completion of {@link Mono}. + * @return unknown value along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { @@ -128,7 +128,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return anything along with {@link Response}. + * @return unknown value along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { diff --git a/typespec-tests/src/test/java/com/client/naming/generated/NamingClientTestBase.java b/typespec-tests/src/test/java/com/client/naming/generated/NamingClientTestBase.java index 755c1c3625..966f8e88d1 100644 --- a/typespec-tests/src/test/java/com/client/naming/generated/NamingClientTestBase.java +++ b/typespec-tests/src/test/java/com/client/naming/generated/NamingClientTestBase.java @@ -13,7 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; -import com.client.naming.ModelClient; +import com.client.naming.ClientModelClient; import com.client.naming.NamingClient; import com.client.naming.NamingClientBuilder; import com.client.naming.UnionEnumClient; @@ -21,7 +21,7 @@ class NamingClientTestBase extends TestProxyTestBase { protected NamingClient namingClient; - protected ModelClient modelClient; + protected ClientModelClient clientModelClient; protected UnionEnumClient unionEnumClient; @@ -36,14 +36,14 @@ protected void beforeTest() { } namingClient = namingClientbuilder.buildClient(); - NamingClientBuilder modelClientbuilder = new NamingClientBuilder().httpClient(HttpClient.createDefault()) + NamingClientBuilder clientModelClientbuilder = new NamingClientBuilder().httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { - modelClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + clientModelClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { - modelClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + clientModelClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); } - modelClient = modelClientbuilder.buildModelClient(); + clientModelClient = clientModelClientbuilder.buildClientModelClient(); NamingClientBuilder unionEnumClientbuilder = new NamingClientBuilder().httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); From 180bf07a8ef6b87bf8b9af585f8c3fed749ac4ce Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Tue, 30 Jul 2024 16:33:39 +0800 Subject: [PATCH 28/90] regen --- .../com/payload/multipart/models/ComplexPartsRequest.java | 6 +++--- .../com/payload/multipart/models/JsonArrayPartsRequest.java | 6 +++--- .../src/test/java/com/client/naming/NamingTests.java | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/typespec-tests/src/main/java/com/payload/multipart/models/ComplexPartsRequest.java b/typespec-tests/src/main/java/com/payload/multipart/models/ComplexPartsRequest.java index d1d44e5398..59e2ed120c 100644 --- a/typespec-tests/src/main/java/com/payload/multipart/models/ComplexPartsRequest.java +++ b/typespec-tests/src/main/java/com/payload/multipart/models/ComplexPartsRequest.java @@ -35,7 +35,7 @@ public final class ComplexPartsRequest { * The previousAddresses property. */ @Generated - private final List> previousAddresses; + private final List
previousAddresses; /* * The pictures property. @@ -54,7 +54,7 @@ public final class ComplexPartsRequest { */ @Generated public ComplexPartsRequest(String id, Address address, ProfileImageFileDetails profileImage, - List> previousAddresses, List pictures) { + List
previousAddresses, List pictures) { this.id = id; this.address = address; this.profileImage = profileImage; @@ -98,7 +98,7 @@ public ProfileImageFileDetails getProfileImage() { * @return the previousAddresses value. */ @Generated - public List> getPreviousAddresses() { + public List
getPreviousAddresses() { return this.previousAddresses; } diff --git a/typespec-tests/src/main/java/com/payload/multipart/models/JsonArrayPartsRequest.java b/typespec-tests/src/main/java/com/payload/multipart/models/JsonArrayPartsRequest.java index cde19fe8d8..6af4fba825 100644 --- a/typespec-tests/src/main/java/com/payload/multipart/models/JsonArrayPartsRequest.java +++ b/typespec-tests/src/main/java/com/payload/multipart/models/JsonArrayPartsRequest.java @@ -23,7 +23,7 @@ public final class JsonArrayPartsRequest { * The previousAddresses property. */ @Generated - private final List> previousAddresses; + private final List
previousAddresses; /** * Creates an instance of JsonArrayPartsRequest class. @@ -32,7 +32,7 @@ public final class JsonArrayPartsRequest { * @param previousAddresses the previousAddresses value to set. */ @Generated - public JsonArrayPartsRequest(ProfileImageFileDetails profileImage, List> previousAddresses) { + public JsonArrayPartsRequest(ProfileImageFileDetails profileImage, List
previousAddresses) { this.profileImage = profileImage; this.previousAddresses = previousAddresses; } @@ -53,7 +53,7 @@ public ProfileImageFileDetails getProfileImage() { * @return the previousAddresses value. */ @Generated - public List> getPreviousAddresses() { + public List
getPreviousAddresses() { return this.previousAddresses; } } diff --git a/typespec-tests/src/test/java/com/client/naming/NamingTests.java b/typespec-tests/src/test/java/com/client/naming/NamingTests.java index 5ebb4b78c5..9a6993599d 100644 --- a/typespec-tests/src/test/java/com/client/naming/NamingTests.java +++ b/typespec-tests/src/test/java/com/client/naming/NamingTests.java @@ -10,6 +10,7 @@ import com.client.naming.models.ExtensibleEnum; import com.client.naming.models.JavaModel; import com.client.naming.models.LanguageClientNameModel; +import org.eclipse.jetty.io.ssl.ALPNProcessor; import org.junit.jupiter.api.Test; public class NamingTests { @@ -17,7 +18,7 @@ public class NamingTests { private final NamingClient client = new NamingClientBuilder().buildClient(); // client name should be "ClientModel", currently a bug in TCGC - private final ModelClient modelClient = new NamingClientBuilder().buildModelClient(); + private final ClientModelClient modelClient = new NamingClientBuilder().buildClientModelClient(); private final UnionEnumClient enumClient = new NamingClientBuilder().buildUnionEnumClient(); From bb7dea4d3ee0378fe04f2eaaa9619c132c959560 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Tue, 30 Jul 2024 16:54:40 +0800 Subject: [PATCH 29/90] handle multipart array case --- typespec-extension/src/code-model-builder.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 3abf1cf547..d3f14de58b 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -3147,12 +3147,6 @@ export class CodeModelBuilder { prop.multipartOptions.isMulti, this.namespace, ); - } else { - schema = this.processMultipartFormDataNonFilePropertySchemaFromSdkType( - prop, - prop.multipartOptions.isMulti, - schema, - ); } } From 8220bad46856257c5fa35c2e12f64436ecabdf4f Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Wed, 31 Jul 2024 15:44:31 +0800 Subject: [PATCH 30/90] add endpoint parameter for ARM as workaround --- typespec-extension/src/code-model-builder.ts | 100 +++++++------------ 1 file changed, 35 insertions(+), 65 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index e2071da32c..20cfb77513 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -287,69 +287,6 @@ export class CodeModelBuilder { return this.codeModel; } - // private processHost(server: HttpServer | undefined): Parameter[] { - // const hostParameters: Parameter[] = []; - // if (server && !this.isArmSynthesizedServer(server)) { - // server.parameters.forEach((it) => { - // let parameter; - - // if (isApiVersion(this.sdkContext, it)) { - // parameter = this.createApiVersionParameter(it.name, ParameterLocation.Uri); - // } else { - // const sdkType = getClientType(this.sdkContext, it.type); - // const schema = this.processSchemaFromSdkType(sdkType, it.name); - // this.trackSchemaUsage(schema, { - // usage: [SchemaContext.Input, SchemaContext.Output /*SchemaContext.Public*/], - // }); - // parameter = new Parameter(this.getName(it), this.getDoc(it), schema, { - // implementation: ImplementationLocation.Client, - // origin: "modelerfour:synthesized/host", - // required: !it.optional, - // protocol: { - // http: new HttpParameter(ParameterLocation.Uri), - // }, - // language: { - // default: { - // serializedName: it.name, - // }, - // }, - // extensions: { - // "x-ms-skip-url-encoding": schema instanceof UriSchema, - // }, - // // // make the logic same as TCGC, which takes the server-side default of host as client-side default - // // clientDefaultValue: getDefaultValue(it.defaultValue), - // }); - // } - - // hostParameters.push(this.codeModel.addGlobalParameter(parameter)); - // }); - // return hostParameters; - // } else { - // // use "endpoint" - // hostParameters.push( - // this.codeModel.addGlobalParameter( - // new Parameter("endpoint", "Server parameter", this.stringSchema, { - // implementation: ImplementationLocation.Client, - // origin: "modelerfour:synthesized/host", - // required: true, - // protocol: { - // http: new HttpParameter(ParameterLocation.Uri), - // }, - // language: { - // default: { - // serializedName: "endpoint", - // }, - // }, - // extensions: { - // "x-ms-skip-url-encoding": true, - // }, - // }), - // ), - // ); - // return hostParameters; - // } - // } - private processHostParametersFromSdkType(sdkPathParameters: SdkPathParameter[]): Parameter[] { const hostParameters: Parameter[] = []; let parameter; @@ -358,7 +295,7 @@ export class CodeModelBuilder { this.trackSchemaUsage(schema, { usage: [SchemaContext.Input, SchemaContext.Output /*SchemaContext.Public*/], }); - parameter = new Parameter(arg.name, arg.description ?? "", schema, { // TODO: descroption or details? + parameter = new Parameter(arg.name, arg.description ?? "", schema, { implementation: ImplementationLocation.Client, origin: "modelerfour:synthesized/host", required: true, @@ -602,9 +539,17 @@ export class CodeModelBuilder { let hostParameters: Parameter[] = []; client.initialization.properties.forEach((initializationProperty) => { if (initializationProperty.kind === "endpoint") { - if (!this.isArm()) { + if (this.isArm()) { // this is just a workaround for ARM + initializationProperty.type.serverUrl = "{endpoint}"; + initializationProperty.type.templateArguments = [this.buildSdkPathPathParameterForARM()]; + } + if (initializationProperty.type.serverUrl) { baseUri = initializationProperty.type.serverUrl; } + + // let templateArguments = initializationProperty.type.templateArguments; + // baseUri = initializationProperty.type.serverUrl; + hostParameters = this.processHostParametersFromSdkType(initializationProperty.type.templateArguments); codeModelClient.addGlobalParameters(hostParameters); } @@ -691,6 +636,31 @@ export class CodeModelBuilder { } } + private buildSdkPathPathParameterForARM(): SdkPathParameter { + return { + kind: "path", + name: "endpoint", + isGeneratedName: true, + description: "Service host", + onClient: true, + urlEncode: false, + optional: false, + serializedName: "endpoint", + correspondingMethodParams: [], + type: { + kind: "string", + encode: "string", + decorators: [], + name: "string", + crossLanguageDefinitionId: "string" + }, + isApiVersionParam: false, + decorators: [], + apiVersions: [], + crossLanguageDefinitionId: "endpoint", + }; + } + private listSubClientsUnderClient(client: SdkClientType, includeNestedOperationGroups: boolean, isRootClient: boolean): SdkClientType[] { const operationGroups: SdkClientType[] = []; for (const method of client.methods) { From e3afeb193906cdf6657da59b2cc459e528106ca4 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Wed, 31 Jul 2024 15:44:43 +0800 Subject: [PATCH 31/90] regen --- .../ArmResourceProviderManager.java | 1 + .../fluent/ArmResourceProviderClient.java | 7 + .../ArmResourceProviderClientBuilder.java | 18 +- .../ArmResourceProviderClientImpl.java | 18 +- ...ExtensionResourceInterfacesClientImpl.java | 117 ++++++++---- .../ChildResourcesInterfacesClientImpl.java | 149 ++++++++++----- ...mTemplateResourceInterfacesClientImpl.java | 47 +++-- .../implementation/OperationsClientImpl.java | 33 +++- ...pLevelArmResourceInterfacesClientImpl.java | 177 +++++++++++++----- 9 files changed, 423 insertions(+), 144 deletions(-) diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/ArmResourceProviderManager.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/ArmResourceProviderManager.java index 6fbd69c3a4..f8f5fc8810 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/ArmResourceProviderManager.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/ArmResourceProviderManager.java @@ -63,6 +63,7 @@ private ArmResourceProviderManager(HttpPipeline httpPipeline, AzureProfile profi Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); this.clientObject = new ArmResourceProviderClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) .buildClient(); diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ArmResourceProviderClient.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ArmResourceProviderClient.java index d3263fbdfe..aabdbaebb3 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ArmResourceProviderClient.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/fluent/ArmResourceProviderClient.java @@ -11,6 +11,13 @@ * The interface for ArmResourceProviderClient class. */ public interface ArmResourceProviderClient { + /** + * Gets Service host. + * + * @return the endpoint value. + */ + String getEndpoint(); + /** * Gets Version parameter. * diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientBuilder.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientBuilder.java index f014b39355..0156585f33 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientBuilder.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientBuilder.java @@ -19,6 +19,22 @@ */ @ServiceClientBuilder(serviceClients = { ArmResourceProviderClientImpl.class }) public final class ArmResourceProviderClientBuilder { + /* + * Service host + */ + private String endpoint; + + /** + * Sets Service host. + * + * @param endpoint the endpoint value. + * @return the ArmResourceProviderClientBuilder. + */ + public ArmResourceProviderClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The ID of the target subscription. The value must be an UUID. */ @@ -115,7 +131,7 @@ public ArmResourceProviderClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); ArmResourceProviderClientImpl client = new ArmResourceProviderClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.subscriptionId); + localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId); return client; } } diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientImpl.java index aa9d985f39..e4703c14c4 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientImpl.java @@ -43,6 +43,20 @@ */ @ServiceClient(builder = ArmResourceProviderClientBuilder.class) public final class ArmResourceProviderClientImpl implements ArmResourceProviderClient { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * Version parameter. */ @@ -190,13 +204,15 @@ public ChildExtensionResourceInterfacesClient getChildExtensionResourceInterface * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. + * @param endpoint Service host. * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ ArmResourceProviderClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId) { + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; + this.endpoint = endpoint; this.subscriptionId = subscriptionId; this.apiVersion = "2023-11-01"; this.childResourcesInterfaces = new ChildResourcesInterfacesClientImpl(this); diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildExtensionResourceInterfacesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildExtensionResourceInterfacesClientImpl.java index c37eae6307..26aab67662 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildExtensionResourceInterfacesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildExtensionResourceInterfacesClientImpl.java @@ -11,6 +11,7 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; @@ -75,8 +76,8 @@ public interface ChildExtensionResourceInterfacesService { @Get("/{resourceUri}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childExtensionResources/{childExtensionResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@QueryParam("api-version") String apiVersion, - @PathParam("resourceUri") String resourceUri, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @PathParam("childExtensionResourceName") String childExtensionResourceName, @HeaderParam("Accept") String accept, Context context); @@ -84,8 +85,8 @@ Mono> get(@QueryParam("api-version") Strin @Put("/{resourceUri}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childExtensionResources/{childExtensionResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@QueryParam("api-version") String apiVersion, - @PathParam("resourceUri") String resourceUri, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @PathParam("childExtensionResourceName") String childExtensionResourceName, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @@ -94,8 +95,8 @@ Mono>> createOrUpdate(@QueryParam("api-version") Strin @Patch("/{resourceUri}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childExtensionResources/{childExtensionResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@QueryParam("api-version") String apiVersion, - @PathParam("resourceUri") String resourceUri, + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @PathParam("childExtensionResourceName") String childExtensionResourceName, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @@ -105,8 +106,8 @@ Mono> update(@QueryParam("api-version") St @Delete("/{resourceUri}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childExtensionResources/{childExtensionResourceName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@QueryParam("api-version") String apiVersion, - @PathParam("resourceUri") String resourceUri, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @PathParam("childExtensionResourceName") String childExtensionResourceName, @HeaderParam("Accept") String accept, Context context); @@ -116,7 +117,8 @@ Mono>> delete(@QueryParam("api-version") String apiVer @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTopLevelArmResource( - @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("resourceUri") String resourceUri, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Accept") String accept, Context context); @@ -125,8 +127,8 @@ Mono> listByTopLevelArmResource( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTopLevelArmResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -143,6 +145,10 @@ Mono> listByTopLevelArmResourceNext( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -156,8 +162,8 @@ private Mono> getWithResponseAsync(String } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, - childExtensionResourceName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + topLevelArmResourceName, childExtensionResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -176,6 +182,10 @@ private Mono> getWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -189,7 +199,7 @@ private Mono> getWithResponseAsync(String } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, topLevelArmResourceName, childExtensionResourceName, accept, context); } @@ -263,6 +273,10 @@ public ChildExtensionResourceInner get(String resourceUri, String topLevelArmRes @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, ChildExtensionResourceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -282,8 +296,9 @@ private Mono>> createOrUpdateWithResponseAsync(String final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getApiVersion(), resourceUri, - topLevelArmResourceName, childExtensionResourceName, contentType, accept, resource, context)) + .withContext( + context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + topLevelArmResourceName, childExtensionResourceName, contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -305,6 +320,10 @@ private Mono>> createOrUpdateWithResponseAsync(String private Mono>> createOrUpdateWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, ChildExtensionResourceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -324,8 +343,8 @@ private Mono>> createOrUpdateWithResponseAsync(String final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, - childExtensionResourceName, contentType, accept, resource, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + topLevelArmResourceName, childExtensionResourceName, contentType, accept, resource, context); } /** @@ -513,6 +532,10 @@ public ChildExtensionResourceInner createOrUpdate(String resourceUri, String top @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, ChildExtensionResourceUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -532,8 +555,8 @@ private Mono> updateWithResponseAsync(Stri final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, - childExtensionResourceName, contentType, accept, properties, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + topLevelArmResourceName, childExtensionResourceName, contentType, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -555,6 +578,10 @@ private Mono> updateWithResponseAsync(Stri private Mono> updateWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, ChildExtensionResourceUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -574,8 +601,8 @@ private Mono> updateWithResponseAsync(Stri final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, - childExtensionResourceName, contentType, accept, properties, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + topLevelArmResourceName, childExtensionResourceName, contentType, accept, properties, context); } /** @@ -650,6 +677,10 @@ public ChildExtensionResourceInner update(String resourceUri, String topLevelArm @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -663,8 +694,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, - childExtensionResourceName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + topLevelArmResourceName, childExtensionResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -683,6 +714,10 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceUri, String topLevelArmResourceName, String childExtensionResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -696,8 +731,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, - childExtensionResourceName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + topLevelArmResourceName, childExtensionResourceName, accept, context); } /** @@ -861,6 +896,10 @@ public void delete(String resourceUri, String topLevelArmResourceName, String ch @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelArmResourceSinglePageAsync(String resourceUri, String topLevelArmResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -870,8 +909,8 @@ public void delete(String resourceUri, String topLevelArmResourceName, String ch } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByTopLevelArmResource(this.client.getApiVersion(), resourceUri, - topLevelArmResourceName, accept, context)) + .withContext(context -> service.listByTopLevelArmResource(this.client.getEndpoint(), + this.client.getApiVersion(), resourceUri, topLevelArmResourceName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -892,6 +931,10 @@ public void delete(String resourceUri, String topLevelArmResourceName, String ch @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelArmResourceSinglePageAsync(String resourceUri, String topLevelArmResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -902,8 +945,8 @@ public void delete(String resourceUri, String topLevelArmResourceName, String ch final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByTopLevelArmResource(this.client.getApiVersion(), resourceUri, topLevelArmResourceName, accept, - context) + .listByTopLevelArmResource(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + topLevelArmResourceName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -995,8 +1038,14 @@ public PagedIterable listByTopLevelArmResource(Stri if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listByTopLevelArmResourceNext(nextLink, accept, context)) + return FluxUtil + .withContext( + context -> service.listByTopLevelArmResourceNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1021,9 +1070,13 @@ public PagedIterable listByTopLevelArmResource(Stri if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByTopLevelArmResourceNext(nextLink, accept, context) + return service.listByTopLevelArmResourceNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java index ca32112b71..ec02ebc5f6 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java @@ -11,6 +11,7 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Post; @@ -76,8 +77,8 @@ public interface ChildResourcesInterfacesService { @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources/{childResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @PathParam("childResourceName") String childResourceName, @HeaderParam("Accept") String accept, @@ -86,8 +87,8 @@ Mono> get(@QueryParam("api-version") String apiVers @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources/{childResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @PathParam("childResourceName") String childResourceName, @HeaderParam("Content-Type") String contentType, @@ -97,8 +98,8 @@ Mono>> createOrUpdate(@QueryParam("api-version") Strin @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources/{childResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @PathParam("childResourceName") String childResourceName, @HeaderParam("Content-Type") String contentType, @@ -109,8 +110,8 @@ Mono> update(@QueryParam("api-version") String apiV @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources/{childResourceName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @PathParam("childResourceName") String childResourceName, @HeaderParam("Accept") String accept, @@ -120,8 +121,8 @@ Mono>> delete(@QueryParam("api-version") String apiVer @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByTopLevelArmResource(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> listByTopLevelArmResource(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Accept") String accept, Context context); @@ -130,8 +131,8 @@ Mono> listByTopLevelArmResource(@QueryParam("a @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/childResources/{childResourceName}/actionWithoutBody") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> actionWithoutBody(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> actionWithoutBody(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @PathParam("childResourceName") String childResourceName, @HeaderParam("Accept") String accept, @@ -142,8 +143,8 @@ Mono>> actionWithoutBody(@QueryParam("api-version") St @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTopLevelArmResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -160,6 +161,10 @@ Mono> listByTopLevelArmResourceNext( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -178,8 +183,9 @@ private Mono> getWithResponseAsync(String resourceG } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, childResourceName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -198,6 +204,10 @@ private Mono> getWithResponseAsync(String resourceG @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -216,8 +226,8 @@ private Mono> getWithResponseAsync(String resourceG } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelArmResourceName, childResourceName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, childResourceName, accept, context); } /** @@ -288,6 +298,10 @@ public ChildResourceInner get(String resourceGroupName, String topLevelArmResour @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, ChildResourceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -312,8 +326,9 @@ private Mono>> createOrUpdateWithResponseAsync(String final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, childResourceName, contentType, accept, resource, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, + contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -334,6 +349,10 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, ChildResourceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -358,8 +377,9 @@ private Mono>> createOrUpdateWithResponseAsync(String final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelArmResourceName, childResourceName, contentType, accept, resource, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, contentType, + accept, resource, context); } /** @@ -541,6 +561,10 @@ public ChildResourceInner createOrUpdate(String resourceGroupName, String topLev @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, ChildResourceUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -565,9 +589,9 @@ private Mono> updateWithResponseAsync(String resour final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, childResourceName, contentType, accept, properties, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, + contentType, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -588,6 +612,10 @@ private Mono> updateWithResponseAsync(String resour @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, ChildResourceUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -612,8 +640,8 @@ private Mono> updateWithResponseAsync(String resour final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelArmResourceName, childResourceName, contentType, accept, properties, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, childResourceName, contentType, accept, properties, context); } /** @@ -688,6 +716,10 @@ public ChildResourceInner update(String resourceGroupName, String topLevelArmRes @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -706,8 +738,9 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, childResourceName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -726,6 +759,10 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -744,8 +781,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelArmResourceName, childResourceName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, childResourceName, accept, context); } /** @@ -908,6 +945,10 @@ public void delete(String resourceGroupName, String topLevelArmResourceName, Str @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelArmResourceSinglePageAsync(String resourceGroupName, String topLevelArmResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -922,8 +963,9 @@ private Mono> listByTopLevelArmResourceSingleP } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByTopLevelArmResource(this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context)) + .withContext( + context -> service.listByTopLevelArmResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -944,6 +986,10 @@ private Mono> listByTopLevelArmResourceSingleP @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelArmResourceSinglePageAsync(String resourceGroupName, String topLevelArmResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -959,8 +1005,8 @@ private Mono> listByTopLevelArmResourceSingleP final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByTopLevelArmResource(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelArmResourceName, accept, context) + .listByTopLevelArmResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1049,6 +1095,10 @@ public PagedIterable listByTopLevelArmResource(String resour @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> actionWithoutBodyWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1067,9 +1117,9 @@ private Mono>> actionWithoutBodyWithResponseAsync(Stri } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.actionWithoutBody(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, childResourceName, accept, context)) + .withContext(context -> service.actionWithoutBody(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1088,6 +1138,10 @@ private Mono>> actionWithoutBodyWithResponseAsync(Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> actionWithoutBodyWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, String childResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1106,8 +1160,9 @@ private Mono>> actionWithoutBodyWithResponseAsync(Stri } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.actionWithoutBody(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, childResourceName, accept, context); + return service.actionWithoutBody(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, childResourceName, accept, + context); } /** @@ -1276,8 +1331,14 @@ private Mono> listByTopLevelArmResourceNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listByTopLevelArmResourceNext(nextLink, accept, context)) + return FluxUtil + .withContext( + context -> service.listByTopLevelArmResourceNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1302,9 +1363,13 @@ private Mono> listByTopLevelArmResourceNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByTopLevelArmResourceNext(nextLink, accept, context) + return service.listByTopLevelArmResourceNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/CustomTemplateResourceInterfacesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/CustomTemplateResourceInterfacesClientImpl.java index b8a6f254ec..8b208a8563 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/CustomTemplateResourceInterfacesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/CustomTemplateResourceInterfacesClientImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; @@ -66,8 +67,8 @@ public interface CustomTemplateResourceInterfacesService { @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/customTemplateResources/{customTemplateResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @PathParam("customTemplateResourceName") String customTemplateResourceName, @@ -77,8 +78,8 @@ Mono>> createOrUpdate(@QueryParam("api-version") Strin @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/customTemplateResources/{customTemplateResourceName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateLongRunning(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> updateLongRunning(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("customTemplateResourceName") String customTemplateResourceName, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @@ -102,6 +103,10 @@ Mono>> updateLongRunning(@QueryParam("api-version") St @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String customTemplateResourceName, CustomTemplateResourceInner resource, String ifMatch, String ifNoneMatch) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -122,9 +127,9 @@ private Mono>> createOrUpdateWithResponseAsync(String final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, ifMatch, ifNoneMatch, customTemplateResourceName, contentType, accept, resource, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, ifMatch, ifNoneMatch, customTemplateResourceName, + contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -147,6 +152,10 @@ private Mono>> createOrUpdateWithResponseAsync(String private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String customTemplateResourceName, CustomTemplateResourceInner resource, String ifMatch, String ifNoneMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -167,8 +176,9 @@ private Mono>> createOrUpdateWithResponseAsync(String final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - ifMatch, ifNoneMatch, customTemplateResourceName, contentType, accept, resource, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, ifMatch, ifNoneMatch, customTemplateResourceName, + contentType, accept, resource, context); } /** @@ -417,6 +427,10 @@ public CustomTemplateResourceInner createOrUpdate(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateLongRunningWithResponseAsync(String resourceGroupName, String customTemplateResourceName, CustomTemplateResourcePatch properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -437,9 +451,9 @@ private Mono>> updateLongRunningWithResponseAsync(Stri final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.updateLongRunning(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, customTemplateResourceName, contentType, accept, properties, context)) + .withContext(context -> service.updateLongRunning(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, customTemplateResourceName, contentType, accept, + properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -459,6 +473,10 @@ private Mono>> updateLongRunningWithResponseAsync(Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateLongRunningWithResponseAsync(String resourceGroupName, String customTemplateResourceName, CustomTemplateResourcePatch properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -479,8 +497,9 @@ private Mono>> updateLongRunningWithResponseAsync(Stri final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.updateLongRunning(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, customTemplateResourceName, contentType, accept, properties, context); + return service.updateLongRunning(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, customTemplateResourceName, contentType, accept, + properties, context); } /** diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/OperationsClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/OperationsClientImpl.java index a7978429e9..0c2de7e03f 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/OperationsClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/OperationsClientImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -65,15 +66,15 @@ public interface OperationsService { @Get("/providers/Cadl.ArmResourceProvider/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -86,8 +87,14 @@ Mono> listNext(@PathParam(value = "nextLink", enco */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.list(this.client.getApiVersion(), accept, context)) + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -105,9 +112,13 @@ private Mono> listSinglePageAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getApiVersion(), accept, context) + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -186,8 +197,12 @@ private Mono> listNextSinglePageAsync(String nextL if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, accept, context)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -211,9 +226,13 @@ private Mono> listNextSinglePageAsync(String nextL if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listNext(nextLink, accept, context) + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java index 29537d3ee0..7b5b9ce130 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java @@ -11,6 +11,7 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Post; @@ -77,8 +78,8 @@ public interface TopLevelArmResourceInterfacesService { @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Accept") String accept, Context context); @@ -86,8 +87,8 @@ Mono> getByResourceGroup(@QueryParam("api-ver @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @@ -96,8 +97,8 @@ Mono>> createOrUpdate(@QueryParam("api-version") Strin @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @@ -107,8 +108,8 @@ Mono> update(@QueryParam("api-version") Strin @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Accept") String accept, Context context); @@ -117,8 +118,8 @@ Mono>> delete(@QueryParam("api-version") String apiVer @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); @@ -126,15 +127,16 @@ Mono> listByResourceGroup(@QueryParam("a @Get("/subscriptions/{subscriptionId}/providers/Cadl.ArmResourceProvider/topLevelArmResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmResourceProvider/topLevelArmResources/{topLevelArmResourceName}/action") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> action(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> action(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Accept") String accept, Context context); @@ -144,16 +146,16 @@ Mono>> action(@QueryParam("api-version") String apiVer @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -169,6 +171,10 @@ Mono> listBySubscriptionNext( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String topLevelArmResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -183,7 +189,7 @@ private Mono> getByResourceGroupWithResponseA } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getApiVersion(), + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -202,6 +208,10 @@ private Mono> getByResourceGroupWithResponseA @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -216,8 +226,8 @@ private Mono> getByResourceGroupWithResponseA } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, accept, context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context); } /** @@ -284,6 +294,10 @@ public TopLevelArmResourceInner getByResourceGroup(String resourceGroupName, Str @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, TopLevelArmResourceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -304,8 +318,9 @@ private Mono>> createOrUpdateWithResponseAsync(String final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, contentType, accept, resource, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, contentType, accept, + resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -325,6 +340,10 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, TopLevelArmResourceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -345,8 +364,9 @@ private Mono>> createOrUpdateWithResponseAsync(String final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelArmResourceName, contentType, accept, resource, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, contentType, accept, resource, + context); } /** @@ -521,6 +541,10 @@ public TopLevelArmResourceInner createOrUpdate(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, TopLevelArmResourceUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -541,8 +565,9 @@ private Mono> updateWithResponseAsync(String final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, contentType, accept, properties, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, contentType, accept, + properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -562,6 +587,10 @@ private Mono> updateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, TopLevelArmResourceUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -582,8 +611,8 @@ private Mono> updateWithResponseAsync(String final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelArmResourceName, contentType, accept, properties, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, contentType, accept, properties, context); } /** @@ -654,6 +683,10 @@ public TopLevelArmResourceInner update(String resourceGroupName, String topLevel @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelArmResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -668,8 +701,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -687,6 +720,10 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -701,8 +738,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelArmResourceName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, accept, context); } /** @@ -850,6 +887,10 @@ public void delete(String resourceGroupName, String topLevelArmResourceName, Con */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -860,7 +901,7 @@ private Mono> listByResourceGroupSingleP } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getApiVersion(), + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -881,6 +922,10 @@ private Mono> listByResourceGroupSingleP @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -892,8 +937,8 @@ private Mono> listByResourceGroupSingleP final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - accept, context) + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -968,14 +1013,18 @@ public PagedIterable listByResourceGroup(String resour */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.list(this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -993,13 +1042,19 @@ private Mono> listSinglePageAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1071,6 +1126,10 @@ public PagedIterable list(Context context) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> actionWithResponseAsync(String resourceGroupName, String topLevelArmResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1085,8 +1144,8 @@ private Mono>> actionWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.action(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, accept, context)) + .withContext(context -> service.action(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1104,6 +1163,10 @@ private Mono>> actionWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> actionWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1118,8 +1181,8 @@ private Mono>> actionWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.action(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelArmResourceName, accept, context); + return service.action(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, accept, context); } /** @@ -1275,8 +1338,14 @@ private Mono> listByResourceGroupNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listByResourceGroupNext(nextLink, accept, context)) + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1301,9 +1370,13 @@ private Mono> listByResourceGroupNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, accept, context) + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1325,8 +1398,14 @@ private Mono> listBySubscriptionNextSing if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listBySubscriptionNext(nextLink, accept, context)) + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1351,9 +1430,13 @@ private Mono> listBySubscriptionNextSing if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, accept, context) + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } From a990b5b52148896667dcbb9bdd3ba6bbabd11d58 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Wed, 31 Jul 2024 16:36:39 +0800 Subject: [PATCH 32/90] regen --- .../ManagedIdentityManager.java | 1 + .../fluent/ManagedIdentityClient.java | 7 + .../ManagedIdentityClientBuilder.java | 18 +- .../ManagedIdentityClientImpl.java | 18 +- ...gedIdentityTrackedResourcesClientImpl.java | 62 +++++-- .../models/resources/ResourcesManager.java | 1 + .../resources/fluent/ResourcesClient.java | 7 + .../NestedProxyResourcesClientImpl.java | 122 ++++++++++---- .../ResourcesClientBuilder.java | 18 +- .../implementation/ResourcesClientImpl.java | 18 +- .../TopLevelTrackedResourcesClientImpl.java | 156 +++++++++++++----- .../ArmStreamStyleSerializationManager.java | 1 + .../ArmStreamStyleSerializationClient.java | 7 + ...StreamStyleSerializationClientBuilder.java | 18 +- ...ArmStreamStyleSerializationClientImpl.java | 18 +- .../implementation/FishesClientImpl.java | 34 +++- .../TopLevelArmResourcesClientImpl.java | 22 ++- 17 files changed, 418 insertions(+), 110 deletions(-) diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/ManagedIdentityManager.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/ManagedIdentityManager.java index dd42caa8da..20036c52da 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/ManagedIdentityManager.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/ManagedIdentityManager.java @@ -47,6 +47,7 @@ private ManagedIdentityManager(HttpPipeline httpPipeline, AzureProfile profile, Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); this.clientObject = new ManagedIdentityClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) .buildClient(); diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/ManagedIdentityClient.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/ManagedIdentityClient.java index 032634dc9a..f0a5e6ccd7 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/ManagedIdentityClient.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/ManagedIdentityClient.java @@ -11,6 +11,13 @@ * The interface for ManagedIdentityClient class. */ public interface ManagedIdentityClient { + /** + * Gets Service host. + * + * @return the endpoint value. + */ + String getEndpoint(); + /** * Gets Version parameter. * diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityClientBuilder.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityClientBuilder.java index d53a199fae..95426bfca5 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityClientBuilder.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityClientBuilder.java @@ -19,6 +19,22 @@ */ @ServiceClientBuilder(serviceClients = { ManagedIdentityClientImpl.class }) public final class ManagedIdentityClientBuilder { + /* + * Service host + */ + private String endpoint; + + /** + * Sets Service host. + * + * @param endpoint the endpoint value. + * @return the ManagedIdentityClientBuilder. + */ + public ManagedIdentityClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The ID of the target subscription. The value must be an UUID. */ @@ -115,7 +131,7 @@ public ManagedIdentityClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); ManagedIdentityClientImpl client = new ManagedIdentityClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.subscriptionId); + localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId); return client; } } diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityClientImpl.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityClientImpl.java index ee35af6cc2..7ca7ea19a0 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityClientImpl.java @@ -39,6 +39,20 @@ */ @ServiceClient(builder = ManagedIdentityClientBuilder.class) public final class ManagedIdentityClientImpl implements ManagedIdentityClient { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * Version parameter. */ @@ -130,13 +144,15 @@ public ManagedIdentityTrackedResourcesClient getManagedIdentityTrackedResources( * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. + * @param endpoint Service host. * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ ManagedIdentityClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId) { + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; + this.endpoint = endpoint; this.subscriptionId = subscriptionId; this.apiVersion = "2023-12-01-preview"; this.managedIdentityTrackedResources = new ManagedIdentityTrackedResourcesClientImpl(this); diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityTrackedResourcesClientImpl.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityTrackedResourcesClientImpl.java index 19f0b36bc9..bd271c409a 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityTrackedResourcesClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityTrackedResourcesClientImpl.java @@ -10,6 +10,7 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; @@ -63,7 +64,7 @@ public interface ManagedIdentityTrackedResourcesService { @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.CommonTypes.ManagedIdentity/managedIdentityTrackedResources/{managedIdentityTrackedResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("managedIdentityTrackedResourceName") String managedIdentityTrackedResourceName, @@ -73,7 +74,8 @@ Mono> getByResourceGroup( @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createWithSystemAssigned( - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("managedIdentityTrackedResourceName") String managedIdentityTrackedResourceName, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @@ -83,7 +85,8 @@ Mono> createWithSystemAssigned( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> updateWithUserAssignedAndSystemAssigned( - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("managedIdentityTrackedResourceName") String managedIdentityTrackedResourceName, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @@ -103,6 +106,10 @@ Mono> updateWithUserAssignedAndSys @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String managedIdentityTrackedResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -117,9 +124,9 @@ Mono> updateWithUserAssignedAndSys } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.getByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, managedIdentityTrackedResourceName, accept, context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, managedIdentityTrackedResourceName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -137,6 +144,10 @@ Mono> updateWithUserAssignedAndSys @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( String resourceGroupName, String managedIdentityTrackedResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -151,8 +162,8 @@ private Mono> getByResourceGroupWi } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, managedIdentityTrackedResourceName, accept, context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, managedIdentityTrackedResourceName, accept, context); } /** @@ -223,6 +234,10 @@ public ManagedIdentityTrackedResourceInner getByResourceGroup(String resourceGro private Mono> createWithSystemAssignedWithResponseAsync( String resourceGroupName, String managedIdentityTrackedResourceName, ManagedIdentityTrackedResourceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -243,9 +258,9 @@ private Mono> createWithSystemAssi final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createWithSystemAssigned(this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, managedIdentityTrackedResourceName, contentType, - accept, resource, context)) + .withContext(context -> service.createWithSystemAssigned(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + managedIdentityTrackedResourceName, contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -266,6 +281,10 @@ private Mono> createWithSystemAssi private Mono> createWithSystemAssignedWithResponseAsync( String resourceGroupName, String managedIdentityTrackedResourceName, ManagedIdentityTrackedResourceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -286,8 +305,9 @@ private Mono> createWithSystemAssi final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createWithSystemAssigned(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, managedIdentityTrackedResourceName, contentType, accept, resource, context); + return service.createWithSystemAssigned(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, managedIdentityTrackedResourceName, contentType, accept, + resource, context); } /** @@ -363,6 +383,10 @@ public ManagedIdentityTrackedResourceInner createWithSystemAssigned(String resou private Mono> updateWithUserAssignedAndSystemAssignedWithResponseAsync(String resourceGroupName, String managedIdentityTrackedResourceName, ManagedIdentityTrackedResourceInner properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -383,9 +407,9 @@ public ManagedIdentityTrackedResourceInner createWithSystemAssigned(String resou final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.updateWithUserAssignedAndSystemAssigned(this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, managedIdentityTrackedResourceName, contentType, - accept, properties, context)) + .withContext(context -> service.updateWithUserAssignedAndSystemAssigned(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + managedIdentityTrackedResourceName, contentType, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -407,6 +431,10 @@ public ManagedIdentityTrackedResourceInner createWithSystemAssigned(String resou updateWithUserAssignedAndSystemAssignedWithResponseAsync(String resourceGroupName, String managedIdentityTrackedResourceName, ManagedIdentityTrackedResourceInner properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -427,7 +455,7 @@ public ManagedIdentityTrackedResourceInner createWithSystemAssigned(String resou final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.updateWithUserAssignedAndSystemAssigned(this.client.getApiVersion(), + return service.updateWithUserAssignedAndSystemAssigned(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, managedIdentityTrackedResourceName, contentType, accept, properties, context); } diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/ResourcesManager.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/ResourcesManager.java index a96212bb57..8b3adc0289 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/ResourcesManager.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/ResourcesManager.java @@ -51,6 +51,7 @@ private ResourcesManager(HttpPipeline httpPipeline, AzureProfile profile, Durati Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); this.clientObject = new ResourcesClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) .buildClient(); diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/ResourcesClient.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/ResourcesClient.java index 760d7eeaf2..eef0d18124 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/ResourcesClient.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/ResourcesClient.java @@ -11,6 +11,13 @@ * The interface for ResourcesClient class. */ public interface ResourcesClient { + /** + * Gets Service host. + * + * @return the endpoint value. + */ + String getEndpoint(); + /** * Gets Version parameter. * diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/NestedProxyResourcesClientImpl.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/NestedProxyResourcesClientImpl.java index fdf9d9a01f..2ec2e1afe4 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/NestedProxyResourcesClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/NestedProxyResourcesClientImpl.java @@ -11,6 +11,7 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; @@ -74,8 +75,8 @@ public interface NestedProxyResourcesService { @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}/nestedProxyResources/{nextedProxyResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("Accept") String accept, @@ -84,8 +85,8 @@ Mono> get(@QueryParam("api-version") String a @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}/nestedProxyResources/{nextedProxyResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrReplace(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrReplace(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @@ -95,8 +96,8 @@ Mono>> createOrReplace(@QueryParam("api-version") Stri @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}/nestedProxyResources/{nextedProxyResourceName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @@ -107,8 +108,8 @@ Mono>> update(@QueryParam("api-version") String apiVer @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}/nestedProxyResources/{nextedProxyResourceName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, @PathParam("nextedProxyResourceName") String nextedProxyResourceName, @HeaderParam("Accept") String accept, @@ -119,7 +120,8 @@ Mono>> delete(@QueryParam("api-version") String apiVer @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTopLevelTrackedResource( - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, @HeaderParam("Accept") String accept, Context context); @@ -129,8 +131,8 @@ Mono> listByTopLevelTrackedResource( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTopLevelTrackedResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -147,6 +149,10 @@ Mono> listByTopLevelTrackedResourceNext( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -165,8 +171,9 @@ private Mono> getWithResponseAsync(String res } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, + nextedProxyResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -185,6 +192,10 @@ private Mono> getWithResponseAsync(String res @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -203,8 +214,8 @@ private Mono> getWithResponseAsync(String res } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelTrackedResourceName, nextedProxyResourceName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, accept, context); } /** @@ -278,6 +289,10 @@ public NestedProxyResourceInner get(String resourceGroupName, String topLevelTra @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, NestedProxyResourceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -302,7 +317,7 @@ private Mono>> createOrReplaceWithResponseAsync(String final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrReplace(this.client.getApiVersion(), + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -326,6 +341,10 @@ private Mono>> createOrReplaceWithResponseAsync(String private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, NestedProxyResourceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -350,8 +369,9 @@ private Mono>> createOrReplaceWithResponseAsync(String final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrReplace(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelTrackedResourceName, nextedProxyResourceName, contentType, accept, resource, context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, + contentType, accept, resource, context); } /** @@ -541,6 +561,10 @@ public NestedProxyResourceInner createOrReplace(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, NestedProxyResourceInner properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -565,9 +589,9 @@ private Mono>> updateWithResponseAsync(String resource final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, contentType, accept, - properties, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, + nextedProxyResourceName, contentType, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -589,6 +613,10 @@ private Mono>> updateWithResponseAsync(String resource private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, NestedProxyResourceInner properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -613,8 +641,9 @@ private Mono>> updateWithResponseAsync(String resource final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelTrackedResourceName, nextedProxyResourceName, contentType, accept, properties, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, contentType, accept, properties, + context); } /** @@ -800,6 +829,10 @@ public NestedProxyResourceInner update(String resourceGroupName, String topLevel @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -818,8 +851,9 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, + nextedProxyResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -838,6 +872,10 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, String nextedProxyResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -856,8 +894,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelTrackedResourceName, nextedProxyResourceName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, nextedProxyResourceName, accept, context); } /** @@ -1022,6 +1060,10 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelTrackedResourceSinglePageAsync(String resourceGroupName, String topLevelTrackedResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1036,8 +1078,9 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByTopLevelTrackedResource(this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context)) + .withContext( + context -> service.listByTopLevelTrackedResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1058,6 +1101,10 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTopLevelTrackedResourceSinglePageAsync( String resourceGroupName, String topLevelTrackedResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1073,8 +1120,8 @@ private Mono> listByTopLevelTrackedResou final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByTopLevelTrackedResource(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, accept, context) + .listByTopLevelTrackedResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1168,8 +1215,13 @@ public PagedIterable listByTopLevelTrackedResource(Str if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listByTopLevelTrackedResourceNext(nextLink, accept, context)) + return FluxUtil.withContext( + context -> service.listByTopLevelTrackedResourceNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1194,9 +1246,13 @@ public PagedIterable listByTopLevelTrackedResource(Str if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByTopLevelTrackedResourceNext(nextLink, accept, context) + return service.listByTopLevelTrackedResourceNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/ResourcesClientBuilder.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/ResourcesClientBuilder.java index 9079e8642f..3a43718066 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/ResourcesClientBuilder.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/ResourcesClientBuilder.java @@ -19,6 +19,22 @@ */ @ServiceClientBuilder(serviceClients = { ResourcesClientImpl.class }) public final class ResourcesClientBuilder { + /* + * Service host + */ + private String endpoint; + + /** + * Sets Service host. + * + * @param endpoint the endpoint value. + * @return the ResourcesClientBuilder. + */ + public ResourcesClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The ID of the target subscription. The value must be an UUID. */ @@ -115,7 +131,7 @@ public ResourcesClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); ResourcesClientImpl client = new ResourcesClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.subscriptionId); + localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId); return client; } } diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/ResourcesClientImpl.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/ResourcesClientImpl.java index 6db6b25389..9589bb096d 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/ResourcesClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/ResourcesClientImpl.java @@ -40,6 +40,20 @@ */ @ServiceClient(builder = ResourcesClientBuilder.class) public final class ResourcesClientImpl implements ResourcesClient { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * Version parameter. */ @@ -145,13 +159,15 @@ public NestedProxyResourcesClient getNestedProxyResources() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. + * @param endpoint Service host. * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ ResourcesClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, - AzureEnvironment environment, String subscriptionId) { + AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; + this.endpoint = endpoint; this.subscriptionId = subscriptionId; this.apiVersion = "2023-12-01-preview"; this.topLevelTrackedResources = new TopLevelTrackedResourcesClientImpl(this); diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java index 48c70ca0e2..8846a0e314 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java @@ -11,6 +11,7 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; @@ -74,8 +75,8 @@ public interface TopLevelTrackedResourcesService { @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, @HeaderParam("Accept") String accept, Context context); @@ -83,8 +84,8 @@ Mono> getByResourceGroup(@QueryParam("api @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrReplace(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrReplace(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @@ -93,8 +94,8 @@ Mono>> createOrReplace(@QueryParam("api-version") Stri @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @@ -104,8 +105,8 @@ Mono>> update(@QueryParam("api-version") String apiVer @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, @HeaderParam("Accept") String accept, Context context); @@ -114,7 +115,7 @@ Mono>> delete(@QueryParam("api-version") String apiVer @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); @@ -123,24 +124,25 @@ Mono> listByResourceGroup( @Get("/subscriptions/{subscriptionId}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -156,6 +158,10 @@ Mono> listBySubscriptionNext( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -170,7 +176,7 @@ private Mono> getByResourceGroupWithRespo } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getApiVersion(), + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -189,6 +195,10 @@ private Mono> getByResourceGroupWithRespo @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -203,8 +213,8 @@ private Mono> getByResourceGroupWithRespo } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, accept, context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context); } /** @@ -272,6 +282,10 @@ public TopLevelTrackedResourceInner getByResourceGroup(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, TopLevelTrackedResourceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -292,9 +306,9 @@ private Mono>> createOrReplaceWithResponseAsync(String final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.createOrReplace(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, contentType, accept, resource, context)) + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, contentType, accept, + resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -314,6 +328,10 @@ private Mono>> createOrReplaceWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, TopLevelTrackedResourceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -334,8 +352,9 @@ private Mono>> createOrReplaceWithResponseAsync(String final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrReplace(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelTrackedResourceName, contentType, accept, resource, context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, contentType, accept, + resource, context); } /** @@ -514,6 +533,10 @@ public TopLevelTrackedResourceInner createOrReplace(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, TopLevelTrackedResourceInner properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -534,8 +557,9 @@ private Mono>> updateWithResponseAsync(String resource final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, contentType, accept, properties, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, contentType, accept, + properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -555,6 +579,10 @@ private Mono>> updateWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, TopLevelTrackedResourceInner properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -575,8 +603,8 @@ private Mono>> updateWithResponseAsync(String resource final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelTrackedResourceName, contentType, accept, properties, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, contentType, accept, properties, context); } /** @@ -752,6 +780,10 @@ public TopLevelTrackedResourceInner update(String resourceGroupName, String topL @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -766,8 +798,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -785,6 +817,10 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String topLevelTrackedResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -799,8 +835,8 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelTrackedResourceName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelTrackedResourceName, accept, context); } /** @@ -950,6 +986,10 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -960,7 +1000,7 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getApiVersion(), + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -981,6 +1021,10 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -992,8 +1036,8 @@ public void delete(String resourceGroupName, String topLevelTrackedResourceName, final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - accept, context) + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1071,14 +1115,18 @@ public PagedIterable listByResourceGroup(String re */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.list(this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1096,13 +1144,19 @@ private Mono> listSinglePageAsync() */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1180,8 +1234,14 @@ private Mono> listByResourceGroupNex if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listByResourceGroupNext(nextLink, accept, context)) + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1206,9 +1266,13 @@ private Mono> listByResourceGroupNex if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, accept, context) + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1230,8 +1294,14 @@ private Mono> listBySubscriptionNext if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listBySubscriptionNext(nextLink, accept, context)) + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1256,9 +1326,13 @@ private Mono> listBySubscriptionNext if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, accept, context) + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/ArmStreamStyleSerializationManager.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/ArmStreamStyleSerializationManager.java index eb39c36857..7b24317712 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/ArmStreamStyleSerializationManager.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/ArmStreamStyleSerializationManager.java @@ -52,6 +52,7 @@ private ArmStreamStyleSerializationManager(HttpPipeline httpPipeline, AzureProfi Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); this.clientObject = new ArmStreamStyleSerializationClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) .buildClient(); diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/ArmStreamStyleSerializationClient.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/ArmStreamStyleSerializationClient.java index 6c2dc1e0da..ce6c002ee6 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/ArmStreamStyleSerializationClient.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/ArmStreamStyleSerializationClient.java @@ -11,6 +11,13 @@ * The interface for ArmStreamStyleSerializationClient class. */ public interface ArmStreamStyleSerializationClient { + /** + * Gets Service host. + * + * @return the endpoint value. + */ + String getEndpoint(); + /** * Gets Version parameter. * diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientBuilder.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientBuilder.java index d0659bf1b5..edb808987a 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientBuilder.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientBuilder.java @@ -19,6 +19,22 @@ */ @ServiceClientBuilder(serviceClients = { ArmStreamStyleSerializationClientImpl.class }) public final class ArmStreamStyleSerializationClientBuilder { + /* + * Service host + */ + private String endpoint; + + /** + * Sets Service host. + * + * @param endpoint the endpoint value. + * @return the ArmStreamStyleSerializationClientBuilder. + */ + public ArmStreamStyleSerializationClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The ID of the target subscription. The value must be an UUID. */ @@ -115,7 +131,7 @@ public ArmStreamStyleSerializationClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); ArmStreamStyleSerializationClientImpl client = new ArmStreamStyleSerializationClientImpl(localPipeline, - localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId); + localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId); return client; } } diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientImpl.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientImpl.java index 306a0a1e3b..5abcf9e421 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientImpl.java @@ -40,6 +40,20 @@ */ @ServiceClient(builder = ArmStreamStyleSerializationClientBuilder.class) public final class ArmStreamStyleSerializationClientImpl implements ArmStreamStyleSerializationClient { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * Version parameter. */ @@ -145,13 +159,15 @@ public TopLevelArmResourcesClient getTopLevelArmResources() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. + * @param endpoint Service host. * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ ArmStreamStyleSerializationClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId) { + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; + this.endpoint = endpoint; this.subscriptionId = subscriptionId; this.apiVersion = "2023-12-01-preview"; this.fishes = new FishesClientImpl(this); diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java index 3e9ee1cf1e..56a91d51b6 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java @@ -10,6 +10,7 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -60,13 +61,15 @@ public interface FishesService { @Get("/model") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorException.class) - Mono> getModel(@HeaderParam("Accept") String accept, Context context); + Mono> getModel(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + Context context); @Put("/model") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorMinException.class) - Mono> putModel(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") FishInner fish, Context context); + Mono> putModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FishInner fish, Context context); } /** @@ -79,8 +82,12 @@ Mono> putModel(@HeaderParam("Content-Type") String contentTy */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getModelWithResponseAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getModel(accept, context)) + return FluxUtil.withContext(context -> service.getModel(this.client.getEndpoint(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -96,9 +103,13 @@ private Mono> getModelWithResponseAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getModelWithResponseAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getModel(accept, context); + return service.getModel(this.client.getEndpoint(), accept, context); } /** @@ -153,6 +164,10 @@ public FishInner getModel() { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> putModelWithResponseAsync(FishInner fish) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (fish == null) { return Mono.error(new IllegalArgumentException("Parameter fish is required and cannot be null.")); } else { @@ -160,7 +175,8 @@ private Mono> putModelWithResponseAsync(FishInner fish) { } final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putModel(contentType, accept, fish, context)) + return FluxUtil + .withContext(context -> service.putModel(this.client.getEndpoint(), contentType, accept, fish, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -177,6 +193,10 @@ private Mono> putModelWithResponseAsync(FishInner fish) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> putModelWithResponseAsync(FishInner fish, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (fish == null) { return Mono.error(new IllegalArgumentException("Parameter fish is required and cannot be null.")); } else { @@ -185,7 +205,7 @@ private Mono> putModelWithResponseAsync(FishInner fish, Cont final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.putModel(contentType, accept, fish, context); + return service.putModel(this.client.getEndpoint(), contentType, accept, fish, context); } /** diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/TopLevelArmResourcesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/TopLevelArmResourcesClientImpl.java index 0f0cbba748..9392abb7bc 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/TopLevelArmResourcesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/TopLevelArmResourcesClientImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.QueryParam; @@ -65,8 +66,8 @@ public interface TopLevelArmResourcesService { @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Cadl.ArmStreamStyleSerialization/topLevelArmResources/{topLevelArmResourceName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelArmResourceName") String topLevelArmResourceName, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @@ -88,6 +89,10 @@ Mono>> update(@QueryParam("api-version") String apiVer @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, TopLevelArmResourceTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -108,8 +113,9 @@ private Mono>> updateWithResponseAsync(String resource final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelArmResourceName, contentType, accept, properties, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, topLevelArmResourceName, contentType, accept, + properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -129,6 +135,10 @@ private Mono>> updateWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String topLevelArmResourceName, TopLevelArmResourceTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -149,8 +159,8 @@ private Mono>> updateWithResponseAsync(String resource final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - topLevelArmResourceName, contentType, accept, properties, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, topLevelArmResourceName, contentType, accept, properties, context); } /** From cde90510f7fe3773553c8f3f084c2dc37d18ed1c Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Wed, 31 Jul 2024 17:39:43 +0800 Subject: [PATCH 33/90] Fixed the api-version being added to builder issue --- typespec-extension/src/code-model-builder.ts | 49 +++++++++----------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index f52547f2e7..25c930f70c 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -150,16 +150,9 @@ import { isKnownContentType, isLroNewPollingStrategy, isPayloadProperty, -<<<<<<< HEAD - loadExamples, sdkHttpOperationIsJsonMergePatch, sdkHttpOperationIsMultipart, sdkHttpOperationIsMultipleContentTypes, -======= - operationIsJsonMergePatch, - operationIsMultipart, - operationIsMultipleContentTypes, ->>>>>>> remote/main } from "./operation-utils.js"; import { PreNamer } from "./prenamer/prenamer.js"; import { @@ -296,26 +289,30 @@ export class CodeModelBuilder { const hostParameters: Parameter[] = []; let parameter; sdkPathParameters.forEach((arg) => { - const schema = this.processSchemaFromSdkType(arg.type, arg.name); - this.trackSchemaUsage(schema, { - usage: [SchemaContext.Input, SchemaContext.Output /*SchemaContext.Public*/], - }); - parameter = new Parameter(arg.name, arg.description ?? "", schema, { - implementation: ImplementationLocation.Client, - origin: "modelerfour:synthesized/host", - required: true, - protocol: { - http: new HttpParameter(ParameterLocation.Uri), - }, - language: { - default: { - serializedName: arg.name, + if (arg.isApiVersionParam) { + parameter = this.createApiVersionParameter(arg.name, ParameterLocation.Uri); + } else { + const schema = this.processSchemaFromSdkType(arg.type, arg.name); + this.trackSchemaUsage(schema, { + usage: [SchemaContext.Input, SchemaContext.Output /*SchemaContext.Public*/], + }); + parameter = new Parameter(arg.name, arg.description ?? "", schema, { + implementation: ImplementationLocation.Client, + origin: "modelerfour:synthesized/host", + required: true, + protocol: { + http: new HttpParameter(ParameterLocation.Uri), }, - }, - extensions: { - "x-ms-skip-url-encoding": schema instanceof UriSchema, - }, - }); + language: { + default: { + serializedName: arg.name, + }, + }, + extensions: { + "x-ms-skip-url-encoding": schema instanceof UriSchema, + }, + }); + } hostParameters.push(this.codeModel.addGlobalParameter(parameter)); }); From 611e3d87893b43e5e2b8191d892e65000cbb4728 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Thu, 1 Aug 2024 08:03:48 +0800 Subject: [PATCH 34/90] solve conflict --- typespec-extension/src/operation-utils.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/typespec-extension/src/operation-utils.ts b/typespec-extension/src/operation-utils.ts index 2324263b55..adbcaa84e2 100644 --- a/typespec-extension/src/operation-utils.ts +++ b/typespec-extension/src/operation-utils.ts @@ -42,6 +42,10 @@ export function isKnownContentType(contentTypes: string[]): boolean { }); } +export function sdkHttpOperationIsJsonMergePatch(op: SdkHttpOperation): boolean { + return sdkHttpOperationIsContentType(op, "application/merge-patch+json"); +} + export function sdkHttpOperationIsMultipart(op: SdkHttpOperation): boolean { return sdkHttpOperationIsContentType(op, "multipart/form-data"); } From cd8336f188de7e96b0af5bf8b170fa08bcacd737 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Tue, 6 Aug 2024 16:50:34 +0800 Subject: [PATCH 35/90] regen --- .../implementation/ResponseClientImpl.java | 8 +-- .../com/cadl/server/ContosoClientBuilder.java | 21 +------ .../implementation/ContosoClientImpl.java | 36 +++--------- .../parameters/spread/AliasAsyncClient.java | 8 +-- .../com/parameters/spread/AliasClient.java | 8 +-- .../spread/implementation/AliasImpl.java | 24 ++++---- .../ResiliencyServiceDrivenClientBuilder.java | 21 +------ .../ResiliencyServiceDrivenClientImpl.java | 57 +++++++------------ .../ResiliencyServiceDrivenClientBuilder.java | 23 +------- .../ResiliencyServiceDrivenClientImpl.java | 56 ++++++------------ .../path/multiple/MultipleClientBuilder.java | 21 +------ .../implementation/MultipleClientImpl.java | 44 +++++--------- .../generated/HttpbinClientTestBase.java | 1 - ...ResiliencyServiceDrivenClientTestBase.java | 1 - ...ResiliencyServiceDrivenClientTestBase.java | 1 - .../generated/MultipleClientTestBase.java | 1 - 16 files changed, 85 insertions(+), 246 deletions(-) diff --git a/typespec-tests/src/main/java/com/cadl/response/implementation/ResponseClientImpl.java b/typespec-tests/src/main/java/com/cadl/response/implementation/ResponseClientImpl.java index 85cab2f101..e9bd3194c3 100644 --- a/typespec-tests/src/main/java/com/cadl/response/implementation/ResponseClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/response/implementation/ResponseClientImpl.java @@ -359,7 +359,7 @@ Response listIntegersSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getJsonUtf8Response(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/json-utf8-response") @ExpectedResponses({ 200 }) @@ -368,7 +368,7 @@ Mono> getJsonUtf8Response(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getJsonUtf8ResponseSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/plus-json-response") @ExpectedResponses({ 200 }) @@ -377,7 +377,7 @@ Response getJsonUtf8ResponseSync(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getPlusJsonResponse(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/response/plus-json-response") @ExpectedResponses({ 200 }) @@ -386,7 +386,7 @@ Mono> getPlusJsonResponse(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getPlusJsonResponseSync(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) diff --git a/typespec-tests/src/main/java/com/cadl/server/ContosoClientBuilder.java b/typespec-tests/src/main/java/com/cadl/server/ContosoClientBuilder.java index 09b7853e68..6df345a264 100644 --- a/typespec-tests/src/main/java/com/cadl/server/ContosoClientBuilder.java +++ b/typespec-tests/src/main/java/com/cadl/server/ContosoClientBuilder.java @@ -189,24 +189,6 @@ public ContosoClientBuilder endpoint(String endpoint) { return this; } - /* - * Api Version - */ - @Generated - private String apiVersion; - - /** - * Sets Api Version. - * - * @param apiVersion the apiVersion value. - * @return the ContosoClientBuilder. - */ - @Generated - public ContosoClientBuilder apiVersion(String apiVersion) { - this.apiVersion = apiVersion; - return this; - } - /* * Service version */ @@ -255,7 +237,7 @@ private ContosoClientImpl buildInnerClient() { ContosoServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : ContosoServiceVersion.getLatest(); ContosoClientImpl client = new ContosoClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), - this.endpoint, this.apiVersion, localServiceVersion); + this.endpoint, localServiceVersion); return client; } @@ -264,7 +246,6 @@ private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); - Objects.requireNonNull(apiVersion, "'apiVersion' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/cadl/server/implementation/ContosoClientImpl.java b/typespec-tests/src/main/java/com/cadl/server/implementation/ContosoClientImpl.java index 4bc0c43910..10740ce1d6 100644 --- a/typespec-tests/src/main/java/com/cadl/server/implementation/ContosoClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/server/implementation/ContosoClientImpl.java @@ -54,20 +54,6 @@ public String getEndpoint() { return this.endpoint; } - /** - * Api Version. - */ - private final String apiVersion; - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - /** * Service version. */ @@ -114,12 +100,11 @@ public SerializerAdapter getSerializerAdapter() { * Initializes an instance of ContosoClient client. * * @param endpoint Service endpoint. - * @param apiVersion Api Version. * @param serviceVersion Service version. */ - public ContosoClientImpl(String endpoint, String apiVersion, ContosoServiceVersion serviceVersion) { + public ContosoClientImpl(String endpoint, ContosoServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion, serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** @@ -127,12 +112,10 @@ public ContosoClientImpl(String endpoint, String apiVersion, ContosoServiceVersi * * @param httpPipeline The HTTP pipeline to send requests through. * @param endpoint Service endpoint. - * @param apiVersion Api Version. * @param serviceVersion Service version. */ - public ContosoClientImpl(HttpPipeline httpPipeline, String endpoint, String apiVersion, - ContosoServiceVersion serviceVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion, serviceVersion); + public ContosoClientImpl(HttpPipeline httpPipeline, String endpoint, ContosoServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** @@ -141,15 +124,13 @@ public ContosoClientImpl(HttpPipeline httpPipeline, String endpoint, String apiV * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param endpoint Service endpoint. - * @param apiVersion Api Version. * @param serviceVersion Service version. */ public ContosoClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - String apiVersion, ContosoServiceVersion serviceVersion) { + ContosoServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; - this.apiVersion = apiVersion; this.serviceVersion = serviceVersion; this.service = RestProxy.create(ContosoClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -192,8 +173,8 @@ Response getSync(@HostParam("Endpoint") String endpoint, @HostParam("ApiVe */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(String group, RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.get(this.getEndpoint(), this.getApiVersion(), group, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.getEndpoint(), this.getServiceVersion().getVersion(), + group, requestOptions, context)); } /** @@ -209,6 +190,7 @@ public Mono> getWithResponseAsync(String group, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String group, RequestOptions requestOptions) { - return service.getSync(this.getEndpoint(), this.getApiVersion(), group, requestOptions, Context.NONE); + return service.getSync(this.getEndpoint(), this.getServiceVersion().getVersion(), group, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/spread/AliasAsyncClient.java b/typespec-tests/src/main/java/com/parameters/spread/AliasAsyncClient.java index 3abdd2fdf6..cfd77d351b 100644 --- a/typespec-tests/src/main/java/com/parameters/spread/AliasAsyncClient.java +++ b/typespec-tests/src/main/java/com/parameters/spread/AliasAsyncClient.java @@ -214,8 +214,8 @@ public Mono spreadAsRequestBody(String name) { * The spreadParameterWithInnerModel operation. * * @param id The id parameter. - * @param name The name parameter. * @param xMsTestHeader The xMsTestHeader parameter. + * @param name The name parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -226,7 +226,7 @@ public Mono spreadAsRequestBody(String name) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono spreadParameterWithInnerModel(String id, String name, String xMsTestHeader) { + public Mono spreadParameterWithInnerModel(String id, String xMsTestHeader, String name) { // Generated convenience method for spreadParameterWithInnerModelWithResponse RequestOptions requestOptions = new RequestOptions(); SpreadParameterWithInnerModelRequest spreadParameterWithInnerModelRequestObj @@ -325,9 +325,9 @@ public Mono spreadWithMultipleParameters(String id, String xMsTestHeader, * spread an alias with contains another alias property as body. * * @param id The id parameter. + * @param xMsTestHeader The xMsTestHeader parameter. * @param name name of the Thing. * @param age age of the Thing. - * @param xMsTestHeader The xMsTestHeader parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -338,7 +338,7 @@ public Mono spreadWithMultipleParameters(String id, String xMsTestHeader, */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono spreadParameterWithInnerAlias(String id, String name, int age, String xMsTestHeader) { + public Mono spreadParameterWithInnerAlias(String id, String xMsTestHeader, String name, int age) { // Generated convenience method for spreadParameterWithInnerAliasWithResponse RequestOptions requestOptions = new RequestOptions(); SpreadParameterWithInnerAliasRequest spreadParameterWithInnerAliasRequestObj diff --git a/typespec-tests/src/main/java/com/parameters/spread/AliasClient.java b/typespec-tests/src/main/java/com/parameters/spread/AliasClient.java index fb0e2fde55..6964882f2f 100644 --- a/typespec-tests/src/main/java/com/parameters/spread/AliasClient.java +++ b/typespec-tests/src/main/java/com/parameters/spread/AliasClient.java @@ -211,8 +211,8 @@ public void spreadAsRequestBody(String name) { * The spreadParameterWithInnerModel operation. * * @param id The id parameter. - * @param name The name parameter. * @param xMsTestHeader The xMsTestHeader parameter. + * @param name The name parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -222,7 +222,7 @@ public void spreadAsRequestBody(String name) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void spreadParameterWithInnerModel(String id, String name, String xMsTestHeader) { + public void spreadParameterWithInnerModel(String id, String xMsTestHeader, String name) { // Generated convenience method for spreadParameterWithInnerModelWithResponse RequestOptions requestOptions = new RequestOptions(); SpreadParameterWithInnerModelRequest spreadParameterWithInnerModelRequestObj @@ -318,9 +318,9 @@ public void spreadWithMultipleParameters(String id, String xMsTestHeader, String * spread an alias with contains another alias property as body. * * @param id The id parameter. + * @param xMsTestHeader The xMsTestHeader parameter. * @param name name of the Thing. * @param age age of the Thing. - * @param xMsTestHeader The xMsTestHeader parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -330,7 +330,7 @@ public void spreadWithMultipleParameters(String id, String xMsTestHeader, String */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void spreadParameterWithInnerAlias(String id, String name, int age, String xMsTestHeader) { + public void spreadParameterWithInnerAlias(String id, String xMsTestHeader, String name, int age) { // Generated convenience method for spreadParameterWithInnerAliasWithResponse RequestOptions requestOptions = new RequestOptions(); SpreadParameterWithInnerAliasRequest spreadParameterWithInnerAliasRequestObj diff --git a/typespec-tests/src/main/java/com/parameters/spread/implementation/AliasImpl.java b/typespec-tests/src/main/java/com/parameters/spread/implementation/AliasImpl.java index 9e6cc162f4..1dd099ff34 100644 --- a/typespec-tests/src/main/java/com/parameters/spread/implementation/AliasImpl.java +++ b/typespec-tests/src/main/java/com/parameters/spread/implementation/AliasImpl.java @@ -85,7 +85,7 @@ Response spreadAsRequestBodySync(@HeaderParam("Content-Type") String conte @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> spreadParameterWithInnerModel(@PathParam("id") String id, - @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("accept") String accept, + @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData spreadParameterWithInnerModelRequest, RequestOptions requestOptions, Context context); @@ -96,7 +96,7 @@ Mono> spreadParameterWithInnerModel(@PathParam("id") String id, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response spreadParameterWithInnerModelSync(@PathParam("id") String id, - @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("accept") String accept, + @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData spreadParameterWithInnerModelRequest, RequestOptions requestOptions, Context context); @@ -151,7 +151,7 @@ Response spreadWithMultipleParametersSync(@PathParam("id") String id, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> spreadParameterWithInnerAlias(@PathParam("id") String id, - @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("accept") String accept, + @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData spreadParameterWithInnerAliasRequest, RequestOptions requestOptions, Context context); @@ -162,7 +162,7 @@ Mono> spreadParameterWithInnerAlias(@PathParam("id") String id, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response spreadParameterWithInnerAliasSync(@PathParam("id") String id, - @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("accept") String accept, + @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData spreadParameterWithInnerAliasRequest, RequestOptions requestOptions, Context context); } @@ -241,8 +241,8 @@ public Response spreadAsRequestBodyWithResponse(BinaryData spreadAsRequest @ServiceMethod(returns = ReturnType.SINGLE) public Mono> spreadParameterWithInnerModelWithResponseAsync(String id, String xMsTestHeader, BinaryData spreadParameterWithInnerModelRequest, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.spreadParameterWithInnerModel(id, xMsTestHeader, accept, + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.spreadParameterWithInnerModel(id, xMsTestHeader, contentType, spreadParameterWithInnerModelRequest, requestOptions, context)); } @@ -269,8 +269,8 @@ public Mono> spreadParameterWithInnerModelWithResponseAsync(Strin @ServiceMethod(returns = ReturnType.SINGLE) public Response spreadParameterWithInnerModelWithResponse(String id, String xMsTestHeader, BinaryData spreadParameterWithInnerModelRequest, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.spreadParameterWithInnerModelSync(id, xMsTestHeader, accept, + final String contentType = "application/json"; + return service.spreadParameterWithInnerModelSync(id, xMsTestHeader, contentType, spreadParameterWithInnerModelRequest, requestOptions, Context.NONE); } @@ -424,8 +424,8 @@ public Response spreadWithMultipleParametersWithResponse(String id, String @ServiceMethod(returns = ReturnType.SINGLE) public Mono> spreadParameterWithInnerAliasWithResponseAsync(String id, String xMsTestHeader, BinaryData spreadParameterWithInnerAliasRequest, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.spreadParameterWithInnerAlias(id, xMsTestHeader, accept, + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.spreadParameterWithInnerAlias(id, xMsTestHeader, contentType, spreadParameterWithInnerAliasRequest, requestOptions, context)); } @@ -453,8 +453,8 @@ public Mono> spreadParameterWithInnerAliasWithResponseAsync(Strin @ServiceMethod(returns = ReturnType.SINGLE) public Response spreadParameterWithInnerAliasWithResponse(String id, String xMsTestHeader, BinaryData spreadParameterWithInnerAliasRequest, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.spreadParameterWithInnerAliasSync(id, xMsTestHeader, accept, + final String contentType = "application/json"; + return service.spreadParameterWithInnerAliasSync(id, xMsTestHeader, contentType, spreadParameterWithInnerAliasRequest, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/resiliency/servicedriven/ResiliencyServiceDrivenClientBuilder.java b/typespec-tests/src/main/java/com/resiliency/servicedriven/ResiliencyServiceDrivenClientBuilder.java index a833d3c4d1..e56acf8643 100644 --- a/typespec-tests/src/main/java/com/resiliency/servicedriven/ResiliencyServiceDrivenClientBuilder.java +++ b/typespec-tests/src/main/java/com/resiliency/servicedriven/ResiliencyServiceDrivenClientBuilder.java @@ -213,24 +213,6 @@ public ResiliencyServiceDrivenClientBuilder serviceDeploymentVersion(String serv return this; } - /* - * Pass in either 'v1' or 'v2'. This represents the API version of a service. - */ - @Generated - private String apiVersion; - - /** - * Sets Pass in either 'v1' or 'v2'. This represents the API version of a service. - * - * @param apiVersion the apiVersion value. - * @return the ResiliencyServiceDrivenClientBuilder. - */ - @Generated - public ResiliencyServiceDrivenClientBuilder apiVersion(String apiVersion) { - this.apiVersion = apiVersion; - return this; - } - /* * Service version */ @@ -280,7 +262,7 @@ private ResiliencyServiceDrivenClientImpl buildInnerClient() { = (serviceVersion != null) ? serviceVersion : ServiceDrivenServiceVersion.getLatest(); ResiliencyServiceDrivenClientImpl client = new ResiliencyServiceDrivenClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), - this.endpoint, this.serviceDeploymentVersion, this.apiVersion, localServiceVersion); + this.endpoint, this.serviceDeploymentVersion, localServiceVersion); return client; } @@ -290,7 +272,6 @@ private void validateClient() { // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); Objects.requireNonNull(serviceDeploymentVersion, "'serviceDeploymentVersion' cannot be null."); - Objects.requireNonNull(apiVersion, "'apiVersion' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/resiliency/servicedriven/implementation/ResiliencyServiceDrivenClientImpl.java b/typespec-tests/src/main/java/com/resiliency/servicedriven/implementation/ResiliencyServiceDrivenClientImpl.java index 9bf3d7c0bb..a5f1b3eb21 100644 --- a/typespec-tests/src/main/java/com/resiliency/servicedriven/implementation/ResiliencyServiceDrivenClientImpl.java +++ b/typespec-tests/src/main/java/com/resiliency/servicedriven/implementation/ResiliencyServiceDrivenClientImpl.java @@ -74,20 +74,6 @@ public String getServiceDeploymentVersion() { return this.serviceDeploymentVersion; } - /** - * Pass in either 'v1' or 'v2'. This represents the API version of a service. - */ - private final String apiVersion; - - /** - * Gets Pass in either 'v1' or 'v2'. This represents the API version of a service. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - /** * Service version. */ @@ -137,14 +123,12 @@ public SerializerAdapter getSerializerAdapter() { * @param serviceDeploymentVersion Pass in either 'v1' or 'v2'. This represents a version of the service deployment * in history. 'v1' is for the deployment when the service had only one api version. 'v2' is for the deployment when * the service had api-versions 'v1' and 'v2'. - * @param apiVersion Pass in either 'v1' or 'v2'. This represents the API version of a service. * @param serviceVersion Service version. */ - public ResiliencyServiceDrivenClientImpl(String endpoint, String serviceDeploymentVersion, String apiVersion, + public ResiliencyServiceDrivenClientImpl(String endpoint, String serviceDeploymentVersion, ServiceDrivenServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceDeploymentVersion, apiVersion, - serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceDeploymentVersion, serviceVersion); } /** @@ -155,13 +139,12 @@ public ResiliencyServiceDrivenClientImpl(String endpoint, String serviceDeployme * @param serviceDeploymentVersion Pass in either 'v1' or 'v2'. This represents a version of the service deployment * in history. 'v1' is for the deployment when the service had only one api version. 'v2' is for the deployment when * the service had api-versions 'v1' and 'v2'. - * @param apiVersion Pass in either 'v1' or 'v2'. This represents the API version of a service. * @param serviceVersion Service version. */ public ResiliencyServiceDrivenClientImpl(HttpPipeline httpPipeline, String endpoint, - String serviceDeploymentVersion, String apiVersion, ServiceDrivenServiceVersion serviceVersion) { + String serviceDeploymentVersion, ServiceDrivenServiceVersion serviceVersion) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceDeploymentVersion, - apiVersion, serviceVersion); + serviceVersion); } /** @@ -173,17 +156,14 @@ public ResiliencyServiceDrivenClientImpl(HttpPipeline httpPipeline, String endpo * @param serviceDeploymentVersion Pass in either 'v1' or 'v2'. This represents a version of the service deployment * in history. 'v1' is for the deployment when the service had only one api version. 'v2' is for the deployment when * the service had api-versions 'v1' and 'v2'. - * @param apiVersion Pass in either 'v1' or 'v2'. This represents the API version of a service. * @param serviceVersion Service version. */ public ResiliencyServiceDrivenClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint, String serviceDeploymentVersion, String apiVersion, - ServiceDrivenServiceVersion serviceVersion) { + String endpoint, String serviceDeploymentVersion, ServiceDrivenServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; this.serviceDeploymentVersion = serviceDeploymentVersion; - this.apiVersion = apiVersion; this.serviceVersion = serviceVersion; this.service = RestProxy.create(ResiliencyServiceDrivenClientService.class, this.httpPipeline, this.getSerializerAdapter()); @@ -292,7 +272,7 @@ Response fromOneOptionalSync(@HostParam("endpoint") String endpoint, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> addOperationWithResponseAsync(RequestOptions requestOptions) { return FluxUtil.withContext(context -> service.addOperation(this.getEndpoint(), - this.getServiceDeploymentVersion(), this.getApiVersion(), requestOptions, context)); + this.getServiceDeploymentVersion(), this.getServiceVersion().getVersion(), requestOptions, context)); } /** @@ -307,8 +287,8 @@ public Mono> addOperationWithResponseAsync(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response addOperationWithResponse(RequestOptions requestOptions) { - return service.addOperationSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), - requestOptions, Context.NONE); + return service.addOperationSync(this.getEndpoint(), this.getServiceDeploymentVersion(), + this.getServiceVersion().getVersion(), requestOptions, Context.NONE); } /** @@ -331,7 +311,7 @@ public Response addOperationWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromNoneWithResponseAsync(RequestOptions requestOptions) { return FluxUtil.withContext(context -> service.fromNone(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getApiVersion(), requestOptions, context)); + this.getServiceVersion().getVersion(), requestOptions, context)); } /** @@ -353,8 +333,8 @@ public Mono> fromNoneWithResponseAsync(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromNoneWithResponse(RequestOptions requestOptions) { - return service.fromNoneSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), - requestOptions, Context.NONE); + return service.fromNoneSync(this.getEndpoint(), this.getServiceDeploymentVersion(), + this.getServiceVersion().getVersion(), requestOptions, Context.NONE); } /** @@ -378,8 +358,9 @@ public Response fromNoneWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromOneRequiredWithResponseAsync(String parameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.fromOneRequired(this.getEndpoint(), - this.getServiceDeploymentVersion(), this.getApiVersion(), parameter, requestOptions, context)); + return FluxUtil + .withContext(context -> service.fromOneRequired(this.getEndpoint(), this.getServiceDeploymentVersion(), + this.getServiceVersion().getVersion(), parameter, requestOptions, context)); } /** @@ -403,8 +384,8 @@ public Mono> fromOneRequiredWithResponseAsync(String parameter, R */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromOneRequiredWithResponse(String parameter, RequestOptions requestOptions) { - return service.fromOneRequiredSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), - parameter, requestOptions, Context.NONE); + return service.fromOneRequiredSync(this.getEndpoint(), this.getServiceDeploymentVersion(), + this.getServiceVersion().getVersion(), parameter, requestOptions, Context.NONE); } /** @@ -429,7 +410,7 @@ public Response fromOneRequiredWithResponse(String parameter, RequestOptio @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromOneOptionalWithResponseAsync(RequestOptions requestOptions) { return FluxUtil.withContext(context -> service.fromOneOptional(this.getEndpoint(), - this.getServiceDeploymentVersion(), this.getApiVersion(), requestOptions, context)); + this.getServiceDeploymentVersion(), this.getServiceVersion().getVersion(), requestOptions, context)); } /** @@ -453,7 +434,7 @@ public Mono> fromOneOptionalWithResponseAsync(RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromOneOptionalWithResponse(RequestOptions requestOptions) { - return service.fromOneOptionalSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), - requestOptions, Context.NONE); + return service.fromOneOptionalSync(this.getEndpoint(), this.getServiceDeploymentVersion(), + this.getServiceVersion().getVersion(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/ResiliencyServiceDrivenClientBuilder.java b/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/ResiliencyServiceDrivenClientBuilder.java index 1e2ca9c103..4b851ce32d 100644 --- a/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/ResiliencyServiceDrivenClientBuilder.java +++ b/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/ResiliencyServiceDrivenClientBuilder.java @@ -213,26 +213,6 @@ public ResiliencyServiceDrivenClientBuilder serviceDeploymentVersion(String serv return this; } - /* - * Pass in 'v1'. This represents the API version of the service. Will grow up in the next deployment to be both 'v1' - * and 'v2' - */ - @Generated - private String apiVersion; - - /** - * Sets Pass in 'v1'. This represents the API version of the service. Will grow up in the next deployment to be both - * 'v1' and 'v2'. - * - * @param apiVersion the apiVersion value. - * @return the ResiliencyServiceDrivenClientBuilder. - */ - @Generated - public ResiliencyServiceDrivenClientBuilder apiVersion(String apiVersion) { - this.apiVersion = apiVersion; - return this; - } - /* * Service version */ @@ -282,7 +262,7 @@ private ResiliencyServiceDrivenClientImpl buildInnerClient() { = (serviceVersion != null) ? serviceVersion : ServiceDrivenServiceVersion.getLatest(); ResiliencyServiceDrivenClientImpl client = new ResiliencyServiceDrivenClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), - this.endpoint, this.serviceDeploymentVersion, this.apiVersion, localServiceVersion); + this.endpoint, this.serviceDeploymentVersion, localServiceVersion); return client; } @@ -292,7 +272,6 @@ private void validateClient() { // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); Objects.requireNonNull(serviceDeploymentVersion, "'serviceDeploymentVersion' cannot be null."); - Objects.requireNonNull(apiVersion, "'apiVersion' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/implementation/ResiliencyServiceDrivenClientImpl.java b/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/implementation/ResiliencyServiceDrivenClientImpl.java index dde4ef8910..e72894c316 100644 --- a/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/implementation/ResiliencyServiceDrivenClientImpl.java +++ b/typespec-tests/src/main/java/com/resiliency/servicedriven/v1/implementation/ResiliencyServiceDrivenClientImpl.java @@ -73,22 +73,6 @@ public String getServiceDeploymentVersion() { return this.serviceDeploymentVersion; } - /** - * Pass in 'v1'. This represents the API version of the service. Will grow up in the next deployment to be both 'v1' - * and 'v2'. - */ - private final String apiVersion; - - /** - * Gets Pass in 'v1'. This represents the API version of the service. Will grow up in the next deployment to be both - * 'v1' and 'v2'. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - /** * Service version. */ @@ -138,15 +122,12 @@ public SerializerAdapter getSerializerAdapter() { * @param serviceDeploymentVersion Pass in either 'v1' or 'v2'. This represents a version of the service deployment * in history. 'v1' is for the deployment when the service had only one api version. 'v2' is for the deployment when * the service had api-versions 'v1' and 'v2'. - * @param apiVersion Pass in 'v1'. This represents the API version of the service. Will grow up in the next - * deployment to be both 'v1' and 'v2'. * @param serviceVersion Service version. */ - public ResiliencyServiceDrivenClientImpl(String endpoint, String serviceDeploymentVersion, String apiVersion, + public ResiliencyServiceDrivenClientImpl(String endpoint, String serviceDeploymentVersion, ServiceDrivenServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceDeploymentVersion, apiVersion, - serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceDeploymentVersion, serviceVersion); } /** @@ -157,14 +138,12 @@ public ResiliencyServiceDrivenClientImpl(String endpoint, String serviceDeployme * @param serviceDeploymentVersion Pass in either 'v1' or 'v2'. This represents a version of the service deployment * in history. 'v1' is for the deployment when the service had only one api version. 'v2' is for the deployment when * the service had api-versions 'v1' and 'v2'. - * @param apiVersion Pass in 'v1'. This represents the API version of the service. Will grow up in the next - * deployment to be both 'v1' and 'v2'. * @param serviceVersion Service version. */ public ResiliencyServiceDrivenClientImpl(HttpPipeline httpPipeline, String endpoint, - String serviceDeploymentVersion, String apiVersion, ServiceDrivenServiceVersion serviceVersion) { + String serviceDeploymentVersion, ServiceDrivenServiceVersion serviceVersion) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceDeploymentVersion, - apiVersion, serviceVersion); + serviceVersion); } /** @@ -176,18 +155,14 @@ public ResiliencyServiceDrivenClientImpl(HttpPipeline httpPipeline, String endpo * @param serviceDeploymentVersion Pass in either 'v1' or 'v2'. This represents a version of the service deployment * in history. 'v1' is for the deployment when the service had only one api version. 'v2' is for the deployment when * the service had api-versions 'v1' and 'v2'. - * @param apiVersion Pass in 'v1'. This represents the API version of the service. Will grow up in the next - * deployment to be both 'v1' and 'v2'. * @param serviceVersion Service version. */ public ResiliencyServiceDrivenClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint, String serviceDeploymentVersion, String apiVersion, - ServiceDrivenServiceVersion serviceVersion) { + String endpoint, String serviceDeploymentVersion, ServiceDrivenServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; this.serviceDeploymentVersion = serviceDeploymentVersion; - this.apiVersion = apiVersion; this.serviceVersion = serviceVersion; this.service = RestProxy.create(ResiliencyServiceDrivenClientService.class, this.httpPipeline, this.getSerializerAdapter()); @@ -277,7 +252,7 @@ Response fromOneOptionalSync(@HostParam("endpoint") String endpoint, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromNoneWithResponseAsync(RequestOptions requestOptions) { return FluxUtil.withContext(context -> service.fromNone(this.getEndpoint(), this.getServiceDeploymentVersion(), - this.getApiVersion(), requestOptions, context)); + this.getServiceVersion().getVersion(), requestOptions, context)); } /** @@ -293,8 +268,8 @@ public Mono> fromNoneWithResponseAsync(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromNoneWithResponse(RequestOptions requestOptions) { - return service.fromNoneSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), - requestOptions, Context.NONE); + return service.fromNoneSync(this.getEndpoint(), this.getServiceDeploymentVersion(), + this.getServiceVersion().getVersion(), requestOptions, Context.NONE); } /** @@ -311,8 +286,9 @@ public Response fromNoneWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromOneRequiredWithResponseAsync(String parameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.fromOneRequired(this.getEndpoint(), - this.getServiceDeploymentVersion(), this.getApiVersion(), parameter, requestOptions, context)); + return FluxUtil + .withContext(context -> service.fromOneRequired(this.getEndpoint(), this.getServiceDeploymentVersion(), + this.getServiceVersion().getVersion(), parameter, requestOptions, context)); } /** @@ -329,8 +305,8 @@ public Mono> fromOneRequiredWithResponseAsync(String parameter, R */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromOneRequiredWithResponse(String parameter, RequestOptions requestOptions) { - return service.fromOneRequiredSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), - parameter, requestOptions, Context.NONE); + return service.fromOneRequiredSync(this.getEndpoint(), this.getServiceDeploymentVersion(), + this.getServiceVersion().getVersion(), parameter, requestOptions, Context.NONE); } /** @@ -354,7 +330,7 @@ public Response fromOneRequiredWithResponse(String parameter, RequestOptio @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromOneOptionalWithResponseAsync(RequestOptions requestOptions) { return FluxUtil.withContext(context -> service.fromOneOptional(this.getEndpoint(), - this.getServiceDeploymentVersion(), this.getApiVersion(), requestOptions, context)); + this.getServiceDeploymentVersion(), this.getServiceVersion().getVersion(), requestOptions, context)); } /** @@ -377,7 +353,7 @@ public Mono> fromOneOptionalWithResponseAsync(RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromOneOptionalWithResponse(RequestOptions requestOptions) { - return service.fromOneOptionalSync(this.getEndpoint(), this.getServiceDeploymentVersion(), this.getApiVersion(), - requestOptions, Context.NONE); + return service.fromOneOptionalSync(this.getEndpoint(), this.getServiceDeploymentVersion(), + this.getServiceVersion().getVersion(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/server/path/multiple/MultipleClientBuilder.java b/typespec-tests/src/main/java/com/server/path/multiple/MultipleClientBuilder.java index 4ebb6b9d97..1ebc0bd08f 100644 --- a/typespec-tests/src/main/java/com/server/path/multiple/MultipleClientBuilder.java +++ b/typespec-tests/src/main/java/com/server/path/multiple/MultipleClientBuilder.java @@ -189,24 +189,6 @@ public MultipleClientBuilder endpoint(String endpoint) { return this; } - /* - * Pass in v1.0 for API version. - */ - @Generated - private String apiVersion; - - /** - * Sets Pass in v1.0 for API version. - * - * @param apiVersion the apiVersion value. - * @return the MultipleClientBuilder. - */ - @Generated - public MultipleClientBuilder apiVersion(String apiVersion) { - this.apiVersion = apiVersion; - return this; - } - /* * Service version */ @@ -255,7 +237,7 @@ private MultipleClientImpl buildInnerClient() { MultipleServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : MultipleServiceVersion.getLatest(); MultipleClientImpl client = new MultipleClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, this.apiVersion, localServiceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); return client; } @@ -264,7 +246,6 @@ private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); - Objects.requireNonNull(apiVersion, "'apiVersion' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/server/path/multiple/implementation/MultipleClientImpl.java b/typespec-tests/src/main/java/com/server/path/multiple/implementation/MultipleClientImpl.java index ba725b365e..629ed9a325 100644 --- a/typespec-tests/src/main/java/com/server/path/multiple/implementation/MultipleClientImpl.java +++ b/typespec-tests/src/main/java/com/server/path/multiple/implementation/MultipleClientImpl.java @@ -54,20 +54,6 @@ public String getEndpoint() { return this.endpoint; } - /** - * Pass in v1.0 for API version. - */ - private final String apiVersion; - - /** - * Gets Pass in v1.0 for API version. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - /** * Service version. */ @@ -114,12 +100,11 @@ public SerializerAdapter getSerializerAdapter() { * Initializes an instance of MultipleClient client. * * @param endpoint Pass in http://localhost:3000 for endpoint. - * @param apiVersion Pass in v1.0 for API version. * @param serviceVersion Service version. */ - public MultipleClientImpl(String endpoint, String apiVersion, MultipleServiceVersion serviceVersion) { + public MultipleClientImpl(String endpoint, MultipleServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion, serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** @@ -127,12 +112,10 @@ public MultipleClientImpl(String endpoint, String apiVersion, MultipleServiceVer * * @param httpPipeline The HTTP pipeline to send requests through. * @param endpoint Pass in http://localhost:3000 for endpoint. - * @param apiVersion Pass in v1.0 for API version. * @param serviceVersion Service version. */ - public MultipleClientImpl(HttpPipeline httpPipeline, String endpoint, String apiVersion, - MultipleServiceVersion serviceVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion, serviceVersion); + public MultipleClientImpl(HttpPipeline httpPipeline, String endpoint, MultipleServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** @@ -141,15 +124,13 @@ public MultipleClientImpl(HttpPipeline httpPipeline, String endpoint, String api * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param endpoint Pass in http://localhost:3000 for endpoint. - * @param apiVersion Pass in v1.0 for API version. * @param serviceVersion Service version. */ public MultipleClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - String apiVersion, MultipleServiceVersion serviceVersion) { + MultipleServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; - this.apiVersion = apiVersion; this.serviceVersion = serviceVersion; this.service = RestProxy.create(MultipleClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -211,8 +192,8 @@ Response withOperationPathParamSync(@HostParam("endpoint") String endpoint */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> noOperationParamsWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.noOperationParams(this.getEndpoint(), this.getApiVersion(), requestOptions, context)); + return FluxUtil.withContext(context -> service.noOperationParams(this.getEndpoint(), + this.getServiceVersion().getVersion(), requestOptions, context)); } /** @@ -227,7 +208,8 @@ public Mono> noOperationParamsWithResponseAsync(RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response noOperationParamsWithResponse(RequestOptions requestOptions) { - return service.noOperationParamsSync(this.getEndpoint(), this.getApiVersion(), requestOptions, Context.NONE); + return service.noOperationParamsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), requestOptions, + Context.NONE); } /** @@ -243,8 +225,8 @@ public Response noOperationParamsWithResponse(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withOperationPathParamWithResponseAsync(String keyword, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withOperationPathParam(this.getEndpoint(), this.getApiVersion(), - keyword, requestOptions, context)); + return FluxUtil.withContext(context -> service.withOperationPathParam(this.getEndpoint(), + this.getServiceVersion().getVersion(), keyword, requestOptions, context)); } /** @@ -260,7 +242,7 @@ public Mono> withOperationPathParamWithResponseAsync(String keywo */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withOperationPathParamWithResponse(String keyword, RequestOptions requestOptions) { - return service.withOperationPathParamSync(this.getEndpoint(), this.getApiVersion(), keyword, requestOptions, - Context.NONE); + return service.withOperationPathParamSync(this.getEndpoint(), this.getServiceVersion().getVersion(), keyword, + requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/test/java/com/cadl/server/generated/HttpbinClientTestBase.java b/typespec-tests/src/test/java/com/cadl/server/generated/HttpbinClientTestBase.java index ff715afeaf..141617ac50 100644 --- a/typespec-tests/src/test/java/com/cadl/server/generated/HttpbinClientTestBase.java +++ b/typespec-tests/src/test/java/com/cadl/server/generated/HttpbinClientTestBase.java @@ -41,7 +41,6 @@ protected void beforeTest() { ContosoClientBuilder contosoClientbuilder = new ContosoClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .apiVersion(Configuration.getGlobalConfiguration().get("APIVERSION", "apiversion")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/resiliency/servicedriven/generated/ResiliencyServiceDrivenClientTestBase.java b/typespec-tests/src/test/java/com/resiliency/servicedriven/generated/ResiliencyServiceDrivenClientTestBase.java index 085cfca3e4..b42cd18d88 100644 --- a/typespec-tests/src/test/java/com/resiliency/servicedriven/generated/ResiliencyServiceDrivenClientTestBase.java +++ b/typespec-tests/src/test/java/com/resiliency/servicedriven/generated/ResiliencyServiceDrivenClientTestBase.java @@ -27,7 +27,6 @@ protected void beforeTest() { .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) .serviceDeploymentVersion( Configuration.getGlobalConfiguration().get("SERVICEDEPLOYMENTVERSION", "servicedeploymentversion")) - .apiVersion(Configuration.getGlobalConfiguration().get("APIVERSION", "apiversion")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/resiliency/servicedriven/v1/generated/ResiliencyServiceDrivenClientTestBase.java b/typespec-tests/src/test/java/com/resiliency/servicedriven/v1/generated/ResiliencyServiceDrivenClientTestBase.java index c4d1be8a6a..eec959eb94 100644 --- a/typespec-tests/src/test/java/com/resiliency/servicedriven/v1/generated/ResiliencyServiceDrivenClientTestBase.java +++ b/typespec-tests/src/test/java/com/resiliency/servicedriven/v1/generated/ResiliencyServiceDrivenClientTestBase.java @@ -27,7 +27,6 @@ protected void beforeTest() { .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) .serviceDeploymentVersion( Configuration.getGlobalConfiguration().get("SERVICEDEPLOYMENTVERSION", "servicedeploymentversion")) - .apiVersion(Configuration.getGlobalConfiguration().get("APIVERSION", "apiversion")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/server/path/multiple/generated/MultipleClientTestBase.java b/typespec-tests/src/test/java/com/server/path/multiple/generated/MultipleClientTestBase.java index 09b7923b1f..a1e5597656 100644 --- a/typespec-tests/src/test/java/com/server/path/multiple/generated/MultipleClientTestBase.java +++ b/typespec-tests/src/test/java/com/server/path/multiple/generated/MultipleClientTestBase.java @@ -24,7 +24,6 @@ class MultipleClientTestBase extends TestProxyTestBase { protected void beforeTest() { MultipleClientBuilder multipleClientbuilder = new MultipleClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .apiVersion(Configuration.getGlobalConfiguration().get("APIVERSION", "apiversion")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { From cc652d4afb9fd3164310432e224ae5a45a58385b Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Wed, 7 Aug 2024 11:08:19 +0800 Subject: [PATCH 36/90] regen --- .../implementation/FishesClientImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java index d6fd4a3a71..e3fea3a3e8 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/FishesClientImpl.java @@ -78,7 +78,7 @@ Mono> putModel(@HostParam("endpoint") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getOutputOnlyModel(@HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** From b38a2fd0c8e51fb7bc816c49379157bd7d439f87 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Wed, 7 Aug 2024 11:21:07 +0800 Subject: [PATCH 37/90] integrate with sdkpackage's example --- typespec-extension/src/code-model-builder.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index bcf470cf2a..68c2a6724b 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -81,6 +81,7 @@ import { shouldGenerateConvenient, shouldGenerateProtocol, getHttpOperationExamples, + SdkHttpOperationExample, } from "@azure-tools/typespec-client-generator-core"; import { EmitContext, @@ -887,14 +888,14 @@ export class CodeModelBuilder { return Boolean(this.options["advanced-versioning"]); } - private getOperationExample(operation: HttpOperation): Record | undefined { - const httpOperationExamples = getHttpOperationExamples(this.sdkContext, operation); + private getOperationExample(sdkMethod: SdkServiceMethod): Record | undefined { + const httpOperationExamples = sdkMethod.operation.examples; if (httpOperationExamples && httpOperationExamples.length > 0) { const operationExamples: Record = {}; for (const example of httpOperationExamples) { const operationExample = example.rawExample; operationExample["x-ms-original-file"] = pathToFileURL(example.filePath).toString(); - operationExamples[operationExample.title ?? operationExample.operationId ?? operation.operation.name] = + operationExamples[operationExample.title ?? operationExample.operationId ?? sdkMethod.name] = operationExample; } return operationExamples; @@ -912,7 +913,7 @@ export class CodeModelBuilder { let operationExamples = undefined; if (sdkMethod.operation && sdkMethod.operation.__raw) { - operationExamples = this.getOperationExample(sdkMethod.operation.__raw); + operationExamples = this.getOperationExample(sdkMethod); } const codeModelOperation = new CodeModelOperation(operationName, sdkMethod.details ?? "", { From 1c5a1b507c7d64e27937abe8448a3c78491edc7a Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Wed, 7 Aug 2024 11:38:13 +0800 Subject: [PATCH 38/90] clean up code --- typespec-extension/src/code-model-builder.ts | 979 +++---------------- 1 file changed, 149 insertions(+), 830 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 68c2a6724b..676f71c101 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -41,11 +41,10 @@ import { VirtualParameter, } from "@autorest/codemodel"; import { KnownMediaType } from "@azure-tools/codegen"; -import { getLroMetadata, getPagedResult, isPollingLocation } from "@azure-tools/typespec-azure-core"; +import { isPollingLocation } from "@azure-tools/typespec-azure-core"; import { SdkArrayType, SdkBodyModelPropertyType, - SdkBodyParameter, SdkBuiltInType, SdkClientType, SdkConstantType, @@ -80,8 +79,6 @@ import { isSdkIntKind, shouldGenerateConvenient, shouldGenerateProtocol, - getHttpOperationExamples, - SdkHttpOperationExample, } from "@azure-tools/typespec-client-generator-core"; import { EmitContext, @@ -106,7 +103,7 @@ import { isArrayModelType, isErrorModel, isRecordModelType, - listServices + listServices, } from "@typespec/compiler"; import { Authentication, @@ -125,10 +122,10 @@ import { getStatusCodeDescription, isHeader, isPathParam, - isQueryParam + isQueryParam, } from "@typespec/http"; import { getSegment } from "@typespec/rest"; -import { Version, getAddedOnVersions } from "@typespec/versioning"; +import { getAddedOnVersions } from "@typespec/versioning"; import { fail } from "assert"; import pkg from "lodash"; import { Client as CodeModelClient, CrossLanguageDefinition } from "./common/client.js"; @@ -163,9 +160,8 @@ import { getNonNullSdkType, getUnionDescription, getUsage, - isStable, modelIs, - pushDistinct + pushDistinct, } from "./type-utils.js"; import { getNamespace, logWarning, pascalCase, stringArrayContainsIgnoreCase, trace } from "./utils.js"; import { pathToFileURL } from "url"; @@ -189,8 +185,7 @@ export class CodeModelBuilder { readonly typeUnionRefCache = new Map(); // Union means it ref a Union type, null means it does not ref any Union, undefined means type visited but not completed // current apiVersion name to generate code - private apiVersion: Version | undefined; - private apiVersionString: string | undefined; + private apiVersion: string | undefined; public constructor(program1: Program, context: EmitContext) { this.options = context.options; @@ -247,7 +242,9 @@ export class CodeModelBuilder { } public async build(): Promise { - this.sdkContext = await createSdkContext(this.emitterContext, "@azure-tools/typespec-java", {versioning: {previewStringRegex: /$/}}); // include all versions and do the filter by ourselves + this.sdkContext = await createSdkContext(this.emitterContext, "@azure-tools/typespec-java", { + versioning: { previewStringRegex: /$/ }, + }); // include all versions and do the filter by ourselves // auth // TODO: it is not very likely, but different client could have different auth @@ -281,35 +278,35 @@ export class CodeModelBuilder { private processHostParametersFromSdkType(sdkPathParameters: SdkPathParameter[]): Parameter[] { const hostParameters: Parameter[] = []; - let parameter; - sdkPathParameters.forEach((arg) => { - if (arg.isApiVersionParam) { - parameter = this.createApiVersionParameter(arg.name, ParameterLocation.Uri); - } else { - const schema = this.processSchemaFromSdkType(arg.type, arg.name); - this.trackSchemaUsage(schema, { - usage: [SchemaContext.Input, SchemaContext.Output /*SchemaContext.Public*/], - }); - parameter = new Parameter(arg.name, arg.description ?? "", schema, { - implementation: ImplementationLocation.Client, - origin: "modelerfour:synthesized/host", - required: true, - protocol: { - http: new HttpParameter(ParameterLocation.Uri), - }, - language: { - default: { - serializedName: arg.name, - }, - }, - extensions: { - "x-ms-skip-url-encoding": schema instanceof UriSchema, + let parameter; + sdkPathParameters.forEach((arg) => { + if (arg.isApiVersionParam) { + parameter = this.createApiVersionParameter(arg.name, ParameterLocation.Uri); + } else { + const schema = this.processSchemaFromSdkType(arg.type, arg.name); + this.trackSchemaUsage(schema, { + usage: [SchemaContext.Input, SchemaContext.Output /*SchemaContext.Public*/], + }); + parameter = new Parameter(arg.name, arg.description ?? "", schema, { + implementation: ImplementationLocation.Client, + origin: "modelerfour:synthesized/host", + required: true, + protocol: { + http: new HttpParameter(ParameterLocation.Uri), + }, + language: { + default: { + serializedName: arg.name, }, - }); - } - hostParameters.push(this.codeModel.addGlobalParameter(parameter)); - }); - + }, + extensions: { + "x-ms-skip-url-encoding": schema instanceof UriSchema, + }, + }); + } + hostParameters.push(this.codeModel.addGlobalParameter(parameter)); + }); + return hostParameters; } @@ -504,7 +501,7 @@ export class CodeModelBuilder { javaNamespace = this.getJavaNamespace(this.namespace + "." + clientNameSegments.slice(0, -1).join(".")); } - const codeModelClient = new CodeModelClient(clientName, client.details ?? "", { + const codeModelClient = new CodeModelClient(clientName, client.details ?? "", { summary: client.description, language: { default: { @@ -524,17 +521,17 @@ export class CodeModelBuilder { const versions = client.apiVersions; if (versions && versions.length > 0) { if (!this.sdkContext.apiVersion || ["all", "latest"].includes(this.sdkContext.apiVersion)) { - this.apiVersionString = versions[versions.length - 1]; + this.apiVersion = versions[versions.length - 1]; } else { - this.apiVersionString = versions.find((it: string) => it === this.sdkContext.apiVersion); - if (!this.apiVersionString) { + this.apiVersion = versions.find((it: string) => it === this.sdkContext.apiVersion); + if (!this.apiVersion) { throw new Error("Unrecognized api-version: " + this.sdkContext.apiVersion); } } codeModelClient.apiVersions = []; for (const version of this.getFilteredApiVersionsFromString( - this.apiVersionString, + this.apiVersion, versions, this.options["service-version-exclude-preview"], )) { @@ -549,7 +546,8 @@ export class CodeModelBuilder { let hostParameters: Parameter[] = []; client.initialization.properties.forEach((initializationProperty) => { if (initializationProperty.kind === "endpoint") { - if (this.isArm()) { // this is just a workaround for ARM + if (this.isArm()) { + // this is just a workaround for ARM initializationProperty.type.serverUrl = "{endpoint}"; initializationProperty.type.templateArguments = [this.buildSdkPathPathParameterForARM()]; } @@ -557,9 +555,6 @@ export class CodeModelBuilder { baseUri = initializationProperty.type.serverUrl; } - // let templateArguments = initializationProperty.type.templateArguments; - // baseUri = initializationProperty.type.serverUrl; - hostParameters = this.processHostParametersFromSdkType(initializationProperty.type.templateArguments); codeModelClient.addGlobalParameters(hostParameters); } @@ -585,26 +580,18 @@ export class CodeModelBuilder { codeModelClient.operationGroups.push(codeModelGroup); } - // operations under operation groups + // operations under operation groups const subClients = this.listSubClientsUnderClient(client, true, true); for (const subClient of subClients) { const serviceMethods = this.listServiceMethodsUnderClient(subClient, false); // operation group with no operation is skipped if (serviceMethods.length > 0) { - // TODO: haoling get name from group path - // const groupPath = subClient..groupPath.split("."); - // let operationGroupName: string; - // if (groupPath.length > 1) { - // // groupPath should be in format of "OpenAIClient.Chat.Completions" - // operationGroupName = groupPath.slice(1).join(""); - // } else { - // // protection - // operationGroupName = operationGroup.type.name; - // } codeModelGroup = new OperationGroup(subClient.name); for (const serviceMethod of serviceMethods) { if (!this.needToSkipProcessingOperation(serviceMethod.__raw, clientContext)) { - codeModelGroup.addOperation(this.processOperationFromSdkType(serviceMethod, clientContext, subClient.name)); + codeModelGroup.addOperation( + this.processOperationFromSdkType(serviceMethod, clientContext, subClient.name), + ); } } codeModelClient.operationGroups.push(codeModelGroup); @@ -643,7 +630,7 @@ export class CodeModelBuilder { } } } - } + } } private buildSdkPathPathParameterForARM(): SdkPathParameter { @@ -662,7 +649,7 @@ export class CodeModelBuilder { encode: "string", decorators: [], name: "string", - crossLanguageDefinitionId: "string" + crossLanguageDefinitionId: "string", }, isApiVersionParam: false, decorators: [], @@ -671,12 +658,17 @@ export class CodeModelBuilder { }; } - private listSubClientsUnderClient(client: SdkClientType, includeNestedOperationGroups: boolean, isRootClient: boolean): SdkClientType[] { + private listSubClientsUnderClient( + client: SdkClientType, + includeNestedOperationGroups: boolean, + isRootClient: boolean, + ): SdkClientType[] { const operationGroups: SdkClientType[] = []; for (const method of client.methods) { if (method.kind === "clientaccessor") { const subClient = method.response; - if (!isRootClient) { // if it is not root client, append the parent client's name + if (!isRootClient) { + // if it is not root client, append the parent client's name subClient.name = this.removeClientSuffix(client.name) + this.removeClientSuffix(pascalCase(subClient.name)); } operationGroups.push(subClient); @@ -690,7 +682,10 @@ export class CodeModelBuilder { return operationGroups; } - private listServiceMethodsUnderClient(client: SdkClientType, includeNestedServiceMethods: boolean): SdkServiceMethod[] { + private listServiceMethodsUnderClient( + client: SdkClientType, + includeNestedServiceMethods: boolean, + ): SdkServiceMethod[] { const methods: SdkServiceMethod[] = []; for (const method of client.methods) { if (includeNestedServiceMethods) { @@ -700,7 +695,7 @@ export class CodeModelBuilder { methods.push(method); } } - } + } if (method.kind !== "clientaccessor") { methods.push(method); } @@ -712,132 +707,6 @@ export class CodeModelBuilder { return clientName.endsWith("Client") ? clientName.slice(0, -6) : clientName; } - // private processClients(): SdkClient[] { - // const sdkPackage = this.sdkContext.experimental_sdkPackage; - // const clients = listClients(this.sdkContext); - // // preprocess group-etag-headers - // this.options["group-etag-headers"] = this.options["group-etag-headers"] ?? true; - - // for (const client of clients) { - // const codeModelClient = new CodeModelClient(client.name, this.getDoc(client.type), { - // summary: this.getSummary(client.type), - - // // at present, use global security definition - // security: this.codeModel.security, - // }); - // codeModelClient.crossLanguageDefinitionId = client.crossLanguageDefinitionId; - - // // versioning - // const versioning = getVersion(this.program, client.service); - // if (versioning && versioning.getVersions()) { - // // @versioned in versioning - // if (!this.sdkContext.apiVersion || ["all", "latest"].includes(this.sdkContext.apiVersion)) { - // this.apiVersion = getDefaultApiVersion(this.sdkContext, client.service); - // } else { - // this.apiVersion = versioning.getVersions().find((it: Version) => it.value === this.sdkContext.apiVersion); - // if (!this.apiVersion) { - // throw new Error("Unrecognized api-version: " + this.sdkContext.apiVersion); - // } - // } - - // codeModelClient.apiVersions = []; - // for (const version of this.getFilteredApiVersions(this.apiVersion, versioning.getVersions())) { - // const apiVersion = new ApiVersion(); - // apiVersion.version = version.value; - // codeModelClient.apiVersions.push(apiVersion); - // } - // } - - // // server - // let baseUri = "{endpoint}"; - // const servers = getServers(this.program, client.service); - // if (servers && servers.length === 1 && !this.isArmSynthesizedServer(servers[0])) { - // baseUri = servers[0].url; - // } - // const hostParameters = this.processHost(servers?.length === 1 ? servers[0] : undefined); - // codeModelClient.addGlobalParameters(hostParameters); - // const clientContext = new ClientContext( - // baseUri, - // hostParameters, - // codeModelClient.globalParameters!, - // codeModelClient.apiVersions, - // ); - // clientContext.preProcessOperations(this.sdkContext, client); - - // const operationGroups = listOperationGroups(this.sdkContext, client, true); - - // const operationWithoutGroup = listOperationsInOperationGroup(this.sdkContext, client); - // let codeModelGroup = new OperationGroup(""); - // for (const operation of operationWithoutGroup) { - // if (!this.needToSkipProcessingOperation(operation, clientContext)) { - // codeModelGroup.addOperation(this.processOperation("", operation, clientContext)); - // } - // } - // if (codeModelGroup.operations?.length > 0) { - // codeModelClient.operationGroups.push(codeModelGroup); - // } - - // for (const operationGroup of operationGroups) { - // const operations = listOperationsInOperationGroup(this.sdkContext, operationGroup); - // // operation group with no operation is skipped - // if (operations.length > 0) { - // const groupPath = operationGroup.groupPath.split("."); - // let operationGroupName: string; - // if (groupPath.length > 1) { - // // groupPath should be in format of "OpenAIClient.Chat.Completions" - // operationGroupName = groupPath.slice(1).join(""); - // } else { - // // protection - // operationGroupName = operationGroup.type.name; - // } - // codeModelGroup = new OperationGroup(operationGroupName); - // for (const operation of operations) { - // if (!this.needToSkipProcessingOperation(operation, clientContext)) { - // codeModelGroup.addOperation(this.processOperation(operationGroupName, operation, clientContext)); - // } - // } - // codeModelClient.operationGroups.push(codeModelGroup); - // } - // } - - // this.codeModel.clients.push(codeModelClient); - // } - - // // postprocess for ServiceVersion - // let apiVersionSameForAllClients = true; - // let sharedApiVersions = undefined; - // for (const client of this.codeModel.clients) { - // const apiVersions = client.apiVersions; - // if (!apiVersions) { - // // client does not have apiVersions - // apiVersionSameForAllClients = false; - // } else if (!sharedApiVersions) { - // // first client, set it to sharedApiVersions - // sharedApiVersions = apiVersions; - // } else { - // apiVersionSameForAllClients = isEqual(sharedApiVersions, apiVersions); - // } - // if (!apiVersionSameForAllClients) { - // break; - // } - // } - // if (apiVersionSameForAllClients) { - // const serviceVersion = getServiceVersion(this.codeModel); - // for (const client of this.codeModel.clients) { - // client.serviceVersion = serviceVersion; - // } - // } else { - // for (const client of this.codeModel.clients) { - // const apiVersions = client.apiVersions; - // if (apiVersions) { - // client.serviceVersion = getServiceVersion(client); - // } - // } - // } - - // return clients; - // } - /** * Filter api-versions for "ServiceVersion". * TODO(xiaofei) pending TCGC design: https://github.com/Azure/typespec-azure/issues/965 @@ -895,8 +764,7 @@ export class CodeModelBuilder { for (const example of httpOperationExamples) { const operationExample = example.rawExample; operationExample["x-ms-original-file"] = pathToFileURL(example.filePath).toString(); - operationExamples[operationExample.title ?? operationExample.operationId ?? sdkMethod.name] = - operationExample; + operationExamples[operationExample.title ?? operationExample.operationId ?? sdkMethod.name] = operationExample; } return operationExamples; } else { @@ -904,8 +772,11 @@ export class CodeModelBuilder { } } - private processOperationFromSdkType(sdkMethod: SdkServiceMethod, clientContext: ClientContext, groupName: string): CodeModelOperation { - // TODO: haoling get operation example + private processOperationFromSdkType( + sdkMethod: SdkServiceMethod, + clientContext: ClientContext, + groupName: string, + ): CodeModelOperation { const operationName = sdkMethod.name; const httpOperation = sdkMethod.operation; const operationId = groupName ? `${groupName}_${operationName}` : `${operationName}`; @@ -929,7 +800,9 @@ export class CodeModelBuilder { const convenienceApiName = this.getConvenienceApiNameFromServiceMethod(sdkMethod); let generateConvenienceApi: boolean = Boolean(convenienceApiName); - let generateProtocolApi: boolean = sdkMethod.__raw ? shouldGenerateProtocol(this.sdkContext, sdkMethod.__raw) : true; + let generateProtocolApi: boolean = sdkMethod.__raw + ? shouldGenerateProtocol(this.sdkContext, sdkMethod.__raw) + : true; let apiComment: string | undefined = undefined; if (generateConvenienceApi) { @@ -945,23 +818,15 @@ export class CodeModelBuilder { generateConvenienceApi = false; apiComment = `Convenience API is not generated, as operation '${operationName}' is multiple content-type`; this.logWarning(apiComment); - } else if (sdkHttpOperationIsJsonMergePatch(httpOperation) && this.options["stream-style-serialization"] === false) { + } else if ( + sdkHttpOperationIsJsonMergePatch(httpOperation) && + this.options["stream-style-serialization"] === false + ) { // do not generate convenient method for json merge patch operation if stream-style-serialization is not enabled generateConvenienceApi = false; apiComment = `Convenience API is not generated, as operation '${operationName}' is 'application/merge-patch+json' and stream-style-serialization is not enabled`; this.logWarning(apiComment); } - // else { - // const union = operationRefersUnion(this.program, op, this.typeUnionRefCache); - // if (union) { - // // and Union - // generateConvenienceApi = false; - // apiComment = `Convenience API is not generated, as operation '${ - // op.operation.name - // }' refers Union '${getUnionDescription(union, this.typeNameOptions)}'`; - // this.logWarning(apiComment); - // } - // } } if (generateConvenienceApi && convenienceApiName) { codeModelOperation.convenienceApi = new ConvenienceApi(convenienceApiName); @@ -971,25 +836,25 @@ export class CodeModelBuilder { codeModelOperation.language.java.comment = apiComment; } - // check for generating protocol api or not - codeModelOperation.generateProtocolApi = generateProtocolApi && !codeModelOperation.internalApi; + // check for generating protocol api or not + codeModelOperation.generateProtocolApi = generateProtocolApi && !codeModelOperation.internalApi; - codeModelOperation.addRequest( - new Request({ - protocol: { - http: { - path: httpOperation.path, - method: httpOperation.verb, - uri: clientContext.baseUri, - }, - }, - }), - ); + codeModelOperation.addRequest( + new Request({ + protocol: { + http: { + path: httpOperation.path, + method: httpOperation.verb, + uri: clientContext.baseUri, + }, + }, + }), + ); - // host + // host clientContext.hostParameters.forEach((it) => codeModelOperation.addParameter(it)); // path/query/header parameters - for (let param of httpOperation.parameters) { + for (const param of httpOperation.parameters) { // if it's paged operation with request body, skip content-type header added by TCGC, as next link call should not have content type header if ((sdkMethod.kind === "paging" || sdkMethod.kind === "lropaging") && httpOperation.bodyParam) { if (param.serializedName.toLocaleLowerCase() === "content-type") { @@ -1007,24 +872,13 @@ export class CodeModelBuilder { // body if (httpOperation.bodyParam && httpOperation.__raw && sdkMethod.__raw && httpOperation.bodyParam.type.__raw) { - // let bodyType = httpOperation.bodyParam.type; - // if (bodyType.kind === "model" && bodyType.__raw) { - // // try use resource type as round-trip model - // const resourceType = getResourceOperation(this.program, rawOperation)?.resourceType; - // if (resourceType && rawHttpOperation.responses && rawHttpOperation.responses.length > 0) { - // const resp = rawHttpOperation.responses[0]; - // if (resp.responses && resp.responses.length > 0 && resp.responses[0].body) { - // const responseBody = resp.responses[0].body; - // const bodyTypeInResponse = this.findResponseBody(responseBody.type); - // // response body type is resource type, and request body type (if templated) contains resource type - // if (bodyTypeInResponse === resourceType && isModelReferredInTemplate(bodyType, resourceType)) { - // bodyType = resourceType; - // } - // } - // } - // this.processParameterBody(codeModelOperation, httpOperation.__raw, bodyType.__raw as Model | ModelProperty); - this.processParameterBodyFromSdkType(codeModelOperation, httpOperation.__raw, httpOperation, httpOperation.bodyParam); - // } + this.processParameterBodyFromSdkType( + codeModelOperation, + httpOperation.__raw, + httpOperation, + httpOperation.bodyParam, + ); + // } } // group ETag header parameters, if exists @@ -1048,190 +902,26 @@ export class CodeModelBuilder { this.processResponseFromSdkType(codeModelOperation, code, response, lroMetadata.longRunning, true); } - // check for paged // this.processRouteForPaged(codeModelOperation, sdkMethod.operation.__raw.responses); this.processRouteForPagedFromSdkType(codeModelOperation, sdkMethod.operation.responses, sdkMethod); - + // check for long-running operation this.processRouteForLongRunningFromSdkType(codeModelOperation, sdkMethod.operation.responses, lroMetadata); - + operationGroup.addOperation(codeModelOperation); return codeModelOperation; } - // private processOperation(groupName: string, operation: Operation, clientContext: ClientContext): CodeModelOperation { - // const op = ignoreDiagnostics(getHttpOperation(this.program, operation)); - - // const operationGroup = this.codeModel.getOperationGroup(groupName); - // const operationName = this.getName(operation); - // const opId = groupName ? `${groupName}_${operationName}` : `${operationName}`; - - // const operationExample = this.getOperationExample(operation); - - // const codeModelOperation = new CodeModelOperation(operationName, this.getDoc(operation), { - // operationId: opId, - // summary: this.getSummary(operation), - // extensions: { - // "x-ms-examples": operationExample - // ? { [operationExample.title ?? operationExample.operationId ?? operation.name]: operationExample } - // : undefined, - // }, - // }); - - // codeModelOperation.crossLanguageDefinitionId = getCrossLanguageDefinitionId(this.sdkContext, operation); - // codeModelOperation.internalApi = this.isInternal(this.sdkContext, operation); - - // const convenienceApiName = this.getConvenienceApiName(operation); - // let generateConvenienceApi: boolean = Boolean(convenienceApiName); - // let generateProtocolApi: boolean = shouldGenerateProtocol(this.sdkContext, operation); - - // let apiComment: string | undefined = undefined; - // if (generateConvenienceApi) { - // // check if the convenience API need to be disabled for some special cases - // if (operationIsMultipart(op)) { - // // do not generate protocol method for multipart/form-data, as it be very hard for user to prepare the request body as BinaryData - // generateProtocolApi = false; - // apiComment = `Protocol API requires serialization of parts with content-disposition and data, as operation '${op.operation.name}' is 'multipart/form-data'`; - // this.logWarning(apiComment); - // } else if (operationIsMultipleContentTypes(op)) { - // // and multiple content types - // // issue link: https://github.com/Azure/autorest.java/issues/1958#issuecomment-1562558219 - // generateConvenienceApi = false; - // apiComment = `Convenience API is not generated, as operation '${op.operation.name}' is multiple content-type`; - // this.logWarning(apiComment); - // } else if (operationIsJsonMergePatch(op) && this.options["stream-style-serialization"] === false) { - // // do not generate convenient method for json merge patch operation if stream-style-serialization is not enabled - // generateConvenienceApi = false; - // apiComment = `Convenience API is not generated, as operation '${op.operation.name}' is 'application/merge-patch+json' and stream-style-serialization is not enabled`; - // this.logWarning(apiComment); - // } - // // else { - // // const union = operationRefersUnion(this.program, op, this.typeUnionRefCache); - // // if (union) { - // // // and Union - // // generateConvenienceApi = false; - // // apiComment = `Convenience API is not generated, as operation '${ - // // op.operation.name - // // }' refers Union '${getUnionDescription(union, this.typeNameOptions)}'`; - // // this.logWarning(apiComment); - // // } - // // } - // } - // if (generateConvenienceApi && convenienceApiName) { - // codeModelOperation.convenienceApi = new ConvenienceApi(convenienceApiName); - // } - // if (apiComment) { - // codeModelOperation.language.java = new Language(); - // codeModelOperation.language.java.comment = apiComment; - // } - - // // check for generating protocol api or not - // codeModelOperation.generateProtocolApi = generateProtocolApi && !codeModelOperation.internalApi; - - // codeModelOperation.addRequest( - // new Request({ - // protocol: { - // http: { - // path: op.path, - // method: op.verb, - // uri: clientContext.baseUri, - // }, - // }, - // }), - // ); - - // // host - // clientContext.hostParameters.forEach((it) => codeModelOperation.addParameter(it)); - // // parameters - // op.parameters.parameters.map((it) => { - // const sdkParamType = ignoreDiagnostics(getSdkModelPropertyType(this.sdkContext, it.param, operation)) as SdkHeaderParameter | SdkQueryParameter | SdkPathParameter; - // this.processParameterFromSdkType(codeModelOperation, sdkParamType, clientContext); - // }); - // // "accept" header - // this.addAcceptHeaderParameter(codeModelOperation, op.responses); - // // body - // if (op.parameters.body) { - // if (op.parameters.body.property) { - // if (!isVoidType(op.parameters.body.property.type)) { - // this.processParameterBody(codeModelOperation, op, op.parameters.body.property); - // } - // } else if (op.parameters.body.type) { - // let bodyType = this.getEffectiveSchemaType(op.parameters.body.type); - - // if (bodyType.kind === "Model") { - // // try use resource type as round-trip model - // const resourceType = getResourceOperation(this.program, operation)?.resourceType; - // if (resourceType && op.responses && op.responses.length > 0) { - // const resp = op.responses[0]; - // if (resp.responses && resp.responses.length > 0 && resp.responses[0].body) { - // const responseBody = resp.responses[0].body; - // const bodyTypeInResponse = this.findResponseBody(responseBody.type); - // // response body type is resource type, and request body type (if templated) contains resource type - // if (bodyTypeInResponse === resourceType && isModelReferredInTemplate(bodyType, resourceType)) { - // bodyType = resourceType; - // } - // } - // } - - // this.processParameterBody(codeModelOperation, op, bodyType); - // } - // } - // } - - // // group ETag header parameters, if exists - // if (this.options["group-etag-headers"]) { - // this.processEtagHeaderParameters(codeModelOperation, op); - // } - - // // lro metadata - // const lroMetadata = this.processLroMetadata(codeModelOperation, op); - - // // responses - // op.responses.map((it) => this.processResponse(codeModelOperation, it, lroMetadata.longRunning)); - - // // check for paged - // this.processRouteForPaged(codeModelOperation, op.responses); - // // check for long-running operation - // this.processRouteForLongRunning(codeModelOperation, operation, op.responses, lroMetadata); - - // operationGroup.addOperation(codeModelOperation); - - // return codeModelOperation; - // } - - private processRouteForPaged(op: CodeModelOperation, responses: HttpOperationResponse[]) { - for (const response of responses) { - if (response.responses && response.responses.length > 0 && response.responses[0].body) { - const responseBody = response.responses[0].body; - const bodyType = this.findResponseBody(responseBody.type); - if (bodyType.kind === "Model") { - const pagedResult = getPagedResult(this.program, bodyType); - if (pagedResult) { - op.extensions = op.extensions ?? {}; - op.extensions["x-ms-pageable"] = { - itemName: pagedResult.itemsProperty?.name, - nextLinkName: pagedResult.nextLinkProperty?.name, - }; - - op.responses?.forEach((r) => { - if (r instanceof SchemaResponse) { - this.trackSchemaUsage(r.schema, { usage: [SchemaContext.Paged] }); - } - }); - - break; - } - } - } - } - } - - private processRouteForPagedFromSdkType(op: CodeModelOperation, responses: Map, sdkMethod: SdkMethod) { + private processRouteForPagedFromSdkType( + op: CodeModelOperation, + responses: Map, + sdkMethod: SdkMethod, + ) { if (sdkMethod.kind === "paging" || sdkMethod.kind === "lropaging") { - for (const [code, response] of responses) { - let bodyType = response.type; + for (const [_, response] of responses) { + const bodyType = response.type; if (bodyType && bodyType.kind === "model") { const pagedResult = sdkMethod.__raw_paged_metadata; if (pagedResult) { @@ -1253,9 +943,12 @@ export class CodeModelBuilder { } } - private processLroMetadataFromSdkType(op: CodeModelOperation, sdkMethod: SdkLroServiceMethod | SdkLroPagingServiceMethod): LongRunningMetadata { + private processLroMetadataFromSdkType( + op: CodeModelOperation, + sdkMethod: SdkLroServiceMethod | SdkLroPagingServiceMethod, + ): LongRunningMetadata { const trackConvenienceApi: boolean = Boolean(op.convenienceApi); - + const lroMetadata = sdkMethod.__raw_lro_metadata; // needs lroMetadata.statusMonitorStep, as getLroMetadata would return for @pollingOperation operation if (lroMetadata && lroMetadata.pollingInfo && lroMetadata.statusMonitorStep) { @@ -1380,7 +1073,7 @@ export class CodeModelBuilder { return; } - for (const [code, response] of responses) { + for (const [_, response] of responses) { if (response.headers) { for (const header of response.headers) { if (isPollingLocation(this.program, header.__raw)) { @@ -1396,13 +1089,17 @@ export class CodeModelBuilder { private _armApiVersionParameter?: Parameter; - private processParameterFromSdkType(op: CodeModelOperation, param: SdkQueryParameter | SdkPathParameter | SdkHeaderParameter, clientContext: ClientContext) { + private processParameterFromSdkType( + op: CodeModelOperation, + param: SdkQueryParameter | SdkPathParameter | SdkHeaderParameter, + clientContext: ClientContext, + ) { if (clientContext.apiVersions && isApiVersion(this.sdkContext, param)) { // pre-condition for "isApiVersion": the client supports ApiVersions if (this.isArm()) { // Currently we assume ARM tsp only have one client and one api-version. // TODO: How will service define mixed api-versions(like those in Compute RP)? - const apiVersion = this.apiVersionString; + const apiVersion = this.apiVersion; if (!this._armApiVersionParameter) { this._armApiVersionParameter = this.createApiVersionParameter( "api-version", @@ -1417,13 +1114,11 @@ export class CodeModelBuilder { op.addParameter(parameter); clientContext.addGlobalParameter(parameter); } - } - else if (param.kind === "path" && param.onClient && this.isSubscriptionId(param)) { + } else if (param.kind === "path" && param.onClient && this.isSubscriptionId(param)) { const parameter = this.subscriptionIdParameter(param); op.addParameter(parameter); clientContext.addGlobalParameter(parameter); - } - else if (param.kind === "header" && SPECIAL_HEADER_NAMES.has(param.serializedName.toLowerCase())) { + } else if (param.kind === "header" && SPECIAL_HEADER_NAMES.has(param.serializedName.toLowerCase())) { // special headers op.specialHeaders = op.specialHeaders ?? []; if (!stringArrayContainsIgnoreCase(op.specialHeaders, param.serializedName)) { @@ -1532,393 +1227,6 @@ export class CodeModelBuilder { } } - // private processParameter(op: CodeModelOperation, param: HttpOperationParameter, clientContext: ClientContext) { - // if (clientContext.apiVersions && isApiVersion(this.sdkContext, param)) { - // // pre-condition for "isApiVersion": the client supports ApiVersions - // if (this.isArm()) { - // // Currently we assume ARM tsp only have one client and one api-version. - // // TODO: How will service define mixed api-versions(like those in Compute RP)? - // const apiVersion = this.apiVersion?.value; - // if (!this._armApiVersionParameter) { - // this._armApiVersionParameter = this.createApiVersionParameter( - // "api-version", - // param.type === "query" ? ParameterLocation.Query : ParameterLocation.Path, - // apiVersion, - // ); - // clientContext.addGlobalParameter(this._armApiVersionParameter); - // } - // op.addParameter(this._armApiVersionParameter); - // } else { - // const parameter = param.type === "query" ? this.apiVersionParameter : this.apiVersionParameterInPath; - // op.addParameter(parameter); - // clientContext.addGlobalParameter(parameter); - // } - // } else if (this.isSubscriptionId(param)) { - // const parameter = this.subscriptionIdParameter(param); - // op.addParameter(parameter); - // clientContext.addGlobalParameter(parameter); - // } else if (SPECIAL_HEADER_NAMES.has(param.name.toLowerCase())) { - // // special headers - // op.specialHeaders = op.specialHeaders ?? []; - // if (!stringArrayContainsIgnoreCase(op.specialHeaders, param.name)) { - // op.specialHeaders.push(param.name); - // } - // } else { - // // schema - // let schema; - // const sdkType = getClientType(this.sdkContext, param.param); - // if ( - // param.type === "header" && - // param.param.type.kind === "Scalar" && - // getEncode(this.program, param.param) === undefined && - // getEncode(this.program, param.param.type) === undefined && - // (hasScalarAsBase(param.param.type, "utcDateTime") || hasScalarAsBase(param.param.type, "offsetDateTime")) && - // (sdkType.kind === "utcDateTime" || sdkType.kind === "offsetDateTime") - // ) { - // // utcDateTime in header maps to rfc7231 - // schema = this.processDateTimeSchemaFromSdkType(sdkType, param.param.name, true); - // } else { - // schema = this.processSchemaFromSdkType(sdkType, param.param.name); - // } - - // // skip-url-encoding - // let extensions: { [id: string]: any } | undefined = undefined; - // if ( - // (param.type === "query" || param.type === "path") && - // param.param.type.kind === "Scalar" && - // schema instanceof UriSchema - // ) { - // extensions = { "x-ms-skip-url-encoding": true }; - // } - - // if (this.supportsAdvancedVersioning()) { - // // versioning - // const addedOn = getAddedOnVersions(this.program, param.param); - // if (addedOn) { - // extensions = extensions ?? {}; - // extensions["x-ms-versioning-added"] = clientContext.getAddedVersions(addedOn); - // } - // } - - // // format if array - // let style = undefined; - // let explode = undefined; - // if (param.param.type.kind === "Model" && isArrayModelType(this.program, param.param.type)) { - // if (param.type === "query") { - // const queryParamOptions = getQueryParamOptions(this.program, param.param); - // switch (queryParamOptions?.format) { - // case "csv": - // style = SerializationStyle.Simple; - // break; - - // case "ssv": - // style = SerializationStyle.SpaceDelimited; - // break; - - // case "tsv": - // style = SerializationStyle.TabDelimited; - // break; - - // case "pipes": - // style = SerializationStyle.PipeDelimited; - // break; - - // case "multi": - // style = SerializationStyle.Form; - // explode = true; - // break; - - // default: - // if (queryParamOptions?.format) { - // this.logWarning(`Unrecognized query parameter format: '${queryParamOptions?.format}'.`); - // } - // break; - // } - // } else if (param.type === "header") { - // const headerFieldOptions = getHeaderFieldOptions(this.program, param.param); - // switch (headerFieldOptions?.format) { - // case "csv": - // style = SerializationStyle.Simple; - // break; - - // default: - // if (headerFieldOptions?.format) { - // this.logWarning(`Unrecognized header parameter format: '${headerFieldOptions?.format}'.`); - // } - // break; - // } - // } - // } - - // const nullable = isNullableType(param.param.type); - // const parameter = new Parameter(this.getName(param.param), this.getDoc(param.param), schema, { - // summary: this.getSummary(param.param), - // implementation: ImplementationLocation.Method, - // required: !param.param.optional, - // nullable: nullable, - // protocol: { - // http: new HttpParameter(param.type, { - // style: style, - // explode: explode, - // }), - // }, - // language: { - // default: { - // serializedName: param.name, - // }, - // }, - // extensions: extensions, - // }); - // op.addParameter(parameter); - - // this.trackSchemaUsage(schema, { usage: [SchemaContext.Input] }); - - // if (op.convenienceApi) { - // this.trackSchemaUsage(schema, { usage: [op.internalApi ? SchemaContext.Internal : SchemaContext.Public] }); - // } - - // if (param.name.toLowerCase() === CONTENT_TYPE_KEY) { - // let mediaTypes = ["application/json"]; - // if (schema instanceof ConstantSchema) { - // mediaTypes = [schema.value.value.toString()]; - // } else if (schema instanceof SealedChoiceSchema) { - // mediaTypes = schema.choices.map((it) => it.value.toString()); - // } - // op.requests![0].protocol.http!.mediaTypes = mediaTypes; - // } - // } - // } - - private addAcceptHeaderParameterFromSdkType(op: CodeModelOperation, responses: Map) { - if (op.parameters?.some((it) => it.language.default.serializedName?.toLowerCase() === "accept")) { - // parameters already include "accept" header - return; - } - - const produces = new Set(); - for (const code of responses.keys()) { - const response = responses.get(code); - if (response) { - if (response.contentTypes && response.contentTypes.length > 0) { - response.contentTypes.forEach((it) => produces.add(it)); - } else if (response.defaultContentType) { - produces.add(response.defaultContentType); - } - } - } - if (produces.size === 0) { - produces.add("application/json"); - } - const acceptTypes = Array.from(produces.values()).join(", "); - - const acceptSchema = - this.codeModel.schemas.constants?.find( - (it) => it.language.default.name === "accept" && it.value.value === acceptTypes, - ) || - this.codeModel.schemas.add( - new ConstantSchema("accept", `Accept: ${acceptTypes}`, { - valueType: this.stringSchema, - value: new ConstantValue(acceptTypes), - }), - ); - op.addParameter( - new Parameter("accept", "Accept header", acceptSchema, { - implementation: ImplementationLocation.Method, - origin: "modelerfour:synthesized/accept", - required: true, - protocol: { - http: new HttpParameter(ParameterLocation.Header), - }, - language: { - default: { - serializedName: "accept", - }, - }, - }), - ); - } - - private addAcceptHeaderParameter(op: CodeModelOperation, responses: HttpOperationResponse[]) { - if (op.parameters?.some((it) => it.language.default.serializedName?.toLowerCase() === "accept")) { - // parameters already include "accept" header - return; - } - - const produces = new Set(); - for (const resp of responses) { - if (resp.responses && resp.responses.length > 0) { - for (const response of resp.responses) { - response.body?.contentTypes.forEach((it) => produces.add(it)); - } - } - } - if (produces.size === 0) { - produces.add("application/json"); - } - const acceptTypes = Array.from(produces.values()).join(", "); - - const acceptSchema = - this.codeModel.schemas.constants?.find( - (it) => it.language.default.name === "accept" && it.value.value === acceptTypes, - ) || - this.codeModel.schemas.add( - new ConstantSchema("accept", `Accept: ${acceptTypes}`, { - valueType: this.stringSchema, - value: new ConstantValue(acceptTypes), - }), - ); - op.addParameter( - new Parameter("accept", "Accept header", acceptSchema, { - implementation: ImplementationLocation.Method, - origin: "modelerfour:synthesized/accept", - required: true, - protocol: { - http: new HttpParameter(ParameterLocation.Header), - }, - language: { - default: { - serializedName: "accept", - }, - }, - }), - ); - } - - private processEtagHeaderParameters(op: CodeModelOperation, httpOperation: HttpOperation) { - if (op.convenienceApi && op.parameters && op.signatureParameters) { - const etagHeadersNames = new Set([ - "if-match", - "if-none-match", - "if-unmodified-since", - "if-modified-since", - ]); - - // collect etag headers in parameters - const etagHeaders: string[] = []; - if (op.parameters) { - for (const parameter of op.parameters) { - if ( - parameter.language.default.serializedName && - etagHeadersNames.has(parameter.language.default.serializedName.toLowerCase()) - ) { - etagHeaders.push(parameter.language.default.serializedName); - } - } - } - - let groupToRequestConditions = false; - let groupToMatchConditions = false; - - if (etagHeaders.length === 4) { - // all 4 headers available, use RequestConditions - groupToRequestConditions = true; - } else if (etagHeaders.length === 2) { - const etagHeadersLowerCase = etagHeaders.map((it) => it.toLowerCase()); - if (etagHeadersLowerCase.includes("if-match") && etagHeadersLowerCase.includes("if-none-match")) { - // only 2 headers available, use MatchConditions - groupToMatchConditions = true; - } - } - - if (groupToRequestConditions || groupToMatchConditions) { - op.convenienceApi.requests = []; - const request = new Request({ - protocol: op.requests![0].protocol, - }); - request.parameters = []; - request.signatureParameters = []; - op.convenienceApi.requests.push(request); - - for (const parameter of op.parameters) { - // copy all parameters to request - const clonedParameter = cloneOperationParameter(parameter); - request.parameters.push(clonedParameter); - - // copy signatureParameters, but exclude etag headers (as they won't be in method signature) - if ( - op.signatureParameters.includes(parameter) && - !( - parameter.language.default.serializedName && - etagHeaders.includes(parameter.language.default.serializedName) - ) - ) { - request.signatureParameters.push(clonedParameter); - } - } - - const namespace = getNamespace(httpOperation.operation); - const schemaName = groupToRequestConditions ? "RequestConditions" : "MatchConditions"; - const schemaDescription = groupToRequestConditions - ? "Specifies HTTP options for conditional requests based on modification time." - : "Specifies HTTP options for conditional requests."; - - // group schema - const requestConditionsSchema = this.codeModel.schemas.add( - new GroupSchema(schemaName, schemaDescription, { - language: { - default: { - namespace: namespace, - }, - java: { - namespace: "com.azure.core.http", - }, - }, - }), - ); - - // parameter (optional) of the group schema - const requestConditionsParameter = new Parameter( - schemaName, - requestConditionsSchema.language.default.description, - requestConditionsSchema, - { - implementation: ImplementationLocation.Method, - required: false, - nullable: true, - }, - ); - - this.trackSchemaUsage(requestConditionsSchema, { usage: [SchemaContext.Input] }); - if (op.convenienceApi) { - this.trackSchemaUsage(requestConditionsSchema, { - usage: [op.internalApi ? SchemaContext.Internal : SchemaContext.Public], - }); - } - - // update group schema for properties - for (const parameter of request.parameters) { - if ( - parameter.language.default.serializedName && - etagHeaders.includes(parameter.language.default.serializedName) - ) { - parameter.groupedBy = requestConditionsParameter; - - requestConditionsSchema.add( - // name is serializedName, as it must be same as that in RequestConditions class - new GroupProperty( - parameter.language.default.serializedName, - parameter.language.default.description, - parameter.schema, - { - originalParameter: [parameter], - summary: parameter.summary, - required: false, - nullable: true, - readOnly: false, - serializedName: parameter.language.default.serializedName, - }, - ), - ); - } - } - - // put RequestConditions/MatchConditions as last parameter/signatureParameters - request.parameters.push(requestConditionsParameter); - request.signatureParameters.push(requestConditionsParameter); - } - } - } - private processEtagHeaderParametersFromSdkType(op: CodeModelOperation, httpOperation: SdkHttpOperation) { if (op.convenienceApi && op.parameters && op.signatureParameters) { const etagHeadersNames = new Set([ @@ -2054,7 +1362,12 @@ export class CodeModelBuilder { } } - private processParameterBodyFromSdkType(op: CodeModelOperation, rawHttpOperation: HttpOperation, sdkHttpOperation: SdkHttpOperation, sdkBody: SdkModelPropertyType) { + private processParameterBodyFromSdkType( + op: CodeModelOperation, + rawHttpOperation: HttpOperation, + sdkHttpOperation: SdkHttpOperation, + sdkBody: SdkModelPropertyType, + ) { // set contentTypes to mediaTypes op.requests![0].protocol.http!.mediaTypes = rawHttpOperation.parameters.body!.contentTypes; @@ -2094,12 +1407,12 @@ export class CodeModelBuilder { if (sdkHttpOperationIsJsonMergePatch(sdkHttpOperation)) { this.trackSchemaUsage(schema, { usage: [SchemaContext.JsonMergePatch] }); } - if (op.convenienceApi && sdkHttpOperationIsMultipart(sdkHttpOperation)){ + if (op.convenienceApi && sdkHttpOperationIsMultipart(sdkHttpOperation)) { this.trackSchemaUsage(schema, { serializationFormats: [KnownMediaType.Multipart] }); } // Implicit body parameter would have usage flag: UsageFlags.Spread, for this case we need to do body parameter flatten - const bodyParameterFlatten = sdkType.kind === "model" && (sdkType.usage & UsageFlags.Spread) && !this.isArm(); + const bodyParameterFlatten = sdkType.kind === "model" && sdkType.usage & UsageFlags.Spread && !this.isArm(); if (schema instanceof ObjectSchema && bodyParameterFlatten) { // flatten body parameter @@ -2118,7 +1431,7 @@ export class CodeModelBuilder { schema.language.default.name = pascalCase(op.language.default.name) + "PatchRequest"; return; } - + this.trackSchemaUsage(schema, { usage: [SchemaContext.Anonymous] }); if (op.convenienceApi && op.parameters) { @@ -2138,7 +1451,7 @@ export class CodeModelBuilder { if (bodyParameter.type.kind === "model") { for (const bodyParam of bodyParameter.type.properties) { if (bodyParam.kind === "property") { - this.addParameterOrBodyToCodeModelRequest(bodyParam, op, request, schema, parameter) + this.addParameterOrBodyToCodeModelRequest(bodyParam, op, request, schema, parameter); } } } @@ -2202,7 +1515,13 @@ export class CodeModelBuilder { } } - private addParameterOrBodyToCodeModelRequest(opParameter: SdkPathParameter | SdkHeaderParameter | SdkQueryParameter | SdkBodyModelPropertyType, op: CodeModelOperation, request: Request, schema: ObjectSchema, originalParameter: Parameter) { + private addParameterOrBodyToCodeModelRequest( + opParameter: SdkPathParameter | SdkHeaderParameter | SdkQueryParameter | SdkBodyModelPropertyType, + op: CodeModelOperation, + request: Request, + schema: ObjectSchema, + originalParameter: Parameter, + ) { const serializedName = opParameter.serializedName; const existParameter = op.parameters?.find((it) => it.language.default.serializedName === serializedName); request.parameters = request.parameters ?? []; @@ -2218,11 +1537,7 @@ export class CodeModelBuilder { } else { // property from anonymous model const existBodyProperty = schema.properties?.find((it) => it.serializedName === serializedName); - if ( - existBodyProperty && - !existBodyProperty.readOnly && - !(existBodyProperty.schema instanceof ConstantSchema) - ) { + if (existBodyProperty && !existBodyProperty.readOnly && !(existBodyProperty.schema instanceof ConstantSchema)) { request.parameters.push( new VirtualParameter( existBodyProperty.language.default.name, @@ -2555,7 +1870,13 @@ export class CodeModelBuilder { } } - private processResponseFromSdkType(op: CodeModelOperation, statusCode: number | HttpStatusCodeRange | "*", sdkResponse: SdkHttpResponse, longRunning: boolean, isErrorResponse: boolean) { + private processResponseFromSdkType( + op: CodeModelOperation, + statusCode: number | HttpStatusCodeRange | "*", + sdkResponse: SdkHttpResponse, + longRunning: boolean, + isErrorResponse: boolean, + ) { // TODO: what to do if more than 1 response? // It happens when the response type is Union, on one status code. // let response: Response; @@ -2573,18 +1894,18 @@ export class CodeModelBuilder { name: header.serializedName, description: header.description ?? header.details, }, - } + }, }), ); } } // let responseBody: SdkHttpResponse | undefined = undefined; - let bodyType: SdkType | undefined = sdkResponse.type; + const bodyType: SdkType | undefined = sdkResponse.type; let trackConvenienceApi: boolean = Boolean(op.convenienceApi); const unknownResponseBody = - sdkResponse.contentTypes && sdkResponse.contentTypes.length > 0 && !isKnownContentType(sdkResponse.contentTypes); + sdkResponse.contentTypes && sdkResponse.contentTypes.length > 0 && !isKnownContentType(sdkResponse.contentTypes); let response: Response; if (unknownResponseBody && bodyType && bodyType.kind === "bytes") { @@ -3531,9 +2852,7 @@ export class CodeModelBuilder { } private isSubscriptionId(param: SdkPathParameter): boolean { - return ( - "subscriptionId".toLocaleLowerCase() === param.name.toLocaleLowerCase() - ); + return "subscriptionId".toLocaleLowerCase() === param.name.toLocaleLowerCase(); } private subscriptionIdParameter(parameter: SdkPathParameter): Parameter { From 3a2955dc2186b27b44526fc2224f010deb318971 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Wed, 7 Aug 2024 15:47:48 +0800 Subject: [PATCH 39/90] regen --- .../basic/implementation/BasicClientImpl.java | 49 +++++++++++-------- .../page/implementation/PageClientImpl.java | 36 +++++++++----- .../implementation/MultipartClientImpl.java | 48 +++++++----------- .../com/parameters/spread/SpreadTests.java | 2 +- 4 files changed, 71 insertions(+), 64 deletions(-) diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java index 0f21b5cd49..3ca295636d 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java @@ -145,7 +145,7 @@ public interface BasicClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrUpdate(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -156,7 +156,7 @@ Mono> createOrUpdate(@QueryParam("api-version") String apiV @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrUpdateSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -167,8 +167,9 @@ Response createOrUpdateSync(@QueryParam("api-version") String apiVer @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrReplace(@QueryParam("api-version") String apiVersion, - @PathParam("id") int id, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); + @PathParam("id") int id, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData resource, + RequestOptions requestOptions, Context context); @Put("/azure/core/basic/users/{id}") @ExpectedResponses({ 200, 201 }) @@ -177,8 +178,8 @@ Mono> createOrReplace(@QueryParam("api-version") String api @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrReplaceSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/users/{id}") @ExpectedResponses({ 200 }) @@ -187,7 +188,7 @@ Response createOrReplaceSync(@QueryParam("api-version") String apiVe @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> get(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/users/{id}") @ExpectedResponses({ 200 }) @@ -196,7 +197,7 @@ Mono> get(@QueryParam("api-version") String apiVersion, @Pa @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/users") @ExpectedResponses({ 200 }) @@ -205,7 +206,7 @@ Response getSync(@QueryParam("api-version") String apiVersion, @Path @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> list(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/basic/users") @ExpectedResponses({ 200 }) @@ -214,7 +215,7 @@ Mono> list(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/azure/core/basic/users/{id}") @ExpectedResponses({ 204 }) @@ -223,7 +224,7 @@ Response listSync(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> delete(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/azure/core/basic/users/{id}") @ExpectedResponses({ 204 }) @@ -232,7 +233,7 @@ Mono> delete(@QueryParam("api-version") String apiVersion, @PathP @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/azure/core/basic/users/{id}:export") @ExpectedResponses({ 200 }) @@ -241,7 +242,7 @@ Response deleteSync(@QueryParam("api-version") String apiVersion, @PathPar @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> export(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @QueryParam("format") String format, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @QueryParam("format") String format, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/azure/core/basic/users/{id}:export") @@ -251,7 +252,7 @@ Mono> export(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response exportSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @QueryParam("format") String format, @HeaderParam("accept") String accept, RequestOptions requestOptions, + @QueryParam("format") String format, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -261,7 +262,7 @@ Response exportSync(@QueryParam("api-version") String apiVersion, @P @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -270,7 +271,7 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = tru @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -434,9 +435,10 @@ public Response createOrUpdateWithResponse(int id, BinaryData resour @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createOrReplaceWithResponseAsync(int id, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.createOrReplace(this.getServiceVersion().getVersion(), id, - accept, resource, requestOptions, context)); + contentType, accept, resource, requestOptions, context)); } /** @@ -489,9 +491,10 @@ public Mono> createOrReplaceWithResponseAsync(int id, Binar @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrReplaceWithResponse(int id, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrReplaceSync(this.getServiceVersion().getVersion(), id, accept, resource, requestOptions, - Context.NONE); + return service.createOrReplaceSync(this.getServiceVersion().getVersion(), id, contentType, accept, resource, + requestOptions, Context.NONE); } /** @@ -521,7 +524,9 @@ public Response createOrReplaceWithResponse(int id, BinaryData resou * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a User along with {@link Response} on successful completion of {@link Mono}. + * @return a user. + * + * Gets a User along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(int id, RequestOptions requestOptions) { @@ -557,7 +562,9 @@ public Mono> getWithResponseAsync(int id, RequestOptions re * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a User along with {@link Response}. + * @return a user. + * + * Gets a User along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(int id, RequestOptions requestOptions) { diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/page/implementation/PageClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/page/implementation/PageClientImpl.java index 2993827597..01da695ac4 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/page/implementation/PageClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/page/implementation/PageClientImpl.java @@ -155,7 +155,7 @@ public interface PageClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithPage(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/page/page") @ExpectedResponses({ 200 }) @@ -164,7 +164,7 @@ Mono> listWithPage(@QueryParam("api-version") String apiVer @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithPageSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/page/parameters") @ExpectedResponses({ 200 }) @@ -173,7 +173,7 @@ Response listWithPageSync(@QueryParam("api-version") String apiVersi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithParameters(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData bodyInput, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData bodyInput, RequestOptions requestOptions, Context context); @Get("/azure/core/page/parameters") @@ -183,7 +183,7 @@ Mono> listWithParameters(@QueryParam("api-version") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithParametersSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData bodyInput, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData bodyInput, RequestOptions requestOptions, Context context); @Get("/azure/core/page/custom-page") @@ -193,7 +193,7 @@ Response listWithParametersSync(@QueryParam("api-version") String ap @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithCustomPageModel(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/page/custom-page") @ExpectedResponses({ 200 }) @@ -202,7 +202,7 @@ Mono> listWithCustomPageModel(@QueryParam("api-version") St @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithCustomPageModelSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -211,7 +211,7 @@ Response listWithCustomPageModelSync(@QueryParam("api-version") Stri @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithPageNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -220,7 +220,7 @@ Mono> listWithPageNext(@PathParam(value = "nextLink", encod @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithPageNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -229,7 +229,7 @@ Response listWithPageNextSync(@PathParam(value = "nextLink", encoded @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithParametersNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("accept") String accept, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -239,7 +239,7 @@ Mono> listWithParametersNext( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithParametersNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -248,7 +248,7 @@ Response listWithParametersNextSync(@PathParam(value = "nextLink", e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithCustomPageModelNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("accept") String accept, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -258,7 +258,7 @@ Mono> listWithCustomPageModelNext( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithCustomPageModelNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("accept") String accept, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -756,6 +756,8 @@ public PagedIterable listWithCustomPageModel(RequestOptions requestO } /** + * List with Azure.Core.Page<>. + * * Get the next page of items. *

Response Body Schema

* @@ -792,6 +794,8 @@ private Mono> listWithPageNextSinglePageAsync(String n } /** + * List with Azure.Core.Page<>. + * * Get the next page of items. *

Response Body Schema

* @@ -827,6 +831,8 @@ private PagedResponse listWithPageNextSinglePage(String nextLink, Re } /** + * List with extensible enum parameter Azure.Core.Page<>. + * * Get the next page of items. *

Response Body Schema

* @@ -864,6 +870,8 @@ private Mono> listWithParametersNextSinglePageAsync(St } /** + * List with extensible enum parameter Azure.Core.Page<>. + * * Get the next page of items. *

Response Body Schema

* @@ -899,6 +907,8 @@ private PagedResponse listWithParametersNextSinglePage(String nextLi } /** + * List with custom page model. + * * Get the next page of items. *

Response Body Schema

* @@ -936,6 +946,8 @@ private Mono> listWithCustomPageModelNextSinglePageAsy } /** + * List with custom page model. + * * Get the next page of items. *

Response Body Schema

* diff --git a/typespec-tests/src/main/java/com/cadl/multipart/implementation/MultipartClientImpl.java b/typespec-tests/src/main/java/com/cadl/multipart/implementation/MultipartClientImpl.java index 4fb2f3255e..9ff920bec9 100644 --- a/typespec-tests/src/main/java/com/cadl/multipart/implementation/MultipartClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/multipart/implementation/MultipartClientImpl.java @@ -43,12 +43,12 @@ public final class MultipartClientImpl { private final MultipartClientService service; /** - * Server parameter. + * Service host. */ private final String endpoint; /** - * Gets Server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -87,7 +87,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of MultipartClient client. * - * @param endpoint Server parameter. + * @param endpoint Service host. */ public MultipartClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), @@ -98,7 +98,7 @@ public MultipartClientImpl(String endpoint) { * Initializes an instance of MultipartClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public MultipartClientImpl(HttpPipeline httpPipeline, String endpoint) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); @@ -109,7 +109,7 @@ public MultipartClientImpl(HttpPipeline httpPipeline, String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Server parameter. + * @param endpoint Service host. */ public MultipartClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; @@ -133,8 +133,8 @@ public interface MultipartClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> upload(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("multipart/form-data") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData data, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/upload/images/{name}") @@ -144,10 +144,9 @@ Mono> upload(@HostParam("endpoint") String endpoint, @PathParam(" @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadSync(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("multipart/form-data") BinaryData data, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData data, + RequestOptions requestOptions, Context context); - // @Multipart not supported by RestProxy @Post("/uploadHttpPart/images/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -155,10 +154,8 @@ Response uploadSync(@HostParam("endpoint") String endpoint, @PathParam("na @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadHttpPart(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, RequestOptions requestOptions, Context context); - // @Multipart not supported by RestProxy @Post("/uploadHttpPart/images/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -166,8 +163,7 @@ Mono> uploadHttpPart(@HostParam("endpoint") String endpoint, @Pat @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadHttpPartSync(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, RequestOptions requestOptions, Context context); } /** @@ -192,9 +188,8 @@ Response uploadHttpPartSync(@HostParam("endpoint") String endpoint, @PathP @ServiceMethod(returns = ReturnType.SINGLE) public Mono> uploadWithResponseAsync(String name, BinaryData data, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; return FluxUtil.withContext( - context -> service.upload(this.getEndpoint(), name, contentType, accept, data, requestOptions, context)); + context -> service.upload(this.getEndpoint(), name, contentType, data, requestOptions, context)); } /** @@ -219,8 +214,7 @@ public Mono> uploadWithResponseAsync(String name, BinaryData data @ServiceMethod(returns = ReturnType.SINGLE) public Response uploadWithResponse(String name, BinaryData data, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.uploadSync(this.getEndpoint(), name, contentType, accept, data, requestOptions, Context.NONE); + return service.uploadSync(this.getEndpoint(), name, contentType, data, requestOptions, Context.NONE); } /** @@ -234,7 +228,6 @@ public Response uploadWithResponse(String name, BinaryData data, RequestOp * You can add these to a request with {@link RequestOptions#addQueryParam} * * @param name The name parameter. - * @param body The body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -243,12 +236,10 @@ public Response uploadWithResponse(String name, BinaryData data, RequestOp * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadHttpPartWithResponseAsync(String name, BinaryData body, - RequestOptions requestOptions) { + public Mono> uploadHttpPartWithResponseAsync(String name, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.uploadHttpPart(this.getEndpoint(), name, contentType, accept, - body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.uploadHttpPart(this.getEndpoint(), name, contentType, requestOptions, context)); } /** @@ -262,7 +253,6 @@ public Mono> uploadHttpPartWithResponseAsync(String name, BinaryD * You can add these to a request with {@link RequestOptions#addQueryParam} * * @param name The name parameter. - * @param body The body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -271,10 +261,8 @@ public Mono> uploadHttpPartWithResponseAsync(String name, BinaryD * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response uploadHttpPartWithResponse(String name, BinaryData body, RequestOptions requestOptions) { + public Response uploadHttpPartWithResponse(String name, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.uploadHttpPartSync(this.getEndpoint(), name, contentType, accept, body, requestOptions, - Context.NONE); + return service.uploadHttpPartSync(this.getEndpoint(), name, contentType, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/test/java/com/parameters/spread/SpreadTests.java b/typespec-tests/src/test/java/com/parameters/spread/SpreadTests.java index 23142e8ecb..bcfa1ac7fa 100644 --- a/typespec-tests/src/test/java/com/parameters/spread/SpreadTests.java +++ b/typespec-tests/src/test/java/com/parameters/spread/SpreadTests.java @@ -22,7 +22,7 @@ public void testSpread() { aliasClient.spreadWithMultipleParameters("1", "bar", "foo", List.of(1, 2), 1, List.of("foo", "bar")); - aliasClient.spreadParameterWithInnerAlias("1", "foo", 1, "bar"); + aliasClient.spreadParameterWithInnerAlias("1", "foo", "bar", 1); aliasClient.spreadParameterWithInnerModel("1", "foo", "bar"); } From 183f5eae42769084fa6f9a92ea964a9c1b446f3b Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Wed, 7 Aug 2024 17:27:49 +0800 Subject: [PATCH 40/90] code clean up --- typespec-extension/src/code-model-builder.ts | 331 ------------------- 1 file changed, 331 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index a290e9274c..44a97e210a 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -878,7 +878,6 @@ export class CodeModelBuilder { httpOperation, httpOperation.bodyParam, ); - // } } // group ETag header parameters, if exists @@ -1036,32 +1035,6 @@ export class CodeModelBuilder { return new LongRunningMetadata(false); } - private processRouteForLongRunning( - op: CodeModelOperation, - operation: Operation, - responses: HttpOperationResponse[], - lroMetadata: LongRunningMetadata, - ) { - if (lroMetadata.longRunning) { - op.extensions = op.extensions ?? {}; - op.extensions["x-ms-long-running-operation"] = true; - return; - } - - for (const resp of responses) { - if (resp.responses && resp.responses.length > 0 && resp.responses[0].headers) { - for (const [_, header] of Object.entries(resp.responses[0].headers)) { - if (isPollingLocation(this.program, header)) { - op.extensions = op.extensions ?? {}; - op.extensions["x-ms-long-running-operation"] = true; - - break; - } - } - } - } - } - private processRouteForLongRunningFromSdkType( op: CodeModelOperation, responses: Map, @@ -1561,315 +1534,11 @@ export class CodeModelBuilder { } } } - - // private processParameterBody(op: CodeModelOperation, httpOperation: HttpOperation, body: ModelProperty | Model) { - // // set contentTypes to mediaTypes - // op.requests![0].protocol.http!.mediaTypes = httpOperation.parameters.body!.contentTypes; - - // const parameters = httpOperation.operation.parameters; - - // const unknownRequestBody = - // op.requests![0].protocol.http!.mediaTypes && - // op.requests![0].protocol.http!.mediaTypes.length > 0 && - // !isKnownContentType(op.requests![0].protocol.http!.mediaTypes); - - // const sdkType: SdkType = getClientType(this.sdkContext, body, httpOperation.operation); - - // let schema: Schema; - // if ( - // unknownRequestBody && - // body.kind === "ModelProperty" && - // body.type.kind === "Scalar" && - // body.type.name === "bytes" - // ) { - // // handle binary request body - // schema = this.processBinarySchema(body.type); - // } else { - // schema = this.processSchemaFromSdkType(sdkType, body.name); - // } - - // const isAnonymousModel = sdkType.kind === "model" && sdkType.isGeneratedName === true; - // const parameterName = body.kind === "Model" ? (sdkType.kind === "model" ? sdkType.name : "") : this.getName(body); - // const parameter = new Parameter(parameterName, this.getDoc(body), schema, { - // summary: this.getSummary(body), - // implementation: ImplementationLocation.Method, - // required: body.kind === "Model" || !body.optional, - // protocol: { - // http: new HttpParameter(ParameterLocation.Body), - // }, - // }); - // op.addParameter(parameter); - - // this.trackSchemaUsage(schema, { usage: [SchemaContext.Input] }); - - // if (op.convenienceApi) { - // // model/schema does not need to be Public or Internal, if it is not to be used in convenience API - // this.trackSchemaUsage(schema, { usage: [op.internalApi ? SchemaContext.Internal : SchemaContext.Public] }); - // } - - // if (operationIsJsonMergePatch(httpOperation)) { - // this.trackSchemaUsage(schema, { usage: [SchemaContext.JsonMergePatch] }); - // } - // if (op.convenienceApi && operationIsMultipart(httpOperation)) { - // this.trackSchemaUsage(schema, { serializationFormats: [KnownMediaType.Multipart] }); - // } - - // if (schema instanceof ObjectSchema && isAnonymousModel) { - // // anonymous model - - // // name the schema for documentation - // schema.language.default.name = pascalCase(op.language.default.name) + "Request"; - - // if (!parameter.language.default.name) { - // // name the parameter for documentation - // parameter.language.default.name = "request"; - // } - - // if (operationIsJsonMergePatch(httpOperation)) { - // // skip model flatten, if "application/merge-patch+json" - // schema.language.default.name = pascalCase(op.language.default.name) + "PatchRequest"; - // return; - // } - - // this.trackSchemaUsage(schema, { usage: [SchemaContext.Anonymous] }); - - // if (op.convenienceApi && op.parameters) { - // op.convenienceApi.requests = []; - // const request = new Request({ - // protocol: op.requests![0].protocol, - // }); - // request.parameters = []; - // op.convenienceApi.requests.push(request); - - // for (const [_, opParameter] of parameters.properties) { - // const serializedName = this.getSerializedName(opParameter); - // const existParameter = op.parameters.find((it) => it.language.default.serializedName === serializedName); - // if (existParameter) { - // // parameter - // if ( - // existParameter.implementation === ImplementationLocation.Method && - // (existParameter.origin?.startsWith("modelerfour:synthesized/") ?? true) - // ) { - // request.parameters.push(cloneOperationParameter(existParameter)); - // } - // } else { - // // property from anonymous model - // const existBodyProperty = schema.properties?.find((it) => it.serializedName === serializedName); - // if ( - // existBodyProperty && - // !existBodyProperty.readOnly && - // !(existBodyProperty.schema instanceof ConstantSchema) - // ) { - // request.parameters.push( - // new VirtualParameter( - // existBodyProperty.language.default.name, - // existBodyProperty.language.default.description, - // existBodyProperty.schema, - // { - // originalParameter: parameter, - // targetProperty: existBodyProperty, - // language: { - // default: { - // serializedName: existBodyProperty.serializedName, - // }, - // }, - // summary: existBodyProperty.summary, - // implementation: ImplementationLocation.Method, - // required: existBodyProperty.required, - // nullable: existBodyProperty.nullable, - // }, - // ), - // ); - // } - // } - // } - // request.signatureParameters = request.parameters; - - // if (request.signatureParameters.length > 6) { - // // create an option bag - // const name = op.language.default.name + "Options"; - // const namespace = getNamespace(httpOperation.operation); - // // option bag schema - // const optionBagSchema = this.codeModel.schemas.add( - // new GroupSchema(name, `Options for ${op.language.default.name} API`, { - // language: { - // default: { - // namespace: namespace, - // }, - // java: { - // namespace: getJavaNamespace(namespace), - // }, - // }, - // }), - // ); - // request.parameters.forEach((it) => { - // optionBagSchema.add( - // new GroupProperty(it.language.default.name, it.language.default.description, it.schema, { - // originalParameter: [it], - // summary: it.summary, - // required: it.required, - // nullable: it.nullable, - // readOnly: false, - // serializedName: it.language.default.serializedName, - // }), - // ); - // }); - - // this.trackSchemaUsage(optionBagSchema, { usage: [SchemaContext.Input] }); - // if (op.convenienceApi) { - // this.trackSchemaUsage(optionBagSchema, { - // usage: [op.internalApi ? SchemaContext.Internal : SchemaContext.Public], - // }); - // } - - // // option bag parameter - // const optionBagParameter = new Parameter( - // "options", - // optionBagSchema.language.default.description, - // optionBagSchema, - // { - // implementation: ImplementationLocation.Method, - // required: true, - // nullable: false, - // }, - // ); - - // request.signatureParameters = [optionBagParameter]; - // request.parameters.forEach((it) => (it.groupedBy = optionBagParameter)); - // request.parameters.push(optionBagParameter); - // } - // } - // } - // } - private findResponseBody(bodyType: Type): Type { // find a type that possibly without http metadata like @statusCode return this.getEffectiveSchemaType(bodyType); } - private processResponse(op: CodeModelOperation, resp: HttpOperationResponse, longRunning: boolean) { - // TODO: what to do if more than 1 response? - // It happens when the response type is Union, on one status code. - let response: Response; - let headers: Array | undefined = undefined; - if (resp.responses && resp.responses.length > 0) { - // headers - headers = []; - for (const response of resp.responses.values()) { - if (response.headers) { - for (const [key, header] of Object.entries(response.headers)) { - const sdkType = getClientType(this.sdkContext, header); - const schema = this.processSchemaFromSdkType(sdkType, key); - headers.push( - new HttpHeader(key, schema, { - language: { - default: { - name: key, - description: this.getDoc(header), - }, - }, - }), - ); - } - } - } - } - - let responseBody: HttpOperationBody | HttpOperationMultipartBody | undefined = undefined; - let bodyType: Type | undefined = undefined; - let trackConvenienceApi: boolean = Boolean(op.convenienceApi); - if (resp.responses && resp.responses.length > 0 && resp.responses[0].body) { - responseBody = resp.responses[0].body; - } - if (responseBody) { - const unknownResponseBody = - responseBody.contentTypes.length > 0 && !isKnownContentType(responseBody.contentTypes); - - bodyType = this.findResponseBody(responseBody.type); - if (unknownResponseBody && bodyType.kind === "Scalar" && bodyType.name === "bytes") { - // binary - response = new BinaryResponse({ - protocol: { - http: { - statusCodes: this.getStatusCodes(resp.statusCodes), - headers: headers, - mediaTypes: responseBody.contentTypes, - knownMediaType: KnownMediaType.Binary, - }, - }, - language: { - default: { - name: op.language.default.name + "Response", - description: this.getResponseDescription(resp), - }, - }, - }); - } else { - // schema (usually JSON) - let schema: Schema | undefined = undefined; - if (longRunning) { - // LRO uses the LroMetadata for poll/final result, not the response of activation request - trackConvenienceApi = false; - } - if (!schema) { - const sdkType = getClientType(this.sdkContext, bodyType); - schema = this.processSchemaFromSdkType(sdkType, op.language.default.name + "Response"); - } - response = new SchemaResponse(schema, { - protocol: { - http: { - statusCodes: this.getStatusCodes(resp.statusCodes), - headers: headers, - mediaTypes: responseBody.contentTypes, - }, - }, - language: { - default: { - name: op.language.default.name + "Response", - description: this.getResponseDescription(resp), - }, - }, - }); - } - } else { - // not binary nor schema, usually NoContent - response = new Response({ - protocol: { - http: { - statusCodes: this.getStatusCodes(resp.statusCodes), - headers: headers, - }, - }, - language: { - default: { - name: op.language.default.name + "Response", - description: this.getResponseDescription(resp), - }, - }, - }); - } - if (resp.statusCodes === "*" || (bodyType && isErrorModel(this.program, bodyType))) { - // "*", or the model is @error - op.addException(response); - - if (response instanceof SchemaResponse) { - this.trackSchemaUsage(response.schema, { usage: [SchemaContext.Exception] }); - } - } else { - op.addResponse(response); - - if (response instanceof SchemaResponse) { - this.trackSchemaUsage(response.schema, { usage: [SchemaContext.Output] }); - - if (trackConvenienceApi) { - this.trackSchemaUsage(response.schema, { - usage: [op.internalApi ? SchemaContext.Internal : SchemaContext.Public], - }); - } - } - } - } - private processResponseFromSdkType( op: CodeModelOperation, statusCode: number | HttpStatusCodeRange | "*", From 15d41b7ddc131eee1f234acac78a908c20521588 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Fri, 9 Aug 2024 15:52:24 +0800 Subject: [PATCH 41/90] support new SdkClientType design --- typespec-extension/src/code-model-builder.ts | 25 +++++++++++++------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index c0e0c42022..6a073560fc 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -547,16 +547,25 @@ export class CodeModelBuilder { let hostParameters: Parameter[] = []; client.initialization.properties.forEach((initializationProperty) => { if (initializationProperty.kind === "endpoint") { - if (this.isArm()) { - // this is just a workaround for ARM - initializationProperty.type.serverUrl = "{endpoint}"; - initializationProperty.type.templateArguments = [this.buildSdkPathPathParameterForARM()]; - } - if (initializationProperty.type.serverUrl) { + let sdkPathParameters: SdkPathParameter[] = []; + if (initializationProperty.type.kind === "union") { + if (initializationProperty.type.values.length <= 2) { + // only get the path parameters from the endpoint whose serverUrl is not {"endpoint"} + for (const endpointType of initializationProperty.type.values) { + if (endpointType.kind === "endpoint" && endpointType.serverUrl !== "{endpoint}") { + sdkPathParameters = endpointType.templateArguments; + baseUri = endpointType.serverUrl; + } + } + } else { + throw new Error("multiple server url defined for one client is not supported yet"); + } + } else { + sdkPathParameters = initializationProperty.type.templateArguments; baseUri = initializationProperty.type.serverUrl; } - - hostParameters = this.processHostParametersFromSdkType(initializationProperty.type.templateArguments); + + hostParameters = this.processHostParametersFromSdkType(sdkPathParameters); codeModelClient.addGlobalParameters(hostParameters); } }); From 955620e82c61c85a05ce0fc0f0ed0324c9975f43 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Fri, 9 Aug 2024 15:53:17 +0800 Subject: [PATCH 42/90] regen --- .../core/access/AccessClientBuilder.java | 25 +- .../implementation/AccessClientImpl.java | 29 +- .../InternalOperationsImpl.java | 52 +- .../implementation/PublicOperationsImpl.java | 34 +- .../RelativeModelInOperationsImpl.java | 30 +- .../SharedModelInOperationsImpl.java | 29 +- .../core/usage/UsageClientBuilder.java | 24 +- .../implementation/ModelInOperationsImpl.java | 51 +- .../usage/implementation/UsageClientImpl.java | 29 +- .../azure/core/basic/BasicClientBuilder.java | 25 +- .../basic/implementation/BasicClientImpl.java | 148 ++++-- .../azure/core/lro/rpc/RpcClientBuilder.java | 25 +- .../lro/rpc/implementation/RpcClientImpl.java | 61 ++- .../lro/standard/StandardClientBuilder.java | 24 +- .../implementation/StandardClientImpl.java | 106 ++-- .../azure/core/model/ModelClientBuilder.java | 25 +- .../AzureCoreEmbeddingVectorsImpl.java | 44 +- .../model/implementation/ModelClientImpl.java | 28 +- .../azure/core/page/PageClientBuilder.java | 25 +- .../page/implementation/PageClientImpl.java | 129 +++-- .../TwoModelsAsPageItemsImpl.java | 63 ++- .../core/scalar/ScalarClientBuilder.java | 26 +- .../AzureLocationScalarsImpl.java | 68 +-- .../implementation/ScalarClientImpl.java | 28 +- .../core/traits/TraitsClientBuilder.java | 26 +- .../implementation/TraitsClientImpl.java | 70 ++- .../basic/AzureExampleClientBuilder.java | 24 +- .../AzureExampleClientImpl.java | 58 +- .../apikey/ApiKeyClientBuilder.java | 26 +- .../implementation/ApiKeyClientImpl.java | 54 +- .../http/custom/CustomClientBuilder.java | 26 +- .../implementation/CustomClientImpl.java | 54 +- .../oauth2/OAuth2ClientBuilder.java | 26 +- .../implementation/OAuth2ClientImpl.java | 54 +- .../union/UnionClientBuilder.java | 24 +- .../union/implementation/UnionClientImpl.java | 52 +- .../XmsClientRequestIdClientBuilder.java | 26 +- .../XmsClientRequestIdClientImpl.java | 42 +- .../implementation/FlattenClientImpl.java | 9 +- .../implementation/MultipartClientImpl.java | 19 +- .../union/implementation/UnionClientImpl.java | 9 +- .../client/naming/NamingClientBuilder.java | 25 +- .../implementation/ClientModelsImpl.java | 33 +- .../implementation/NamingClientImpl.java | 125 +++-- .../naming/implementation/UnionEnumsImpl.java | 34 +- .../com/encode/bytes/BytesClientBuilder.java | 24 +- .../bytes/implementation/BytesClientImpl.java | 29 +- .../bytes/implementation/HeadersImpl.java | 53 +- .../bytes/implementation/PropertiesImpl.java | 76 +-- .../bytes/implementation/QueriesImpl.java | 53 +- .../implementation/RequestBodiesImpl.java | 79 +-- .../implementation/ResponseBodiesImpl.java | 68 +-- .../datetime/DatetimeClientBuilder.java | 24 +- .../implementation/DatetimeClientImpl.java | 29 +- .../datetime/implementation/HeadersImpl.java | 68 +-- .../implementation/PropertiesImpl.java | 94 ++-- .../datetime/implementation/QueriesImpl.java | 68 +-- .../implementation/ResponseHeadersImpl.java | 45 +- .../duration/DurationClientBuilder.java | 24 +- .../implementation/DurationClientImpl.java | 29 +- .../duration/implementation/HeadersImpl.java | 81 +-- .../implementation/PropertiesImpl.java | 115 ++-- .../duration/implementation/QueriesImpl.java | 80 +-- .../parameters/basic/BasicClientBuilder.java | 24 +- .../basic/implementation/BasicClientImpl.java | 29 +- .../implementation/ExplicitBodiesImpl.java | 18 +- .../implementation/ImplicitBodiesImpl.java | 18 +- .../BodyOptionalityClientBuilder.java | 26 +- .../BodyOptionalityClientImpl.java | 60 ++- .../implementation/OptionalExplicitsImpl.java | 21 +- .../CollectionFormatClientBuilder.java | 26 +- .../CollectionFormatClientImpl.java | 29 +- .../implementation/HeadersImpl.java | 14 +- .../implementation/QueriesImpl.java | 58 +- .../spread/SpreadClientBuilder.java | 25 +- .../spread/implementation/AliasImpl.java | 79 +-- .../spread/implementation/ModelsImpl.java | 89 ++-- .../implementation/SpreadClientImpl.java | 29 +- .../ContentNegotiationClientBuilder.java | 26 +- .../ContentNegotiationClientImpl.java | 30 +- .../implementation/DifferentBodiesImpl.java | 29 +- .../implementation/SameBodiesImpl.java | 29 +- .../JsonMergePatchClientBuilder.java | 26 +- .../JsonMergePatchClientImpl.java | 81 +-- .../mediatype/MediaTypeClientBuilder.java | 24 +- .../implementation/MediaTypeClientImpl.java | 29 +- .../implementation/StringBodiesImpl.java | 59 ++- .../multipart/MultiPartClientBuilder.java | 24 +- .../implementation/FormDatasImpl.java | 123 +++-- .../implementation/MultiPartClientImpl.java | 29 +- .../pageable/PageableClientBuilder.java | 24 +- .../implementation/PageableClientImpl.java | 56 +- .../encodedname/json/JsonClientBuilder.java | 24 +- .../json/implementation/JsonClientImpl.java | 29 +- .../json/implementation/PropertiesImpl.java | 27 +- .../ConditionalRequestClientBuilder.java | 26 +- .../ConditionalRequestClientImpl.java | 53 +- .../RepeatabilityClientBuilder.java | 26 +- .../RepeatabilityClientImpl.java | 43 +- .../SpecialWordsClientBuilder.java | 24 +- .../implementation/ModelPropertiesImpl.java | 18 +- .../implementation/ModelsImpl.java | 498 +++++++++++------- .../implementation/OperationsImpl.java | 321 ++++++----- .../implementation/ParametersImpl.java | 412 +++++++++------ .../SpecialWordsClientImpl.java | 29 +- .../com/type/array/ArrayClientBuilder.java | 24 +- .../array/implementation/ArrayClientImpl.java | 29 +- .../implementation/BooleanValuesImpl.java | 27 +- .../implementation/DatetimeValuesImpl.java | 27 +- .../implementation/DurationValuesImpl.java | 27 +- .../implementation/Float32ValuesImpl.java | 27 +- .../array/implementation/Int32ValuesImpl.java | 27 +- .../array/implementation/Int64ValuesImpl.java | 27 +- .../array/implementation/ModelValuesImpl.java | 27 +- .../NullableBooleanValuesImpl.java | 27 +- .../NullableFloatValuesImpl.java | 27 +- .../NullableInt32ValuesImpl.java | 27 +- .../NullableModelValuesImpl.java | 27 +- .../NullableStringValuesImpl.java | 27 +- .../implementation/StringValuesImpl.java | 27 +- .../implementation/UnknownValuesImpl.java | 27 +- .../dictionary/DictionaryClientBuilder.java | 24 +- .../implementation/BooleanValuesImpl.java | 27 +- .../implementation/DatetimeValuesImpl.java | 27 +- .../implementation/DictionaryClientImpl.java | 29 +- .../implementation/DurationValuesImpl.java | 27 +- .../implementation/Float32ValuesImpl.java | 27 +- .../implementation/Int32ValuesImpl.java | 27 +- .../implementation/Int64ValuesImpl.java | 27 +- .../implementation/ModelValuesImpl.java | 27 +- .../NullableFloatValuesImpl.java | 27 +- .../RecursiveModelValuesImpl.java | 27 +- .../implementation/StringValuesImpl.java | 27 +- .../implementation/UnknownValuesImpl.java | 27 +- .../extensible/ExtensibleClientBuilder.java | 24 +- .../implementation/ExtensibleClientImpl.java | 29 +- .../implementation/StringOperationsImpl.java | 59 ++- .../type/enums/fixed/FixedClientBuilder.java | 24 +- .../fixed/implementation/FixedClientImpl.java | 29 +- .../implementation/StringOperationsImpl.java | 46 +- .../type/model/empty/EmptyClientBuilder.java | 24 +- .../empty/implementation/EmptyClientImpl.java | 78 ++- .../model/flatten/FlattenClientBuilder.java | 24 +- .../implementation/FlattenClientImpl.java | 70 ++- .../EnumDiscriminatorClientBuilder.java | 26 +- .../EnumDiscriminatorClientImpl.java | 147 ++++-- .../EnumNestedDiscriminatorClientBuilder.java | 24 +- .../EnumNestedDiscriminatorClientImpl.java | 114 ++-- .../NestedDiscriminatorClientBuilder.java | 26 +- .../NestedDiscriminatorClientImpl.java | 114 ++-- .../NotDiscriminatedClientBuilder.java | 26 +- .../NotDiscriminatedClientImpl.java | 76 ++- .../recursive/RecursiveClientBuilder.java | 24 +- .../implementation/RecursiveClientImpl.java | 56 +- .../SingleDiscriminatorClientBuilder.java | 26 +- .../SingleDiscriminatorClientImpl.java | 127 +++-- .../type/model/usage/UsageClientBuilder.java | 24 +- .../usage/implementation/UsageClientImpl.java | 77 ++- .../visibility/VisibilityClientBuilder.java | 24 +- .../implementation/VisibilityClientImpl.java | 143 +++-- .../AdditionalPropertiesClientBuilder.java | 26 +- .../AdditionalPropertiesClientImpl.java | 30 +- .../ExtendsDifferentSpreadFloatsImpl.java | 27 +- ...ExtendsDifferentSpreadModelArraysImpl.java | 27 +- .../ExtendsDifferentSpreadModelsImpl.java | 27 +- .../ExtendsDifferentSpreadStringsImpl.java | 27 +- .../implementation/ExtendsFloatsImpl.java | 27 +- .../ExtendsModelArraysImpl.java | 27 +- .../implementation/ExtendsModelsImpl.java | 27 +- .../implementation/ExtendsStringsImpl.java | 27 +- .../ExtendsUnknownDerivedsImpl.java | 27 +- .../ExtendsUnknownDiscriminatedsImpl.java | 27 +- .../implementation/ExtendsUnknownsImpl.java | 27 +- .../implementation/IsFloatsImpl.java | 27 +- .../implementation/IsModelArraysImpl.java | 27 +- .../implementation/IsModelsImpl.java | 27 +- .../implementation/IsStringsImpl.java | 27 +- .../implementation/IsUnknownDerivedsImpl.java | 27 +- .../IsUnknownDiscriminatedsImpl.java | 27 +- .../implementation/IsUnknownsImpl.java | 27 +- .../implementation/MultipleSpreadsImpl.java | 27 +- .../SpreadDifferentFloatsImpl.java | 27 +- .../SpreadDifferentModelArraysImpl.java | 27 +- .../SpreadDifferentModelsImpl.java | 27 +- .../SpreadDifferentStringsImpl.java | 27 +- .../implementation/SpreadFloatsImpl.java | 27 +- .../implementation/SpreadModelArraysImpl.java | 27 +- .../implementation/SpreadModelsImpl.java | 27 +- .../SpreadRecordDiscriminatedUnionsImpl.java | 27 +- ...readRecordNonDiscriminatedUnion2sImpl.java | 27 +- ...readRecordNonDiscriminatedUnion3sImpl.java | 27 +- ...preadRecordNonDiscriminatedUnionsImpl.java | 27 +- .../SpreadRecordUnionsImpl.java | 27 +- .../implementation/SpreadStringsImpl.java | 27 +- .../nullable/NullableClientBuilder.java | 24 +- .../nullable/implementation/BytesImpl.java | 59 ++- .../implementation/CollectionsBytesImpl.java | 59 ++- .../implementation/CollectionsModelsImpl.java | 59 ++- .../CollectionsStringsImpl.java | 59 ++- .../DatetimeOperationsImpl.java | 59 ++- .../DurationOperationsImpl.java | 59 ++- .../implementation/NullableClientImpl.java | 29 +- .../implementation/StringOperationsImpl.java | 59 ++- .../optional/OptionalClientBuilder.java | 24 +- .../implementation/BooleanLiteralsImpl.java | 59 ++- .../optional/implementation/BytesImpl.java | 59 ++- .../implementation/CollectionsBytesImpl.java | 59 ++- .../implementation/CollectionsModelsImpl.java | 59 ++- .../DatetimeOperationsImpl.java | 59 ++- .../DurationOperationsImpl.java | 59 ++- .../implementation/FloatLiteralsImpl.java | 59 ++- .../implementation/IntLiteralsImpl.java | 59 ++- .../implementation/OptionalClientImpl.java | 29 +- .../implementation/PlainDatesImpl.java | 59 ++- .../implementation/PlainTimesImpl.java | 59 ++- .../RequiredAndOptionalsImpl.java | 59 ++- .../implementation/StringLiteralsImpl.java | 59 ++- .../implementation/StringOperationsImpl.java | 59 ++- .../UnionFloatLiteralsImpl.java | 59 ++- .../implementation/UnionIntLiteralsImpl.java | 59 ++- .../UnionStringLiteralsImpl.java | 59 ++- .../valuetypes/ValueTypesClientBuilder.java | 24 +- .../implementation/BooleanLiteralsImpl.java | 27 +- .../implementation/BooleanOperationsImpl.java | 27 +- .../valuetypes/implementation/BytesImpl.java | 27 +- .../implementation/CollectionsIntsImpl.java | 27 +- .../implementation/CollectionsModelsImpl.java | 27 +- .../CollectionsStringsImpl.java | 27 +- .../DatetimeOperationsImpl.java | 27 +- .../implementation/Decimal128sImpl.java | 27 +- .../implementation/DecimalsImpl.java | 27 +- .../implementation/DictionaryStringsImpl.java | 27 +- .../DurationOperationsImpl.java | 27 +- .../valuetypes/implementation/EnumsImpl.java | 27 +- .../implementation/ExtensibleEnumsImpl.java | 27 +- .../implementation/FloatLiteralsImpl.java | 27 +- .../implementation/FloatOperationsImpl.java | 27 +- .../implementation/IntLiteralsImpl.java | 27 +- .../valuetypes/implementation/IntsImpl.java | 27 +- .../valuetypes/implementation/ModelsImpl.java | 27 +- .../valuetypes/implementation/NeversImpl.java | 27 +- .../implementation/StringLiteralsImpl.java | 27 +- .../implementation/StringOperationsImpl.java | 27 +- .../implementation/UnionEnumValuesImpl.java | 27 +- .../UnionFloatLiteralsImpl.java | 27 +- .../implementation/UnionIntLiteralsImpl.java | 27 +- .../UnionStringLiteralsImpl.java | 27 +- .../implementation/UnknownArraysImpl.java | 27 +- .../implementation/UnknownDictsImpl.java | 27 +- .../implementation/UnknownIntsImpl.java | 27 +- .../implementation/UnknownStringsImpl.java | 27 +- .../implementation/ValueTypesClientImpl.java | 29 +- .../com/type/scalar/ScalarClientBuilder.java | 25 +- .../implementation/BooleanOperationsImpl.java | 27 +- .../implementation/Decimal128TypesImpl.java | 44 +- .../Decimal128VerifiesImpl.java | 31 +- .../implementation/DecimalTypesImpl.java | 44 +- .../implementation/DecimalVerifiesImpl.java | 31 +- .../implementation/ScalarClientImpl.java | 29 +- .../implementation/StringOperationsImpl.java | 27 +- .../scalar/implementation/UnknownsImpl.java | 27 +- .../com/type/union/UnionClientBuilder.java | 24 +- .../union/implementation/EnumsOnliesImpl.java | 27 +- .../implementation/FloatsOnliesImpl.java | 27 +- .../union/implementation/IntsOnliesImpl.java | 27 +- .../implementation/MixedLiteralsImpl.java | 27 +- .../union/implementation/MixedTypesImpl.java | 27 +- .../implementation/ModelsOnliesImpl.java | 27 +- .../implementation/StringAndArraysImpl.java | 27 +- .../StringExtensibleNamedsImpl.java | 27 +- .../implementation/StringExtensiblesImpl.java | 27 +- .../implementation/StringsOnliesImpl.java | 27 +- .../union/implementation/UnionClientImpl.java | 29 +- .../example/basic/generated/BasicAction.java | 5 +- .../generated/AccessClientTestBase.java | 13 +- .../usage/generated/UsageClientTestBase.java | 7 +- .../basic/generated/BasicClientTestBase.java | 7 +- .../lro/rpc/generated/RpcClientTestBase.java | 7 +- .../generated/StandardClientTestBase.java | 7 +- .../model/generated/ModelClientTestBase.java | 7 +- .../page/generated/PageClientTestBase.java | 10 +- .../generated/ScalarClientTestBase.java | 7 +- .../generated/TraitsClientTestBase.java | 7 +- .../generated/AzureExampleClientTestBase.java | 8 +- .../generated/ApiKeyClientTestBase.java | 7 +- .../generated/CustomClientTestBase.java | 7 +- .../generated/OAuth2ClientTestBase.java | 7 +- .../union/generated/UnionClientTestBase.java | 7 +- .../XmsClientRequestIdClientTestBase.java | 8 +- .../generated/NamingClientTestBase.java | 19 +- .../bytes/generated/BytesClientTestBase.java | 31 +- .../generated/DatetimeClientTestBase.java | 22 +- .../generated/DurationClientTestBase.java | 19 +- .../basic/generated/BasicClientTestBase.java | 13 +- .../BodyOptionalityClientTestBase.java | 15 +- .../CollectionFormatClientTestBase.java | 15 +- .../generated/SpreadClientTestBase.java | 13 +- .../ContentNegotiationClientTestBase.java | 15 +- .../JsonMergePatchClientTestBase.java | 8 +- .../generated/MediaTypeClientTestBase.java | 4 +- .../generated/MultiPartClientTestBase.java | 4 +- .../generated/PageableClientTestBase.java | 7 +- .../json/generated/JsonClientTestBase.java | 7 +- .../ConditionalRequestClientTestBase.java | 8 +- .../RepeatabilityClientTestBase.java | 8 +- .../generated/SpecialWordsClientTestBase.java | 29 +- .../array/generated/ArrayClientTestBase.java | 70 ++- .../generated/DictionaryClientTestBase.java | 34 +- .../generated/ExtensibleClientTestBase.java | 4 +- .../fixed/generated/FixedClientTestBase.java | 7 +- .../empty/generated/EmptyClientTestBase.java | 7 +- .../generated/FlattenClientTestBase.java | 7 +- .../EnumDiscriminatorClientTestBase.java | 8 +- ...EnumNestedDiscriminatorClientTestBase.java | 5 +- .../NestedDiscriminatorClientTestBase.java | 8 +- .../NotDiscriminatedClientTestBase.java | 8 +- .../generated/RecursiveClientTestBase.java | 4 +- .../SingleDiscriminatorClientTestBase.java | 8 +- .../usage/generated/UsageClientTestBase.java | 7 +- .../generated/VisibilityClientTestBase.java | 4 +- .../AdditionalPropertiesClientTestBase.java | 195 ++++--- .../generated/NullableClientTestBase.java | 25 +- .../generated/OptionalClientTestBase.java | 52 +- .../generated/ValueTypesClientTestBase.java | 94 ++-- .../generated/ScalarClientTestBase.java | 28 +- .../union/generated/UnionClientTestBase.java | 55 +- 326 files changed, 8097 insertions(+), 4607 deletions(-) diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/AccessClientBuilder.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/AccessClientBuilder.java index 39003a1f55..b35ff4b2e7 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/AccessClientBuilder.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/AccessClientBuilder.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -49,8 +50,8 @@ InternalOperationAsyncClient.class, SharedModelInOperationAsyncClient.class, RelativeModelInOperationAsyncClient.class }) -public final class AccessClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class AccessClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -182,6 +183,22 @@ public AccessClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public AccessClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -209,7 +226,8 @@ public AccessClientBuilder retryPolicy(RetryPolicy retryPolicy) { private AccessClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - AccessClientImpl client = new AccessClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + AccessClientImpl client + = new AccessClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -217,6 +235,7 @@ private AccessClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/AccessClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/AccessClientImpl.java index e5f1fc646c..ae5fdc17a5 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/AccessClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/AccessClientImpl.java @@ -15,6 +15,20 @@ * Initializes a new instance of the AccessClient type. */ public final class AccessClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -101,19 +115,22 @@ public RelativeModelInOperationsImpl getRelativeModelInOperations() { /** * Initializes an instance of AccessClient client. + * + * @param endpoint Service host. */ - public AccessClientImpl() { + public AccessClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of AccessClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public AccessClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public AccessClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -121,10 +138,12 @@ public AccessClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public AccessClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public AccessClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.publicOperations = new PublicOperationsImpl(this); this.internalOperations = new InternalOperationsImpl(this); this.sharedModelInOperations = new SharedModelInOperationsImpl(this); diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/InternalOperationsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/InternalOperationsImpl.java index f0b3990416..d1cec38a8d 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/InternalOperationsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/InternalOperationsImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class InternalOperationsImpl { * The interface defining all the services for AccessClientInternalOperations to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AccessClientInternal") public interface InternalOperationsService { @Get("/azure/client-generator-core/access/internalOperation/noDecoratorInInternal") @@ -63,8 +64,9 @@ public interface InternalOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> noDecoratorInInternal(@QueryParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Mono> noDecoratorInInternal(@HostParam("endpoint") String endpoint, + @QueryParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/azure/client-generator-core/access/internalOperation/noDecoratorInInternal") @ExpectedResponses({ 200 }) @@ -72,8 +74,9 @@ Mono> noDecoratorInInternal(@QueryParam("name") String name @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response noDecoratorInInternalSync(@QueryParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Response noDecoratorInInternalSync(@HostParam("endpoint") String endpoint, + @QueryParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/azure/client-generator-core/access/internalOperation/internalDecoratorInInternal") @ExpectedResponses({ 200 }) @@ -81,8 +84,9 @@ Response noDecoratorInInternalSync(@QueryParam("name") String name, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> internalDecoratorInInternal(@QueryParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Mono> internalDecoratorInInternal(@HostParam("endpoint") String endpoint, + @QueryParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/azure/client-generator-core/access/internalOperation/internalDecoratorInInternal") @ExpectedResponses({ 200 }) @@ -90,8 +94,9 @@ Mono> internalDecoratorInInternal(@QueryParam("name") Strin @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response internalDecoratorInInternalSync(@QueryParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Response internalDecoratorInInternalSync(@HostParam("endpoint") String endpoint, + @QueryParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/azure/client-generator-core/access/internalOperation/publicDecoratorInInternal") @ExpectedResponses({ 200 }) @@ -99,8 +104,9 @@ Response internalDecoratorInInternalSync(@QueryParam("name") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> publicDecoratorInInternal(@QueryParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Mono> publicDecoratorInInternal(@HostParam("endpoint") String endpoint, + @QueryParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/azure/client-generator-core/access/internalOperation/publicDecoratorInInternal") @ExpectedResponses({ 200 }) @@ -108,8 +114,9 @@ Mono> publicDecoratorInInternal(@QueryParam("name") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response publicDecoratorInInternalSync(@QueryParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Response publicDecoratorInInternalSync(@HostParam("endpoint") String endpoint, + @QueryParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); } /** @@ -135,7 +142,8 @@ Response publicDecoratorInInternalSync(@QueryParam("name") String na public Mono> noDecoratorInInternalWithResponseAsync(String name, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.noDecoratorInInternal(name, accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.noDecoratorInInternal(this.client.getEndpoint(), name, accept, requestOptions, context)); } /** @@ -159,7 +167,7 @@ public Mono> noDecoratorInInternalWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) public Response noDecoratorInInternalWithResponse(String name, RequestOptions requestOptions) { final String accept = "application/json"; - return service.noDecoratorInInternalSync(name, accept, requestOptions, Context.NONE); + return service.noDecoratorInInternalSync(this.client.getEndpoint(), name, accept, requestOptions, Context.NONE); } /** @@ -185,8 +193,8 @@ public Response noDecoratorInInternalWithResponse(String name, Reque public Mono> internalDecoratorInInternalWithResponseAsync(String name, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.internalDecoratorInInternal(name, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.internalDecoratorInInternal(this.client.getEndpoint(), name, + accept, requestOptions, context)); } /** @@ -210,7 +218,8 @@ public Mono> internalDecoratorInInternalWithResponseAsync(S @ServiceMethod(returns = ReturnType.SINGLE) public Response internalDecoratorInInternalWithResponse(String name, RequestOptions requestOptions) { final String accept = "application/json"; - return service.internalDecoratorInInternalSync(name, accept, requestOptions, Context.NONE); + return service.internalDecoratorInInternalSync(this.client.getEndpoint(), name, accept, requestOptions, + Context.NONE); } /** @@ -236,8 +245,8 @@ public Response internalDecoratorInInternalWithResponse(String name, public Mono> publicDecoratorInInternalWithResponseAsync(String name, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.publicDecoratorInInternal(name, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.publicDecoratorInInternal(this.client.getEndpoint(), name, + accept, requestOptions, context)); } /** @@ -262,6 +271,7 @@ public Mono> publicDecoratorInInternalWithResponseAsync(Str @ServiceMethod(returns = ReturnType.SINGLE) public Response publicDecoratorInInternalWithResponse(String name, RequestOptions requestOptions) { final String accept = "application/json"; - return service.publicDecoratorInInternalSync(name, accept, requestOptions, Context.NONE); + return service.publicDecoratorInInternalSync(this.client.getEndpoint(), name, accept, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/PublicOperationsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/PublicOperationsImpl.java index d50ff927b4..e6aaefc24a 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/PublicOperationsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/PublicOperationsImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class PublicOperationsImpl { * The interface defining all the services for AccessClientPublicOperations to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AccessClientPublicOp") public interface PublicOperationsService { @Get("/azure/client-generator-core/access/publicOperation/noDecoratorInPublic") @@ -63,8 +64,9 @@ public interface PublicOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> noDecoratorInPublic(@QueryParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Mono> noDecoratorInPublic(@HostParam("endpoint") String endpoint, + @QueryParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/azure/client-generator-core/access/publicOperation/noDecoratorInPublic") @ExpectedResponses({ 200 }) @@ -72,8 +74,9 @@ Mono> noDecoratorInPublic(@QueryParam("name") String name, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response noDecoratorInPublicSync(@QueryParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Response noDecoratorInPublicSync(@HostParam("endpoint") String endpoint, + @QueryParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/azure/client-generator-core/access/publicOperation/publicDecoratorInPublic") @ExpectedResponses({ 200 }) @@ -81,8 +84,9 @@ Response noDecoratorInPublicSync(@QueryParam("name") String name, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> publicDecoratorInPublic(@QueryParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Mono> publicDecoratorInPublic(@HostParam("endpoint") String endpoint, + @QueryParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/azure/client-generator-core/access/publicOperation/publicDecoratorInPublic") @ExpectedResponses({ 200 }) @@ -90,8 +94,9 @@ Mono> publicDecoratorInPublic(@QueryParam("name") String na @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response publicDecoratorInPublicSync(@QueryParam("name") String name, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Response publicDecoratorInPublicSync(@HostParam("endpoint") String endpoint, + @QueryParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); } /** @@ -116,7 +121,8 @@ Response publicDecoratorInPublicSync(@QueryParam("name") String name @ServiceMethod(returns = ReturnType.SINGLE) public Mono> noDecoratorInPublicWithResponseAsync(String name, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.noDecoratorInPublic(name, accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.noDecoratorInPublic(this.client.getEndpoint(), name, accept, requestOptions, context)); } /** @@ -140,7 +146,7 @@ public Mono> noDecoratorInPublicWithResponseAsync(String na @ServiceMethod(returns = ReturnType.SINGLE) public Response noDecoratorInPublicWithResponse(String name, RequestOptions requestOptions) { final String accept = "application/json"; - return service.noDecoratorInPublicSync(name, accept, requestOptions, Context.NONE); + return service.noDecoratorInPublicSync(this.client.getEndpoint(), name, accept, requestOptions, Context.NONE); } /** @@ -166,7 +172,8 @@ public Response noDecoratorInPublicWithResponse(String name, Request public Mono> publicDecoratorInPublicWithResponseAsync(String name, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.publicDecoratorInPublic(name, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.publicDecoratorInPublic(this.client.getEndpoint(), name, accept, + requestOptions, context)); } /** @@ -190,6 +197,7 @@ public Mono> publicDecoratorInPublicWithResponseAsync(Strin @ServiceMethod(returns = ReturnType.SINGLE) public Response publicDecoratorInPublicWithResponse(String name, RequestOptions requestOptions) { final String accept = "application/json"; - return service.publicDecoratorInPublicSync(name, accept, requestOptions, Context.NONE); + return service.publicDecoratorInPublicSync(this.client.getEndpoint(), name, accept, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/RelativeModelInOperationsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/RelativeModelInOperationsImpl.java index a475dde8cc..4f77f36c60 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/RelativeModelInOperationsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/RelativeModelInOperationsImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class RelativeModelInOperationsImpl { * The interface defining all the services for AccessClientRelativeModelInOperations to be used by the proxy service * to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AccessClientRelative") public interface RelativeModelInOperationsService { @Get("/azure/client-generator-core/access/relativeModelInOperation/operation") @@ -63,8 +64,8 @@ public interface RelativeModelInOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> operation(@QueryParam("name") String name, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> operation(@HostParam("endpoint") String endpoint, @QueryParam("name") String name, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/relativeModelInOperation/operation") @ExpectedResponses({ 200 }) @@ -72,8 +73,8 @@ Mono> operation(@QueryParam("name") String name, @HeaderPar @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response operationSync(@QueryParam("name") String name, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Response operationSync(@HostParam("endpoint") String endpoint, @QueryParam("name") String name, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/relativeModelInOperation/discriminator") @ExpectedResponses({ 200 }) @@ -81,8 +82,9 @@ Response operationSync(@QueryParam("name") String name, @HeaderParam @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> discriminator(@QueryParam("kind") String kind, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> discriminator(@HostParam("endpoint") String endpoint, + @QueryParam("kind") String kind, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/azure/client-generator-core/access/relativeModelInOperation/discriminator") @ExpectedResponses({ 200 }) @@ -90,8 +92,8 @@ Mono> discriminator(@QueryParam("kind") String kind, @Heade @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response discriminatorSync(@QueryParam("kind") String kind, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Response discriminatorSync(@HostParam("endpoint") String endpoint, @QueryParam("kind") String kind, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -129,7 +131,8 @@ Response discriminatorSync(@QueryParam("kind") String kind, @HeaderP @ServiceMethod(returns = ReturnType.SINGLE) public Mono> operationWithResponseAsync(String name, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.operation(name, accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.operation(this.client.getEndpoint(), name, accept, requestOptions, context)); } /** @@ -166,7 +169,7 @@ public Mono> operationWithResponseAsync(String name, Reques @ServiceMethod(returns = ReturnType.SINGLE) public Response operationWithResponse(String name, RequestOptions requestOptions) { final String accept = "application/json"; - return service.operationSync(name, accept, requestOptions, Context.NONE); + return service.operationSync(this.client.getEndpoint(), name, accept, requestOptions, Context.NONE); } /** @@ -199,7 +202,8 @@ public Response operationWithResponse(String name, RequestOptions re @ServiceMethod(returns = ReturnType.SINGLE) public Mono> discriminatorWithResponseAsync(String kind, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.discriminator(kind, accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.discriminator(this.client.getEndpoint(), kind, accept, requestOptions, context)); } /** @@ -231,6 +235,6 @@ public Mono> discriminatorWithResponseAsync(String kind, Re @ServiceMethod(returns = ReturnType.SINGLE) public Response discriminatorWithResponse(String kind, RequestOptions requestOptions) { final String accept = "application/json"; - return service.discriminatorSync(kind, accept, requestOptions, Context.NONE); + return service.discriminatorSync(this.client.getEndpoint(), kind, accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/SharedModelInOperationsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/SharedModelInOperationsImpl.java index ba5e9df97d..62910d08de 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/SharedModelInOperationsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/implementation/SharedModelInOperationsImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class SharedModelInOperationsImpl { * The interface defining all the services for AccessClientSharedModelInOperations to be used by the proxy service * to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AccessClientSharedMo") public interface SharedModelInOperationsService { @Get("/azure/client-generator-core/access/sharedModelInOperation/public") @@ -63,8 +64,8 @@ public interface SharedModelInOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> publicMethod(@QueryParam("name") String name, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> publicMethod(@HostParam("endpoint") String endpoint, @QueryParam("name") String name, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/sharedModelInOperation/public") @ExpectedResponses({ 200 }) @@ -72,8 +73,8 @@ Mono> publicMethod(@QueryParam("name") String name, @Header @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response publicMethodSync(@QueryParam("name") String name, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Response publicMethodSync(@HostParam("endpoint") String endpoint, @QueryParam("name") String name, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/sharedModelInOperation/internal") @ExpectedResponses({ 200 }) @@ -81,8 +82,8 @@ Response publicMethodSync(@QueryParam("name") String name, @HeaderPa @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> internal(@QueryParam("name") String name, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> internal(@HostParam("endpoint") String endpoint, @QueryParam("name") String name, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/access/sharedModelInOperation/internal") @ExpectedResponses({ 200 }) @@ -90,8 +91,8 @@ Mono> internal(@QueryParam("name") String name, @HeaderPara @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response internalSync(@QueryParam("name") String name, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Response internalSync(@HostParam("endpoint") String endpoint, @QueryParam("name") String name, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -116,7 +117,8 @@ Response internalSync(@QueryParam("name") String name, @HeaderParam( @ServiceMethod(returns = ReturnType.SINGLE) public Mono> publicMethodWithResponseAsync(String name, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.publicMethod(name, accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.publicMethod(this.client.getEndpoint(), name, accept, requestOptions, context)); } /** @@ -140,7 +142,7 @@ public Mono> publicMethodWithResponseAsync(String name, Req @ServiceMethod(returns = ReturnType.SINGLE) public Response publicMethodWithResponse(String name, RequestOptions requestOptions) { final String accept = "application/json"; - return service.publicMethodSync(name, accept, requestOptions, Context.NONE); + return service.publicMethodSync(this.client.getEndpoint(), name, accept, requestOptions, Context.NONE); } /** @@ -165,7 +167,8 @@ public Response publicMethodWithResponse(String name, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> internalWithResponseAsync(String name, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.internal(name, accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.internal(this.client.getEndpoint(), name, accept, requestOptions, context)); } /** @@ -189,6 +192,6 @@ public Mono> internalWithResponseAsync(String name, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response internalWithResponse(String name, RequestOptions requestOptions) { final String accept = "application/json"; - return service.internalSync(name, accept, requestOptions, Context.NONE); + return service.internalSync(this.client.getEndpoint(), name, accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/UsageClientBuilder.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/UsageClientBuilder.java index 2c0f549df6..1a7076c567 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/UsageClientBuilder.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/UsageClientBuilder.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,7 +41,8 @@ * A builder for creating a new instance of the UsageClient type. */ @ServiceClientBuilder(serviceClients = { UsageClient.class, UsageAsyncClient.class }) -public final class UsageClientBuilder implements HttpTrait, ConfigurationTrait { +public final class UsageClientBuilder implements HttpTrait, ConfigurationTrait, + EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -172,6 +174,22 @@ public UsageClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public UsageClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -199,7 +217,8 @@ public UsageClientBuilder retryPolicy(RetryPolicy retryPolicy) { private UsageClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - UsageClientImpl client = new UsageClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + UsageClientImpl client + = new UsageClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -207,6 +226,7 @@ private UsageClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/implementation/ModelInOperationsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/implementation/ModelInOperationsImpl.java index a8cd183108..4c8f3a930b 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/implementation/ModelInOperationsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/implementation/ModelInOperationsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; @@ -56,7 +57,7 @@ public final class ModelInOperationsImpl { * The interface defining all the services for UsageClientModelInOperations to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "UsageClientModelInOp") public interface ModelInOperationsService { @Post("/azure/client-generator-core/usage/inputToInputOutput") @@ -65,8 +66,9 @@ public interface ModelInOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> inputToInputOutput(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> inputToInputOutput(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/azure/client-generator-core/usage/inputToInputOutput") @ExpectedResponses({ 204 }) @@ -74,8 +76,9 @@ Mono> inputToInputOutput(@HeaderParam("Content-Type") String cont @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response inputToInputOutputSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response inputToInputOutputSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/usage/outputToInputOutput") @ExpectedResponses({ 200 }) @@ -83,8 +86,8 @@ Response inputToInputOutputSync(@HeaderParam("Content-Type") String conten @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> outputToInputOutput(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> outputToInputOutput(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/client-generator-core/usage/outputToInputOutput") @ExpectedResponses({ 200 }) @@ -92,8 +95,8 @@ Mono> outputToInputOutput(@HeaderParam("Accept") String acc @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response outputToInputOutputSync(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Response outputToInputOutputSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/azure/client-generator-core/usage/modelInReadOnlyProperty") @ExpectedResponses({ 200 }) @@ -101,9 +104,9 @@ Response outputToInputOutputSync(@HeaderParam("Accept") String accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> modelInReadOnlyProperty(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> modelInReadOnlyProperty(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/azure/client-generator-core/usage/modelInReadOnlyProperty") @ExpectedResponses({ 200 }) @@ -111,9 +114,9 @@ Mono> modelInReadOnlyProperty(@HeaderParam("Content-Type") @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response modelInReadOnlyPropertySync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response modelInReadOnlyPropertySync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -142,7 +145,8 @@ Response modelInReadOnlyPropertySync(@HeaderParam("Content-Type") St @ServiceMethod(returns = ReturnType.SINGLE) public Mono> inputToInputOutputWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.inputToInputOutput(contentType, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.inputToInputOutput(this.client.getEndpoint(), contentType, body, + requestOptions, context)); } /** @@ -171,7 +175,8 @@ public Mono> inputToInputOutputWithResponseAsync(BinaryData body, @ServiceMethod(returns = ReturnType.SINGLE) public Response inputToInputOutputWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.inputToInputOutputSync(contentType, body, requestOptions, Context.NONE); + return service.inputToInputOutputSync(this.client.getEndpoint(), contentType, body, requestOptions, + Context.NONE); } /** @@ -199,7 +204,8 @@ public Response inputToInputOutputWithResponse(BinaryData body, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> outputToInputOutputWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.outputToInputOutput(accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.outputToInputOutput(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -227,7 +233,7 @@ public Mono> outputToInputOutputWithResponseAsync(RequestOp @ServiceMethod(returns = ReturnType.SINGLE) public Response outputToInputOutputWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.outputToInputOutputSync(accept, requestOptions, Context.NONE); + return service.outputToInputOutputSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -280,8 +286,8 @@ public Mono> modelInReadOnlyPropertyWithResponseAsync(Binar RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.modelInReadOnlyProperty(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.modelInReadOnlyProperty(this.client.getEndpoint(), contentType, + accept, body, requestOptions, context)); } /** @@ -333,6 +339,7 @@ public Mono> modelInReadOnlyPropertyWithResponseAsync(Binar public Response modelInReadOnlyPropertyWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.modelInReadOnlyPropertySync(contentType, accept, body, requestOptions, Context.NONE); + return service.modelInReadOnlyPropertySync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/implementation/UsageClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/implementation/UsageClientImpl.java index 98db3aa8b3..72ec8e251a 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/implementation/UsageClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/implementation/UsageClientImpl.java @@ -15,6 +15,20 @@ * Initializes a new instance of the UsageClient type. */ public final class UsageClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -59,19 +73,22 @@ public ModelInOperationsImpl getModelInOperations() { /** * Initializes an instance of UsageClient client. + * + * @param endpoint Service host. */ - public UsageClientImpl() { + public UsageClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of UsageClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public UsageClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public UsageClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -79,10 +96,12 @@ public UsageClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public UsageClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public UsageClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.modelInOperations = new ModelInOperationsImpl(this); } } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/BasicClientBuilder.java b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/BasicClientBuilder.java index 4ad1db38c1..5eb4fb0cf8 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/BasicClientBuilder.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/BasicClientBuilder.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,7 +41,8 @@ * A builder for creating a new instance of the BasicClient type. */ @ServiceClientBuilder(serviceClients = { BasicClient.class, BasicAsyncClient.class }) -public final class BasicClientBuilder implements HttpTrait, ConfigurationTrait { +public final class BasicClientBuilder implements HttpTrait, ConfigurationTrait, + EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -172,6 +174,22 @@ public BasicClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public BasicClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * Service version */ @@ -219,8 +237,8 @@ private BasicClientImpl buildInnerClient() { HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); BasicServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : BasicServiceVersion.getLatest(); - BasicClientImpl client - = new BasicClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localServiceVersion); + BasicClientImpl client = new BasicClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), + this.endpoint, localServiceVersion); return client; } @@ -228,6 +246,7 @@ private BasicClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java index 3ca295636d..20ae11448b 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/implementation/BasicClientImpl.java @@ -11,6 +11,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Post; @@ -55,6 +56,20 @@ public final class BasicClientImpl { */ private final BasicClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * Service version. */ @@ -100,21 +115,23 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of BasicClient client. * + * @param endpoint Service host. * @param serviceVersion Service version. */ - public BasicClientImpl(BasicServiceVersion serviceVersion) { + public BasicClientImpl(String endpoint, BasicServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** * Initializes an instance of BasicClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. * @param serviceVersion Service version. */ - public BasicClientImpl(HttpPipeline httpPipeline, BasicServiceVersion serviceVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), serviceVersion); + public BasicClientImpl(HttpPipeline httpPipeline, String endpoint, BasicServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** @@ -122,12 +139,14 @@ public BasicClientImpl(HttpPipeline httpPipeline, BasicServiceVersion serviceVer * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. * @param serviceVersion Service version. */ - public BasicClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + public BasicClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, BasicServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.serviceVersion = serviceVersion; this.service = RestProxy.create(BasicClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -135,7 +154,7 @@ public BasicClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAd /** * The interface defining all the services for BasicClient to be used by the proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "BasicClient") public interface BasicClientService { @Patch("/azure/core/basic/users/{id}") @@ -144,7 +163,8 @@ public interface BasicClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdate(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("id") int id, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -155,7 +175,8 @@ Mono> createOrUpdate(@QueryParam("api-version") String apiV @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createOrUpdateSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("id") int id, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -166,10 +187,10 @@ Response createOrUpdateSync(@QueryParam("api-version") String apiVer @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrReplace(@QueryParam("api-version") String apiVersion, - @PathParam("id") int id, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + Mono> createOrReplace(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("id") int id, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Put("/azure/core/basic/users/{id}") @ExpectedResponses({ 200, 201 }) @@ -177,7 +198,8 @@ Mono> createOrReplace(@QueryParam("api-version") String api @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createOrReplaceSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, + Response createOrReplaceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("id") int id, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @@ -187,8 +209,9 @@ Response createOrReplaceSync(@QueryParam("api-version") String apiVe @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("id") int id, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/azure/core/basic/users/{id}") @ExpectedResponses({ 200 }) @@ -196,8 +219,9 @@ Mono> get(@QueryParam("api-version") String apiVersion, @Pa @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("id") int id, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/azure/core/basic/users") @ExpectedResponses({ 200 }) @@ -205,8 +229,9 @@ Response getSync(@QueryParam("api-version") String apiVersion, @Path @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/azure/core/basic/users") @ExpectedResponses({ 200 }) @@ -214,8 +239,9 @@ Mono> list(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Delete("/azure/core/basic/users/{id}") @ExpectedResponses({ 204 }) @@ -223,8 +249,9 @@ Response listSync(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("id") int id, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Delete("/azure/core/basic/users/{id}") @ExpectedResponses({ 204 }) @@ -232,8 +259,9 @@ Mono> delete(@QueryParam("api-version") String apiVersion, @PathP @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("id") int id, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Post("/azure/core/basic/users/{id}:export") @ExpectedResponses({ 200 }) @@ -241,9 +269,9 @@ Response deleteSync(@QueryParam("api-version") String apiVersion, @PathPar @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> export(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @QueryParam("format") String format, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> export(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("id") int id, @QueryParam("format") String format, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/azure/core/basic/users/{id}:export") @ExpectedResponses({ 200 }) @@ -251,9 +279,9 @@ Mono> export(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response exportSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @QueryParam("format") String format, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response exportSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("id") int id, @QueryParam("format") String format, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -262,7 +290,8 @@ Response exportSync(@QueryParam("api-version") String apiVersion, @P @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -271,7 +300,8 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = tru @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); } /** @@ -326,8 +356,8 @@ public Mono> createOrUpdateWithResponseAsync(int id, Binary RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdate(this.getServiceVersion().getVersion(), id, - contentType, accept, resource, requestOptions, context)); + return FluxUtil.withContext(context -> service.createOrUpdate(this.getEndpoint(), + this.getServiceVersion().getVersion(), id, contentType, accept, resource, requestOptions, context)); } /** @@ -381,8 +411,8 @@ public Mono> createOrUpdateWithResponseAsync(int id, Binary public Response createOrUpdateWithResponse(int id, BinaryData resource, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.getServiceVersion().getVersion(), id, contentType, accept, resource, - requestOptions, Context.NONE); + return service.createOrUpdateSync(this.getEndpoint(), this.getServiceVersion().getVersion(), id, contentType, + accept, resource, requestOptions, Context.NONE); } /** @@ -437,8 +467,8 @@ public Mono> createOrReplaceWithResponseAsync(int id, Binar RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrReplace(this.getServiceVersion().getVersion(), id, - contentType, accept, resource, requestOptions, context)); + return FluxUtil.withContext(context -> service.createOrReplace(this.getEndpoint(), + this.getServiceVersion().getVersion(), id, contentType, accept, resource, requestOptions, context)); } /** @@ -493,8 +523,8 @@ public Response createOrReplaceWithResponse(int id, BinaryData resou RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrReplaceSync(this.getServiceVersion().getVersion(), id, contentType, accept, resource, - requestOptions, Context.NONE); + return service.createOrReplaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), id, contentType, + accept, resource, requestOptions, Context.NONE); } /** @@ -531,8 +561,8 @@ public Response createOrReplaceWithResponse(int id, BinaryData resou @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(int id, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.get(this.getServiceVersion().getVersion(), id, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.getEndpoint(), this.getServiceVersion().getVersion(), + id, accept, requestOptions, context)); } /** @@ -569,7 +599,8 @@ public Mono> getWithResponseAsync(int id, RequestOptions re @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(int id, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(this.getServiceVersion().getVersion(), id, accept, requestOptions, Context.NONE); + return service.getSync(this.getEndpoint(), this.getServiceVersion().getVersion(), id, accept, requestOptions, + Context.NONE); } /** @@ -620,8 +651,8 @@ public Response getWithResponse(int id, RequestOptions requestOption private Mono> listSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.list(this.getServiceVersion().getVersion(), accept, requestOptions, context)) + .withContext(context -> service.list(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -746,8 +777,8 @@ public PagedFlux listAsync(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(RequestOptions requestOptions) { final String accept = "application/json"; - Response res - = service.listSync(this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + Response res = service.listSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } @@ -841,8 +872,8 @@ public PagedIterable list(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteWithResponseAsync(int id, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.delete(this.getServiceVersion().getVersion(), id, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.delete(this.getEndpoint(), this.getServiceVersion().getVersion(), + id, accept, requestOptions, context)); } /** @@ -861,7 +892,8 @@ public Mono> deleteWithResponseAsync(int id, RequestOptions reque @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(int id, RequestOptions requestOptions) { final String accept = "application/json"; - return service.deleteSync(this.getServiceVersion().getVersion(), id, accept, requestOptions, Context.NONE); + return service.deleteSync(this.getEndpoint(), this.getServiceVersion().getVersion(), id, accept, requestOptions, + Context.NONE); } /** @@ -897,8 +929,8 @@ public Response deleteWithResponse(int id, RequestOptions requestOptions) @ServiceMethod(returns = ReturnType.SINGLE) public Mono> exportWithResponseAsync(int id, String format, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.export(this.getServiceVersion().getVersion(), id, format, accept, - requestOptions, context)); + return FluxUtil.withContext(context -> service.export(this.getEndpoint(), this.getServiceVersion().getVersion(), + id, format, accept, requestOptions, context)); } /** @@ -934,8 +966,8 @@ public Mono> exportWithResponseAsync(int id, String format, @ServiceMethod(returns = ReturnType.SINGLE) public Response exportWithResponse(int id, String format, RequestOptions requestOptions) { final String accept = "application/json"; - return service.exportSync(this.getServiceVersion().getVersion(), id, format, accept, requestOptions, - Context.NONE); + return service.exportSync(this.getEndpoint(), this.getServiceVersion().getVersion(), id, format, accept, + requestOptions, Context.NONE); } /** @@ -970,7 +1002,8 @@ public Response exportWithResponse(int id, String format, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, accept, requestOptions, context)) + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -1007,7 +1040,8 @@ private Mono> listNextSinglePageAsync(String nextLink, @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listNextSync(nextLink, accept, requestOptions, Context.NONE); + Response res + = service.listNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/RpcClientBuilder.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/RpcClientBuilder.java index 681162180a..cae3c9be65 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/RpcClientBuilder.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/RpcClientBuilder.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,7 +41,8 @@ * A builder for creating a new instance of the RpcClient type. */ @ServiceClientBuilder(serviceClients = { RpcClient.class, RpcAsyncClient.class }) -public final class RpcClientBuilder implements HttpTrait, ConfigurationTrait { +public final class RpcClientBuilder + implements HttpTrait, ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -172,6 +174,22 @@ public RpcClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public RpcClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * Service version */ @@ -219,8 +237,8 @@ private RpcClientImpl buildInnerClient() { HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); RpcServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : RpcServiceVersion.getLatest(); - RpcClientImpl client - = new RpcClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localServiceVersion); + RpcClientImpl client = new RpcClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), + this.endpoint, localServiceVersion); return client; } @@ -228,6 +246,7 @@ private RpcClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/implementation/RpcClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/implementation/RpcClientImpl.java index 996c4a46a3..c8f5a11840 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/implementation/RpcClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/implementation/RpcClientImpl.java @@ -10,6 +10,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -49,6 +50,20 @@ public final class RpcClientImpl { */ private final RpcClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * Service version. */ @@ -94,21 +109,23 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of RpcClient client. * + * @param endpoint Service host. * @param serviceVersion Service version. */ - public RpcClientImpl(RpcServiceVersion serviceVersion) { + public RpcClientImpl(String endpoint, RpcServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** * Initializes an instance of RpcClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. * @param serviceVersion Service version. */ - public RpcClientImpl(HttpPipeline httpPipeline, RpcServiceVersion serviceVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), serviceVersion); + public RpcClientImpl(HttpPipeline httpPipeline, String endpoint, RpcServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** @@ -116,12 +133,14 @@ public RpcClientImpl(HttpPipeline httpPipeline, RpcServiceVersion serviceVersion * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. * @param serviceVersion Service version. */ - public RpcClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + public RpcClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, RpcServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.serviceVersion = serviceVersion; this.service = RestProxy.create(RpcClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -129,7 +148,7 @@ public RpcClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdap /** * The interface defining all the services for RpcClient to be used by the proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "RpcClient") public interface RpcClientService { @Post("/azure/core/lro/rpc/generations:submit") @@ -138,9 +157,10 @@ public interface RpcClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> longRunningRpc(@QueryParam("api-version") String apiVersion, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> longRunningRpc(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/azure/core/lro/rpc/generations:submit") @ExpectedResponses({ 202 }) @@ -148,9 +168,10 @@ Mono> longRunningRpc(@QueryParam("api-version") String apiV @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response longRunningRpcSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response longRunningRpcSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -196,8 +217,8 @@ Response longRunningRpcSync(@QueryParam("api-version") String apiVer private Mono> longRunningRpcWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.longRunningRpc(this.getServiceVersion().getVersion(), - contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.longRunningRpc(this.getEndpoint(), + this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context)); } /** @@ -242,8 +263,8 @@ private Mono> longRunningRpcWithResponseAsync(BinaryData bo private Response longRunningRpcWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.longRunningRpcSync(this.getServiceVersion().getVersion(), contentType, accept, body, - requestOptions, Context.NONE); + return service.longRunningRpcSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, + accept, body, requestOptions, Context.NONE); } /** @@ -290,7 +311,7 @@ public PollerFlux beginLongRunningRpcAsync(BinaryData bo () -> this.longRunningRpcWithResponseAsync(body, requestOptions), new com._specs_.azure.core.lro.rpc.implementation.OperationLocationPollingStrategy<>( new PollingStrategyOptions(this.getHttpPipeline()) - + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE) @@ -343,7 +364,7 @@ public SyncPoller beginLongRunningRpc(BinaryData body, R () -> this.longRunningRpcWithResponse(body, requestOptions), new com._specs_.azure.core.lro.rpc.implementation.SyncOperationLocationPollingStrategy<>( new PollingStrategyOptions(this.getHttpPipeline()) - + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE) @@ -397,7 +418,7 @@ public PollerFlux beginLongRunningRpcWit () -> this.longRunningRpcWithResponseAsync(body, requestOptions), new com._specs_.azure.core.lro.rpc.implementation.OperationLocationPollingStrategy<>( new PollingStrategyOptions(this.getHttpPipeline()) - + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE) @@ -452,7 +473,7 @@ public SyncPoller beginLongRunningRpcWit () -> this.longRunningRpcWithResponse(body, requestOptions), new com._specs_.azure.core.lro.rpc.implementation.SyncOperationLocationPollingStrategy<>( new PollingStrategyOptions(this.getHttpPipeline()) - + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE) diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/StandardClientBuilder.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/StandardClientBuilder.java index 6ab779db9e..5a63fad907 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/StandardClientBuilder.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/StandardClientBuilder.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,8 +41,8 @@ * A builder for creating a new instance of the StandardClient type. */ @ServiceClientBuilder(serviceClients = { StandardClient.class, StandardAsyncClient.class }) -public final class StandardClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class StandardClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -173,6 +174,22 @@ public StandardClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public StandardClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * Service version */ @@ -221,7 +238,7 @@ private StandardClientImpl buildInnerClient() { StandardServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : StandardServiceVersion.getLatest(); StandardClientImpl client = new StandardClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), localServiceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); return client; } @@ -229,6 +246,7 @@ private StandardClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/implementation/StandardClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/implementation/StandardClientImpl.java index 2e2ff4667f..f7e54a273b 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/implementation/StandardClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/implementation/StandardClientImpl.java @@ -12,6 +12,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; @@ -53,6 +54,20 @@ public final class StandardClientImpl { */ private final StandardClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * Service version. */ @@ -98,21 +113,23 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of StandardClient client. * + * @param endpoint Service host. * @param serviceVersion Service version. */ - public StandardClientImpl(StandardServiceVersion serviceVersion) { + public StandardClientImpl(String endpoint, StandardServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** * Initializes an instance of StandardClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. * @param serviceVersion Service version. */ - public StandardClientImpl(HttpPipeline httpPipeline, StandardServiceVersion serviceVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), serviceVersion); + public StandardClientImpl(HttpPipeline httpPipeline, String endpoint, StandardServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** @@ -120,12 +137,14 @@ public StandardClientImpl(HttpPipeline httpPipeline, StandardServiceVersion serv * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. * @param serviceVersion Service version. */ - public StandardClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + public StandardClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, StandardServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.serviceVersion = serviceVersion; this.service = RestProxy.create(StandardClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -133,7 +152,7 @@ public StandardClientImpl(HttpPipeline httpPipeline, SerializerAdapter serialize /** * The interface defining all the services for StandardClient to be used by the proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "StandardClient") public interface StandardClientService { @Put("/azure/core/lro/standard/users/{name}") @@ -142,10 +161,10 @@ public interface StandardClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrReplace(@QueryParam("api-version") String apiVersion, - @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + Mono> createOrReplace(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Put("/azure/core/lro/standard/users/{name}") @ExpectedResponses({ 200, 201 }) @@ -153,10 +172,10 @@ Mono> createOrReplace(@QueryParam("api-version") String api @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createOrReplaceSync(@QueryParam("api-version") String apiVersion, - @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData resource, - RequestOptions requestOptions, Context context); + Response createOrReplaceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); @Delete("/azure/core/lro/standard/users/{name}") @ExpectedResponses({ 202 }) @@ -164,7 +183,8 @@ Response createOrReplaceSync(@QueryParam("api-version") String apiVe @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete(@QueryParam("api-version") String apiVersion, @PathParam("name") String name, + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/azure/core/lro/standard/users/{name}") @@ -173,7 +193,8 @@ Mono> delete(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteSync(@QueryParam("api-version") String apiVersion, @PathParam("name") String name, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/azure/core/lro/standard/users/{name}:export") @@ -182,7 +203,8 @@ Response deleteSync(@QueryParam("api-version") String apiVersion, @P @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> export(@QueryParam("api-version") String apiVersion, @PathParam("name") String name, + Mono> export(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("name") String name, @QueryParam("format") String format, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @@ -192,7 +214,8 @@ Mono> export(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response exportSync(@QueryParam("api-version") String apiVersion, @PathParam("name") String name, + Response exportSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("name") String name, @QueryParam("format") String format, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } @@ -233,8 +256,8 @@ private Mono> createOrReplaceWithResponseAsync(String name, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrReplace(this.getServiceVersion().getVersion(), name, - contentType, accept, resource, requestOptions, context)); + return FluxUtil.withContext(context -> service.createOrReplace(this.getEndpoint(), + this.getServiceVersion().getVersion(), name, contentType, accept, resource, requestOptions, context)); } /** @@ -273,8 +296,8 @@ private Response createOrReplaceWithResponse(String name, BinaryData RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrReplaceSync(this.getServiceVersion().getVersion(), name, contentType, accept, resource, - requestOptions, Context.NONE); + return service.createOrReplaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), name, contentType, + accept, resource, requestOptions, Context.NONE); } /** @@ -315,7 +338,7 @@ public PollerFlux beginCreateOrReplaceAsync(String name, () -> this.createOrReplaceWithResponseAsync(name, resource, requestOptions), new com._specs_.azure.core.lro.standard.implementation.OperationLocationPollingStrategy<>( new PollingStrategyOptions(this.getHttpPipeline()) - + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE) @@ -361,7 +384,7 @@ public SyncPoller beginCreateOrReplace(String name, Bina () -> this.createOrReplaceWithResponse(name, resource, requestOptions), new com._specs_.azure.core.lro.standard.implementation.SyncOperationLocationPollingStrategy<>( new PollingStrategyOptions(this.getHttpPipeline()) - + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE) @@ -407,7 +430,7 @@ public PollerFlux beginCreateOrReplaceWithModelAsync () -> this.createOrReplaceWithResponseAsync(name, resource, requestOptions), new com._specs_.azure.core.lro.standard.implementation.OperationLocationPollingStrategy<>( new PollingStrategyOptions(this.getHttpPipeline()) - + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE) @@ -453,7 +476,7 @@ public SyncPoller beginCreateOrReplaceWithModel(Stri () -> this.createOrReplaceWithResponse(name, resource, requestOptions), new com._specs_.azure.core.lro.standard.implementation.SyncOperationLocationPollingStrategy<>( new PollingStrategyOptions(this.getHttpPipeline()) - + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE) @@ -494,8 +517,8 @@ public SyncPoller beginCreateOrReplaceWithModel(Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String name, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.delete(this.getServiceVersion().getVersion(), name, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.delete(this.getEndpoint(), this.getServiceVersion().getVersion(), + name, accept, requestOptions, context)); } /** @@ -530,7 +553,8 @@ private Mono> deleteWithResponseAsync(String name, RequestO @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String name, RequestOptions requestOptions) { final String accept = "application/json"; - return service.deleteSync(this.getServiceVersion().getVersion(), name, accept, requestOptions, Context.NONE); + return service.deleteSync(this.getEndpoint(), this.getServiceVersion().getVersion(), name, accept, + requestOptions, Context.NONE); } /** @@ -567,7 +591,7 @@ public PollerFlux beginDeleteAsync(String name, RequestOptions return PollerFlux.create(Duration.ofSeconds(1), () -> this.deleteWithResponseAsync(name, requestOptions), new com._specs_.azure.core.lro.standard.implementation.OperationLocationPollingStrategy<>( new PollingStrategyOptions(this.getHttpPipeline()) - + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE) @@ -609,7 +633,7 @@ public SyncPoller beginDelete(String name, RequestOptions requ return SyncPoller.createPoller(Duration.ofSeconds(1), () -> this.deleteWithResponse(name, requestOptions), new com._specs_.azure.core.lro.standard.implementation.SyncOperationLocationPollingStrategy<>( new PollingStrategyOptions(this.getHttpPipeline()) - + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE) @@ -652,7 +676,7 @@ public PollerFlux beginDeleteWithModelAsync(String n return PollerFlux.create(Duration.ofSeconds(1), () -> this.deleteWithResponseAsync(name, requestOptions), new com._specs_.azure.core.lro.standard.implementation.OperationLocationPollingStrategy<>( new PollingStrategyOptions(this.getHttpPipeline()) - + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE) @@ -694,7 +718,7 @@ public SyncPoller beginDeleteWithModel(String name, return SyncPoller.createPoller(Duration.ofSeconds(1), () -> this.deleteWithResponse(name, requestOptions), new com._specs_.azure.core.lro.standard.implementation.SyncOperationLocationPollingStrategy<>( new PollingStrategyOptions(this.getHttpPipeline()) - + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE) @@ -741,8 +765,8 @@ public SyncPoller beginDeleteWithModel(String name, private Mono> exportWithResponseAsync(String name, String format, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.export(this.getServiceVersion().getVersion(), name, format, - accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.export(this.getEndpoint(), this.getServiceVersion().getVersion(), + name, format, accept, requestOptions, context)); } /** @@ -782,8 +806,8 @@ private Mono> exportWithResponseAsync(String name, String f @ServiceMethod(returns = ReturnType.SINGLE) private Response exportWithResponse(String name, String format, RequestOptions requestOptions) { final String accept = "application/json"; - return service.exportSync(this.getServiceVersion().getVersion(), name, format, accept, requestOptions, - Context.NONE); + return service.exportSync(this.getEndpoint(), this.getServiceVersion().getVersion(), name, format, accept, + requestOptions, Context.NONE); } /** @@ -827,7 +851,7 @@ public PollerFlux beginExportAsync(String name, String f () -> this.exportWithResponseAsync(name, format, requestOptions), new com._specs_.azure.core.lro.standard.implementation.OperationLocationPollingStrategy<>( new PollingStrategyOptions(this.getHttpPipeline()) - + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE) @@ -876,7 +900,7 @@ public SyncPoller beginExport(String name, String format () -> this.exportWithResponse(name, format, requestOptions), new com._specs_.azure.core.lro.standard.implementation.SyncOperationLocationPollingStrategy<>( new PollingStrategyOptions(this.getHttpPipeline()) - + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE) @@ -926,7 +950,7 @@ public PollerFlux beginExportWithModelAsync( () -> this.exportWithResponseAsync(name, format, requestOptions), new com._specs_.azure.core.lro.standard.implementation.OperationLocationPollingStrategy<>( new PollingStrategyOptions(this.getHttpPipeline()) - + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE) @@ -976,7 +1000,7 @@ public SyncPoller beginExportWithModel(Strin () -> this.exportWithResponse(name, format, requestOptions), new com._specs_.azure.core.lro.standard.implementation.SyncOperationLocationPollingStrategy<>( new PollingStrategyOptions(this.getHttpPipeline()) - + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE) diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/model/ModelClientBuilder.java b/typespec-tests/src/main/java/com/_specs_/azure/core/model/ModelClientBuilder.java index 24a5ebd756..8bdb17f957 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/model/ModelClientBuilder.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/model/ModelClientBuilder.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,7 +41,8 @@ * A builder for creating a new instance of the ModelClient type. */ @ServiceClientBuilder(serviceClients = { ModelClient.class, ModelAsyncClient.class }) -public final class ModelClientBuilder implements HttpTrait, ConfigurationTrait { +public final class ModelClientBuilder implements HttpTrait, ConfigurationTrait, + EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -172,6 +174,22 @@ public ModelClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ModelClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * Service version */ @@ -219,8 +237,8 @@ private ModelClientImpl buildInnerClient() { HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); ModelServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : ModelServiceVersion.getLatest(); - ModelClientImpl client - = new ModelClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localServiceVersion); + ModelClientImpl client = new ModelClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), + this.endpoint, localServiceVersion); return client; } @@ -228,6 +246,7 @@ private ModelClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/model/implementation/AzureCoreEmbeddingVectorsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/model/implementation/AzureCoreEmbeddingVectorsImpl.java index 3942e716fe..ae6979705b 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/model/implementation/AzureCoreEmbeddingVectorsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/model/implementation/AzureCoreEmbeddingVectorsImpl.java @@ -10,6 +10,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; @@ -66,7 +67,7 @@ public ModelServiceVersion getServiceVersion() { * The interface defining all the services for ModelClientAzureCoreEmbeddingVectors to be used by the proxy service * to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ModelClientAzureCore") public interface AzureCoreEmbeddingVectorsService { @Get("/azure/core/model/embeddingVector") @@ -75,8 +76,8 @@ public interface AzureCoreEmbeddingVectorsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/azure/core/model/embeddingVector") @ExpectedResponses({ 200 }) @@ -84,8 +85,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/azure/core/model/embeddingVector") @ExpectedResponses({ 204 }) @@ -93,8 +94,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/azure/core/model/embeddingVector") @ExpectedResponses({ 204 }) @@ -102,7 +104,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/azure/core/model/embeddingVector") @@ -111,9 +113,9 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> post(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> post(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/azure/core/model/embeddingVector") @ExpectedResponses({ 200 }) @@ -121,9 +123,9 @@ Mono> post(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response postSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -146,7 +148,7 @@ Response postSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -169,7 +171,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -193,7 +195,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -217,7 +220,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -254,7 +257,8 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt public Mono> postWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.post(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.post(this.client.getEndpoint(), contentType, accept, body, requestOptions, context)); } /** @@ -291,6 +295,6 @@ public Mono> postWithResponseAsync(BinaryData body, Request public Response postWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.postSync(contentType, accept, body, requestOptions, Context.NONE); + return service.postSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/model/implementation/ModelClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/model/implementation/ModelClientImpl.java index 1453d155e2..5ea0743ef4 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/model/implementation/ModelClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/model/implementation/ModelClientImpl.java @@ -16,6 +16,20 @@ * Initializes a new instance of the ModelClient type. */ public final class ModelClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * Service version. */ @@ -75,21 +89,23 @@ public AzureCoreEmbeddingVectorsImpl getAzureCoreEmbeddingVectors() { /** * Initializes an instance of ModelClient client. * + * @param endpoint Service host. * @param serviceVersion Service version. */ - public ModelClientImpl(ModelServiceVersion serviceVersion) { + public ModelClientImpl(String endpoint, ModelServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** * Initializes an instance of ModelClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. * @param serviceVersion Service version. */ - public ModelClientImpl(HttpPipeline httpPipeline, ModelServiceVersion serviceVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), serviceVersion); + public ModelClientImpl(HttpPipeline httpPipeline, String endpoint, ModelServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** @@ -97,12 +113,14 @@ public ModelClientImpl(HttpPipeline httpPipeline, ModelServiceVersion serviceVer * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. * @param serviceVersion Service version. */ - public ModelClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + public ModelClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, ModelServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.serviceVersion = serviceVersion; this.azureCoreEmbeddingVectors = new AzureCoreEmbeddingVectorsImpl(this); } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/page/PageClientBuilder.java b/typespec-tests/src/main/java/com/_specs_/azure/core/page/PageClientBuilder.java index 177bf2dab8..a9d2b453c4 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/page/PageClientBuilder.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/page/PageClientBuilder.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -45,7 +46,8 @@ TwoModelsAsPageItemClient.class, PageAsyncClient.class, TwoModelsAsPageItemAsyncClient.class }) -public final class PageClientBuilder implements HttpTrait, ConfigurationTrait { +public final class PageClientBuilder + implements HttpTrait, ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -176,6 +178,22 @@ public PageClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public PageClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * Service version */ @@ -223,8 +241,8 @@ private PageClientImpl buildInnerClient() { HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); PageServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : PageServiceVersion.getLatest(); - PageClientImpl client - = new PageClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localServiceVersion); + PageClientImpl client = new PageClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), + this.endpoint, localServiceVersion); return client; } @@ -232,6 +250,7 @@ private PageClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/page/implementation/PageClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/page/implementation/PageClientImpl.java index 01da695ac4..63bf4c0cc1 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/page/implementation/PageClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/page/implementation/PageClientImpl.java @@ -10,6 +10,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -50,6 +51,20 @@ public final class PageClientImpl { */ private final PageClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * Service version. */ @@ -109,21 +124,23 @@ public TwoModelsAsPageItemsImpl getTwoModelsAsPageItems() { /** * Initializes an instance of PageClient client. * + * @param endpoint Service host. * @param serviceVersion Service version. */ - public PageClientImpl(PageServiceVersion serviceVersion) { + public PageClientImpl(String endpoint, PageServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** * Initializes an instance of PageClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. * @param serviceVersion Service version. */ - public PageClientImpl(HttpPipeline httpPipeline, PageServiceVersion serviceVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), serviceVersion); + public PageClientImpl(HttpPipeline httpPipeline, String endpoint, PageServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** @@ -131,12 +148,14 @@ public PageClientImpl(HttpPipeline httpPipeline, PageServiceVersion serviceVersi * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. * @param serviceVersion Service version. */ - public PageClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + public PageClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, PageServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.serviceVersion = serviceVersion; this.twoModelsAsPageItems = new TwoModelsAsPageItemsImpl(this); this.service = RestProxy.create(PageClientService.class, this.httpPipeline, this.getSerializerAdapter()); @@ -145,7 +164,7 @@ public PageClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAda /** * The interface defining all the services for PageClient to be used by the proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "PageClient") public interface PageClientService { @Get("/azure/core/page/page") @@ -154,8 +173,9 @@ public interface PageClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listWithPage(@QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Mono> listWithPage(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/azure/core/page/page") @ExpectedResponses({ 200 }) @@ -163,8 +183,9 @@ Mono> listWithPage(@QueryParam("api-version") String apiVer @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listWithPageSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Response listWithPageSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/azure/core/page/parameters") @ExpectedResponses({ 200 }) @@ -172,9 +193,9 @@ Response listWithPageSync(@QueryParam("api-version") String apiVersi @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listWithParameters(@QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData bodyInput, - RequestOptions requestOptions, Context context); + Mono> listWithParameters(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData bodyInput, RequestOptions requestOptions, Context context); @Get("/azure/core/page/parameters") @ExpectedResponses({ 200 }) @@ -182,9 +203,9 @@ Mono> listWithParameters(@QueryParam("api-version") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listWithParametersSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData bodyInput, - RequestOptions requestOptions, Context context); + Response listWithParametersSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData bodyInput, RequestOptions requestOptions, Context context); @Get("/azure/core/page/custom-page") @ExpectedResponses({ 200 }) @@ -192,8 +213,9 @@ Response listWithParametersSync(@QueryParam("api-version") String ap @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listWithCustomPageModel(@QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Mono> listWithCustomPageModel(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/azure/core/page/custom-page") @ExpectedResponses({ 200 }) @@ -201,8 +223,9 @@ Mono> listWithCustomPageModel(@QueryParam("api-version") St @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listWithCustomPageModelSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Response listWithCustomPageModelSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -211,7 +234,8 @@ Response listWithCustomPageModelSync(@QueryParam("api-version") Stri @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithPageNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -220,7 +244,8 @@ Mono> listWithPageNext(@PathParam(value = "nextLink", encod @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithPageNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -229,8 +254,8 @@ Response listWithPageNextSync(@PathParam(value = "nextLink", encoded @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithParametersNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -239,7 +264,8 @@ Mono> listWithParametersNext( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithParametersNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -248,8 +274,8 @@ Response listWithParametersNextSync(@PathParam(value = "nextLink", e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listWithCustomPageModelNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -258,8 +284,8 @@ Mono> listWithCustomPageModelNext( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listWithCustomPageModelNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -292,8 +318,8 @@ Response listWithCustomPageModelNextSync( private Mono> listWithPageSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listWithPage(this.getServiceVersion().getVersion(), accept, requestOptions, context)) + .withContext(context -> service.listWithPage(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -362,8 +388,8 @@ public PagedFlux listWithPageAsync(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listWithPageSinglePage(RequestOptions requestOptions) { final String accept = "application/json"; - Response res - = service.listWithPageSync(this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + Response res = service.listWithPageSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } @@ -451,8 +477,8 @@ private Mono> listWithParametersSinglePageAsync(Binary RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listWithParameters(this.getServiceVersion().getVersion(), accept, bodyInput, - requestOptions, context)) + .withContext(context -> service.listWithParameters(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, bodyInput, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -556,8 +582,8 @@ public PagedFlux listWithParametersAsync(BinaryData bodyInput, Reque private PagedResponse listWithParametersSinglePage(BinaryData bodyInput, RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listWithParametersSync(this.getServiceVersion().getVersion(), accept, - bodyInput, requestOptions, Context.NONE); + Response res = service.listWithParametersSync(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, bodyInput, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } @@ -644,8 +670,8 @@ public PagedIterable listWithParameters(BinaryData bodyInput, Reques private Mono> listWithCustomPageModelSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listWithCustomPageModel(this.getServiceVersion().getVersion(), accept, - requestOptions, context)) + .withContext(context -> service.listWithCustomPageModel(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "items"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -714,8 +740,8 @@ public PagedFlux listWithCustomPageModelAsync(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listWithCustomPageModelSinglePage(RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listWithCustomPageModelSync(this.getServiceVersion().getVersion(), accept, - requestOptions, Context.NONE); + Response res = service.listWithCustomPageModelSync(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "items"), getNextLink(res.getValue(), "nextLink"), null); } @@ -788,7 +814,9 @@ public PagedIterable listWithCustomPageModel(RequestOptions requestO private Mono> listWithPageNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listWithPageNext(nextLink, accept, requestOptions, context)) + return FluxUtil + .withContext( + context -> service.listWithPageNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -825,7 +853,8 @@ private Mono> listWithPageNextSinglePageAsync(String n @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listWithPageNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listWithPageNextSync(nextLink, accept, requestOptions, Context.NONE); + Response res + = service.listWithPageNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } @@ -863,8 +892,8 @@ private PagedResponse listWithPageNextSinglePage(String nextLink, Re private Mono> listWithParametersNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listWithParametersNext(nextLink, accept, requestOptions, context)) + return FluxUtil.withContext( + context -> service.listWithParametersNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -901,7 +930,8 @@ private Mono> listWithParametersNextSinglePageAsync(St @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listWithParametersNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listWithParametersNextSync(nextLink, accept, requestOptions, Context.NONE); + Response res + = service.listWithParametersNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } @@ -940,7 +970,8 @@ private Mono> listWithCustomPageModelNextSinglePageAsy RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listWithCustomPageModelNext(nextLink, accept, requestOptions, context)) + .withContext(context -> service.listWithCustomPageModelNext(nextLink, this.getEndpoint(), accept, + requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "items"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -978,8 +1009,8 @@ private Mono> listWithCustomPageModelNextSinglePageAsy private PagedResponse listWithCustomPageModelNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - Response res - = service.listWithCustomPageModelNextSync(nextLink, accept, requestOptions, Context.NONE); + Response res = service.listWithCustomPageModelNextSync(nextLink, this.getEndpoint(), accept, + requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "items"), getNextLink(res.getValue(), "nextLink"), null); } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/page/implementation/TwoModelsAsPageItemsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/page/implementation/TwoModelsAsPageItemsImpl.java index 4ad19ca9ed..239ad70130 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/page/implementation/TwoModelsAsPageItemsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/page/implementation/TwoModelsAsPageItemsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -72,7 +73,7 @@ public PageServiceVersion getServiceVersion() { * The interface defining all the services for PageClientTwoModelsAsPageItems to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "PageClientTwoModelsA") public interface TwoModelsAsPageItemsService { @Get("/azure/core/page/first-item") @@ -81,8 +82,9 @@ public interface TwoModelsAsPageItemsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listFirstItem(@QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Mono> listFirstItem(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/azure/core/page/first-item") @ExpectedResponses({ 200 }) @@ -90,8 +92,9 @@ Mono> listFirstItem(@QueryParam("api-version") String apiVe @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listFirstItemSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Response listFirstItemSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/azure/core/page/second-item") @ExpectedResponses({ 200 }) @@ -99,8 +102,9 @@ Response listFirstItemSync(@QueryParam("api-version") String apiVers @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listSecondItem(@QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Mono> listSecondItem(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/azure/core/page/second-item") @ExpectedResponses({ 200 }) @@ -108,8 +112,9 @@ Mono> listSecondItem(@QueryParam("api-version") String apiV @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listSecondItemSync(@QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Response listSecondItemSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -118,7 +123,8 @@ Response listSecondItemSync(@QueryParam("api-version") String apiVer @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listFirstItemNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -127,7 +133,8 @@ Mono> listFirstItemNext(@PathParam(value = "nextLink", enco @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listFirstItemNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -136,7 +143,8 @@ Response listFirstItemNextSync(@PathParam(value = "nextLink", encode @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listSecondItemNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -145,7 +153,8 @@ Mono> listSecondItemNext(@PathParam(value = "nextLink", enc @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listSecondItemNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); } /** @@ -171,8 +180,8 @@ Response listSecondItemNextSync(@PathParam(value = "nextLink", encod private Mono> listFirstItemSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listFirstItem(this.client.getServiceVersion().getVersion(), accept, - requestOptions, context)) + .withContext(context -> service.listFirstItem(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -225,8 +234,8 @@ public PagedFlux listFirstItemAsync(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listFirstItemSinglePage(RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listFirstItemSync(this.client.getServiceVersion().getVersion(), accept, - requestOptions, Context.NONE); + Response res = service.listFirstItemSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } @@ -281,8 +290,8 @@ public PagedIterable listFirstItem(RequestOptions requestOptions) { private Mono> listSecondItemSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listSecondItem(this.client.getServiceVersion().getVersion(), accept, - requestOptions, context)) + .withContext(context -> service.listSecondItem(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -335,8 +344,8 @@ public PagedFlux listSecondItemAsync(RequestOptions requestOptions) @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSecondItemSinglePage(RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listSecondItemSync(this.client.getServiceVersion().getVersion(), accept, - requestOptions, Context.NONE); + Response res = service.listSecondItemSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } @@ -394,7 +403,8 @@ public PagedIterable listSecondItem(RequestOptions requestOptions) { private Mono> listFirstItemNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listFirstItemNext(nextLink, accept, requestOptions, context)) + return FluxUtil.withContext( + context -> service.listFirstItemNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -423,7 +433,8 @@ private Mono> listFirstItemNextSinglePageAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listFirstItemNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listFirstItemNextSync(nextLink, accept, requestOptions, Context.NONE); + Response res + = service.listFirstItemNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } @@ -454,7 +465,8 @@ private PagedResponse listFirstItemNextSinglePage(String nextLink, R private Mono> listSecondItemNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listSecondItemNext(nextLink, accept, requestOptions, context)) + return FluxUtil.withContext( + context -> service.listSecondItemNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -483,7 +495,8 @@ private Mono> listSecondItemNextSinglePageAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSecondItemNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listSecondItemNextSync(nextLink, accept, requestOptions, Context.NONE); + Response res + = service.listSecondItemNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarClientBuilder.java b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarClientBuilder.java index 5fa4135934..6b8c0adbb5 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarClientBuilder.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarClientBuilder.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,8 +41,8 @@ * A builder for creating a new instance of the ScalarClient type. */ @ServiceClientBuilder(serviceClients = { ScalarClient.class, ScalarAsyncClient.class }) -public final class ScalarClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class ScalarClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -173,6 +174,22 @@ public ScalarClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ScalarClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * Service version */ @@ -220,8 +237,8 @@ private ScalarClientImpl buildInnerClient() { HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); ScalarServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : ScalarServiceVersion.getLatest(); - ScalarClientImpl client - = new ScalarClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localServiceVersion); + ScalarClientImpl client = new ScalarClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), + this.endpoint, localServiceVersion); return client; } @@ -229,6 +246,7 @@ private ScalarClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/implementation/AzureLocationScalarsImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/implementation/AzureLocationScalarsImpl.java index 4371e52b86..ad6f9f9f66 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/implementation/AzureLocationScalarsImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/implementation/AzureLocationScalarsImpl.java @@ -10,6 +10,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; @@ -67,7 +68,7 @@ public ScalarServiceVersion getServiceVersion() { * The interface defining all the services for ScalarClientAzureLocationScalars to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ScalarClientAzureLoc") public interface AzureLocationScalarsService { @Get("/azure/core/scalar/azureLocation") @@ -76,8 +77,8 @@ public interface AzureLocationScalarsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/azure/core/scalar/azureLocation") @ExpectedResponses({ 200 }) @@ -85,8 +86,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/azure/core/scalar/azureLocation") @ExpectedResponses({ 204 }) @@ -94,8 +95,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/azure/core/scalar/azureLocation") @ExpectedResponses({ 204 }) @@ -103,7 +105,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/azure/core/scalar/azureLocation") @@ -112,9 +114,9 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> post(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> post(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/azure/core/scalar/azureLocation") @ExpectedResponses({ 200 }) @@ -122,9 +124,9 @@ Mono> post(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response postSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/azure/core/scalar/azureLocation/header") @ExpectedResponses({ 204 }) @@ -132,8 +134,8 @@ Response postSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> headerMethod(@HeaderParam("region") String region, RequestOptions requestOptions, - Context context); + Mono> headerMethod(@HostParam("endpoint") String endpoint, @HeaderParam("region") String region, + RequestOptions requestOptions, Context context); @Post("/azure/core/scalar/azureLocation/header") @ExpectedResponses({ 204 }) @@ -141,8 +143,8 @@ Mono> headerMethod(@HeaderParam("region") String region, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response headerMethodSync(@HeaderParam("region") String region, RequestOptions requestOptions, - Context context); + Response headerMethodSync(@HostParam("endpoint") String endpoint, @HeaderParam("region") String region, + RequestOptions requestOptions, Context context); @Post("/azure/core/scalar/azureLocation/query") @ExpectedResponses({ 204 }) @@ -150,7 +152,8 @@ Response headerMethodSync(@HeaderParam("region") String region, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> query(@QueryParam("region") String region, RequestOptions requestOptions, Context context); + Mono> query(@HostParam("endpoint") String endpoint, @QueryParam("region") String region, + RequestOptions requestOptions, Context context); @Post("/azure/core/scalar/azureLocation/query") @ExpectedResponses({ 204 }) @@ -158,7 +161,8 @@ Response headerMethodSync(@HeaderParam("region") String region, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response querySync(@QueryParam("region") String region, RequestOptions requestOptions, Context context); + Response querySync(@HostParam("endpoint") String endpoint, @QueryParam("region") String region, + RequestOptions requestOptions, Context context); } /** @@ -179,7 +183,7 @@ Response headerMethodSync(@HeaderParam("region") String region, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -200,7 +204,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -222,7 +226,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -244,7 +249,7 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -277,7 +282,8 @@ public Response putWithResponse(BinaryData body, RequestOptions requestOpt public Mono> postWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.post(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.post(this.client.getEndpoint(), contentType, accept, body, requestOptions, context)); } /** @@ -310,7 +316,7 @@ public Mono> postWithResponseAsync(BinaryData body, Request public Response postWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.postSync(contentType, accept, body, requestOptions, Context.NONE); + return service.postSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, Context.NONE); } /** @@ -326,7 +332,8 @@ public Response postWithResponse(BinaryData body, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> headerMethodWithResponseAsync(String region, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.headerMethod(region, requestOptions, context)); + return FluxUtil + .withContext(context -> service.headerMethod(this.client.getEndpoint(), region, requestOptions, context)); } /** @@ -342,7 +349,7 @@ public Mono> headerMethodWithResponseAsync(String region, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response headerMethodWithResponse(String region, RequestOptions requestOptions) { - return service.headerMethodSync(region, requestOptions, Context.NONE); + return service.headerMethodSync(this.client.getEndpoint(), region, requestOptions, Context.NONE); } /** @@ -358,7 +365,8 @@ public Response headerMethodWithResponse(String region, RequestOptions req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> queryWithResponseAsync(String region, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.query(region, requestOptions, context)); + return FluxUtil + .withContext(context -> service.query(this.client.getEndpoint(), region, requestOptions, context)); } /** @@ -374,6 +382,6 @@ public Mono> queryWithResponseAsync(String region, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response queryWithResponse(String region, RequestOptions requestOptions) { - return service.querySync(region, requestOptions, Context.NONE); + return service.querySync(this.client.getEndpoint(), region, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/implementation/ScalarClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/implementation/ScalarClientImpl.java index 936a53c98f..8571d3943f 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/implementation/ScalarClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/implementation/ScalarClientImpl.java @@ -16,6 +16,20 @@ * Initializes a new instance of the ScalarClient type. */ public final class ScalarClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * Service version. */ @@ -75,21 +89,23 @@ public AzureLocationScalarsImpl getAzureLocationScalars() { /** * Initializes an instance of ScalarClient client. * + * @param endpoint Service host. * @param serviceVersion Service version. */ - public ScalarClientImpl(ScalarServiceVersion serviceVersion) { + public ScalarClientImpl(String endpoint, ScalarServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** * Initializes an instance of ScalarClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. * @param serviceVersion Service version. */ - public ScalarClientImpl(HttpPipeline httpPipeline, ScalarServiceVersion serviceVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), serviceVersion); + public ScalarClientImpl(HttpPipeline httpPipeline, String endpoint, ScalarServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** @@ -97,12 +113,14 @@ public ScalarClientImpl(HttpPipeline httpPipeline, ScalarServiceVersion serviceV * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. * @param serviceVersion Service version. */ - public ScalarClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + public ScalarClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, ScalarServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.serviceVersion = serviceVersion; this.azureLocationScalars = new AzureLocationScalarsImpl(this); } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsClientBuilder.java b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsClientBuilder.java index e272cf2955..95513e117a 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsClientBuilder.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsClientBuilder.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,8 +41,8 @@ * A builder for creating a new instance of the TraitsClient type. */ @ServiceClientBuilder(serviceClients = { TraitsClient.class, TraitsAsyncClient.class }) -public final class TraitsClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class TraitsClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -173,6 +174,22 @@ public TraitsClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public TraitsClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * Service version */ @@ -220,8 +237,8 @@ private TraitsClientImpl buildInnerClient() { HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); TraitsServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : TraitsServiceVersion.getLatest(); - TraitsClientImpl client - = new TraitsClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localServiceVersion); + TraitsClientImpl client = new TraitsClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), + this.endpoint, localServiceVersion); return client; } @@ -229,6 +246,7 @@ private TraitsClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/implementation/TraitsClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/implementation/TraitsClientImpl.java index e685d76646..fe021b1fc9 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/implementation/TraitsClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/implementation/TraitsClientImpl.java @@ -10,6 +10,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.QueryParam; @@ -48,6 +49,20 @@ public final class TraitsClientImpl { */ private final TraitsClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * Service version. */ @@ -93,21 +108,23 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of TraitsClient client. * + * @param endpoint Service host. * @param serviceVersion Service version. */ - public TraitsClientImpl(TraitsServiceVersion serviceVersion) { + public TraitsClientImpl(String endpoint, TraitsServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** * Initializes an instance of TraitsClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. * @param serviceVersion Service version. */ - public TraitsClientImpl(HttpPipeline httpPipeline, TraitsServiceVersion serviceVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), serviceVersion); + public TraitsClientImpl(HttpPipeline httpPipeline, String endpoint, TraitsServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** @@ -115,12 +132,14 @@ public TraitsClientImpl(HttpPipeline httpPipeline, TraitsServiceVersion serviceV * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. * @param serviceVersion Service version. */ - public TraitsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + public TraitsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, TraitsServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.serviceVersion = serviceVersion; this.service = RestProxy.create(TraitsClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -128,7 +147,7 @@ public TraitsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerA /** * The interface defining all the services for TraitsClient to be used by the proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "TraitsClient") public interface TraitsClientService { @Get("/azure/core/traits/user/{id}") @@ -137,9 +156,9 @@ public interface TraitsClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> smokeTest(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("foo") String foo, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> smokeTest(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("id") int id, @HeaderParam("foo") String foo, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/azure/core/traits/user/{id}") @ExpectedResponses({ 200 }) @@ -147,9 +166,9 @@ Mono> smokeTest(@QueryParam("api-version") String apiVersio @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response smokeTestSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, - @HeaderParam("foo") String foo, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response smokeTestSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("id") int id, @HeaderParam("foo") String foo, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/azure/core/traits/user/{id}:repeatableAction") @ExpectedResponses({ 200 }) @@ -157,10 +176,10 @@ Response smokeTestSync(@QueryParam("api-version") String apiVersion, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> repeatableAction(@QueryParam("api-version") String apiVersion, - @PathParam("id") int id, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> repeatableAction(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("id") int id, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/azure/core/traits/user/{id}:repeatableAction") @ExpectedResponses({ 200 }) @@ -168,7 +187,8 @@ Mono> repeatableAction(@QueryParam("api-version") String ap @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response repeatableActionSync(@QueryParam("api-version") String apiVersion, @PathParam("id") int id, + Response repeatableActionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("id") int id, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -211,8 +231,8 @@ Response repeatableActionSync(@QueryParam("api-version") String apiV @ServiceMethod(returns = ReturnType.SINGLE) public Mono> smokeTestWithResponseAsync(int id, String foo, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.smokeTest(this.getServiceVersion().getVersion(), id, foo, accept, - requestOptions, context)); + return FluxUtil.withContext(context -> service.smokeTest(this.getEndpoint(), + this.getServiceVersion().getVersion(), id, foo, accept, requestOptions, context)); } /** @@ -252,8 +272,8 @@ public Mono> smokeTestWithResponseAsync(int id, String foo, @ServiceMethod(returns = ReturnType.SINGLE) public Response smokeTestWithResponse(int id, String foo, RequestOptions requestOptions) { final String accept = "application/json"; - return service.smokeTestSync(this.getServiceVersion().getVersion(), id, foo, accept, requestOptions, - Context.NONE); + return service.smokeTestSync(this.getEndpoint(), this.getServiceVersion().getVersion(), id, foo, accept, + requestOptions, Context.NONE); } /** @@ -311,8 +331,8 @@ public Mono> repeatableActionWithResponseAsync(int id, Bina DateTimeRfc1123.toRfc1123String(OffsetDateTime.now())); } }); - return FluxUtil.withContext(context -> service.repeatableAction(this.getServiceVersion().getVersion(), id, - contentType, accept, body, requestOptionsLocal, context)); + return FluxUtil.withContext(context -> service.repeatableAction(this.getEndpoint(), + this.getServiceVersion().getVersion(), id, contentType, accept, body, requestOptionsLocal, context)); } /** @@ -369,7 +389,7 @@ public Response repeatableActionWithResponse(int id, BinaryData body DateTimeRfc1123.toRfc1123String(OffsetDateTime.now())); } }); - return service.repeatableActionSync(this.getServiceVersion().getVersion(), id, contentType, accept, body, - requestOptionsLocal, Context.NONE); + return service.repeatableActionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), id, contentType, + accept, body, requestOptionsLocal, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/_specs_/azure/example/basic/AzureExampleClientBuilder.java b/typespec-tests/src/main/java/com/_specs_/azure/example/basic/AzureExampleClientBuilder.java index fde603e181..eb659e1df3 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/example/basic/AzureExampleClientBuilder.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/example/basic/AzureExampleClientBuilder.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,8 +41,8 @@ * A builder for creating a new instance of the AzureExampleClient type. */ @ServiceClientBuilder(serviceClients = { AzureExampleClient.class, AzureExampleAsyncClient.class }) -public final class AzureExampleClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class AzureExampleClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -173,6 +174,22 @@ public AzureExampleClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public AzureExampleClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * Service version */ @@ -221,7 +238,7 @@ private AzureExampleClientImpl buildInnerClient() { BasicServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : BasicServiceVersion.getLatest(); AzureExampleClientImpl client = new AzureExampleClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), localServiceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); return client; } @@ -229,6 +246,7 @@ private AzureExampleClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/_specs_/azure/example/basic/implementation/AzureExampleClientImpl.java b/typespec-tests/src/main/java/com/_specs_/azure/example/basic/implementation/AzureExampleClientImpl.java index f7e9e9cdb6..fa748ec0a3 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/example/basic/implementation/AzureExampleClientImpl.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/example/basic/implementation/AzureExampleClientImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -42,6 +43,20 @@ public final class AzureExampleClientImpl { */ private final AzureExampleClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * Service version. */ @@ -87,21 +102,23 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of AzureExampleClient client. * + * @param endpoint Service host. * @param serviceVersion Service version. */ - public AzureExampleClientImpl(BasicServiceVersion serviceVersion) { + public AzureExampleClientImpl(String endpoint, BasicServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** * Initializes an instance of AzureExampleClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. * @param serviceVersion Service version. */ - public AzureExampleClientImpl(HttpPipeline httpPipeline, BasicServiceVersion serviceVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), serviceVersion); + public AzureExampleClientImpl(HttpPipeline httpPipeline, String endpoint, BasicServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** @@ -109,12 +126,14 @@ public AzureExampleClientImpl(HttpPipeline httpPipeline, BasicServiceVersion ser * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. * @param serviceVersion Service version. */ - public AzureExampleClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + public AzureExampleClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, BasicServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.serviceVersion = serviceVersion; this.service = RestProxy.create(AzureExampleClientService.class, this.httpPipeline, this.getSerializerAdapter()); @@ -124,7 +143,7 @@ public AzureExampleClientImpl(HttpPipeline httpPipeline, SerializerAdapter seria * The interface defining all the services for AzureExampleClient to be used by the proxy service to perform REST * calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AzureExampleClient") public interface AzureExampleClientService { @Post("/azure/example/basic/basic") @@ -133,10 +152,11 @@ public interface AzureExampleClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> basicAction(@QueryParam("api-version") String apiVersion, - @QueryParam("query-param") String queryParam, @HeaderParam("header-param") String headerParam, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> basicAction(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("query-param") String queryParam, + @HeaderParam("header-param") String headerParam, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/azure/example/basic/basic") @ExpectedResponses({ 200 }) @@ -144,10 +164,11 @@ Mono> basicAction(@QueryParam("api-version") String apiVers @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response basicActionSync(@QueryParam("api-version") String apiVersion, - @QueryParam("query-param") String queryParam, @HeaderParam("header-param") String headerParam, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response basicActionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("query-param") String queryParam, + @HeaderParam("header-param") String headerParam, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -205,8 +226,9 @@ public Mono> basicActionWithResponseAsync(String queryParam BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.basicAction(this.getServiceVersion().getVersion(), queryParam, - headerParam, contentType, accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.basicAction(this.getEndpoint(), this.getServiceVersion().getVersion(), + queryParam, headerParam, contentType, accept, body, requestOptions, context)); } /** @@ -264,7 +286,7 @@ public Response basicActionWithResponse(String queryParam, String he RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.basicActionSync(this.getServiceVersion().getVersion(), queryParam, headerParam, contentType, - accept, body, requestOptions, Context.NONE); + return service.basicActionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), queryParam, + headerParam, contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/authentication/apikey/ApiKeyClientBuilder.java b/typespec-tests/src/main/java/com/authentication/apikey/ApiKeyClientBuilder.java index c916fc6e2d..a3c449d1cf 100644 --- a/typespec-tests/src/main/java/com/authentication/apikey/ApiKeyClientBuilder.java +++ b/typespec-tests/src/main/java/com/authentication/apikey/ApiKeyClientBuilder.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.client.traits.KeyCredentialTrait; import com.azure.core.credential.KeyCredential; @@ -43,8 +44,9 @@ * A builder for creating a new instance of the ApiKeyClient type. */ @ServiceClientBuilder(serviceClients = { ApiKeyClient.class, ApiKeyAsyncClient.class }) -public final class ApiKeyClientBuilder implements HttpTrait, - ConfigurationTrait, KeyCredentialTrait { +public final class ApiKeyClientBuilder + implements HttpTrait, ConfigurationTrait, + KeyCredentialTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -191,6 +193,22 @@ public ApiKeyClientBuilder credential(KeyCredential keyCredential) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ApiKeyClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -218,7 +236,8 @@ public ApiKeyClientBuilder retryPolicy(RetryPolicy retryPolicy) { private ApiKeyClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - ApiKeyClientImpl client = new ApiKeyClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + ApiKeyClientImpl client + = new ApiKeyClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -226,6 +245,7 @@ private ApiKeyClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/authentication/apikey/implementation/ApiKeyClientImpl.java b/typespec-tests/src/main/java/com/authentication/apikey/implementation/ApiKeyClientImpl.java index 12cfe4eaf4..57f30be3a5 100644 --- a/typespec-tests/src/main/java/com/authentication/apikey/implementation/ApiKeyClientImpl.java +++ b/typespec-tests/src/main/java/com/authentication/apikey/implementation/ApiKeyClientImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; @@ -38,6 +39,20 @@ public final class ApiKeyClientImpl { */ private final ApiKeyClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -68,19 +83,22 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of ApiKeyClient client. + * + * @param endpoint Service host. */ - public ApiKeyClientImpl() { + public ApiKeyClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of ApiKeyClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public ApiKeyClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public ApiKeyClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -88,17 +106,19 @@ public ApiKeyClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public ApiKeyClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public ApiKeyClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.service = RestProxy.create(ApiKeyClientService.class, this.httpPipeline, this.getSerializerAdapter()); } /** * The interface defining all the services for ApiKeyClient to be used by the proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ApiKeyClient") public interface ApiKeyClientService { @Get("/authentication/api-key/valid") @@ -107,7 +127,8 @@ public interface ApiKeyClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> valid(RequestOptions requestOptions, Context context); + Mono> valid(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/authentication/api-key/valid") @ExpectedResponses({ 204 }) @@ -115,7 +136,8 @@ public interface ApiKeyClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response validSync(RequestOptions requestOptions, Context context); + Response validSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/authentication/api-key/invalid") @ExpectedResponses({ 204 }) @@ -123,8 +145,8 @@ public interface ApiKeyClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> invalid(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> invalid(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/authentication/api-key/invalid") @ExpectedResponses({ 204 }) @@ -132,8 +154,8 @@ Mono> invalid(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response invalidSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response invalidSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); } /** @@ -148,7 +170,7 @@ Response invalidSync(@HeaderParam("Accept") String accept, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> validWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.valid(requestOptions, context)); + return FluxUtil.withContext(context -> service.valid(this.getEndpoint(), requestOptions, context)); } /** @@ -163,7 +185,7 @@ public Mono> validWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validWithResponse(RequestOptions requestOptions) { - return service.validSync(requestOptions, Context.NONE); + return service.validSync(this.getEndpoint(), requestOptions, Context.NONE); } /** @@ -179,7 +201,7 @@ public Response validWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> invalidWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.invalid(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.invalid(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -195,6 +217,6 @@ public Mono> invalidWithResponseAsync(RequestOptions requestOptio @ServiceMethod(returns = ReturnType.SINGLE) public Response invalidWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.invalidSync(accept, requestOptions, Context.NONE); + return service.invalidSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/authentication/http/custom/CustomClientBuilder.java b/typespec-tests/src/main/java/com/authentication/http/custom/CustomClientBuilder.java index e387c89a64..606765986b 100644 --- a/typespec-tests/src/main/java/com/authentication/http/custom/CustomClientBuilder.java +++ b/typespec-tests/src/main/java/com/authentication/http/custom/CustomClientBuilder.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.client.traits.KeyCredentialTrait; import com.azure.core.credential.KeyCredential; @@ -43,8 +44,9 @@ * A builder for creating a new instance of the CustomClient type. */ @ServiceClientBuilder(serviceClients = { CustomClient.class, CustomAsyncClient.class }) -public final class CustomClientBuilder implements HttpTrait, - ConfigurationTrait, KeyCredentialTrait { +public final class CustomClientBuilder + implements HttpTrait, ConfigurationTrait, + KeyCredentialTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -192,6 +194,22 @@ public CustomClientBuilder credential(KeyCredential keyCredential) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public CustomClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -219,7 +237,8 @@ public CustomClientBuilder retryPolicy(RetryPolicy retryPolicy) { private CustomClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - CustomClientImpl client = new CustomClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + CustomClientImpl client + = new CustomClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -227,6 +246,7 @@ private CustomClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/authentication/http/custom/implementation/CustomClientImpl.java b/typespec-tests/src/main/java/com/authentication/http/custom/implementation/CustomClientImpl.java index b6657d5c58..f61eee8d7c 100644 --- a/typespec-tests/src/main/java/com/authentication/http/custom/implementation/CustomClientImpl.java +++ b/typespec-tests/src/main/java/com/authentication/http/custom/implementation/CustomClientImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; @@ -38,6 +39,20 @@ public final class CustomClientImpl { */ private final CustomClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -68,19 +83,22 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of CustomClient client. + * + * @param endpoint Service host. */ - public CustomClientImpl() { + public CustomClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of CustomClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public CustomClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public CustomClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -88,17 +106,19 @@ public CustomClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public CustomClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public CustomClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.service = RestProxy.create(CustomClientService.class, this.httpPipeline, this.getSerializerAdapter()); } /** * The interface defining all the services for CustomClient to be used by the proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "CustomClient") public interface CustomClientService { @Get("/authentication/http/custom/valid") @@ -107,7 +127,8 @@ public interface CustomClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> valid(RequestOptions requestOptions, Context context); + Mono> valid(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/authentication/http/custom/valid") @ExpectedResponses({ 204 }) @@ -115,7 +136,8 @@ public interface CustomClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response validSync(RequestOptions requestOptions, Context context); + Response validSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/authentication/http/custom/invalid") @ExpectedResponses({ 204 }) @@ -123,8 +145,8 @@ public interface CustomClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> invalid(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> invalid(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/authentication/http/custom/invalid") @ExpectedResponses({ 204 }) @@ -132,8 +154,8 @@ Mono> invalid(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response invalidSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response invalidSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); } /** @@ -148,7 +170,7 @@ Response invalidSync(@HeaderParam("Accept") String accept, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> validWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.valid(requestOptions, context)); + return FluxUtil.withContext(context -> service.valid(this.getEndpoint(), requestOptions, context)); } /** @@ -163,7 +185,7 @@ public Mono> validWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validWithResponse(RequestOptions requestOptions) { - return service.validSync(requestOptions, Context.NONE); + return service.validSync(this.getEndpoint(), requestOptions, Context.NONE); } /** @@ -179,7 +201,7 @@ public Response validWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> invalidWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.invalid(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.invalid(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -195,6 +217,6 @@ public Mono> invalidWithResponseAsync(RequestOptions requestOptio @ServiceMethod(returns = ReturnType.SINGLE) public Response invalidWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.invalidSync(accept, requestOptions, Context.NONE); + return service.invalidSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/authentication/oauth2/OAuth2ClientBuilder.java b/typespec-tests/src/main/java/com/authentication/oauth2/OAuth2ClientBuilder.java index f36beec9e4..aa31f335c9 100644 --- a/typespec-tests/src/main/java/com/authentication/oauth2/OAuth2ClientBuilder.java +++ b/typespec-tests/src/main/java/com/authentication/oauth2/OAuth2ClientBuilder.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.client.traits.TokenCredentialTrait; import com.azure.core.credential.TokenCredential; @@ -43,8 +44,9 @@ * A builder for creating a new instance of the OAuth2Client type. */ @ServiceClientBuilder(serviceClients = { OAuth2Client.class, OAuth2AsyncClient.class }) -public final class OAuth2ClientBuilder implements HttpTrait, - ConfigurationTrait, TokenCredentialTrait { +public final class OAuth2ClientBuilder + implements HttpTrait, ConfigurationTrait, + TokenCredentialTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -194,6 +196,22 @@ public OAuth2ClientBuilder credential(TokenCredential tokenCredential) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public OAuth2ClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -221,7 +239,8 @@ public OAuth2ClientBuilder retryPolicy(RetryPolicy retryPolicy) { private OAuth2ClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - OAuth2ClientImpl client = new OAuth2ClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + OAuth2ClientImpl client + = new OAuth2ClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -229,6 +248,7 @@ private OAuth2ClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/authentication/oauth2/implementation/OAuth2ClientImpl.java b/typespec-tests/src/main/java/com/authentication/oauth2/implementation/OAuth2ClientImpl.java index 3cc7d5a24f..a603f8e20c 100644 --- a/typespec-tests/src/main/java/com/authentication/oauth2/implementation/OAuth2ClientImpl.java +++ b/typespec-tests/src/main/java/com/authentication/oauth2/implementation/OAuth2ClientImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; @@ -38,6 +39,20 @@ public final class OAuth2ClientImpl { */ private final OAuth2ClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -68,19 +83,22 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of OAuth2Client client. + * + * @param endpoint Service host. */ - public OAuth2ClientImpl() { + public OAuth2ClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of OAuth2Client client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public OAuth2ClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public OAuth2ClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -88,17 +106,19 @@ public OAuth2ClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public OAuth2ClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public OAuth2ClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.service = RestProxy.create(OAuth2ClientService.class, this.httpPipeline, this.getSerializerAdapter()); } /** * The interface defining all the services for OAuth2Client to be used by the proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "OAuth2Client") public interface OAuth2ClientService { @Get("/authentication/oauth2/valid") @@ -107,7 +127,8 @@ public interface OAuth2ClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> valid(RequestOptions requestOptions, Context context); + Mono> valid(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/authentication/oauth2/valid") @ExpectedResponses({ 204 }) @@ -115,7 +136,8 @@ public interface OAuth2ClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response validSync(RequestOptions requestOptions, Context context); + Response validSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/authentication/oauth2/invalid") @ExpectedResponses({ 204 }) @@ -123,8 +145,8 @@ public interface OAuth2ClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> invalid(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> invalid(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/authentication/oauth2/invalid") @ExpectedResponses({ 204 }) @@ -132,8 +154,8 @@ Mono> invalid(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response invalidSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response invalidSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); } /** @@ -148,7 +170,7 @@ Response invalidSync(@HeaderParam("Accept") String accept, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> validWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.valid(requestOptions, context)); + return FluxUtil.withContext(context -> service.valid(this.getEndpoint(), requestOptions, context)); } /** @@ -163,7 +185,7 @@ public Mono> validWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validWithResponse(RequestOptions requestOptions) { - return service.validSync(requestOptions, Context.NONE); + return service.validSync(this.getEndpoint(), requestOptions, Context.NONE); } /** @@ -179,7 +201,7 @@ public Response validWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> invalidWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.invalid(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.invalid(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -195,6 +217,6 @@ public Mono> invalidWithResponseAsync(RequestOptions requestOptio @ServiceMethod(returns = ReturnType.SINGLE) public Response invalidWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.invalidSync(accept, requestOptions, Context.NONE); + return service.invalidSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/authentication/union/UnionClientBuilder.java b/typespec-tests/src/main/java/com/authentication/union/UnionClientBuilder.java index 6a7464872a..5855133f29 100644 --- a/typespec-tests/src/main/java/com/authentication/union/UnionClientBuilder.java +++ b/typespec-tests/src/main/java/com/authentication/union/UnionClientBuilder.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.client.traits.KeyCredentialTrait; import com.azure.core.client.traits.TokenCredentialTrait; @@ -47,7 +48,8 @@ */ @ServiceClientBuilder(serviceClients = { UnionClient.class, UnionAsyncClient.class }) public final class UnionClientBuilder implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, KeyCredentialTrait { + TokenCredentialTrait, KeyCredentialTrait, + EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -213,6 +215,22 @@ public UnionClientBuilder credential(KeyCredential keyCredential) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public UnionClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -240,7 +258,8 @@ public UnionClientBuilder retryPolicy(RetryPolicy retryPolicy) { private UnionClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - UnionClientImpl client = new UnionClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + UnionClientImpl client + = new UnionClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -248,6 +267,7 @@ private UnionClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/authentication/union/implementation/UnionClientImpl.java b/typespec-tests/src/main/java/com/authentication/union/implementation/UnionClientImpl.java index 4c601b975a..c09b8c5c1a 100644 --- a/typespec-tests/src/main/java/com/authentication/union/implementation/UnionClientImpl.java +++ b/typespec-tests/src/main/java/com/authentication/union/implementation/UnionClientImpl.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; @@ -37,6 +38,20 @@ public final class UnionClientImpl { */ private final UnionClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -67,19 +82,22 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of UnionClient client. + * + * @param endpoint Service host. */ - public UnionClientImpl() { + public UnionClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of UnionClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public UnionClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public UnionClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -87,17 +105,19 @@ public UnionClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public UnionClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public UnionClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.service = RestProxy.create(UnionClientService.class, this.httpPipeline, this.getSerializerAdapter()); } /** * The interface defining all the services for UnionClient to be used by the proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "UnionClient") public interface UnionClientService { @Get("/authentication/union/validkey") @@ -106,7 +126,8 @@ public interface UnionClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> validKey(RequestOptions requestOptions, Context context); + Mono> validKey(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/authentication/union/validkey") @ExpectedResponses({ 204 }) @@ -114,7 +135,8 @@ public interface UnionClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response validKeySync(RequestOptions requestOptions, Context context); + Response validKeySync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/authentication/union/validtoken") @ExpectedResponses({ 204 }) @@ -122,7 +144,8 @@ public interface UnionClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> validToken(RequestOptions requestOptions, Context context); + Mono> validToken(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/authentication/union/validtoken") @ExpectedResponses({ 204 }) @@ -130,7 +153,8 @@ public interface UnionClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response validTokenSync(RequestOptions requestOptions, Context context); + Response validTokenSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); } /** @@ -145,7 +169,7 @@ public interface UnionClientService { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> validKeyWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.validKey(requestOptions, context)); + return FluxUtil.withContext(context -> service.validKey(this.getEndpoint(), requestOptions, context)); } /** @@ -160,7 +184,7 @@ public Mono> validKeyWithResponseAsync(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validKeyWithResponse(RequestOptions requestOptions) { - return service.validKeySync(requestOptions, Context.NONE); + return service.validKeySync(this.getEndpoint(), requestOptions, Context.NONE); } /** @@ -175,7 +199,7 @@ public Response validKeyWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> validTokenWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.validToken(requestOptions, context)); + return FluxUtil.withContext(context -> service.validToken(this.getEndpoint(), requestOptions, context)); } /** @@ -190,6 +214,6 @@ public Mono> validTokenWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validTokenWithResponse(RequestOptions requestOptions) { - return service.validTokenSync(requestOptions, Context.NONE); + return service.validTokenSync(this.getEndpoint(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClientBuilder.java b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClientBuilder.java index 940ee6b158..213d53be12 100644 --- a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClientBuilder.java +++ b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,8 +41,8 @@ * A builder for creating a new instance of the XmsClientRequestIdClient type. */ @ServiceClientBuilder(serviceClients = { XmsClientRequestIdClient.class, XmsClientRequestIdAsyncClient.class }) -public final class XmsClientRequestIdClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class XmsClientRequestIdClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -173,6 +174,22 @@ public XmsClientRequestIdClientBuilder configuration(Configuration configuration return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public XmsClientRequestIdClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -200,8 +217,8 @@ public XmsClientRequestIdClientBuilder retryPolicy(RetryPolicy retryPolicy) { private XmsClientRequestIdClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - XmsClientRequestIdClientImpl client - = new XmsClientRequestIdClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + XmsClientRequestIdClientImpl client = new XmsClientRequestIdClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -209,6 +226,7 @@ private XmsClientRequestIdClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/implementation/XmsClientRequestIdClientImpl.java b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/implementation/XmsClientRequestIdClientImpl.java index 41b9820341..d416106f38 100644 --- a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/implementation/XmsClientRequestIdClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/implementation/XmsClientRequestIdClientImpl.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; @@ -37,6 +38,20 @@ public final class XmsClientRequestIdClientImpl { */ private final XmsClientRequestIdClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -67,19 +82,22 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of XmsClientRequestIdClient client. + * + * @param endpoint Service host. */ - public XmsClientRequestIdClientImpl() { + public XmsClientRequestIdClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of XmsClientRequestIdClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public XmsClientRequestIdClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public XmsClientRequestIdClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -87,10 +105,13 @@ public XmsClientRequestIdClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public XmsClientRequestIdClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public XmsClientRequestIdClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.service = RestProxy.create(XmsClientRequestIdClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -99,7 +120,7 @@ public XmsClientRequestIdClientImpl(HttpPipeline httpPipeline, SerializerAdapter * The interface defining all the services for XmsClientRequestIdClient to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "XmsClientRequestIdCl") public interface XmsClientRequestIdClientService { @Get("/azure/special-headers/x-ms-client-request-id/") @@ -108,7 +129,8 @@ public interface XmsClientRequestIdClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(RequestOptions requestOptions, Context context); + Mono> get(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/azure/special-headers/x-ms-client-request-id/") @ExpectedResponses({ 204 }) @@ -116,7 +138,7 @@ public interface XmsClientRequestIdClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(RequestOptions requestOptions, Context context); + Response getSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); } /** @@ -132,7 +154,7 @@ public interface XmsClientRequestIdClientService { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.get(requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.getEndpoint(), requestOptions, context)); } /** @@ -147,6 +169,6 @@ public Mono> getWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { - return service.getSync(requestOptions, Context.NONE); + return service.getSync(this.getEndpoint(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/flatten/implementation/FlattenClientImpl.java b/typespec-tests/src/main/java/com/cadl/flatten/implementation/FlattenClientImpl.java index acf60e58aa..d54baf3bb5 100644 --- a/typespec-tests/src/main/java/com/cadl/flatten/implementation/FlattenClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/flatten/implementation/FlattenClientImpl.java @@ -46,12 +46,11 @@ public final class FlattenClientImpl { private final FlattenClientService service; /** - * Flatten. */ private final String endpoint; /** - * Gets Flatten. + * Gets. * * @return the endpoint value. */ @@ -104,7 +103,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of FlattenClient client. * - * @param endpoint Flatten. + * @param endpoint * @param serviceVersion Service version. */ public FlattenClientImpl(String endpoint, FlattenServiceVersion serviceVersion) { @@ -116,7 +115,7 @@ public FlattenClientImpl(String endpoint, FlattenServiceVersion serviceVersion) * Initializes an instance of FlattenClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Flatten. + * @param endpoint * @param serviceVersion Service version. */ public FlattenClientImpl(HttpPipeline httpPipeline, String endpoint, FlattenServiceVersion serviceVersion) { @@ -128,7 +127,7 @@ public FlattenClientImpl(HttpPipeline httpPipeline, String endpoint, FlattenServ * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Flatten. + * @param endpoint * @param serviceVersion Service version. */ public FlattenClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, diff --git a/typespec-tests/src/main/java/com/cadl/multipart/implementation/MultipartClientImpl.java b/typespec-tests/src/main/java/com/cadl/multipart/implementation/MultipartClientImpl.java index 9ff920bec9..c0b1c87530 100644 --- a/typespec-tests/src/main/java/com/cadl/multipart/implementation/MultipartClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/multipart/implementation/MultipartClientImpl.java @@ -147,6 +147,7 @@ Response uploadSync(@HostParam("endpoint") String endpoint, @PathParam("na @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData data, RequestOptions requestOptions, Context context); + // @Multipart not supported by RestProxy @Post("/uploadHttpPart/images/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -154,8 +155,10 @@ Response uploadSync(@HostParam("endpoint") String endpoint, @PathParam("na @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadHttpPart(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("content-type") String contentType, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); + // @Multipart not supported by RestProxy @Post("/uploadHttpPart/images/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -163,7 +166,8 @@ Mono> uploadHttpPart(@HostParam("endpoint") String endpoint, @Pat @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadHttpPartSync(@HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("content-type") String contentType, RequestOptions requestOptions, Context context); + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -228,6 +232,7 @@ public Response uploadWithResponse(String name, BinaryData data, RequestOp * You can add these to a request with {@link RequestOptions#addQueryParam} * * @param name The name parameter. + * @param body The body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -236,10 +241,11 @@ public Response uploadWithResponse(String name, BinaryData data, RequestOp * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadHttpPartWithResponseAsync(String name, RequestOptions requestOptions) { + public Mono> uploadHttpPartWithResponseAsync(String name, BinaryData body, + RequestOptions requestOptions) { final String contentType = "multipart/form-data"; return FluxUtil.withContext( - context -> service.uploadHttpPart(this.getEndpoint(), name, contentType, requestOptions, context)); + context -> service.uploadHttpPart(this.getEndpoint(), name, contentType, body, requestOptions, context)); } /** @@ -253,6 +259,7 @@ public Mono> uploadHttpPartWithResponseAsync(String name, Request * You can add these to a request with {@link RequestOptions#addQueryParam} * * @param name The name parameter. + * @param body The body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -261,8 +268,8 @@ public Mono> uploadHttpPartWithResponseAsync(String name, Request * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response uploadHttpPartWithResponse(String name, RequestOptions requestOptions) { + public Response uploadHttpPartWithResponse(String name, BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return service.uploadHttpPartSync(this.getEndpoint(), name, contentType, requestOptions, Context.NONE); + return service.uploadHttpPartSync(this.getEndpoint(), name, contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/cadl/union/implementation/UnionClientImpl.java b/typespec-tests/src/main/java/com/cadl/union/implementation/UnionClientImpl.java index c2598deaec..240291b036 100644 --- a/typespec-tests/src/main/java/com/cadl/union/implementation/UnionClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/union/implementation/UnionClientImpl.java @@ -17,12 +17,11 @@ */ public final class UnionClientImpl { /** - * Union. */ private final String endpoint; /** - * Gets Union. + * Gets. * * @return the endpoint value. */ @@ -89,7 +88,7 @@ public UnionFlattenOpsImpl getUnionFlattenOps() { /** * Initializes an instance of UnionClient client. * - * @param endpoint Union. + * @param endpoint * @param serviceVersion Service version. */ public UnionClientImpl(String endpoint, UnionServiceVersion serviceVersion) { @@ -101,7 +100,7 @@ public UnionClientImpl(String endpoint, UnionServiceVersion serviceVersion) { * Initializes an instance of UnionClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Union. + * @param endpoint * @param serviceVersion Service version. */ public UnionClientImpl(HttpPipeline httpPipeline, String endpoint, UnionServiceVersion serviceVersion) { @@ -113,7 +112,7 @@ public UnionClientImpl(HttpPipeline httpPipeline, String endpoint, UnionServiceV * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Union. + * @param endpoint * @param serviceVersion Service version. */ public UnionClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, diff --git a/typespec-tests/src/main/java/com/client/naming/NamingClientBuilder.java b/typespec-tests/src/main/java/com/client/naming/NamingClientBuilder.java index dfeb2c86c9..12038d5712 100644 --- a/typespec-tests/src/main/java/com/client/naming/NamingClientBuilder.java +++ b/typespec-tests/src/main/java/com/client/naming/NamingClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -47,8 +48,8 @@ NamingAsyncClient.class, ClientModelAsyncClient.class, UnionEnumAsyncClient.class }) -public final class NamingClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class NamingClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -179,6 +180,22 @@ public NamingClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public NamingClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -206,7 +223,8 @@ public NamingClientBuilder retryPolicy(RetryPolicy retryPolicy) { private NamingClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - NamingClientImpl client = new NamingClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + NamingClientImpl client + = new NamingClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -214,6 +232,7 @@ private NamingClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/client/naming/implementation/ClientModelsImpl.java b/typespec-tests/src/main/java/com/client/naming/implementation/ClientModelsImpl.java index 5c10848240..8e2403e6b8 100644 --- a/typespec-tests/src/main/java/com/client/naming/implementation/ClientModelsImpl.java +++ b/typespec-tests/src/main/java/com/client/naming/implementation/ClientModelsImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class ClientModelsImpl { * The interface defining all the services for NamingClientClientModels to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "NamingClientClientMo") public interface ClientModelsService { @Post("/client/naming/model/client") @@ -63,8 +64,9 @@ public interface ClientModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> client(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> client(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/client/naming/model/client") @ExpectedResponses({ 204 }) @@ -72,8 +74,9 @@ Mono> client(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response clientSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response clientSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/client/naming/model/language") @ExpectedResponses({ 204 }) @@ -81,8 +84,9 @@ Response clientSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> language(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> language(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/client/naming/model/language") @ExpectedResponses({ 204 }) @@ -90,8 +94,9 @@ Mono> language(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response languageSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response languageSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -115,7 +120,8 @@ Response languageSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> clientWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.client(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.client(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -139,7 +145,7 @@ public Mono> clientWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response clientWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.clientSync(contentType, body, requestOptions, Context.NONE); + return service.clientSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -163,7 +169,8 @@ public Response clientWithResponse(BinaryData body, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> languageWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.language(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.language(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -187,6 +194,6 @@ public Mono> languageWithResponseAsync(BinaryData body, RequestOp @ServiceMethod(returns = ReturnType.SINGLE) public Response languageWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.languageSync(contentType, body, requestOptions, Context.NONE); + return service.languageSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/naming/implementation/NamingClientImpl.java b/typespec-tests/src/main/java/com/client/naming/implementation/NamingClientImpl.java index 948992ce54..2b80eddc75 100644 --- a/typespec-tests/src/main/java/com/client/naming/implementation/NamingClientImpl.java +++ b/typespec-tests/src/main/java/com/client/naming/implementation/NamingClientImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -42,6 +43,20 @@ public final class NamingClientImpl { */ private final NamingClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -100,19 +115,22 @@ public UnionEnumsImpl getUnionEnums() { /** * Initializes an instance of NamingClient client. + * + * @param endpoint Service host. */ - public NamingClientImpl() { + public NamingClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of NamingClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public NamingClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public NamingClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -120,10 +138,12 @@ public NamingClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public NamingClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public NamingClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.clientModels = new ClientModelsImpl(this); this.unionEnums = new UnionEnumsImpl(this); this.service = RestProxy.create(NamingClientService.class, this.httpPipeline, this.getSerializerAdapter()); @@ -132,7 +152,7 @@ public NamingClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerA /** * The interface defining all the services for NamingClient to be used by the proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "NamingClient") public interface NamingClientService { @Post("/client/naming/operation") @@ -141,7 +161,8 @@ public interface NamingClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> clientName(RequestOptions requestOptions, Context context); + Mono> clientName(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Post("/client/naming/operation") @ExpectedResponses({ 204 }) @@ -149,7 +170,8 @@ public interface NamingClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response clientNameSync(RequestOptions requestOptions, Context context); + Response clientNameSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Post("/client/naming/parameter") @ExpectedResponses({ 204 }) @@ -157,8 +179,8 @@ public interface NamingClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> parameter(@QueryParam("defaultName") String clientName, RequestOptions requestOptions, - Context context); + Mono> parameter(@HostParam("endpoint") String endpoint, + @QueryParam("defaultName") String clientName, RequestOptions requestOptions, Context context); @Post("/client/naming/parameter") @ExpectedResponses({ 204 }) @@ -166,8 +188,8 @@ Mono> parameter(@QueryParam("defaultName") String clientName, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response parameterSync(@QueryParam("defaultName") String clientName, RequestOptions requestOptions, - Context context); + Response parameterSync(@HostParam("endpoint") String endpoint, + @QueryParam("defaultName") String clientName, RequestOptions requestOptions, Context context); @Post("/client/naming/property/client") @ExpectedResponses({ 204 }) @@ -175,8 +197,9 @@ Response parameterSync(@QueryParam("defaultName") String clientName, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> client(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> client(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/client/naming/property/client") @ExpectedResponses({ 204 }) @@ -184,8 +207,9 @@ Mono> client(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response clientSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response clientSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/client/naming/property/language") @ExpectedResponses({ 204 }) @@ -193,8 +217,9 @@ Response clientSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> language(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> language(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/client/naming/property/language") @ExpectedResponses({ 204 }) @@ -202,8 +227,9 @@ Mono> language(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response languageSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response languageSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/client/naming/property/compatible-with-encoded-name") @ExpectedResponses({ 204 }) @@ -211,8 +237,9 @@ Response languageSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> compatibleWithEncodedName(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> compatibleWithEncodedName(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/client/naming/property/compatible-with-encoded-name") @ExpectedResponses({ 204 }) @@ -220,8 +247,9 @@ Mono> compatibleWithEncodedName(@HeaderParam("Content-Type") Stri @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response compatibleWithEncodedNameSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response compatibleWithEncodedNameSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/client/naming/header") @ExpectedResponses({ 204 }) @@ -229,8 +257,8 @@ Response compatibleWithEncodedNameSync(@HeaderParam("Content-Type") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> request(@HeaderParam("default-name") String clientName, RequestOptions requestOptions, - Context context); + Mono> request(@HostParam("endpoint") String endpoint, + @HeaderParam("default-name") String clientName, RequestOptions requestOptions, Context context); @Post("/client/naming/header") @ExpectedResponses({ 204 }) @@ -238,8 +266,8 @@ Mono> request(@HeaderParam("default-name") String clientName, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requestSync(@HeaderParam("default-name") String clientName, RequestOptions requestOptions, - Context context); + Response requestSync(@HostParam("endpoint") String endpoint, + @HeaderParam("default-name") String clientName, RequestOptions requestOptions, Context context); @Get("/client/naming/header") @ExpectedResponses({ 204 }) @@ -247,7 +275,8 @@ Response requestSync(@HeaderParam("default-name") String clientName, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> response(RequestOptions requestOptions, Context context); + Mono> response(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/client/naming/header") @ExpectedResponses({ 204 }) @@ -255,7 +284,8 @@ Response requestSync(@HeaderParam("default-name") String clientName, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response responseSync(RequestOptions requestOptions, Context context); + Response responseSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); } /** @@ -270,7 +300,7 @@ Response requestSync(@HeaderParam("default-name") String clientName, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> clientNameWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.clientName(requestOptions, context)); + return FluxUtil.withContext(context -> service.clientName(this.getEndpoint(), requestOptions, context)); } /** @@ -285,7 +315,7 @@ public Mono> clientNameWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response clientNameWithResponse(RequestOptions requestOptions) { - return service.clientNameSync(requestOptions, Context.NONE); + return service.clientNameSync(this.getEndpoint(), requestOptions, Context.NONE); } /** @@ -301,7 +331,8 @@ public Response clientNameWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> parameterWithResponseAsync(String clientName, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.parameter(clientName, requestOptions, context)); + return FluxUtil + .withContext(context -> service.parameter(this.getEndpoint(), clientName, requestOptions, context)); } /** @@ -317,7 +348,7 @@ public Mono> parameterWithResponseAsync(String clientName, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response parameterWithResponse(String clientName, RequestOptions requestOptions) { - return service.parameterSync(clientName, requestOptions, Context.NONE); + return service.parameterSync(this.getEndpoint(), clientName, requestOptions, Context.NONE); } /** @@ -341,7 +372,8 @@ public Response parameterWithResponse(String clientName, RequestOptions re @ServiceMethod(returns = ReturnType.SINGLE) public Mono> clientWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.client(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.client(this.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -365,7 +397,7 @@ public Mono> clientWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response clientWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.clientSync(contentType, body, requestOptions, Context.NONE); + return service.clientSync(this.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -389,7 +421,8 @@ public Response clientWithResponse(BinaryData body, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> languageWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.language(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.language(this.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -413,7 +446,7 @@ public Mono> languageWithResponseAsync(BinaryData body, RequestOp @ServiceMethod(returns = ReturnType.SINGLE) public Response languageWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.languageSync(contentType, body, requestOptions, Context.NONE); + return service.languageSync(this.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -438,8 +471,8 @@ public Response languageWithResponse(BinaryData body, RequestOptions reque public Mono> compatibleWithEncodedNameWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil - .withContext(context -> service.compatibleWithEncodedName(contentType, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.compatibleWithEncodedName(this.getEndpoint(), contentType, body, + requestOptions, context)); } /** @@ -463,7 +496,8 @@ public Mono> compatibleWithEncodedNameWithResponseAsync(BinaryDat @ServiceMethod(returns = ReturnType.SINGLE) public Response compatibleWithEncodedNameWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.compatibleWithEncodedNameSync(contentType, body, requestOptions, Context.NONE); + return service.compatibleWithEncodedNameSync(this.getEndpoint(), contentType, body, requestOptions, + Context.NONE); } /** @@ -479,7 +513,8 @@ public Response compatibleWithEncodedNameWithResponse(BinaryData body, Req */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> requestWithResponseAsync(String clientName, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.request(clientName, requestOptions, context)); + return FluxUtil + .withContext(context -> service.request(this.getEndpoint(), clientName, requestOptions, context)); } /** @@ -495,7 +530,7 @@ public Mono> requestWithResponseAsync(String clientName, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response requestWithResponse(String clientName, RequestOptions requestOptions) { - return service.requestSync(clientName, requestOptions, Context.NONE); + return service.requestSync(this.getEndpoint(), clientName, requestOptions, Context.NONE); } /** @@ -510,7 +545,7 @@ public Response requestWithResponse(String clientName, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.response(requestOptions, context)); + return FluxUtil.withContext(context -> service.response(this.getEndpoint(), requestOptions, context)); } /** @@ -525,6 +560,6 @@ public Mono> responseWithResponseAsync(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response responseWithResponse(RequestOptions requestOptions) { - return service.responseSync(requestOptions, Context.NONE); + return service.responseSync(this.getEndpoint(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/naming/implementation/UnionEnumsImpl.java b/typespec-tests/src/main/java/com/client/naming/implementation/UnionEnumsImpl.java index b7ff363129..ed4791a76e 100644 --- a/typespec-tests/src/main/java/com/client/naming/implementation/UnionEnumsImpl.java +++ b/typespec-tests/src/main/java/com/client/naming/implementation/UnionEnumsImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class UnionEnumsImpl { * The interface defining all the services for NamingClientUnionEnums to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "NamingClientUnionEnu") public interface UnionEnumsService { @Post("/client/naming/union-enum/union-enum-name") @@ -63,8 +64,9 @@ public interface UnionEnumsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unionEnumName(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> unionEnumName(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/client/naming/union-enum/union-enum-name") @ExpectedResponses({ 204 }) @@ -72,8 +74,9 @@ Mono> unionEnumName(@HeaderParam("Content-Type") String contentTy @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unionEnumNameSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response unionEnumNameSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/client/naming/union-enum/union-enum-member-name") @ExpectedResponses({ 204 }) @@ -81,8 +84,9 @@ Response unionEnumNameSync(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unionEnumMemberName(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> unionEnumMemberName(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/client/naming/union-enum/union-enum-member-name") @ExpectedResponses({ 204 }) @@ -90,8 +94,9 @@ Mono> unionEnumMemberName(@HeaderParam("Content-Type") String con @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unionEnumMemberNameSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response unionEnumMemberNameSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -113,7 +118,8 @@ Response unionEnumMemberNameSync(@HeaderParam("Content-Type") String conte @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unionEnumNameWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.unionEnumName(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.unionEnumName(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -135,7 +141,7 @@ public Mono> unionEnumNameWithResponseAsync(BinaryData body, Requ @ServiceMethod(returns = ReturnType.SINGLE) public Response unionEnumNameWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.unionEnumNameSync(contentType, body, requestOptions, Context.NONE); + return service.unionEnumNameSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -157,7 +163,8 @@ public Response unionEnumNameWithResponse(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unionEnumMemberNameWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.unionEnumMemberName(contentType, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.unionEnumMemberName(this.client.getEndpoint(), contentType, body, + requestOptions, context)); } /** @@ -179,6 +186,7 @@ public Mono> unionEnumMemberNameWithResponseAsync(BinaryData body @ServiceMethod(returns = ReturnType.SINGLE) public Response unionEnumMemberNameWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.unionEnumMemberNameSync(contentType, body, requestOptions, Context.NONE); + return service.unionEnumMemberNameSync(this.client.getEndpoint(), contentType, body, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/bytes/BytesClientBuilder.java b/typespec-tests/src/main/java/com/encode/bytes/BytesClientBuilder.java index aab04fcddc..2efd7b25e1 100644 --- a/typespec-tests/src/main/java/com/encode/bytes/BytesClientBuilder.java +++ b/typespec-tests/src/main/java/com/encode/bytes/BytesClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -51,7 +52,8 @@ HeaderAsyncClient.class, RequestBodyAsyncClient.class, ResponseBodyAsyncClient.class }) -public final class BytesClientBuilder implements HttpTrait, ConfigurationTrait { +public final class BytesClientBuilder implements HttpTrait, ConfigurationTrait, + EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -182,6 +184,22 @@ public BytesClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public BytesClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -209,7 +227,8 @@ public BytesClientBuilder retryPolicy(RetryPolicy retryPolicy) { private BytesClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - BytesClientImpl client = new BytesClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + BytesClientImpl client + = new BytesClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -217,6 +236,7 @@ private BytesClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/encode/bytes/implementation/BytesClientImpl.java b/typespec-tests/src/main/java/com/encode/bytes/implementation/BytesClientImpl.java index 99e008537a..e6da811f4e 100644 --- a/typespec-tests/src/main/java/com/encode/bytes/implementation/BytesClientImpl.java +++ b/typespec-tests/src/main/java/com/encode/bytes/implementation/BytesClientImpl.java @@ -15,6 +15,20 @@ * Initializes a new instance of the BytesClient type. */ public final class BytesClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -115,19 +129,22 @@ public ResponseBodiesImpl getResponseBodies() { /** * Initializes an instance of BytesClient client. + * + * @param endpoint Service host. */ - public BytesClientImpl() { + public BytesClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of BytesClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public BytesClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public BytesClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -135,10 +152,12 @@ public BytesClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public BytesClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public BytesClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.queries = new QueriesImpl(this); this.properties = new PropertiesImpl(this); this.headers = new HeadersImpl(this); diff --git a/typespec-tests/src/main/java/com/encode/bytes/implementation/HeadersImpl.java b/typespec-tests/src/main/java/com/encode/bytes/implementation/HeadersImpl.java index 6ff5c712a4..583636ef74 100644 --- a/typespec-tests/src/main/java/com/encode/bytes/implementation/HeadersImpl.java +++ b/typespec-tests/src/main/java/com/encode/bytes/implementation/HeadersImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; @@ -57,7 +58,7 @@ public final class HeadersImpl { * The interface defining all the services for BytesClientHeaders to be used by the proxy service to perform REST * calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "BytesClientHeaders") public interface HeadersService { @Get("/encode/bytes/header/default") @@ -66,8 +67,8 @@ public interface HeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("value") String value, RequestOptions requestOptions, - Context context); + Mono> defaultMethod(@HostParam("endpoint") String endpoint, @HeaderParam("value") String value, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/header/default") @ExpectedResponses({ 204 }) @@ -75,8 +76,8 @@ Mono> defaultMethod(@HeaderParam("value") String value, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("value") String value, RequestOptions requestOptions, - Context context); + Response defaultMethodSync(@HostParam("endpoint") String endpoint, @HeaderParam("value") String value, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/header/base64") @ExpectedResponses({ 204 }) @@ -84,7 +85,8 @@ Response defaultMethodSync(@HeaderParam("value") String value, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64(@HeaderParam("value") String value, RequestOptions requestOptions, Context context); + Mono> base64(@HostParam("endpoint") String endpoint, @HeaderParam("value") String value, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/header/base64") @ExpectedResponses({ 204 }) @@ -92,7 +94,8 @@ Response defaultMethodSync(@HeaderParam("value") String value, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64Sync(@HeaderParam("value") String value, RequestOptions requestOptions, Context context); + Response base64Sync(@HostParam("endpoint") String endpoint, @HeaderParam("value") String value, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/header/base64url") @ExpectedResponses({ 204 }) @@ -100,8 +103,8 @@ Response defaultMethodSync(@HeaderParam("value") String value, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64url(@HeaderParam("value") Base64Url value, RequestOptions requestOptions, - Context context); + Mono> base64url(@HostParam("endpoint") String endpoint, @HeaderParam("value") Base64Url value, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/header/base64url") @ExpectedResponses({ 204 }) @@ -109,8 +112,8 @@ Mono> base64url(@HeaderParam("value") Base64Url value, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlSync(@HeaderParam("value") Base64Url value, RequestOptions requestOptions, - Context context); + Response base64urlSync(@HostParam("endpoint") String endpoint, @HeaderParam("value") Base64Url value, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/header/base64url-array") @ExpectedResponses({ 204 }) @@ -118,8 +121,8 @@ Response base64urlSync(@HeaderParam("value") Base64Url value, RequestOptio @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64urlArray(@HeaderParam("value") String value, RequestOptions requestOptions, - Context context); + Mono> base64urlArray(@HostParam("endpoint") String endpoint, @HeaderParam("value") String value, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/header/base64url-array") @ExpectedResponses({ 204 }) @@ -127,8 +130,8 @@ Mono> base64urlArray(@HeaderParam("value") String value, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlArraySync(@HeaderParam("value") String value, RequestOptions requestOptions, - Context context); + Response base64urlArraySync(@HostParam("endpoint") String endpoint, @HeaderParam("value") String value, + RequestOptions requestOptions, Context context); } /** @@ -145,7 +148,8 @@ Response base64urlArraySync(@HeaderParam("value") String value, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(byte[] value, RequestOptions requestOptions) { String valueConverted = Base64Util.encodeToString(value); - return FluxUtil.withContext(context -> service.defaultMethod(valueConverted, requestOptions, context)); + return FluxUtil.withContext( + context -> service.defaultMethod(this.client.getEndpoint(), valueConverted, requestOptions, context)); } /** @@ -162,7 +166,7 @@ public Mono> defaultMethodWithResponseAsync(byte[] value, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(byte[] value, RequestOptions requestOptions) { String valueConverted = Base64Util.encodeToString(value); - return service.defaultMethodSync(valueConverted, requestOptions, Context.NONE); + return service.defaultMethodSync(this.client.getEndpoint(), valueConverted, requestOptions, Context.NONE); } /** @@ -179,7 +183,8 @@ public Response defaultMethodWithResponse(byte[] value, RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64WithResponseAsync(byte[] value, RequestOptions requestOptions) { String valueConverted = Base64Util.encodeToString(value); - return FluxUtil.withContext(context -> service.base64(valueConverted, requestOptions, context)); + return FluxUtil + .withContext(context -> service.base64(this.client.getEndpoint(), valueConverted, requestOptions, context)); } /** @@ -196,7 +201,7 @@ public Mono> base64WithResponseAsync(byte[] value, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response base64WithResponse(byte[] value, RequestOptions requestOptions) { String valueConverted = Base64Util.encodeToString(value); - return service.base64Sync(valueConverted, requestOptions, Context.NONE); + return service.base64Sync(this.client.getEndpoint(), valueConverted, requestOptions, Context.NONE); } /** @@ -213,7 +218,8 @@ public Response base64WithResponse(byte[] value, RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64urlWithResponseAsync(byte[] value, RequestOptions requestOptions) { Base64Url valueConverted = Base64Url.encode(value); - return FluxUtil.withContext(context -> service.base64url(valueConverted, requestOptions, context)); + return FluxUtil.withContext( + context -> service.base64url(this.client.getEndpoint(), valueConverted, requestOptions, context)); } /** @@ -230,7 +236,7 @@ public Mono> base64urlWithResponseAsync(byte[] value, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response base64urlWithResponse(byte[] value, RequestOptions requestOptions) { Base64Url valueConverted = Base64Url.encode(value); - return service.base64urlSync(valueConverted, requestOptions, Context.NONE); + return service.base64urlSync(this.client.getEndpoint(), valueConverted, requestOptions, Context.NONE); } /** @@ -250,7 +256,8 @@ public Mono> base64urlArrayWithResponseAsync(List value, .serializeIterable( value.stream().map(paramItemValue -> Base64Url.encode(paramItemValue)).collect(Collectors.toList()), CollectionFormat.CSV); - return FluxUtil.withContext(context -> service.base64urlArray(valueConverted, requestOptions, context)); + return FluxUtil.withContext( + context -> service.base64urlArray(this.client.getEndpoint(), valueConverted, requestOptions, context)); } /** @@ -270,6 +277,6 @@ public Response base64urlArrayWithResponse(List value, RequestOpti .serializeIterable( value.stream().map(paramItemValue -> Base64Url.encode(paramItemValue)).collect(Collectors.toList()), CollectionFormat.CSV); - return service.base64urlArraySync(valueConverted, requestOptions, Context.NONE); + return service.base64urlArraySync(this.client.getEndpoint(), valueConverted, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/bytes/implementation/PropertiesImpl.java b/typespec-tests/src/main/java/com/encode/bytes/implementation/PropertiesImpl.java index fadb0b0f01..cf13e81e8d 100644 --- a/typespec-tests/src/main/java/com/encode/bytes/implementation/PropertiesImpl.java +++ b/typespec-tests/src/main/java/com/encode/bytes/implementation/PropertiesImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class PropertiesImpl { * The interface defining all the services for BytesClientProperties to be used by the proxy service to perform REST * calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "BytesClientPropertie") public interface PropertiesService { @Post("/encode/bytes/property/default") @@ -63,9 +64,9 @@ public interface PropertiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> defaultMethod(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/default") @ExpectedResponses({ 200 }) @@ -73,9 +74,9 @@ Mono> defaultMethod(@HeaderParam("Content-Type") String con @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response defaultMethodSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/base64") @ExpectedResponses({ 200 }) @@ -83,9 +84,9 @@ Response defaultMethodSync(@HeaderParam("Content-Type") String conte @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> base64(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/base64") @ExpectedResponses({ 200 }) @@ -93,9 +94,9 @@ Mono> base64(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64Sync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response base64Sync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/base64url") @ExpectedResponses({ 200 }) @@ -103,9 +104,9 @@ Response base64Sync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64url(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> base64url(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/base64url") @ExpectedResponses({ 200 }) @@ -113,9 +114,9 @@ Mono> base64url(@HeaderParam("Content-Type") String content @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response base64urlSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/base64url-array") @ExpectedResponses({ 200 }) @@ -123,9 +124,9 @@ Response base64urlSync(@HeaderParam("Content-Type") String contentTy @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64urlArray(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> base64urlArray(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/bytes/property/base64url-array") @ExpectedResponses({ 200 }) @@ -133,9 +134,9 @@ Mono> base64urlArray(@HeaderParam("Content-Type") String co @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlArraySync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response base64urlArraySync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -168,8 +169,8 @@ Response base64urlArraySync(@HeaderParam("Content-Type") String cont public Mono> defaultMethodWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.defaultMethod(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.defaultMethod(this.client.getEndpoint(), contentType, accept, + body, requestOptions, context)); } /** @@ -202,7 +203,8 @@ public Mono> defaultMethodWithResponseAsync(BinaryData body public Response defaultMethodWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.defaultMethodSync(contentType, accept, body, requestOptions, Context.NONE); + return service.defaultMethodSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } /** @@ -235,7 +237,8 @@ public Response defaultMethodWithResponse(BinaryData body, RequestOp public Mono> base64WithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.base64(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.base64(this.client.getEndpoint(), contentType, accept, body, requestOptions, context)); } /** @@ -268,7 +271,7 @@ public Mono> base64WithResponseAsync(BinaryData body, Reque public Response base64WithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.base64Sync(contentType, accept, body, requestOptions, Context.NONE); + return service.base64Sync(this.client.getEndpoint(), contentType, accept, body, requestOptions, Context.NONE); } /** @@ -301,7 +304,8 @@ public Response base64WithResponse(BinaryData body, RequestOptions r public Mono> base64urlWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.base64url(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64url(this.client.getEndpoint(), contentType, accept, body, + requestOptions, context)); } /** @@ -334,7 +338,8 @@ public Mono> base64urlWithResponseAsync(BinaryData body, Re public Response base64urlWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.base64urlSync(contentType, accept, body, requestOptions, Context.NONE); + return service.base64urlSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } /** @@ -371,8 +376,8 @@ public Response base64urlWithResponse(BinaryData body, RequestOption public Mono> base64urlArrayWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.base64urlArray(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.base64urlArray(this.client.getEndpoint(), contentType, accept, + body, requestOptions, context)); } /** @@ -409,6 +414,7 @@ public Mono> base64urlArrayWithResponseAsync(BinaryData bod public Response base64urlArrayWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.base64urlArraySync(contentType, accept, body, requestOptions, Context.NONE); + return service.base64urlArraySync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/bytes/implementation/QueriesImpl.java b/typespec-tests/src/main/java/com/encode/bytes/implementation/QueriesImpl.java index 176ea4989f..238ac4a189 100644 --- a/typespec-tests/src/main/java/com/encode/bytes/implementation/QueriesImpl.java +++ b/typespec-tests/src/main/java/com/encode/bytes/implementation/QueriesImpl.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -57,7 +58,7 @@ public final class QueriesImpl { * The interface defining all the services for BytesClientQueries to be used by the proxy service to perform REST * calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "BytesClientQueries") public interface QueriesService { @Get("/encode/bytes/query/default") @@ -66,8 +67,8 @@ public interface QueriesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@QueryParam("value") String value, RequestOptions requestOptions, - Context context); + Mono> defaultMethod(@HostParam("endpoint") String endpoint, @QueryParam("value") String value, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/query/default") @ExpectedResponses({ 204 }) @@ -75,8 +76,8 @@ Mono> defaultMethod(@QueryParam("value") String value, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@QueryParam("value") String value, RequestOptions requestOptions, - Context context); + Response defaultMethodSync(@HostParam("endpoint") String endpoint, @QueryParam("value") String value, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/query/base64") @ExpectedResponses({ 204 }) @@ -84,7 +85,8 @@ Response defaultMethodSync(@QueryParam("value") String value, RequestOptio @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64(@QueryParam("value") String value, RequestOptions requestOptions, Context context); + Mono> base64(@HostParam("endpoint") String endpoint, @QueryParam("value") String value, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/query/base64") @ExpectedResponses({ 204 }) @@ -92,7 +94,8 @@ Response defaultMethodSync(@QueryParam("value") String value, RequestOptio @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64Sync(@QueryParam("value") String value, RequestOptions requestOptions, Context context); + Response base64Sync(@HostParam("endpoint") String endpoint, @QueryParam("value") String value, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/query/base64url") @ExpectedResponses({ 204 }) @@ -100,8 +103,8 @@ Response defaultMethodSync(@QueryParam("value") String value, RequestOptio @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64url(@QueryParam("value") Base64Url value, RequestOptions requestOptions, - Context context); + Mono> base64url(@HostParam("endpoint") String endpoint, @QueryParam("value") Base64Url value, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/query/base64url") @ExpectedResponses({ 204 }) @@ -109,8 +112,8 @@ Mono> base64url(@QueryParam("value") Base64Url value, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlSync(@QueryParam("value") Base64Url value, RequestOptions requestOptions, - Context context); + Response base64urlSync(@HostParam("endpoint") String endpoint, @QueryParam("value") Base64Url value, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/query/base64url-array") @ExpectedResponses({ 204 }) @@ -118,8 +121,8 @@ Response base64urlSync(@QueryParam("value") Base64Url value, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64urlArray(@QueryParam("value") String value, RequestOptions requestOptions, - Context context); + Mono> base64urlArray(@HostParam("endpoint") String endpoint, @QueryParam("value") String value, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/query/base64url-array") @ExpectedResponses({ 204 }) @@ -127,8 +130,8 @@ Mono> base64urlArray(@QueryParam("value") String value, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlArraySync(@QueryParam("value") String value, RequestOptions requestOptions, - Context context); + Response base64urlArraySync(@HostParam("endpoint") String endpoint, @QueryParam("value") String value, + RequestOptions requestOptions, Context context); } /** @@ -145,7 +148,8 @@ Response base64urlArraySync(@QueryParam("value") String value, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(byte[] value, RequestOptions requestOptions) { String valueConverted = Base64Util.encodeToString(value); - return FluxUtil.withContext(context -> service.defaultMethod(valueConverted, requestOptions, context)); + return FluxUtil.withContext( + context -> service.defaultMethod(this.client.getEndpoint(), valueConverted, requestOptions, context)); } /** @@ -162,7 +166,7 @@ public Mono> defaultMethodWithResponseAsync(byte[] value, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(byte[] value, RequestOptions requestOptions) { String valueConverted = Base64Util.encodeToString(value); - return service.defaultMethodSync(valueConverted, requestOptions, Context.NONE); + return service.defaultMethodSync(this.client.getEndpoint(), valueConverted, requestOptions, Context.NONE); } /** @@ -179,7 +183,8 @@ public Response defaultMethodWithResponse(byte[] value, RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64WithResponseAsync(byte[] value, RequestOptions requestOptions) { String valueConverted = Base64Util.encodeToString(value); - return FluxUtil.withContext(context -> service.base64(valueConverted, requestOptions, context)); + return FluxUtil + .withContext(context -> service.base64(this.client.getEndpoint(), valueConverted, requestOptions, context)); } /** @@ -196,7 +201,7 @@ public Mono> base64WithResponseAsync(byte[] value, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response base64WithResponse(byte[] value, RequestOptions requestOptions) { String valueConverted = Base64Util.encodeToString(value); - return service.base64Sync(valueConverted, requestOptions, Context.NONE); + return service.base64Sync(this.client.getEndpoint(), valueConverted, requestOptions, Context.NONE); } /** @@ -213,7 +218,8 @@ public Response base64WithResponse(byte[] value, RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64urlWithResponseAsync(byte[] value, RequestOptions requestOptions) { Base64Url valueConverted = Base64Url.encode(value); - return FluxUtil.withContext(context -> service.base64url(valueConverted, requestOptions, context)); + return FluxUtil.withContext( + context -> service.base64url(this.client.getEndpoint(), valueConverted, requestOptions, context)); } /** @@ -230,7 +236,7 @@ public Mono> base64urlWithResponseAsync(byte[] value, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response base64urlWithResponse(byte[] value, RequestOptions requestOptions) { Base64Url valueConverted = Base64Url.encode(value); - return service.base64urlSync(valueConverted, requestOptions, Context.NONE); + return service.base64urlSync(this.client.getEndpoint(), valueConverted, requestOptions, Context.NONE); } /** @@ -250,7 +256,8 @@ public Mono> base64urlArrayWithResponseAsync(List value, .serializeIterable( value.stream().map(paramItemValue -> Base64Url.encode(paramItemValue)).collect(Collectors.toList()), CollectionFormat.CSV); - return FluxUtil.withContext(context -> service.base64urlArray(valueConverted, requestOptions, context)); + return FluxUtil.withContext( + context -> service.base64urlArray(this.client.getEndpoint(), valueConverted, requestOptions, context)); } /** @@ -270,6 +277,6 @@ public Response base64urlArrayWithResponse(List value, RequestOpti .serializeIterable( value.stream().map(paramItemValue -> Base64Url.encode(paramItemValue)).collect(Collectors.toList()), CollectionFormat.CSV); - return service.base64urlArraySync(valueConverted, requestOptions, Context.NONE); + return service.base64urlArraySync(this.client.getEndpoint(), valueConverted, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/bytes/implementation/RequestBodiesImpl.java b/typespec-tests/src/main/java/com/encode/bytes/implementation/RequestBodiesImpl.java index 0d8c967708..87b035b669 100644 --- a/typespec-tests/src/main/java/com/encode/bytes/implementation/RequestBodiesImpl.java +++ b/typespec-tests/src/main/java/com/encode/bytes/implementation/RequestBodiesImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class RequestBodiesImpl { * The interface defining all the services for BytesClientRequestBodies to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "BytesClientRequestBo") public interface RequestBodiesService { @Post("/encode/bytes/body/request/default") @@ -63,8 +64,9 @@ public interface RequestBodiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); + Mono> defaultMethod(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData value, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/default") @ExpectedResponses({ 204 }) @@ -72,8 +74,9 @@ Mono> defaultMethod(@HeaderParam("Content-Type") String contentTy @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); + Response defaultMethodSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData value, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/octet-stream") @ExpectedResponses({ 204 }) @@ -81,8 +84,9 @@ Response defaultMethodSync(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> octetStream(@HeaderParam("content-type") String contentType, - @BodyParam("application/octet-stream") BinaryData value, RequestOptions requestOptions, Context context); + Mono> octetStream(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/octet-stream") BinaryData value, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/octet-stream") @ExpectedResponses({ 204 }) @@ -90,8 +94,9 @@ Mono> octetStream(@HeaderParam("content-type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response octetStreamSync(@HeaderParam("content-type") String contentType, - @BodyParam("application/octet-stream") BinaryData value, RequestOptions requestOptions, Context context); + Response octetStreamSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/octet-stream") BinaryData value, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/custom-content-type") @ExpectedResponses({ 204 }) @@ -99,8 +104,9 @@ Response octetStreamSync(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> customContentType(@HeaderParam("content-type") String contentType, - @BodyParam("image/png") BinaryData value, RequestOptions requestOptions, Context context); + Mono> customContentType(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("image/png") BinaryData value, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/custom-content-type") @ExpectedResponses({ 204 }) @@ -108,8 +114,9 @@ Mono> customContentType(@HeaderParam("content-type") String conte @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response customContentTypeSync(@HeaderParam("content-type") String contentType, - @BodyParam("image/png") BinaryData value, RequestOptions requestOptions, Context context); + Response customContentTypeSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("image/png") BinaryData value, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/base64") @ExpectedResponses({ 204 }) @@ -117,8 +124,9 @@ Response customContentTypeSync(@HeaderParam("content-type") String content @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); + Mono> base64(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData value, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/base64") @ExpectedResponses({ 204 }) @@ -126,8 +134,9 @@ Mono> base64(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64Sync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); + Response base64Sync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData value, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/base64url") @ExpectedResponses({ 204 }) @@ -135,8 +144,9 @@ Response base64Sync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64url(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); + Mono> base64url(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData value, + RequestOptions requestOptions, Context context); @Post("/encode/bytes/body/request/base64url") @ExpectedResponses({ 204 }) @@ -144,8 +154,9 @@ Mono> base64url(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); + Response base64urlSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData value, + RequestOptions requestOptions, Context context); } /** @@ -167,7 +178,8 @@ Response base64urlSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(BinaryData value, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.defaultMethod(contentType, value, requestOptions, context)); + return FluxUtil.withContext( + context -> service.defaultMethod(this.client.getEndpoint(), contentType, value, requestOptions, context)); } /** @@ -189,7 +201,7 @@ public Mono> defaultMethodWithResponseAsync(BinaryData value, Req @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(BinaryData value, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.defaultMethodSync(contentType, value, requestOptions, Context.NONE); + return service.defaultMethodSync(this.client.getEndpoint(), contentType, value, requestOptions, Context.NONE); } /** @@ -211,7 +223,8 @@ public Response defaultMethodWithResponse(BinaryData value, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> octetStreamWithResponseAsync(BinaryData value, RequestOptions requestOptions) { final String contentType = "application/octet-stream"; - return FluxUtil.withContext(context -> service.octetStream(contentType, value, requestOptions, context)); + return FluxUtil.withContext( + context -> service.octetStream(this.client.getEndpoint(), contentType, value, requestOptions, context)); } /** @@ -233,7 +246,7 @@ public Mono> octetStreamWithResponseAsync(BinaryData value, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response octetStreamWithResponse(BinaryData value, RequestOptions requestOptions) { final String contentType = "application/octet-stream"; - return service.octetStreamSync(contentType, value, requestOptions, Context.NONE); + return service.octetStreamSync(this.client.getEndpoint(), contentType, value, requestOptions, Context.NONE); } /** @@ -255,7 +268,8 @@ public Response octetStreamWithResponse(BinaryData value, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> customContentTypeWithResponseAsync(BinaryData value, RequestOptions requestOptions) { final String contentType = "image/png"; - return FluxUtil.withContext(context -> service.customContentType(contentType, value, requestOptions, context)); + return FluxUtil.withContext(context -> service.customContentType(this.client.getEndpoint(), contentType, value, + requestOptions, context)); } /** @@ -277,7 +291,8 @@ public Mono> customContentTypeWithResponseAsync(BinaryData value, @ServiceMethod(returns = ReturnType.SINGLE) public Response customContentTypeWithResponse(BinaryData value, RequestOptions requestOptions) { final String contentType = "image/png"; - return service.customContentTypeSync(contentType, value, requestOptions, Context.NONE); + return service.customContentTypeSync(this.client.getEndpoint(), contentType, value, requestOptions, + Context.NONE); } /** @@ -299,7 +314,8 @@ public Response customContentTypeWithResponse(BinaryData value, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64WithResponseAsync(BinaryData value, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.base64(contentType, value, requestOptions, context)); + return FluxUtil.withContext( + context -> service.base64(this.client.getEndpoint(), contentType, value, requestOptions, context)); } /** @@ -321,7 +337,7 @@ public Mono> base64WithResponseAsync(BinaryData value, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response base64WithResponse(BinaryData value, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.base64Sync(contentType, value, requestOptions, Context.NONE); + return service.base64Sync(this.client.getEndpoint(), contentType, value, requestOptions, Context.NONE); } /** @@ -343,7 +359,8 @@ public Response base64WithResponse(BinaryData value, RequestOptions reques @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64urlWithResponseAsync(BinaryData value, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.base64url(contentType, value, requestOptions, context)); + return FluxUtil.withContext( + context -> service.base64url(this.client.getEndpoint(), contentType, value, requestOptions, context)); } /** @@ -365,6 +382,6 @@ public Mono> base64urlWithResponseAsync(BinaryData value, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response base64urlWithResponse(BinaryData value, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.base64urlSync(contentType, value, requestOptions, Context.NONE); + return service.base64urlSync(this.client.getEndpoint(), contentType, value, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/bytes/implementation/ResponseBodiesImpl.java b/typespec-tests/src/main/java/com/encode/bytes/implementation/ResponseBodiesImpl.java index 7aa9f06c83..8f84bfe688 100644 --- a/typespec-tests/src/main/java/com/encode/bytes/implementation/ResponseBodiesImpl.java +++ b/typespec-tests/src/main/java/com/encode/bytes/implementation/ResponseBodiesImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; @@ -53,7 +54,7 @@ public final class ResponseBodiesImpl { * The interface defining all the services for BytesClientResponseBodies to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "BytesClientResponseB") public interface ResponseBodiesService { @Get("/encode/bytes/body/response/default") @@ -62,8 +63,8 @@ public interface ResponseBodiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> defaultMethod(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/default") @ExpectedResponses({ 200 }) @@ -71,8 +72,8 @@ Mono> defaultMethod(@HeaderParam("Accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response defaultMethodSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/octet-stream") @ExpectedResponses({ 200 }) @@ -80,8 +81,8 @@ Response defaultMethodSync(@HeaderParam("Accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> octetStream(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> octetStream(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/octet-stream") @ExpectedResponses({ 200 }) @@ -89,8 +90,8 @@ Mono> octetStream(@HeaderParam("Accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response octetStreamSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response octetStreamSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/custom-content-type") @ExpectedResponses({ 200 }) @@ -98,8 +99,8 @@ Response octetStreamSync(@HeaderParam("Accept") String accept, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> customContentType(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> customContentType(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/custom-content-type") @ExpectedResponses({ 200 }) @@ -107,8 +108,8 @@ Mono> customContentType(@HeaderParam("Accept") String accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response customContentTypeSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response customContentTypeSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/base64") @ExpectedResponses({ 200 }) @@ -116,8 +117,8 @@ Response customContentTypeSync(@HeaderParam("Accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> base64(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/base64") @ExpectedResponses({ 200 }) @@ -125,8 +126,8 @@ Mono> base64(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64Sync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response base64Sync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/base64url") @ExpectedResponses({ 200 }) @@ -134,8 +135,8 @@ Response base64Sync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> base64url(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> base64url(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/encode/bytes/body/response/base64url") @ExpectedResponses({ 200 }) @@ -143,8 +144,8 @@ Mono> base64url(@HeaderParam("Accept") String accept, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response base64urlSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response base64urlSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); } /** @@ -165,7 +166,8 @@ Response base64urlSync(@HeaderParam("Accept") String accept, Request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.defaultMethod(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.defaultMethod(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -186,7 +188,7 @@ public Mono> defaultMethodWithResponseAsync(RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.defaultMethodSync(accept, requestOptions, Context.NONE); + return service.defaultMethodSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -207,7 +209,8 @@ public Response defaultMethodWithResponse(RequestOptions requestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Mono> octetStreamWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/octet-stream"; - return FluxUtil.withContext(context -> service.octetStream(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.octetStream(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -228,7 +231,7 @@ public Mono> octetStreamWithResponseAsync(RequestOptions re @ServiceMethod(returns = ReturnType.SINGLE) public Response octetStreamWithResponse(RequestOptions requestOptions) { final String accept = "application/octet-stream"; - return service.octetStreamSync(accept, requestOptions, Context.NONE); + return service.octetStreamSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -249,7 +252,8 @@ public Response octetStreamWithResponse(RequestOptions requestOption @ServiceMethod(returns = ReturnType.SINGLE) public Mono> customContentTypeWithResponseAsync(RequestOptions requestOptions) { final String accept = "image/png"; - return FluxUtil.withContext(context -> service.customContentType(accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.customContentType(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -270,7 +274,7 @@ public Mono> customContentTypeWithResponseAsync(RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response customContentTypeWithResponse(RequestOptions requestOptions) { final String accept = "image/png"; - return service.customContentTypeSync(accept, requestOptions, Context.NONE); + return service.customContentTypeSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -291,7 +295,8 @@ public Response customContentTypeWithResponse(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64WithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.base64(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.base64(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -312,7 +317,7 @@ public Mono> base64WithResponseAsync(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Response base64WithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.base64Sync(accept, requestOptions, Context.NONE); + return service.base64Sync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -333,7 +338,8 @@ public Response base64WithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> base64urlWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.base64url(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.base64url(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -354,6 +360,6 @@ public Mono> base64urlWithResponseAsync(RequestOptions requ @ServiceMethod(returns = ReturnType.SINGLE) public Response base64urlWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.base64urlSync(accept, requestOptions, Context.NONE); + return service.base64urlSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/datetime/DatetimeClientBuilder.java b/typespec-tests/src/main/java/com/encode/datetime/DatetimeClientBuilder.java index 515fde9d94..39a6c7371d 100644 --- a/typespec-tests/src/main/java/com/encode/datetime/DatetimeClientBuilder.java +++ b/typespec-tests/src/main/java/com/encode/datetime/DatetimeClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -49,8 +50,8 @@ PropertyAsyncClient.class, HeaderAsyncClient.class, ResponseHeaderAsyncClient.class }) -public final class DatetimeClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class DatetimeClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -181,6 +182,22 @@ public DatetimeClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public DatetimeClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -209,7 +226,7 @@ private DatetimeClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); DatetimeClientImpl client - = new DatetimeClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + = new DatetimeClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -217,6 +234,7 @@ private DatetimeClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/encode/datetime/implementation/DatetimeClientImpl.java b/typespec-tests/src/main/java/com/encode/datetime/implementation/DatetimeClientImpl.java index 9dd82ddfe9..7074d58795 100644 --- a/typespec-tests/src/main/java/com/encode/datetime/implementation/DatetimeClientImpl.java +++ b/typespec-tests/src/main/java/com/encode/datetime/implementation/DatetimeClientImpl.java @@ -15,6 +15,20 @@ * Initializes a new instance of the DatetimeClient type. */ public final class DatetimeClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -101,19 +115,22 @@ public ResponseHeadersImpl getResponseHeaders() { /** * Initializes an instance of DatetimeClient client. + * + * @param endpoint Service host. */ - public DatetimeClientImpl() { + public DatetimeClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of DatetimeClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public DatetimeClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public DatetimeClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -121,10 +138,12 @@ public DatetimeClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public DatetimeClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public DatetimeClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.queries = new QueriesImpl(this); this.properties = new PropertiesImpl(this); this.headers = new HeadersImpl(this); diff --git a/typespec-tests/src/main/java/com/encode/datetime/implementation/HeadersImpl.java b/typespec-tests/src/main/java/com/encode/datetime/implementation/HeadersImpl.java index a28340f48f..b3357760fe 100644 --- a/typespec-tests/src/main/java/com/encode/datetime/implementation/HeadersImpl.java +++ b/typespec-tests/src/main/java/com/encode/datetime/implementation/HeadersImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; @@ -57,7 +58,7 @@ public final class HeadersImpl { * The interface defining all the services for DatetimeClientHeaders to be used by the proxy service to perform REST * calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "DatetimeClientHeader") public interface HeadersService { @Get("/encode/datetime/header/default") @@ -66,8 +67,8 @@ public interface HeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, - Context context); + Mono> defaultMethod(@HostParam("endpoint") String endpoint, + @HeaderParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, Context context); @Get("/encode/datetime/header/default") @ExpectedResponses({ 204 }) @@ -75,8 +76,8 @@ Mono> defaultMethod(@HeaderParam("value") DateTimeRfc1123 value, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, - Context context); + Response defaultMethodSync(@HostParam("endpoint") String endpoint, + @HeaderParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, Context context); @Get("/encode/datetime/header/rfc3339") @ExpectedResponses({ 204 }) @@ -84,8 +85,8 @@ Response defaultMethodSync(@HeaderParam("value") DateTimeRfc1123 value, Re @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc3339(@HeaderParam("value") OffsetDateTime value, RequestOptions requestOptions, - Context context); + Mono> rfc3339(@HostParam("endpoint") String endpoint, @HeaderParam("value") OffsetDateTime value, + RequestOptions requestOptions, Context context); @Get("/encode/datetime/header/rfc3339") @ExpectedResponses({ 204 }) @@ -93,8 +94,8 @@ Mono> rfc3339(@HeaderParam("value") OffsetDateTime value, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc3339Sync(@HeaderParam("value") OffsetDateTime value, RequestOptions requestOptions, - Context context); + Response rfc3339Sync(@HostParam("endpoint") String endpoint, @HeaderParam("value") OffsetDateTime value, + RequestOptions requestOptions, Context context); @Get("/encode/datetime/header/rfc7231") @ExpectedResponses({ 204 }) @@ -102,8 +103,8 @@ Response rfc3339Sync(@HeaderParam("value") OffsetDateTime value, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc7231(@HeaderParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, - Context context); + Mono> rfc7231(@HostParam("endpoint") String endpoint, + @HeaderParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, Context context); @Get("/encode/datetime/header/rfc7231") @ExpectedResponses({ 204 }) @@ -111,8 +112,8 @@ Mono> rfc7231(@HeaderParam("value") DateTimeRfc1123 value, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc7231Sync(@HeaderParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, - Context context); + Response rfc7231Sync(@HostParam("endpoint") String endpoint, @HeaderParam("value") DateTimeRfc1123 value, + RequestOptions requestOptions, Context context); @Get("/encode/datetime/header/unix-timestamp") @ExpectedResponses({ 204 }) @@ -120,8 +121,8 @@ Response rfc7231Sync(@HeaderParam("value") DateTimeRfc1123 value, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestamp(@HeaderParam("value") long value, RequestOptions requestOptions, - Context context); + Mono> unixTimestamp(@HostParam("endpoint") String endpoint, @HeaderParam("value") long value, + RequestOptions requestOptions, Context context); @Get("/encode/datetime/header/unix-timestamp") @ExpectedResponses({ 204 }) @@ -129,8 +130,8 @@ Mono> unixTimestamp(@HeaderParam("value") long value, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampSync(@HeaderParam("value") long value, RequestOptions requestOptions, - Context context); + Response unixTimestampSync(@HostParam("endpoint") String endpoint, @HeaderParam("value") long value, + RequestOptions requestOptions, Context context); @Get("/encode/datetime/header/unix-timestamp-array") @ExpectedResponses({ 204 }) @@ -138,8 +139,8 @@ Response unixTimestampSync(@HeaderParam("value") long value, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestampArray(@HeaderParam("value") String value, RequestOptions requestOptions, - Context context); + Mono> unixTimestampArray(@HostParam("endpoint") String endpoint, + @HeaderParam("value") String value, RequestOptions requestOptions, Context context); @Get("/encode/datetime/header/unix-timestamp-array") @ExpectedResponses({ 204 }) @@ -147,8 +148,8 @@ Mono> unixTimestampArray(@HeaderParam("value") String value, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampArraySync(@HeaderParam("value") String value, RequestOptions requestOptions, - Context context); + Response unixTimestampArraySync(@HostParam("endpoint") String endpoint, + @HeaderParam("value") String value, RequestOptions requestOptions, Context context); } /** @@ -165,7 +166,8 @@ Response unixTimestampArraySync(@HeaderParam("value") String value, Reques @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { DateTimeRfc1123 valueConverted = new DateTimeRfc1123(value); - return FluxUtil.withContext(context -> service.defaultMethod(valueConverted, requestOptions, context)); + return FluxUtil.withContext( + context -> service.defaultMethod(this.client.getEndpoint(), valueConverted, requestOptions, context)); } /** @@ -182,7 +184,7 @@ public Mono> defaultMethodWithResponseAsync(OffsetDateTime value, @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(OffsetDateTime value, RequestOptions requestOptions) { DateTimeRfc1123 valueConverted = new DateTimeRfc1123(value); - return service.defaultMethodSync(valueConverted, requestOptions, Context.NONE); + return service.defaultMethodSync(this.client.getEndpoint(), valueConverted, requestOptions, Context.NONE); } /** @@ -198,7 +200,8 @@ public Response defaultMethodWithResponse(OffsetDateTime value, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc3339WithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.rfc3339(value, requestOptions, context)); + return FluxUtil + .withContext(context -> service.rfc3339(this.client.getEndpoint(), value, requestOptions, context)); } /** @@ -214,7 +217,7 @@ public Mono> rfc3339WithResponseAsync(OffsetDateTime value, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc3339WithResponse(OffsetDateTime value, RequestOptions requestOptions) { - return service.rfc3339Sync(value, requestOptions, Context.NONE); + return service.rfc3339Sync(this.client.getEndpoint(), value, requestOptions, Context.NONE); } /** @@ -231,7 +234,8 @@ public Response rfc3339WithResponse(OffsetDateTime value, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc7231WithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { DateTimeRfc1123 valueConverted = new DateTimeRfc1123(value); - return FluxUtil.withContext(context -> service.rfc7231(valueConverted, requestOptions, context)); + return FluxUtil.withContext( + context -> service.rfc7231(this.client.getEndpoint(), valueConverted, requestOptions, context)); } /** @@ -248,7 +252,7 @@ public Mono> rfc7231WithResponseAsync(OffsetDateTime value, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc7231WithResponse(OffsetDateTime value, RequestOptions requestOptions) { DateTimeRfc1123 valueConverted = new DateTimeRfc1123(value); - return service.rfc7231Sync(valueConverted, requestOptions, Context.NONE); + return service.rfc7231Sync(this.client.getEndpoint(), valueConverted, requestOptions, Context.NONE); } /** @@ -265,7 +269,8 @@ public Response rfc7231WithResponse(OffsetDateTime value, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unixTimestampWithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { long valueConverted = value.toEpochSecond(); - return FluxUtil.withContext(context -> service.unixTimestamp(valueConverted, requestOptions, context)); + return FluxUtil.withContext( + context -> service.unixTimestamp(this.client.getEndpoint(), valueConverted, requestOptions, context)); } /** @@ -282,7 +287,7 @@ public Mono> unixTimestampWithResponseAsync(OffsetDateTime value, @ServiceMethod(returns = ReturnType.SINGLE) public Response unixTimestampWithResponse(OffsetDateTime value, RequestOptions requestOptions) { long valueConverted = value.toEpochSecond(); - return service.unixTimestampSync(valueConverted, requestOptions, Context.NONE); + return service.unixTimestampSync(this.client.getEndpoint(), valueConverted, requestOptions, Context.NONE); } /** @@ -303,7 +308,8 @@ public Mono> unixTimestampArrayWithResponseAsync(List paramItemValue.toEpochSecond()).collect(Collectors.toList()), CollectionFormat.CSV); - return FluxUtil.withContext(context -> service.unixTimestampArray(valueConverted, requestOptions, context)); + return FluxUtil.withContext( + context -> service.unixTimestampArray(this.client.getEndpoint(), valueConverted, requestOptions, context)); } /** @@ -323,6 +329,6 @@ public Response unixTimestampArrayWithResponse(List value, .serializeIterable( value.stream().map(paramItemValue -> paramItemValue.toEpochSecond()).collect(Collectors.toList()), CollectionFormat.CSV); - return service.unixTimestampArraySync(valueConverted, requestOptions, Context.NONE); + return service.unixTimestampArraySync(this.client.getEndpoint(), valueConverted, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/datetime/implementation/PropertiesImpl.java b/typespec-tests/src/main/java/com/encode/datetime/implementation/PropertiesImpl.java index 7b1be1ade9..0ee32e70e6 100644 --- a/typespec-tests/src/main/java/com/encode/datetime/implementation/PropertiesImpl.java +++ b/typespec-tests/src/main/java/com/encode/datetime/implementation/PropertiesImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class PropertiesImpl { * The interface defining all the services for DatetimeClientProperties to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "DatetimeClientProper") public interface PropertiesService { @Post("/encode/datetime/property/default") @@ -63,9 +64,9 @@ public interface PropertiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> defaultMethod(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/default") @ExpectedResponses({ 200 }) @@ -73,9 +74,9 @@ Mono> defaultMethod(@HeaderParam("Content-Type") String con @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response defaultMethodSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/rfc3339") @ExpectedResponses({ 200 }) @@ -83,9 +84,9 @@ Response defaultMethodSync(@HeaderParam("Content-Type") String conte @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc3339(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> rfc3339(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/rfc3339") @ExpectedResponses({ 200 }) @@ -93,9 +94,9 @@ Mono> rfc3339(@HeaderParam("Content-Type") String contentTy @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc3339Sync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response rfc3339Sync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/rfc7231") @ExpectedResponses({ 200 }) @@ -103,9 +104,9 @@ Response rfc3339Sync(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc7231(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> rfc7231(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/rfc7231") @ExpectedResponses({ 200 }) @@ -113,9 +114,9 @@ Mono> rfc7231(@HeaderParam("Content-Type") String contentTy @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc7231Sync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response rfc7231Sync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/unix-timestamp") @ExpectedResponses({ 200 }) @@ -123,9 +124,9 @@ Response rfc7231Sync(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestamp(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> unixTimestamp(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/unix-timestamp") @ExpectedResponses({ 200 }) @@ -133,9 +134,9 @@ Mono> unixTimestamp(@HeaderParam("Content-Type") String con @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response unixTimestampSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/unix-timestamp-array") @ExpectedResponses({ 200 }) @@ -143,9 +144,9 @@ Response unixTimestampSync(@HeaderParam("Content-Type") String conte @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestampArray(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> unixTimestampArray(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/datetime/property/unix-timestamp-array") @ExpectedResponses({ 200 }) @@ -153,9 +154,9 @@ Mono> unixTimestampArray(@HeaderParam("Content-Type") Strin @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampArraySync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response unixTimestampArraySync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -188,8 +189,8 @@ Response unixTimestampArraySync(@HeaderParam("Content-Type") String public Mono> defaultMethodWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.defaultMethod(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.defaultMethod(this.client.getEndpoint(), contentType, accept, + body, requestOptions, context)); } /** @@ -222,7 +223,8 @@ public Mono> defaultMethodWithResponseAsync(BinaryData body public Response defaultMethodWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.defaultMethodSync(contentType, accept, body, requestOptions, Context.NONE); + return service.defaultMethodSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } /** @@ -255,7 +257,8 @@ public Response defaultMethodWithResponse(BinaryData body, RequestOp public Mono> rfc3339WithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.rfc3339(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.rfc3339(this.client.getEndpoint(), contentType, accept, body, requestOptions, context)); } /** @@ -288,7 +291,7 @@ public Mono> rfc3339WithResponseAsync(BinaryData body, Requ public Response rfc3339WithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.rfc3339Sync(contentType, accept, body, requestOptions, Context.NONE); + return service.rfc3339Sync(this.client.getEndpoint(), contentType, accept, body, requestOptions, Context.NONE); } /** @@ -321,7 +324,8 @@ public Response rfc3339WithResponse(BinaryData body, RequestOptions public Mono> rfc7231WithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.rfc7231(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.rfc7231(this.client.getEndpoint(), contentType, accept, body, requestOptions, context)); } /** @@ -354,7 +358,7 @@ public Mono> rfc7231WithResponseAsync(BinaryData body, Requ public Response rfc7231WithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.rfc7231Sync(contentType, accept, body, requestOptions, Context.NONE); + return service.rfc7231Sync(this.client.getEndpoint(), contentType, accept, body, requestOptions, Context.NONE); } /** @@ -387,8 +391,8 @@ public Response rfc7231WithResponse(BinaryData body, RequestOptions public Mono> unixTimestampWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.unixTimestamp(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.unixTimestamp(this.client.getEndpoint(), contentType, accept, + body, requestOptions, context)); } /** @@ -421,7 +425,8 @@ public Mono> unixTimestampWithResponseAsync(BinaryData body public Response unixTimestampWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.unixTimestampSync(contentType, accept, body, requestOptions, Context.NONE); + return service.unixTimestampSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } /** @@ -459,8 +464,8 @@ public Mono> unixTimestampArrayWithResponseAsync(BinaryData RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.unixTimestampArray(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.unixTimestampArray(this.client.getEndpoint(), contentType, + accept, body, requestOptions, context)); } /** @@ -497,6 +502,7 @@ public Mono> unixTimestampArrayWithResponseAsync(BinaryData public Response unixTimestampArrayWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.unixTimestampArraySync(contentType, accept, body, requestOptions, Context.NONE); + return service.unixTimestampArraySync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/datetime/implementation/QueriesImpl.java b/typespec-tests/src/main/java/com/encode/datetime/implementation/QueriesImpl.java index c093cd7e19..3d1d80eb68 100644 --- a/typespec-tests/src/main/java/com/encode/datetime/implementation/QueriesImpl.java +++ b/typespec-tests/src/main/java/com/encode/datetime/implementation/QueriesImpl.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -57,7 +58,7 @@ public final class QueriesImpl { * The interface defining all the services for DatetimeClientQueries to be used by the proxy service to perform REST * calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "DatetimeClientQuerie") public interface QueriesService { @Get("/encode/datetime/query/default") @@ -66,8 +67,8 @@ public interface QueriesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@QueryParam("value") OffsetDateTime value, RequestOptions requestOptions, - Context context); + Mono> defaultMethod(@HostParam("endpoint") String endpoint, + @QueryParam("value") OffsetDateTime value, RequestOptions requestOptions, Context context); @Get("/encode/datetime/query/default") @ExpectedResponses({ 204 }) @@ -75,8 +76,8 @@ Mono> defaultMethod(@QueryParam("value") OffsetDateTime value, Re @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@QueryParam("value") OffsetDateTime value, RequestOptions requestOptions, - Context context); + Response defaultMethodSync(@HostParam("endpoint") String endpoint, + @QueryParam("value") OffsetDateTime value, RequestOptions requestOptions, Context context); @Get("/encode/datetime/query/rfc3339") @ExpectedResponses({ 204 }) @@ -84,8 +85,8 @@ Response defaultMethodSync(@QueryParam("value") OffsetDateTime value, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc3339(@QueryParam("value") OffsetDateTime value, RequestOptions requestOptions, - Context context); + Mono> rfc3339(@HostParam("endpoint") String endpoint, @QueryParam("value") OffsetDateTime value, + RequestOptions requestOptions, Context context); @Get("/encode/datetime/query/rfc3339") @ExpectedResponses({ 204 }) @@ -93,8 +94,8 @@ Mono> rfc3339(@QueryParam("value") OffsetDateTime value, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc3339Sync(@QueryParam("value") OffsetDateTime value, RequestOptions requestOptions, - Context context); + Response rfc3339Sync(@HostParam("endpoint") String endpoint, @QueryParam("value") OffsetDateTime value, + RequestOptions requestOptions, Context context); @Get("/encode/datetime/query/rfc7231") @ExpectedResponses({ 204 }) @@ -102,8 +103,8 @@ Response rfc3339Sync(@QueryParam("value") OffsetDateTime value, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc7231(@QueryParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, - Context context); + Mono> rfc7231(@HostParam("endpoint") String endpoint, @QueryParam("value") DateTimeRfc1123 value, + RequestOptions requestOptions, Context context); @Get("/encode/datetime/query/rfc7231") @ExpectedResponses({ 204 }) @@ -111,8 +112,8 @@ Mono> rfc7231(@QueryParam("value") DateTimeRfc1123 value, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc7231Sync(@QueryParam("value") DateTimeRfc1123 value, RequestOptions requestOptions, - Context context); + Response rfc7231Sync(@HostParam("endpoint") String endpoint, @QueryParam("value") DateTimeRfc1123 value, + RequestOptions requestOptions, Context context); @Get("/encode/datetime/query/unix-timestamp") @ExpectedResponses({ 204 }) @@ -120,8 +121,8 @@ Response rfc7231Sync(@QueryParam("value") DateTimeRfc1123 value, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestamp(@QueryParam("value") long value, RequestOptions requestOptions, - Context context); + Mono> unixTimestamp(@HostParam("endpoint") String endpoint, @QueryParam("value") long value, + RequestOptions requestOptions, Context context); @Get("/encode/datetime/query/unix-timestamp") @ExpectedResponses({ 204 }) @@ -129,8 +130,8 @@ Mono> unixTimestamp(@QueryParam("value") long value, RequestOptio @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampSync(@QueryParam("value") long value, RequestOptions requestOptions, - Context context); + Response unixTimestampSync(@HostParam("endpoint") String endpoint, @QueryParam("value") long value, + RequestOptions requestOptions, Context context); @Get("/encode/datetime/query/unix-timestamp-array") @ExpectedResponses({ 204 }) @@ -138,8 +139,8 @@ Response unixTimestampSync(@QueryParam("value") long value, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestampArray(@QueryParam("value") String value, RequestOptions requestOptions, - Context context); + Mono> unixTimestampArray(@HostParam("endpoint") String endpoint, + @QueryParam("value") String value, RequestOptions requestOptions, Context context); @Get("/encode/datetime/query/unix-timestamp-array") @ExpectedResponses({ 204 }) @@ -147,8 +148,8 @@ Mono> unixTimestampArray(@QueryParam("value") String value, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampArraySync(@QueryParam("value") String value, RequestOptions requestOptions, - Context context); + Response unixTimestampArraySync(@HostParam("endpoint") String endpoint, @QueryParam("value") String value, + RequestOptions requestOptions, Context context); } /** @@ -164,7 +165,8 @@ Response unixTimestampArraySync(@QueryParam("value") String value, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.defaultMethod(value, requestOptions, context)); + return FluxUtil + .withContext(context -> service.defaultMethod(this.client.getEndpoint(), value, requestOptions, context)); } /** @@ -180,7 +182,7 @@ public Mono> defaultMethodWithResponseAsync(OffsetDateTime value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(OffsetDateTime value, RequestOptions requestOptions) { - return service.defaultMethodSync(value, requestOptions, Context.NONE); + return service.defaultMethodSync(this.client.getEndpoint(), value, requestOptions, Context.NONE); } /** @@ -196,7 +198,8 @@ public Response defaultMethodWithResponse(OffsetDateTime value, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc3339WithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.rfc3339(value, requestOptions, context)); + return FluxUtil + .withContext(context -> service.rfc3339(this.client.getEndpoint(), value, requestOptions, context)); } /** @@ -212,7 +215,7 @@ public Mono> rfc3339WithResponseAsync(OffsetDateTime value, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc3339WithResponse(OffsetDateTime value, RequestOptions requestOptions) { - return service.rfc3339Sync(value, requestOptions, Context.NONE); + return service.rfc3339Sync(this.client.getEndpoint(), value, requestOptions, Context.NONE); } /** @@ -229,7 +232,8 @@ public Response rfc3339WithResponse(OffsetDateTime value, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc7231WithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { DateTimeRfc1123 valueConverted = new DateTimeRfc1123(value); - return FluxUtil.withContext(context -> service.rfc7231(valueConverted, requestOptions, context)); + return FluxUtil.withContext( + context -> service.rfc7231(this.client.getEndpoint(), valueConverted, requestOptions, context)); } /** @@ -246,7 +250,7 @@ public Mono> rfc7231WithResponseAsync(OffsetDateTime value, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc7231WithResponse(OffsetDateTime value, RequestOptions requestOptions) { DateTimeRfc1123 valueConverted = new DateTimeRfc1123(value); - return service.rfc7231Sync(valueConverted, requestOptions, Context.NONE); + return service.rfc7231Sync(this.client.getEndpoint(), valueConverted, requestOptions, Context.NONE); } /** @@ -263,7 +267,8 @@ public Response rfc7231WithResponse(OffsetDateTime value, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unixTimestampWithResponseAsync(OffsetDateTime value, RequestOptions requestOptions) { long valueConverted = value.toEpochSecond(); - return FluxUtil.withContext(context -> service.unixTimestamp(valueConverted, requestOptions, context)); + return FluxUtil.withContext( + context -> service.unixTimestamp(this.client.getEndpoint(), valueConverted, requestOptions, context)); } /** @@ -280,7 +285,7 @@ public Mono> unixTimestampWithResponseAsync(OffsetDateTime value, @ServiceMethod(returns = ReturnType.SINGLE) public Response unixTimestampWithResponse(OffsetDateTime value, RequestOptions requestOptions) { long valueConverted = value.toEpochSecond(); - return service.unixTimestampSync(valueConverted, requestOptions, Context.NONE); + return service.unixTimestampSync(this.client.getEndpoint(), valueConverted, requestOptions, Context.NONE); } /** @@ -301,7 +306,8 @@ public Mono> unixTimestampArrayWithResponseAsync(List paramItemValue.toEpochSecond()).collect(Collectors.toList()), CollectionFormat.CSV); - return FluxUtil.withContext(context -> service.unixTimestampArray(valueConverted, requestOptions, context)); + return FluxUtil.withContext( + context -> service.unixTimestampArray(this.client.getEndpoint(), valueConverted, requestOptions, context)); } /** @@ -321,6 +327,6 @@ public Response unixTimestampArrayWithResponse(List value, .serializeIterable( value.stream().map(paramItemValue -> paramItemValue.toEpochSecond()).collect(Collectors.toList()), CollectionFormat.CSV); - return service.unixTimestampArraySync(valueConverted, requestOptions, Context.NONE); + return service.unixTimestampArraySync(this.client.getEndpoint(), valueConverted, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/datetime/implementation/ResponseHeadersImpl.java b/typespec-tests/src/main/java/com/encode/datetime/implementation/ResponseHeadersImpl.java index 5f01e18700..b1a994d44e 100644 --- a/typespec-tests/src/main/java/com/encode/datetime/implementation/ResponseHeadersImpl.java +++ b/typespec-tests/src/main/java/com/encode/datetime/implementation/ResponseHeadersImpl.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; @@ -51,7 +52,7 @@ public final class ResponseHeadersImpl { * The interface defining all the services for DatetimeClientResponseHeaders to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "DatetimeClientRespon") public interface ResponseHeadersService { @Get("/encode/datetime/responseheader/default") @@ -60,7 +61,8 @@ public interface ResponseHeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(RequestOptions requestOptions, Context context); + Mono> defaultMethod(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/responseheader/default") @ExpectedResponses({ 204 }) @@ -68,7 +70,8 @@ public interface ResponseHeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(RequestOptions requestOptions, Context context); + Response defaultMethodSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/responseheader/rfc3339") @ExpectedResponses({ 204 }) @@ -76,7 +79,8 @@ public interface ResponseHeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc3339(RequestOptions requestOptions, Context context); + Mono> rfc3339(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/responseheader/rfc3339") @ExpectedResponses({ 204 }) @@ -84,7 +88,8 @@ public interface ResponseHeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc3339Sync(RequestOptions requestOptions, Context context); + Response rfc3339Sync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/responseheader/rfc7231") @ExpectedResponses({ 204 }) @@ -92,7 +97,8 @@ public interface ResponseHeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> rfc7231(RequestOptions requestOptions, Context context); + Mono> rfc7231(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/responseheader/rfc7231") @ExpectedResponses({ 204 }) @@ -100,7 +106,8 @@ public interface ResponseHeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response rfc7231Sync(RequestOptions requestOptions, Context context); + Response rfc7231Sync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/responseheader/unix-timestamp") @ExpectedResponses({ 204 }) @@ -108,7 +115,8 @@ public interface ResponseHeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unixTimestamp(RequestOptions requestOptions, Context context); + Mono> unixTimestamp(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/encode/datetime/responseheader/unix-timestamp") @ExpectedResponses({ 204 }) @@ -116,7 +124,8 @@ public interface ResponseHeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unixTimestampSync(RequestOptions requestOptions, Context context); + Response unixTimestampSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); } /** @@ -131,7 +140,8 @@ public interface ResponseHeadersService { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.defaultMethod(requestOptions, context)); + return FluxUtil + .withContext(context -> service.defaultMethod(this.client.getEndpoint(), requestOptions, context)); } /** @@ -146,7 +156,7 @@ public Mono> defaultMethodWithResponseAsync(RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(RequestOptions requestOptions) { - return service.defaultMethodSync(requestOptions, Context.NONE); + return service.defaultMethodSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -161,7 +171,7 @@ public Response defaultMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc3339WithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.rfc3339(requestOptions, context)); + return FluxUtil.withContext(context -> service.rfc3339(this.client.getEndpoint(), requestOptions, context)); } /** @@ -176,7 +186,7 @@ public Mono> rfc3339WithResponseAsync(RequestOptions requestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc3339WithResponse(RequestOptions requestOptions) { - return service.rfc3339Sync(requestOptions, Context.NONE); + return service.rfc3339Sync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -191,7 +201,7 @@ public Response rfc3339WithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> rfc7231WithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.rfc7231(requestOptions, context)); + return FluxUtil.withContext(context -> service.rfc7231(this.client.getEndpoint(), requestOptions, context)); } /** @@ -206,7 +216,7 @@ public Mono> rfc7231WithResponseAsync(RequestOptions requestOptio */ @ServiceMethod(returns = ReturnType.SINGLE) public Response rfc7231WithResponse(RequestOptions requestOptions) { - return service.rfc7231Sync(requestOptions, Context.NONE); + return service.rfc7231Sync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -221,7 +231,8 @@ public Response rfc7231WithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> unixTimestampWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.unixTimestamp(requestOptions, context)); + return FluxUtil + .withContext(context -> service.unixTimestamp(this.client.getEndpoint(), requestOptions, context)); } /** @@ -236,6 +247,6 @@ public Mono> unixTimestampWithResponseAsync(RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response unixTimestampWithResponse(RequestOptions requestOptions) { - return service.unixTimestampSync(requestOptions, Context.NONE); + return service.unixTimestampSync(this.client.getEndpoint(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/duration/DurationClientBuilder.java b/typespec-tests/src/main/java/com/encode/duration/DurationClientBuilder.java index be49f60039..6f25da7f88 100644 --- a/typespec-tests/src/main/java/com/encode/duration/DurationClientBuilder.java +++ b/typespec-tests/src/main/java/com/encode/duration/DurationClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -47,8 +48,8 @@ QueryAsyncClient.class, PropertyAsyncClient.class, HeaderAsyncClient.class }) -public final class DurationClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class DurationClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -179,6 +180,22 @@ public DurationClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public DurationClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -207,7 +224,7 @@ private DurationClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); DurationClientImpl client - = new DurationClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + = new DurationClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -215,6 +232,7 @@ private DurationClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/encode/duration/implementation/DurationClientImpl.java b/typespec-tests/src/main/java/com/encode/duration/implementation/DurationClientImpl.java index e8411d2aff..9d731a2bda 100644 --- a/typespec-tests/src/main/java/com/encode/duration/implementation/DurationClientImpl.java +++ b/typespec-tests/src/main/java/com/encode/duration/implementation/DurationClientImpl.java @@ -15,6 +15,20 @@ * Initializes a new instance of the DurationClient type. */ public final class DurationClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -87,19 +101,22 @@ public HeadersImpl getHeaders() { /** * Initializes an instance of DurationClient client. + * + * @param endpoint Service host. */ - public DurationClientImpl() { + public DurationClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of DurationClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public DurationClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public DurationClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -107,10 +124,12 @@ public DurationClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public DurationClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public DurationClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.queries = new QueriesImpl(this); this.properties = new PropertiesImpl(this); this.headers = new HeadersImpl(this); diff --git a/typespec-tests/src/main/java/com/encode/duration/implementation/HeadersImpl.java b/typespec-tests/src/main/java/com/encode/duration/implementation/HeadersImpl.java index 466082b506..a966e154f0 100644 --- a/typespec-tests/src/main/java/com/encode/duration/implementation/HeadersImpl.java +++ b/typespec-tests/src/main/java/com/encode/duration/implementation/HeadersImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; @@ -55,7 +56,7 @@ public final class HeadersImpl { * The interface defining all the services for DurationClientHeaders to be used by the proxy service to perform REST * calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "DurationClientHeader") public interface HeadersService { @Get("/encode/duration/header/default") @@ -64,8 +65,8 @@ public interface HeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("duration") Duration duration, RequestOptions requestOptions, - Context context); + Mono> defaultMethod(@HostParam("endpoint") String endpoint, + @HeaderParam("duration") Duration duration, RequestOptions requestOptions, Context context); @Get("/encode/duration/header/default") @ExpectedResponses({ 204 }) @@ -73,8 +74,8 @@ Mono> defaultMethod(@HeaderParam("duration") Duration duration, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("duration") Duration duration, RequestOptions requestOptions, - Context context); + Response defaultMethodSync(@HostParam("endpoint") String endpoint, + @HeaderParam("duration") Duration duration, RequestOptions requestOptions, Context context); @Get("/encode/duration/header/iso8601") @ExpectedResponses({ 204 }) @@ -82,8 +83,8 @@ Response defaultMethodSync(@HeaderParam("duration") Duration duration, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> iso8601(@HeaderParam("duration") Duration duration, RequestOptions requestOptions, - Context context); + Mono> iso8601(@HostParam("endpoint") String endpoint, @HeaderParam("duration") Duration duration, + RequestOptions requestOptions, Context context); @Get("/encode/duration/header/iso8601") @ExpectedResponses({ 204 }) @@ -91,8 +92,8 @@ Mono> iso8601(@HeaderParam("duration") Duration duration, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response iso8601Sync(@HeaderParam("duration") Duration duration, RequestOptions requestOptions, - Context context); + Response iso8601Sync(@HostParam("endpoint") String endpoint, @HeaderParam("duration") Duration duration, + RequestOptions requestOptions, Context context); @Get("/encode/duration/header/iso8601-array") @ExpectedResponses({ 204 }) @@ -100,8 +101,8 @@ Response iso8601Sync(@HeaderParam("duration") Duration duration, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> iso8601Array(@HeaderParam("duration") String duration, RequestOptions requestOptions, - Context context); + Mono> iso8601Array(@HostParam("endpoint") String endpoint, + @HeaderParam("duration") String duration, RequestOptions requestOptions, Context context); @Get("/encode/duration/header/iso8601-array") @ExpectedResponses({ 204 }) @@ -109,8 +110,8 @@ Mono> iso8601Array(@HeaderParam("duration") String duration, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response iso8601ArraySync(@HeaderParam("duration") String duration, RequestOptions requestOptions, - Context context); + Response iso8601ArraySync(@HostParam("endpoint") String endpoint, + @HeaderParam("duration") String duration, RequestOptions requestOptions, Context context); @Get("/encode/duration/header/int32-seconds") @ExpectedResponses({ 204 }) @@ -118,8 +119,8 @@ Response iso8601ArraySync(@HeaderParam("duration") String duration, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> int32Seconds(@HeaderParam("duration") long duration, RequestOptions requestOptions, - Context context); + Mono> int32Seconds(@HostParam("endpoint") String endpoint, + @HeaderParam("duration") long duration, RequestOptions requestOptions, Context context); @Get("/encode/duration/header/int32-seconds") @ExpectedResponses({ 204 }) @@ -127,8 +128,8 @@ Mono> int32Seconds(@HeaderParam("duration") long duration, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response int32SecondsSync(@HeaderParam("duration") long duration, RequestOptions requestOptions, - Context context); + Response int32SecondsSync(@HostParam("endpoint") String endpoint, @HeaderParam("duration") long duration, + RequestOptions requestOptions, Context context); @Get("/encode/duration/header/float-seconds") @ExpectedResponses({ 204 }) @@ -136,8 +137,8 @@ Response int32SecondsSync(@HeaderParam("duration") long duration, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> floatSeconds(@HeaderParam("duration") double duration, RequestOptions requestOptions, - Context context); + Mono> floatSeconds(@HostParam("endpoint") String endpoint, + @HeaderParam("duration") double duration, RequestOptions requestOptions, Context context); @Get("/encode/duration/header/float-seconds") @ExpectedResponses({ 204 }) @@ -145,8 +146,8 @@ Mono> floatSeconds(@HeaderParam("duration") double duration, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response floatSecondsSync(@HeaderParam("duration") double duration, RequestOptions requestOptions, - Context context); + Response floatSecondsSync(@HostParam("endpoint") String endpoint, + @HeaderParam("duration") double duration, RequestOptions requestOptions, Context context); @Get("/encode/duration/header/float64-seconds") @ExpectedResponses({ 204 }) @@ -154,8 +155,8 @@ Response floatSecondsSync(@HeaderParam("duration") double duration, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> float64Seconds(@HeaderParam("duration") double duration, RequestOptions requestOptions, - Context context); + Mono> float64Seconds(@HostParam("endpoint") String endpoint, + @HeaderParam("duration") double duration, RequestOptions requestOptions, Context context); @Get("/encode/duration/header/float64-seconds") @ExpectedResponses({ 204 }) @@ -163,8 +164,8 @@ Mono> float64Seconds(@HeaderParam("duration") double duration, Re @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response float64SecondsSync(@HeaderParam("duration") double duration, RequestOptions requestOptions, - Context context); + Response float64SecondsSync(@HostParam("endpoint") String endpoint, + @HeaderParam("duration") double duration, RequestOptions requestOptions, Context context); } /** @@ -180,7 +181,8 @@ Response float64SecondsSync(@HeaderParam("duration") double duration, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(Duration duration, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.defaultMethod(duration, requestOptions, context)); + return FluxUtil.withContext( + context -> service.defaultMethod(this.client.getEndpoint(), duration, requestOptions, context)); } /** @@ -196,7 +198,7 @@ public Mono> defaultMethodWithResponseAsync(Duration duration, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(Duration duration, RequestOptions requestOptions) { - return service.defaultMethodSync(duration, requestOptions, Context.NONE); + return service.defaultMethodSync(this.client.getEndpoint(), duration, requestOptions, Context.NONE); } /** @@ -212,7 +214,8 @@ public Response defaultMethodWithResponse(Duration duration, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> iso8601WithResponseAsync(Duration duration, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.iso8601(duration, requestOptions, context)); + return FluxUtil + .withContext(context -> service.iso8601(this.client.getEndpoint(), duration, requestOptions, context)); } /** @@ -228,7 +231,7 @@ public Mono> iso8601WithResponseAsync(Duration duration, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response iso8601WithResponse(Duration duration, RequestOptions requestOptions) { - return service.iso8601Sync(duration, requestOptions, Context.NONE); + return service.iso8601Sync(this.client.getEndpoint(), duration, requestOptions, Context.NONE); } /** @@ -246,7 +249,8 @@ public Response iso8601WithResponse(Duration duration, RequestOptions requ public Mono> iso8601ArrayWithResponseAsync(List duration, RequestOptions requestOptions) { String durationConverted = JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(duration, CollectionFormat.CSV); - return FluxUtil.withContext(context -> service.iso8601Array(durationConverted, requestOptions, context)); + return FluxUtil.withContext( + context -> service.iso8601Array(this.client.getEndpoint(), durationConverted, requestOptions, context)); } /** @@ -264,7 +268,7 @@ public Mono> iso8601ArrayWithResponseAsync(List duratio public Response iso8601ArrayWithResponse(List duration, RequestOptions requestOptions) { String durationConverted = JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(duration, CollectionFormat.CSV); - return service.iso8601ArraySync(durationConverted, requestOptions, Context.NONE); + return service.iso8601ArraySync(this.client.getEndpoint(), durationConverted, requestOptions, Context.NONE); } /** @@ -281,7 +285,8 @@ public Response iso8601ArrayWithResponse(List duration, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Mono> int32SecondsWithResponseAsync(Duration duration, RequestOptions requestOptions) { long durationConverted = duration.getSeconds(); - return FluxUtil.withContext(context -> service.int32Seconds(durationConverted, requestOptions, context)); + return FluxUtil.withContext( + context -> service.int32Seconds(this.client.getEndpoint(), durationConverted, requestOptions, context)); } /** @@ -298,7 +303,7 @@ public Mono> int32SecondsWithResponseAsync(Duration duration, Req @ServiceMethod(returns = ReturnType.SINGLE) public Response int32SecondsWithResponse(Duration duration, RequestOptions requestOptions) { long durationConverted = duration.getSeconds(); - return service.int32SecondsSync(durationConverted, requestOptions, Context.NONE); + return service.int32SecondsSync(this.client.getEndpoint(), durationConverted, requestOptions, Context.NONE); } /** @@ -315,7 +320,8 @@ public Response int32SecondsWithResponse(Duration duration, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> floatSecondsWithResponseAsync(Duration duration, RequestOptions requestOptions) { double durationConverted = (double) duration.toNanos() / 1000_000_000L; - return FluxUtil.withContext(context -> service.floatSeconds(durationConverted, requestOptions, context)); + return FluxUtil.withContext( + context -> service.floatSeconds(this.client.getEndpoint(), durationConverted, requestOptions, context)); } /** @@ -332,7 +338,7 @@ public Mono> floatSecondsWithResponseAsync(Duration duration, Req @ServiceMethod(returns = ReturnType.SINGLE) public Response floatSecondsWithResponse(Duration duration, RequestOptions requestOptions) { double durationConverted = (double) duration.toNanos() / 1000_000_000L; - return service.floatSecondsSync(durationConverted, requestOptions, Context.NONE); + return service.floatSecondsSync(this.client.getEndpoint(), durationConverted, requestOptions, Context.NONE); } /** @@ -349,7 +355,8 @@ public Response floatSecondsWithResponse(Duration duration, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> float64SecondsWithResponseAsync(Duration duration, RequestOptions requestOptions) { double durationConverted = (double) duration.toNanos() / 1000_000_000L; - return FluxUtil.withContext(context -> service.float64Seconds(durationConverted, requestOptions, context)); + return FluxUtil.withContext( + context -> service.float64Seconds(this.client.getEndpoint(), durationConverted, requestOptions, context)); } /** @@ -366,6 +373,6 @@ public Mono> float64SecondsWithResponseAsync(Duration duration, R @ServiceMethod(returns = ReturnType.SINGLE) public Response float64SecondsWithResponse(Duration duration, RequestOptions requestOptions) { double durationConverted = (double) duration.toNanos() / 1000_000_000L; - return service.float64SecondsSync(durationConverted, requestOptions, Context.NONE); + return service.float64SecondsSync(this.client.getEndpoint(), durationConverted, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/duration/implementation/PropertiesImpl.java b/typespec-tests/src/main/java/com/encode/duration/implementation/PropertiesImpl.java index 5c97a30990..d3f98e0853 100644 --- a/typespec-tests/src/main/java/com/encode/duration/implementation/PropertiesImpl.java +++ b/typespec-tests/src/main/java/com/encode/duration/implementation/PropertiesImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class PropertiesImpl { * The interface defining all the services for DurationClientProperties to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "DurationClientProper") public interface PropertiesService { @Post("/encode/duration/property/default") @@ -63,9 +64,9 @@ public interface PropertiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> defaultMethod(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/duration/property/default") @ExpectedResponses({ 200 }) @@ -73,9 +74,9 @@ Mono> defaultMethod(@HeaderParam("Content-Type") String con @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response defaultMethodSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/duration/property/iso8601") @ExpectedResponses({ 200 }) @@ -83,9 +84,9 @@ Response defaultMethodSync(@HeaderParam("Content-Type") String conte @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> iso8601(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> iso8601(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/duration/property/iso8601") @ExpectedResponses({ 200 }) @@ -93,9 +94,9 @@ Mono> iso8601(@HeaderParam("Content-Type") String contentTy @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response iso8601Sync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response iso8601Sync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/duration/property/int32-seconds") @ExpectedResponses({ 200 }) @@ -103,9 +104,9 @@ Response iso8601Sync(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> int32Seconds(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> int32Seconds(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/duration/property/int32-seconds") @ExpectedResponses({ 200 }) @@ -113,9 +114,9 @@ Mono> int32Seconds(@HeaderParam("Content-Type") String cont @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response int32SecondsSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response int32SecondsSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/duration/property/float-seconds") @ExpectedResponses({ 200 }) @@ -123,9 +124,9 @@ Response int32SecondsSync(@HeaderParam("Content-Type") String conten @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> floatSeconds(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> floatSeconds(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/duration/property/float-seconds") @ExpectedResponses({ 200 }) @@ -133,9 +134,9 @@ Mono> floatSeconds(@HeaderParam("Content-Type") String cont @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response floatSecondsSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response floatSecondsSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/duration/property/float64-seconds") @ExpectedResponses({ 200 }) @@ -143,9 +144,9 @@ Response floatSecondsSync(@HeaderParam("Content-Type") String conten @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> float64Seconds(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> float64Seconds(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/duration/property/float64-seconds") @ExpectedResponses({ 200 }) @@ -153,9 +154,9 @@ Mono> float64Seconds(@HeaderParam("Content-Type") String co @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response float64SecondsSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response float64SecondsSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/duration/property/float-seconds-array") @ExpectedResponses({ 200 }) @@ -163,9 +164,9 @@ Response float64SecondsSync(@HeaderParam("Content-Type") String cont @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> floatSecondsArray(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> floatSecondsArray(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/duration/property/float-seconds-array") @ExpectedResponses({ 200 }) @@ -173,9 +174,9 @@ Mono> floatSecondsArray(@HeaderParam("Content-Type") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response floatSecondsArraySync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response floatSecondsArraySync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -208,8 +209,8 @@ Response floatSecondsArraySync(@HeaderParam("Content-Type") String c public Mono> defaultMethodWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.defaultMethod(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.defaultMethod(this.client.getEndpoint(), contentType, accept, + body, requestOptions, context)); } /** @@ -242,7 +243,8 @@ public Mono> defaultMethodWithResponseAsync(BinaryData body public Response defaultMethodWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.defaultMethodSync(contentType, accept, body, requestOptions, Context.NONE); + return service.defaultMethodSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } /** @@ -275,7 +277,8 @@ public Response defaultMethodWithResponse(BinaryData body, RequestOp public Mono> iso8601WithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.iso8601(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.iso8601(this.client.getEndpoint(), contentType, accept, body, requestOptions, context)); } /** @@ -308,7 +311,7 @@ public Mono> iso8601WithResponseAsync(BinaryData body, Requ public Response iso8601WithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.iso8601Sync(contentType, accept, body, requestOptions, Context.NONE); + return service.iso8601Sync(this.client.getEndpoint(), contentType, accept, body, requestOptions, Context.NONE); } /** @@ -341,8 +344,8 @@ public Response iso8601WithResponse(BinaryData body, RequestOptions public Mono> int32SecondsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.int32Seconds(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.int32Seconds(this.client.getEndpoint(), contentType, accept, + body, requestOptions, context)); } /** @@ -375,7 +378,8 @@ public Mono> int32SecondsWithResponseAsync(BinaryData body, public Response int32SecondsWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.int32SecondsSync(contentType, accept, body, requestOptions, Context.NONE); + return service.int32SecondsSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } /** @@ -408,8 +412,8 @@ public Response int32SecondsWithResponse(BinaryData body, RequestOpt public Mono> floatSecondsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.floatSeconds(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.floatSeconds(this.client.getEndpoint(), contentType, accept, + body, requestOptions, context)); } /** @@ -442,7 +446,8 @@ public Mono> floatSecondsWithResponseAsync(BinaryData body, public Response floatSecondsWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.floatSecondsSync(contentType, accept, body, requestOptions, Context.NONE); + return service.floatSecondsSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } /** @@ -475,8 +480,8 @@ public Response floatSecondsWithResponse(BinaryData body, RequestOpt public Mono> float64SecondsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.float64Seconds(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.float64Seconds(this.client.getEndpoint(), contentType, accept, + body, requestOptions, context)); } /** @@ -509,7 +514,8 @@ public Mono> float64SecondsWithResponseAsync(BinaryData bod public Response float64SecondsWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.float64SecondsSync(contentType, accept, body, requestOptions, Context.NONE); + return service.float64SecondsSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } /** @@ -547,8 +553,8 @@ public Mono> floatSecondsArrayWithResponseAsync(BinaryData RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.floatSecondsArray(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.floatSecondsArray(this.client.getEndpoint(), contentType, accept, + body, requestOptions, context)); } /** @@ -585,6 +591,7 @@ public Mono> floatSecondsArrayWithResponseAsync(BinaryData public Response floatSecondsArrayWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.floatSecondsArraySync(contentType, accept, body, requestOptions, Context.NONE); + return service.floatSecondsArraySync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/encode/duration/implementation/QueriesImpl.java b/typespec-tests/src/main/java/com/encode/duration/implementation/QueriesImpl.java index bccb586fc2..ce7f88f870 100644 --- a/typespec-tests/src/main/java/com/encode/duration/implementation/QueriesImpl.java +++ b/typespec-tests/src/main/java/com/encode/duration/implementation/QueriesImpl.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -56,7 +57,7 @@ public final class QueriesImpl { * The interface defining all the services for DurationClientQueries to be used by the proxy service to perform REST * calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "DurationClientQuerie") public interface QueriesService { @Get("/encode/duration/query/default") @@ -65,8 +66,8 @@ public interface QueriesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> defaultMethod(@QueryParam("input") Duration input, RequestOptions requestOptions, - Context context); + Mono> defaultMethod(@HostParam("endpoint") String endpoint, @QueryParam("input") Duration input, + RequestOptions requestOptions, Context context); @Get("/encode/duration/query/default") @ExpectedResponses({ 204 }) @@ -74,8 +75,8 @@ Mono> defaultMethod(@QueryParam("input") Duration input, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defaultMethodSync(@QueryParam("input") Duration input, RequestOptions requestOptions, - Context context); + Response defaultMethodSync(@HostParam("endpoint") String endpoint, @QueryParam("input") Duration input, + RequestOptions requestOptions, Context context); @Get("/encode/duration/query/iso8601") @ExpectedResponses({ 204 }) @@ -83,8 +84,8 @@ Response defaultMethodSync(@QueryParam("input") Duration input, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> iso8601(@QueryParam("input") Duration input, RequestOptions requestOptions, - Context context); + Mono> iso8601(@HostParam("endpoint") String endpoint, @QueryParam("input") Duration input, + RequestOptions requestOptions, Context context); @Get("/encode/duration/query/iso8601") @ExpectedResponses({ 204 }) @@ -92,7 +93,8 @@ Mono> iso8601(@QueryParam("input") Duration input, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response iso8601Sync(@QueryParam("input") Duration input, RequestOptions requestOptions, Context context); + Response iso8601Sync(@HostParam("endpoint") String endpoint, @QueryParam("input") Duration input, + RequestOptions requestOptions, Context context); @Get("/encode/duration/query/int32-seconds") @ExpectedResponses({ 204 }) @@ -100,8 +102,8 @@ Mono> iso8601(@QueryParam("input") Duration input, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> int32Seconds(@QueryParam("input") long input, RequestOptions requestOptions, - Context context); + Mono> int32Seconds(@HostParam("endpoint") String endpoint, @QueryParam("input") long input, + RequestOptions requestOptions, Context context); @Get("/encode/duration/query/int32-seconds") @ExpectedResponses({ 204 }) @@ -109,8 +111,8 @@ Mono> int32Seconds(@QueryParam("input") long input, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response int32SecondsSync(@QueryParam("input") long input, RequestOptions requestOptions, - Context context); + Response int32SecondsSync(@HostParam("endpoint") String endpoint, @QueryParam("input") long input, + RequestOptions requestOptions, Context context); @Get("/encode/duration/query/float-seconds") @ExpectedResponses({ 204 }) @@ -118,8 +120,8 @@ Response int32SecondsSync(@QueryParam("input") long input, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> floatSeconds(@QueryParam("input") double input, RequestOptions requestOptions, - Context context); + Mono> floatSeconds(@HostParam("endpoint") String endpoint, @QueryParam("input") double input, + RequestOptions requestOptions, Context context); @Get("/encode/duration/query/float-seconds") @ExpectedResponses({ 204 }) @@ -127,8 +129,8 @@ Mono> floatSeconds(@QueryParam("input") double input, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response floatSecondsSync(@QueryParam("input") double input, RequestOptions requestOptions, - Context context); + Response floatSecondsSync(@HostParam("endpoint") String endpoint, @QueryParam("input") double input, + RequestOptions requestOptions, Context context); @Get("/encode/duration/query/float64-seconds") @ExpectedResponses({ 204 }) @@ -136,8 +138,8 @@ Response floatSecondsSync(@QueryParam("input") double input, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> float64Seconds(@QueryParam("input") double input, RequestOptions requestOptions, - Context context); + Mono> float64Seconds(@HostParam("endpoint") String endpoint, @QueryParam("input") double input, + RequestOptions requestOptions, Context context); @Get("/encode/duration/query/float64-seconds") @ExpectedResponses({ 204 }) @@ -145,8 +147,8 @@ Mono> float64Seconds(@QueryParam("input") double input, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response float64SecondsSync(@QueryParam("input") double input, RequestOptions requestOptions, - Context context); + Response float64SecondsSync(@HostParam("endpoint") String endpoint, @QueryParam("input") double input, + RequestOptions requestOptions, Context context); @Get("/encode/duration/query/int32-seconds-array") @ExpectedResponses({ 204 }) @@ -154,8 +156,8 @@ Response float64SecondsSync(@QueryParam("input") double input, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> int32SecondsArray(@QueryParam("input") String input, RequestOptions requestOptions, - Context context); + Mono> int32SecondsArray(@HostParam("endpoint") String endpoint, + @QueryParam("input") String input, RequestOptions requestOptions, Context context); @Get("/encode/duration/query/int32-seconds-array") @ExpectedResponses({ 204 }) @@ -163,8 +165,8 @@ Mono> int32SecondsArray(@QueryParam("input") String input, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response int32SecondsArraySync(@QueryParam("input") String input, RequestOptions requestOptions, - Context context); + Response int32SecondsArraySync(@HostParam("endpoint") String endpoint, @QueryParam("input") String input, + RequestOptions requestOptions, Context context); } /** @@ -180,7 +182,8 @@ Response int32SecondsArraySync(@QueryParam("input") String input, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defaultMethodWithResponseAsync(Duration input, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.defaultMethod(input, requestOptions, context)); + return FluxUtil + .withContext(context -> service.defaultMethod(this.client.getEndpoint(), input, requestOptions, context)); } /** @@ -196,7 +199,7 @@ public Mono> defaultMethodWithResponseAsync(Duration input, Reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defaultMethodWithResponse(Duration input, RequestOptions requestOptions) { - return service.defaultMethodSync(input, requestOptions, Context.NONE); + return service.defaultMethodSync(this.client.getEndpoint(), input, requestOptions, Context.NONE); } /** @@ -212,7 +215,8 @@ public Response defaultMethodWithResponse(Duration input, RequestOptions r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> iso8601WithResponseAsync(Duration input, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.iso8601(input, requestOptions, context)); + return FluxUtil + .withContext(context -> service.iso8601(this.client.getEndpoint(), input, requestOptions, context)); } /** @@ -228,7 +232,7 @@ public Mono> iso8601WithResponseAsync(Duration input, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response iso8601WithResponse(Duration input, RequestOptions requestOptions) { - return service.iso8601Sync(input, requestOptions, Context.NONE); + return service.iso8601Sync(this.client.getEndpoint(), input, requestOptions, Context.NONE); } /** @@ -245,7 +249,8 @@ public Response iso8601WithResponse(Duration input, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> int32SecondsWithResponseAsync(Duration input, RequestOptions requestOptions) { long inputConverted = input.getSeconds(); - return FluxUtil.withContext(context -> service.int32Seconds(inputConverted, requestOptions, context)); + return FluxUtil.withContext( + context -> service.int32Seconds(this.client.getEndpoint(), inputConverted, requestOptions, context)); } /** @@ -262,7 +267,7 @@ public Mono> int32SecondsWithResponseAsync(Duration input, Reques @ServiceMethod(returns = ReturnType.SINGLE) public Response int32SecondsWithResponse(Duration input, RequestOptions requestOptions) { long inputConverted = input.getSeconds(); - return service.int32SecondsSync(inputConverted, requestOptions, Context.NONE); + return service.int32SecondsSync(this.client.getEndpoint(), inputConverted, requestOptions, Context.NONE); } /** @@ -279,7 +284,8 @@ public Response int32SecondsWithResponse(Duration input, RequestOptions re @ServiceMethod(returns = ReturnType.SINGLE) public Mono> floatSecondsWithResponseAsync(Duration input, RequestOptions requestOptions) { double inputConverted = (double) input.toNanos() / 1000_000_000L; - return FluxUtil.withContext(context -> service.floatSeconds(inputConverted, requestOptions, context)); + return FluxUtil.withContext( + context -> service.floatSeconds(this.client.getEndpoint(), inputConverted, requestOptions, context)); } /** @@ -296,7 +302,7 @@ public Mono> floatSecondsWithResponseAsync(Duration input, Reques @ServiceMethod(returns = ReturnType.SINGLE) public Response floatSecondsWithResponse(Duration input, RequestOptions requestOptions) { double inputConverted = (double) input.toNanos() / 1000_000_000L; - return service.floatSecondsSync(inputConverted, requestOptions, Context.NONE); + return service.floatSecondsSync(this.client.getEndpoint(), inputConverted, requestOptions, Context.NONE); } /** @@ -313,7 +319,8 @@ public Response floatSecondsWithResponse(Duration input, RequestOptions re @ServiceMethod(returns = ReturnType.SINGLE) public Mono> float64SecondsWithResponseAsync(Duration input, RequestOptions requestOptions) { double inputConverted = (double) input.toNanos() / 1000_000_000L; - return FluxUtil.withContext(context -> service.float64Seconds(inputConverted, requestOptions, context)); + return FluxUtil.withContext( + context -> service.float64Seconds(this.client.getEndpoint(), inputConverted, requestOptions, context)); } /** @@ -330,7 +337,7 @@ public Mono> float64SecondsWithResponseAsync(Duration input, Requ @ServiceMethod(returns = ReturnType.SINGLE) public Response float64SecondsWithResponse(Duration input, RequestOptions requestOptions) { double inputConverted = (double) input.toNanos() / 1000_000_000L; - return service.float64SecondsSync(inputConverted, requestOptions, Context.NONE); + return service.float64SecondsSync(this.client.getEndpoint(), inputConverted, requestOptions, Context.NONE); } /** @@ -351,7 +358,8 @@ public Mono> int32SecondsArrayWithResponseAsync(List in .serializeIterable( input.stream().map(paramItemValue -> paramItemValue.getSeconds()).collect(Collectors.toList()), CollectionFormat.CSV); - return FluxUtil.withContext(context -> service.int32SecondsArray(inputConverted, requestOptions, context)); + return FluxUtil.withContext( + context -> service.int32SecondsArray(this.client.getEndpoint(), inputConverted, requestOptions, context)); } /** @@ -371,6 +379,6 @@ public Response int32SecondsArrayWithResponse(List input, Reques .serializeIterable( input.stream().map(paramItemValue -> paramItemValue.getSeconds()).collect(Collectors.toList()), CollectionFormat.CSV); - return service.int32SecondsArraySync(inputConverted, requestOptions, Context.NONE); + return service.int32SecondsArraySync(this.client.getEndpoint(), inputConverted, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/basic/BasicClientBuilder.java b/typespec-tests/src/main/java/com/parameters/basic/BasicClientBuilder.java index 6384f456a6..c97efb9668 100644 --- a/typespec-tests/src/main/java/com/parameters/basic/BasicClientBuilder.java +++ b/typespec-tests/src/main/java/com/parameters/basic/BasicClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -45,7 +46,8 @@ ImplicitBodyClient.class, ExplicitBodyAsyncClient.class, ImplicitBodyAsyncClient.class }) -public final class BasicClientBuilder implements HttpTrait, ConfigurationTrait { +public final class BasicClientBuilder implements HttpTrait, ConfigurationTrait, + EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -176,6 +178,22 @@ public BasicClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public BasicClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -203,7 +221,8 @@ public BasicClientBuilder retryPolicy(RetryPolicy retryPolicy) { private BasicClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - BasicClientImpl client = new BasicClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + BasicClientImpl client + = new BasicClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -211,6 +230,7 @@ private BasicClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/parameters/basic/implementation/BasicClientImpl.java b/typespec-tests/src/main/java/com/parameters/basic/implementation/BasicClientImpl.java index 67dae32ce8..d1abd782b8 100644 --- a/typespec-tests/src/main/java/com/parameters/basic/implementation/BasicClientImpl.java +++ b/typespec-tests/src/main/java/com/parameters/basic/implementation/BasicClientImpl.java @@ -15,6 +15,20 @@ * Initializes a new instance of the BasicClient type. */ public final class BasicClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -73,19 +87,22 @@ public ImplicitBodiesImpl getImplicitBodies() { /** * Initializes an instance of BasicClient client. + * + * @param endpoint Service host. */ - public BasicClientImpl() { + public BasicClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of BasicClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public BasicClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public BasicClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -93,10 +110,12 @@ public BasicClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public BasicClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public BasicClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.explicitBodies = new ExplicitBodiesImpl(this); this.implicitBodies = new ImplicitBodiesImpl(this); } diff --git a/typespec-tests/src/main/java/com/parameters/basic/implementation/ExplicitBodiesImpl.java b/typespec-tests/src/main/java/com/parameters/basic/implementation/ExplicitBodiesImpl.java index b8fba3c8c3..1d8fb58927 100644 --- a/typespec-tests/src/main/java/com/parameters/basic/implementation/ExplicitBodiesImpl.java +++ b/typespec-tests/src/main/java/com/parameters/basic/implementation/ExplicitBodiesImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class ExplicitBodiesImpl { * The interface defining all the services for BasicClientExplicitBodies to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "BasicClientExplicitB") public interface ExplicitBodiesService { @Put("/parameters/basic/explicit-body/simple") @@ -63,8 +64,9 @@ public interface ExplicitBodiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> simple(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> simple(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/parameters/basic/explicit-body/simple") @ExpectedResponses({ 204 }) @@ -72,8 +74,9 @@ Mono> simple(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response simpleSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response simpleSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -97,7 +100,8 @@ Response simpleSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> simpleWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.simple(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.simple(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -121,6 +125,6 @@ public Mono> simpleWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response simpleWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.simpleSync(contentType, body, requestOptions, Context.NONE); + return service.simpleSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/basic/implementation/ImplicitBodiesImpl.java b/typespec-tests/src/main/java/com/parameters/basic/implementation/ImplicitBodiesImpl.java index 94e75bcb9d..1278afcded 100644 --- a/typespec-tests/src/main/java/com/parameters/basic/implementation/ImplicitBodiesImpl.java +++ b/typespec-tests/src/main/java/com/parameters/basic/implementation/ImplicitBodiesImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class ImplicitBodiesImpl { * The interface defining all the services for BasicClientImplicitBodies to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "BasicClientImplicitB") public interface ImplicitBodiesService { @Put("/parameters/basic/implicit-body/simple") @@ -63,8 +64,9 @@ public interface ImplicitBodiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> simple(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData simpleRequest, RequestOptions requestOptions, Context context); + Mono> simple(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData simpleRequest, + RequestOptions requestOptions, Context context); @Put("/parameters/basic/implicit-body/simple") @ExpectedResponses({ 204 }) @@ -72,8 +74,9 @@ Mono> simple(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response simpleSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData simpleRequest, RequestOptions requestOptions, Context context); + Response simpleSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData simpleRequest, + RequestOptions requestOptions, Context context); } /** @@ -97,7 +100,8 @@ Response simpleSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> simpleWithResponseAsync(BinaryData simpleRequest, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.simple(contentType, simpleRequest, requestOptions, context)); + return FluxUtil.withContext( + context -> service.simple(this.client.getEndpoint(), contentType, simpleRequest, requestOptions, context)); } /** @@ -121,6 +125,6 @@ public Mono> simpleWithResponseAsync(BinaryData simpleRequest, Re @ServiceMethod(returns = ReturnType.SINGLE) public Response simpleWithResponse(BinaryData simpleRequest, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.simpleSync(contentType, simpleRequest, requestOptions, Context.NONE); + return service.simpleSync(this.client.getEndpoint(), contentType, simpleRequest, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/bodyoptionality/BodyOptionalityClientBuilder.java b/typespec-tests/src/main/java/com/parameters/bodyoptionality/BodyOptionalityClientBuilder.java index 0c6daba8e4..1e2e8757c5 100644 --- a/typespec-tests/src/main/java/com/parameters/bodyoptionality/BodyOptionalityClientBuilder.java +++ b/typespec-tests/src/main/java/com/parameters/bodyoptionality/BodyOptionalityClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -45,8 +46,8 @@ OptionalExplicitClient.class, BodyOptionalityAsyncClient.class, OptionalExplicitAsyncClient.class }) -public final class BodyOptionalityClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class BodyOptionalityClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -178,6 +179,22 @@ public BodyOptionalityClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public BodyOptionalityClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -205,8 +222,8 @@ public BodyOptionalityClientBuilder retryPolicy(RetryPolicy retryPolicy) { private BodyOptionalityClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - BodyOptionalityClientImpl client - = new BodyOptionalityClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + BodyOptionalityClientImpl client = new BodyOptionalityClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -214,6 +231,7 @@ private BodyOptionalityClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/BodyOptionalityClientImpl.java b/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/BodyOptionalityClientImpl.java index 9ac49d53a0..56a73fd13b 100644 --- a/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/BodyOptionalityClientImpl.java +++ b/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/BodyOptionalityClientImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -40,6 +41,20 @@ public final class BodyOptionalityClientImpl { */ private final BodyOptionalityClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -84,19 +99,22 @@ public OptionalExplicitsImpl getOptionalExplicits() { /** * Initializes an instance of BodyOptionalityClient client. + * + * @param endpoint Service host. */ - public BodyOptionalityClientImpl() { + public BodyOptionalityClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of BodyOptionalityClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public BodyOptionalityClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public BodyOptionalityClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -104,10 +122,12 @@ public BodyOptionalityClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public BodyOptionalityClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public BodyOptionalityClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.optionalExplicits = new OptionalExplicitsImpl(this); this.service = RestProxy.create(BodyOptionalityClientService.class, this.httpPipeline, this.getSerializerAdapter()); @@ -117,7 +137,7 @@ public BodyOptionalityClientImpl(HttpPipeline httpPipeline, SerializerAdapter se * The interface defining all the services for BodyOptionalityClient to be used by the proxy service to perform REST * calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "BodyOptionalityClien") public interface BodyOptionalityClientService { @Post("/parameters/body-optionality/required-explicit") @@ -126,8 +146,9 @@ public interface BodyOptionalityClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> requiredExplicit(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> requiredExplicit(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/parameters/body-optionality/required-explicit") @ExpectedResponses({ 204 }) @@ -135,8 +156,9 @@ Mono> requiredExplicit(@HeaderParam("Content-Type") String conten @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requiredExplicitSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response requiredExplicitSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/parameters/body-optionality/required-implicit") @ExpectedResponses({ 204 }) @@ -144,7 +166,8 @@ Response requiredExplicitSync(@HeaderParam("Content-Type") String contentT @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> requiredImplicit(@HeaderParam("Content-Type") String contentType, + Mono> requiredImplicit(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData requiredImplicitRequest, RequestOptions requestOptions, Context context); @@ -154,7 +177,8 @@ Mono> requiredImplicit(@HeaderParam("Content-Type") String conten @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requiredImplicitSync(@HeaderParam("Content-Type") String contentType, + Response requiredImplicitSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData requiredImplicitRequest, RequestOptions requestOptions, Context context); } @@ -180,7 +204,8 @@ Response requiredImplicitSync(@HeaderParam("Content-Type") String contentT @ServiceMethod(returns = ReturnType.SINGLE) public Mono> requiredExplicitWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.requiredExplicit(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.requiredExplicit(this.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -204,7 +229,7 @@ public Mono> requiredExplicitWithResponseAsync(BinaryData body, R @ServiceMethod(returns = ReturnType.SINGLE) public Response requiredExplicitWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.requiredExplicitSync(contentType, body, requestOptions, Context.NONE); + return service.requiredExplicitSync(this.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -229,8 +254,8 @@ public Response requiredExplicitWithResponse(BinaryData body, RequestOptio public Mono> requiredImplicitWithResponseAsync(BinaryData requiredImplicitRequest, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext( - context -> service.requiredImplicit(contentType, requiredImplicitRequest, requestOptions, context)); + return FluxUtil.withContext(context -> service.requiredImplicit(this.getEndpoint(), contentType, + requiredImplicitRequest, requestOptions, context)); } /** @@ -255,6 +280,7 @@ public Mono> requiredImplicitWithResponseAsync(BinaryData require public Response requiredImplicitWithResponse(BinaryData requiredImplicitRequest, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.requiredImplicitSync(contentType, requiredImplicitRequest, requestOptions, Context.NONE); + return service.requiredImplicitSync(this.getEndpoint(), contentType, requiredImplicitRequest, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/OptionalExplicitsImpl.java b/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/OptionalExplicitsImpl.java index 0a985849b3..cb4d687e7b 100644 --- a/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/OptionalExplicitsImpl.java +++ b/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/OptionalExplicitsImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -52,7 +53,7 @@ public final class OptionalExplicitsImpl { * The interface defining all the services for BodyOptionalityClientOptionalExplicits to be used by the proxy * service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "BodyOptionalityClien") public interface OptionalExplicitsService { @Post("/parameters/body-optionality/optional-explicit/set") @@ -61,7 +62,8 @@ public interface OptionalExplicitsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> set(RequestOptions requestOptions, Context context); + Mono> set(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Post("/parameters/body-optionality/optional-explicit/set") @ExpectedResponses({ 204 }) @@ -69,7 +71,7 @@ public interface OptionalExplicitsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response setSync(RequestOptions requestOptions, Context context); + Response setSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); @Post("/parameters/body-optionality/optional-explicit/omit") @ExpectedResponses({ 204 }) @@ -77,7 +79,8 @@ public interface OptionalExplicitsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> omit(RequestOptions requestOptions, Context context); + Mono> omit(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Post("/parameters/body-optionality/optional-explicit/omit") @ExpectedResponses({ 204 }) @@ -85,7 +88,7 @@ public interface OptionalExplicitsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response omitSync(RequestOptions requestOptions, Context context); + Response omitSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); } /** @@ -121,7 +124,7 @@ public Mono> setWithResponseAsync(RequestOptions requestOptions) requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); } }); - return FluxUtil.withContext(context -> service.set(requestOptionsLocal, context)); + return FluxUtil.withContext(context -> service.set(this.client.getEndpoint(), requestOptionsLocal, context)); } /** @@ -157,7 +160,7 @@ public Response setWithResponse(RequestOptions requestOptions) { requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); } }); - return service.setSync(requestOptionsLocal, Context.NONE); + return service.setSync(this.client.getEndpoint(), requestOptionsLocal, Context.NONE); } /** @@ -193,7 +196,7 @@ public Mono> omitWithResponseAsync(RequestOptions requestOptions) requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); } }); - return FluxUtil.withContext(context -> service.omit(requestOptionsLocal, context)); + return FluxUtil.withContext(context -> service.omit(this.client.getEndpoint(), requestOptionsLocal, context)); } /** @@ -229,6 +232,6 @@ public Response omitWithResponse(RequestOptions requestOptions) { requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); } }); - return service.omitSync(requestOptionsLocal, Context.NONE); + return service.omitSync(this.client.getEndpoint(), requestOptionsLocal, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/collectionformat/CollectionFormatClientBuilder.java b/typespec-tests/src/main/java/com/parameters/collectionformat/CollectionFormatClientBuilder.java index 0d251b6a5b..8deea95059 100644 --- a/typespec-tests/src/main/java/com/parameters/collectionformat/CollectionFormatClientBuilder.java +++ b/typespec-tests/src/main/java/com/parameters/collectionformat/CollectionFormatClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -41,8 +42,8 @@ */ @ServiceClientBuilder( serviceClients = { QueryClient.class, HeaderClient.class, QueryAsyncClient.class, HeaderAsyncClient.class }) -public final class CollectionFormatClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class CollectionFormatClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -174,6 +175,22 @@ public CollectionFormatClientBuilder configuration(Configuration configuration) return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public CollectionFormatClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -201,8 +218,8 @@ public CollectionFormatClientBuilder retryPolicy(RetryPolicy retryPolicy) { private CollectionFormatClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - CollectionFormatClientImpl client - = new CollectionFormatClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + CollectionFormatClientImpl client = new CollectionFormatClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -210,6 +227,7 @@ private CollectionFormatClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/CollectionFormatClientImpl.java b/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/CollectionFormatClientImpl.java index 24d094c116..aa16ca784b 100644 --- a/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/CollectionFormatClientImpl.java +++ b/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/CollectionFormatClientImpl.java @@ -15,6 +15,20 @@ * Initializes a new instance of the CollectionFormatClient type. */ public final class CollectionFormatClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -73,19 +87,22 @@ public HeadersImpl getHeaders() { /** * Initializes an instance of CollectionFormatClient client. + * + * @param endpoint Service host. */ - public CollectionFormatClientImpl() { + public CollectionFormatClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of CollectionFormatClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public CollectionFormatClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public CollectionFormatClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -93,10 +110,12 @@ public CollectionFormatClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public CollectionFormatClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public CollectionFormatClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.queries = new QueriesImpl(this); this.headers = new HeadersImpl(this); } diff --git a/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/HeadersImpl.java b/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/HeadersImpl.java index 6e220ab978..49f15aeacb 100644 --- a/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/HeadersImpl.java +++ b/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/HeadersImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; @@ -54,7 +55,7 @@ public final class HeadersImpl { * The interface defining all the services for CollectionFormatClientHeaders to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "CollectionFormatClie") public interface HeadersService { @Get("/parameters/collection-format/header/csv") @@ -63,7 +64,8 @@ public interface HeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> csv(@HeaderParam("colors") String colors, RequestOptions requestOptions, Context context); + Mono> csv(@HostParam("endpoint") String endpoint, @HeaderParam("colors") String colors, + RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/header/csv") @ExpectedResponses({ 204 }) @@ -71,7 +73,8 @@ public interface HeadersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response csvSync(@HeaderParam("colors") String colors, RequestOptions requestOptions, Context context); + Response csvSync(@HostParam("endpoint") String endpoint, @HeaderParam("colors") String colors, + RequestOptions requestOptions, Context context); } /** @@ -90,7 +93,8 @@ public Mono> csvWithResponseAsync(List colors, RequestOpt String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return FluxUtil.withContext(context -> service.csv(colorsConverted, requestOptions, context)); + return FluxUtil + .withContext(context -> service.csv(this.client.getEndpoint(), colorsConverted, requestOptions, context)); } /** @@ -109,6 +113,6 @@ public Response csvWithResponse(List colors, RequestOptions reques String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return service.csvSync(colorsConverted, requestOptions, Context.NONE); + return service.csvSync(this.client.getEndpoint(), colorsConverted, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/QueriesImpl.java b/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/QueriesImpl.java index 695c4a5eab..b68ab56256 100644 --- a/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/QueriesImpl.java +++ b/typespec-tests/src/main/java/com/parameters/collectionformat/implementation/QueriesImpl.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class QueriesImpl { * The interface defining all the services for CollectionFormatClientQueries to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "CollectionFormatClie") public interface QueriesService { @Get("/parameters/collection-format/query/multi") @@ -63,7 +64,8 @@ public interface QueriesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> multi(@QueryParam(value = "colors", multipleQueryParams = true) List colors, + Mono> multi(@HostParam("endpoint") String endpoint, + @QueryParam(value = "colors", multipleQueryParams = true) List colors, RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/multi") @@ -72,7 +74,8 @@ Mono> multi(@QueryParam(value = "colors", multipleQueryParams = t @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response multiSync(@QueryParam(value = "colors", multipleQueryParams = true) List colors, + Response multiSync(@HostParam("endpoint") String endpoint, + @QueryParam(value = "colors", multipleQueryParams = true) List colors, RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/ssv") @@ -81,7 +84,8 @@ Response multiSync(@QueryParam(value = "colors", multipleQueryParams = tru @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> ssv(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context); + Mono> ssv(@HostParam("endpoint") String endpoint, @QueryParam("colors") String colors, + RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/ssv") @ExpectedResponses({ 204 }) @@ -89,7 +93,8 @@ Response multiSync(@QueryParam(value = "colors", multipleQueryParams = tru @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response ssvSync(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context); + Response ssvSync(@HostParam("endpoint") String endpoint, @QueryParam("colors") String colors, + RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/tsv") @ExpectedResponses({ 204 }) @@ -97,7 +102,8 @@ Response multiSync(@QueryParam(value = "colors", multipleQueryParams = tru @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> tsv(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context); + Mono> tsv(@HostParam("endpoint") String endpoint, @QueryParam("colors") String colors, + RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/tsv") @ExpectedResponses({ 204 }) @@ -105,7 +111,8 @@ Response multiSync(@QueryParam(value = "colors", multipleQueryParams = tru @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response tsvSync(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context); + Response tsvSync(@HostParam("endpoint") String endpoint, @QueryParam("colors") String colors, + RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/pipes") @ExpectedResponses({ 204 }) @@ -113,7 +120,8 @@ Response multiSync(@QueryParam(value = "colors", multipleQueryParams = tru @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> pipes(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context); + Mono> pipes(@HostParam("endpoint") String endpoint, @QueryParam("colors") String colors, + RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/pipes") @ExpectedResponses({ 204 }) @@ -121,7 +129,8 @@ Response multiSync(@QueryParam(value = "colors", multipleQueryParams = tru @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response pipesSync(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context); + Response pipesSync(@HostParam("endpoint") String endpoint, @QueryParam("colors") String colors, + RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/csv") @ExpectedResponses({ 204 }) @@ -129,7 +138,8 @@ Response multiSync(@QueryParam(value = "colors", multipleQueryParams = tru @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> csv(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context); + Mono> csv(@HostParam("endpoint") String endpoint, @QueryParam("colors") String colors, + RequestOptions requestOptions, Context context); @Get("/parameters/collection-format/query/csv") @ExpectedResponses({ 204 }) @@ -137,7 +147,8 @@ Response multiSync(@QueryParam(value = "colors", multipleQueryParams = tru @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response csvSync(@QueryParam("colors") String colors, RequestOptions requestOptions, Context context); + Response csvSync(@HostParam("endpoint") String endpoint, @QueryParam("colors") String colors, + RequestOptions requestOptions, Context context); } /** @@ -155,7 +166,8 @@ Response multiSync(@QueryParam(value = "colors", multipleQueryParams = tru public Mono> multiWithResponseAsync(List colors, RequestOptions requestOptions) { List colorsConverted = colors.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return FluxUtil.withContext(context -> service.multi(colorsConverted, requestOptions, context)); + return FluxUtil + .withContext(context -> service.multi(this.client.getEndpoint(), colorsConverted, requestOptions, context)); } /** @@ -173,7 +185,7 @@ public Mono> multiWithResponseAsync(List colors, RequestO public Response multiWithResponse(List colors, RequestOptions requestOptions) { List colorsConverted = colors.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return service.multiSync(colorsConverted, requestOptions, Context.NONE); + return service.multiSync(this.client.getEndpoint(), colorsConverted, requestOptions, Context.NONE); } /** @@ -192,7 +204,8 @@ public Mono> ssvWithResponseAsync(List colors, RequestOpt String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(" ")); - return FluxUtil.withContext(context -> service.ssv(colorsConverted, requestOptions, context)); + return FluxUtil + .withContext(context -> service.ssv(this.client.getEndpoint(), colorsConverted, requestOptions, context)); } /** @@ -211,7 +224,7 @@ public Response ssvWithResponse(List colors, RequestOptions reques String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(" ")); - return service.ssvSync(colorsConverted, requestOptions, Context.NONE); + return service.ssvSync(this.client.getEndpoint(), colorsConverted, requestOptions, Context.NONE); } /** @@ -230,7 +243,8 @@ public Mono> tsvWithResponseAsync(List colors, RequestOpt String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining("\t")); - return FluxUtil.withContext(context -> service.tsv(colorsConverted, requestOptions, context)); + return FluxUtil + .withContext(context -> service.tsv(this.client.getEndpoint(), colorsConverted, requestOptions, context)); } /** @@ -249,7 +263,7 @@ public Response tsvWithResponse(List colors, RequestOptions reques String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining("\t")); - return service.tsvSync(colorsConverted, requestOptions, Context.NONE); + return service.tsvSync(this.client.getEndpoint(), colorsConverted, requestOptions, Context.NONE); } /** @@ -268,7 +282,8 @@ public Mono> pipesWithResponseAsync(List colors, RequestO String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining("|")); - return FluxUtil.withContext(context -> service.pipes(colorsConverted, requestOptions, context)); + return FluxUtil + .withContext(context -> service.pipes(this.client.getEndpoint(), colorsConverted, requestOptions, context)); } /** @@ -287,7 +302,7 @@ public Response pipesWithResponse(List colors, RequestOptions requ String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining("|")); - return service.pipesSync(colorsConverted, requestOptions, Context.NONE); + return service.pipesSync(this.client.getEndpoint(), colorsConverted, requestOptions, Context.NONE); } /** @@ -306,7 +321,8 @@ public Mono> csvWithResponseAsync(List colors, RequestOpt String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return FluxUtil.withContext(context -> service.csv(colorsConverted, requestOptions, context)); + return FluxUtil + .withContext(context -> service.csv(this.client.getEndpoint(), colorsConverted, requestOptions, context)); } /** @@ -325,6 +341,6 @@ public Response csvWithResponse(List colors, RequestOptions reques String colorsConverted = colors.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return service.csvSync(colorsConverted, requestOptions, Context.NONE); + return service.csvSync(this.client.getEndpoint(), colorsConverted, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/spread/SpreadClientBuilder.java b/typespec-tests/src/main/java/com/parameters/spread/SpreadClientBuilder.java index 0c9d2e14ca..88b00bb987 100644 --- a/typespec-tests/src/main/java/com/parameters/spread/SpreadClientBuilder.java +++ b/typespec-tests/src/main/java/com/parameters/spread/SpreadClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -41,8 +42,8 @@ */ @ServiceClientBuilder( serviceClients = { ModelClient.class, AliasClient.class, ModelAsyncClient.class, AliasAsyncClient.class }) -public final class SpreadClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class SpreadClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -173,6 +174,22 @@ public SpreadClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public SpreadClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -200,7 +217,8 @@ public SpreadClientBuilder retryPolicy(RetryPolicy retryPolicy) { private SpreadClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - SpreadClientImpl client = new SpreadClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + SpreadClientImpl client + = new SpreadClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -208,6 +226,7 @@ private SpreadClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/parameters/spread/implementation/AliasImpl.java b/typespec-tests/src/main/java/com/parameters/spread/implementation/AliasImpl.java index 1dd099ff34..b99cea4e3e 100644 --- a/typespec-tests/src/main/java/com/parameters/spread/implementation/AliasImpl.java +++ b/typespec-tests/src/main/java/com/parameters/spread/implementation/AliasImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; @@ -55,7 +56,7 @@ public final class AliasImpl { * The interface defining all the services for SpreadClientAlias to be used by the proxy service to perform REST * calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "SpreadClientAlias") public interface AliasService { @Put("/parameters/spread/alias/request-body") @@ -64,7 +65,8 @@ public interface AliasService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> spreadAsRequestBody(@HeaderParam("Content-Type") String contentType, + Mono> spreadAsRequestBody(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData spreadAsRequestBodyRequest, RequestOptions requestOptions, Context context); @@ -74,7 +76,8 @@ Mono> spreadAsRequestBody(@HeaderParam("Content-Type") String con @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response spreadAsRequestBodySync(@HeaderParam("Content-Type") String contentType, + Response spreadAsRequestBodySync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData spreadAsRequestBodyRequest, RequestOptions requestOptions, Context context); @@ -84,8 +87,9 @@ Response spreadAsRequestBodySync(@HeaderParam("Content-Type") String conte @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> spreadParameterWithInnerModel(@PathParam("id") String id, - @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("Content-Type") String contentType, + Mono> spreadParameterWithInnerModel(@HostParam("endpoint") String endpoint, + @PathParam("id") String id, @HeaderParam("x-ms-test-header") String xMsTestHeader, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData spreadParameterWithInnerModelRequest, RequestOptions requestOptions, Context context); @@ -95,8 +99,9 @@ Mono> spreadParameterWithInnerModel(@PathParam("id") String id, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response spreadParameterWithInnerModelSync(@PathParam("id") String id, - @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("Content-Type") String contentType, + Response spreadParameterWithInnerModelSync(@HostParam("endpoint") String endpoint, + @PathParam("id") String id, @HeaderParam("x-ms-test-header") String xMsTestHeader, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData spreadParameterWithInnerModelRequest, RequestOptions requestOptions, Context context); @@ -106,8 +111,9 @@ Response spreadParameterWithInnerModelSync(@PathParam("id") String id, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> spreadAsRequestParameter(@PathParam("id") String id, - @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("Content-Type") String contentType, + Mono> spreadAsRequestParameter(@HostParam("endpoint") String endpoint, + @PathParam("id") String id, @HeaderParam("x-ms-test-header") String xMsTestHeader, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData spreadAsRequestParameterRequest, RequestOptions requestOptions, Context context); @@ -117,7 +123,7 @@ Mono> spreadAsRequestParameter(@PathParam("id") String id, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response spreadAsRequestParameterSync(@PathParam("id") String id, + Response spreadAsRequestParameterSync(@HostParam("endpoint") String endpoint, @PathParam("id") String id, @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData spreadAsRequestParameterRequest, RequestOptions requestOptions, Context context); @@ -128,8 +134,9 @@ Response spreadAsRequestParameterSync(@PathParam("id") String id, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> spreadWithMultipleParameters(@PathParam("id") String id, - @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("Content-Type") String contentType, + Mono> spreadWithMultipleParameters(@HostParam("endpoint") String endpoint, + @PathParam("id") String id, @HeaderParam("x-ms-test-header") String xMsTestHeader, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData spreadWithMultipleParametersRequest, RequestOptions requestOptions, Context context); @@ -139,8 +146,9 @@ Mono> spreadWithMultipleParameters(@PathParam("id") String id, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response spreadWithMultipleParametersSync(@PathParam("id") String id, - @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("Content-Type") String contentType, + Response spreadWithMultipleParametersSync(@HostParam("endpoint") String endpoint, + @PathParam("id") String id, @HeaderParam("x-ms-test-header") String xMsTestHeader, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData spreadWithMultipleParametersRequest, RequestOptions requestOptions, Context context); @@ -150,8 +158,9 @@ Response spreadWithMultipleParametersSync(@PathParam("id") String id, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> spreadParameterWithInnerAlias(@PathParam("id") String id, - @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("Content-Type") String contentType, + Mono> spreadParameterWithInnerAlias(@HostParam("endpoint") String endpoint, + @PathParam("id") String id, @HeaderParam("x-ms-test-header") String xMsTestHeader, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData spreadParameterWithInnerAliasRequest, RequestOptions requestOptions, Context context); @@ -161,8 +170,9 @@ Mono> spreadParameterWithInnerAlias(@PathParam("id") String id, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response spreadParameterWithInnerAliasSync(@PathParam("id") String id, - @HeaderParam("x-ms-test-header") String xMsTestHeader, @HeaderParam("Content-Type") String contentType, + Response spreadParameterWithInnerAliasSync(@HostParam("endpoint") String endpoint, + @PathParam("id") String id, @HeaderParam("x-ms-test-header") String xMsTestHeader, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData spreadParameterWithInnerAliasRequest, RequestOptions requestOptions, Context context); } @@ -189,8 +199,8 @@ Response spreadParameterWithInnerAliasSync(@PathParam("id") String id, public Mono> spreadAsRequestBodyWithResponseAsync(BinaryData spreadAsRequestBodyRequest, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext( - context -> service.spreadAsRequestBody(contentType, spreadAsRequestBodyRequest, requestOptions, context)); + return FluxUtil.withContext(context -> service.spreadAsRequestBody(this.client.getEndpoint(), contentType, + spreadAsRequestBodyRequest, requestOptions, context)); } /** @@ -215,7 +225,8 @@ public Mono> spreadAsRequestBodyWithResponseAsync(BinaryData spre public Response spreadAsRequestBodyWithResponse(BinaryData spreadAsRequestBodyRequest, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.spreadAsRequestBodySync(contentType, spreadAsRequestBodyRequest, requestOptions, Context.NONE); + return service.spreadAsRequestBodySync(this.client.getEndpoint(), contentType, spreadAsRequestBodyRequest, + requestOptions, Context.NONE); } /** @@ -242,8 +253,8 @@ public Response spreadAsRequestBodyWithResponse(BinaryData spreadAsRequest public Mono> spreadParameterWithInnerModelWithResponseAsync(String id, String xMsTestHeader, BinaryData spreadParameterWithInnerModelRequest, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.spreadParameterWithInnerModel(id, xMsTestHeader, contentType, - spreadParameterWithInnerModelRequest, requestOptions, context)); + return FluxUtil.withContext(context -> service.spreadParameterWithInnerModel(this.client.getEndpoint(), id, + xMsTestHeader, contentType, spreadParameterWithInnerModelRequest, requestOptions, context)); } /** @@ -270,7 +281,7 @@ public Mono> spreadParameterWithInnerModelWithResponseAsync(Strin public Response spreadParameterWithInnerModelWithResponse(String id, String xMsTestHeader, BinaryData spreadParameterWithInnerModelRequest, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.spreadParameterWithInnerModelSync(id, xMsTestHeader, contentType, + return service.spreadParameterWithInnerModelSync(this.client.getEndpoint(), id, xMsTestHeader, contentType, spreadParameterWithInnerModelRequest, requestOptions, Context.NONE); } @@ -298,8 +309,8 @@ public Response spreadParameterWithInnerModelWithResponse(String id, Strin public Mono> spreadAsRequestParameterWithResponseAsync(String id, String xMsTestHeader, BinaryData spreadAsRequestParameterRequest, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.spreadAsRequestParameter(id, xMsTestHeader, contentType, - spreadAsRequestParameterRequest, requestOptions, context)); + return FluxUtil.withContext(context -> service.spreadAsRequestParameter(this.client.getEndpoint(), id, + xMsTestHeader, contentType, spreadAsRequestParameterRequest, requestOptions, context)); } /** @@ -326,8 +337,8 @@ public Mono> spreadAsRequestParameterWithResponseAsync(String id, public Response spreadAsRequestParameterWithResponse(String id, String xMsTestHeader, BinaryData spreadAsRequestParameterRequest, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.spreadAsRequestParameterSync(id, xMsTestHeader, contentType, spreadAsRequestParameterRequest, - requestOptions, Context.NONE); + return service.spreadAsRequestParameterSync(this.client.getEndpoint(), id, xMsTestHeader, contentType, + spreadAsRequestParameterRequest, requestOptions, Context.NONE); } /** @@ -361,8 +372,8 @@ public Response spreadAsRequestParameterWithResponse(String id, String xMs public Mono> spreadWithMultipleParametersWithResponseAsync(String id, String xMsTestHeader, BinaryData spreadWithMultipleParametersRequest, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.spreadWithMultipleParameters(id, xMsTestHeader, contentType, - spreadWithMultipleParametersRequest, requestOptions, context)); + return FluxUtil.withContext(context -> service.spreadWithMultipleParameters(this.client.getEndpoint(), id, + xMsTestHeader, contentType, spreadWithMultipleParametersRequest, requestOptions, context)); } /** @@ -396,7 +407,7 @@ public Mono> spreadWithMultipleParametersWithResponseAsync(String public Response spreadWithMultipleParametersWithResponse(String id, String xMsTestHeader, BinaryData spreadWithMultipleParametersRequest, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.spreadWithMultipleParametersSync(id, xMsTestHeader, contentType, + return service.spreadWithMultipleParametersSync(this.client.getEndpoint(), id, xMsTestHeader, contentType, spreadWithMultipleParametersRequest, requestOptions, Context.NONE); } @@ -425,8 +436,8 @@ public Response spreadWithMultipleParametersWithResponse(String id, String public Mono> spreadParameterWithInnerAliasWithResponseAsync(String id, String xMsTestHeader, BinaryData spreadParameterWithInnerAliasRequest, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.spreadParameterWithInnerAlias(id, xMsTestHeader, contentType, - spreadParameterWithInnerAliasRequest, requestOptions, context)); + return FluxUtil.withContext(context -> service.spreadParameterWithInnerAlias(this.client.getEndpoint(), id, + xMsTestHeader, contentType, spreadParameterWithInnerAliasRequest, requestOptions, context)); } /** @@ -454,7 +465,7 @@ public Mono> spreadParameterWithInnerAliasWithResponseAsync(Strin public Response spreadParameterWithInnerAliasWithResponse(String id, String xMsTestHeader, BinaryData spreadParameterWithInnerAliasRequest, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.spreadParameterWithInnerAliasSync(id, xMsTestHeader, contentType, + return service.spreadParameterWithInnerAliasSync(this.client.getEndpoint(), id, xMsTestHeader, contentType, spreadParameterWithInnerAliasRequest, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/spread/implementation/ModelsImpl.java b/typespec-tests/src/main/java/com/parameters/spread/implementation/ModelsImpl.java index fb0640c249..bd8d00820e 100644 --- a/typespec-tests/src/main/java/com/parameters/spread/implementation/ModelsImpl.java +++ b/typespec-tests/src/main/java/com/parameters/spread/implementation/ModelsImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; @@ -54,7 +55,7 @@ public final class ModelsImpl { * The interface defining all the services for SpreadClientModels to be used by the proxy service to perform REST * calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "SpreadClientModels") public interface ModelsService { @Put("/parameters/spread/model/request-body") @@ -63,7 +64,8 @@ public interface ModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> spreadAsRequestBody(@HeaderParam("Content-Type") String contentType, + Mono> spreadAsRequestBody(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData spreadAsRequestBodyRequest1, RequestOptions requestOptions, Context context); @@ -73,7 +75,8 @@ Mono> spreadAsRequestBody(@HeaderParam("Content-Type") String con @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response spreadAsRequestBodySync(@HeaderParam("Content-Type") String contentType, + Response spreadAsRequestBodySync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData spreadAsRequestBodyRequest1, RequestOptions requestOptions, Context context); @@ -83,8 +86,9 @@ Response spreadAsRequestBodySync(@HeaderParam("Content-Type") String conte @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> spreadCompositeRequestOnlyWithBody(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> spreadCompositeRequestOnlyWithBody(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/parameters/spread/model/composite-request-only-with-body") @ExpectedResponses({ 204 }) @@ -92,8 +96,9 @@ Mono> spreadCompositeRequestOnlyWithBody(@HeaderParam("Content-Ty @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response spreadCompositeRequestOnlyWithBodySync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response spreadCompositeRequestOnlyWithBodySync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/parameters/spread/model/composite-request-without-body/{name}") @ExpectedResponses({ 204 }) @@ -101,8 +106,9 @@ Response spreadCompositeRequestOnlyWithBodySync(@HeaderParam("Content-Type @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> spreadCompositeRequestWithoutBody(@PathParam("name") String name, - @HeaderParam("test-header") String testHeader, RequestOptions requestOptions, Context context); + Mono> spreadCompositeRequestWithoutBody(@HostParam("endpoint") String endpoint, + @PathParam("name") String name, @HeaderParam("test-header") String testHeader, + RequestOptions requestOptions, Context context); @Put("/parameters/spread/model/composite-request-without-body/{name}") @ExpectedResponses({ 204 }) @@ -110,8 +116,9 @@ Mono> spreadCompositeRequestWithoutBody(@PathParam("name") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response spreadCompositeRequestWithoutBodySync(@PathParam("name") String name, - @HeaderParam("test-header") String testHeader, RequestOptions requestOptions, Context context); + Response spreadCompositeRequestWithoutBodySync(@HostParam("endpoint") String endpoint, + @PathParam("name") String name, @HeaderParam("test-header") String testHeader, + RequestOptions requestOptions, Context context); @Put("/parameters/spread/model/composite-request/{name}") @ExpectedResponses({ 204 }) @@ -119,9 +126,10 @@ Response spreadCompositeRequestWithoutBodySync(@PathParam("name") String n @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> spreadCompositeRequest(@PathParam("name") String name, - @HeaderParam("test-header") String testHeader, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> spreadCompositeRequest(@HostParam("endpoint") String endpoint, + @PathParam("name") String name, @HeaderParam("test-header") String testHeader, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/parameters/spread/model/composite-request/{name}") @ExpectedResponses({ 204 }) @@ -129,9 +137,10 @@ Mono> spreadCompositeRequest(@PathParam("name") String name, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response spreadCompositeRequestSync(@PathParam("name") String name, - @HeaderParam("test-header") String testHeader, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response spreadCompositeRequestSync(@HostParam("endpoint") String endpoint, + @PathParam("name") String name, @HeaderParam("test-header") String testHeader, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/parameters/spread/model/composite-request-mix/{name}") @ExpectedResponses({ 204 }) @@ -139,8 +148,9 @@ Response spreadCompositeRequestSync(@PathParam("name") String name, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> spreadCompositeRequestMix(@PathParam("name") String name, - @HeaderParam("test-header") String testHeader, @HeaderParam("Content-Type") String contentType, + Mono> spreadCompositeRequestMix(@HostParam("endpoint") String endpoint, + @PathParam("name") String name, @HeaderParam("test-header") String testHeader, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData spreadCompositeRequestMixRequest, RequestOptions requestOptions, Context context); @@ -150,8 +160,9 @@ Mono> spreadCompositeRequestMix(@PathParam("name") String name, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response spreadCompositeRequestMixSync(@PathParam("name") String name, - @HeaderParam("test-header") String testHeader, @HeaderParam("Content-Type") String contentType, + Response spreadCompositeRequestMixSync(@HostParam("endpoint") String endpoint, + @PathParam("name") String name, @HeaderParam("test-header") String testHeader, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData spreadCompositeRequestMixRequest, RequestOptions requestOptions, Context context); } @@ -178,8 +189,8 @@ Response spreadCompositeRequestMixSync(@PathParam("name") String name, public Mono> spreadAsRequestBodyWithResponseAsync(BinaryData spreadAsRequestBodyRequest1, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext( - context -> service.spreadAsRequestBody(contentType, spreadAsRequestBodyRequest1, requestOptions, context)); + return FluxUtil.withContext(context -> service.spreadAsRequestBody(this.client.getEndpoint(), contentType, + spreadAsRequestBodyRequest1, requestOptions, context)); } /** @@ -204,7 +215,8 @@ public Mono> spreadAsRequestBodyWithResponseAsync(BinaryData spre public Response spreadAsRequestBodyWithResponse(BinaryData spreadAsRequestBodyRequest1, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.spreadAsRequestBodySync(contentType, spreadAsRequestBodyRequest1, requestOptions, Context.NONE); + return service.spreadAsRequestBodySync(this.client.getEndpoint(), contentType, spreadAsRequestBodyRequest1, + requestOptions, Context.NONE); } /** @@ -229,8 +241,8 @@ public Response spreadAsRequestBodyWithResponse(BinaryData spreadAsRequest public Mono> spreadCompositeRequestOnlyWithBodyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext( - context -> service.spreadCompositeRequestOnlyWithBody(contentType, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.spreadCompositeRequestOnlyWithBody(this.client.getEndpoint(), + contentType, body, requestOptions, context)); } /** @@ -255,7 +267,8 @@ public Mono> spreadCompositeRequestOnlyWithBodyWithResponseAsync( public Response spreadCompositeRequestOnlyWithBodyWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.spreadCompositeRequestOnlyWithBodySync(contentType, body, requestOptions, Context.NONE); + return service.spreadCompositeRequestOnlyWithBodySync(this.client.getEndpoint(), contentType, body, + requestOptions, Context.NONE); } /** @@ -273,8 +286,8 @@ public Response spreadCompositeRequestOnlyWithBodyWithResponse(BinaryData @ServiceMethod(returns = ReturnType.SINGLE) public Mono> spreadCompositeRequestWithoutBodyWithResponseAsync(String name, String testHeader, RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.spreadCompositeRequestWithoutBody(name, testHeader, requestOptions, context)); + return FluxUtil.withContext(context -> service.spreadCompositeRequestWithoutBody(this.client.getEndpoint(), + name, testHeader, requestOptions, context)); } /** @@ -292,7 +305,8 @@ public Mono> spreadCompositeRequestWithoutBodyWithResponseAsync(S @ServiceMethod(returns = ReturnType.SINGLE) public Response spreadCompositeRequestWithoutBodyWithResponse(String name, String testHeader, RequestOptions requestOptions) { - return service.spreadCompositeRequestWithoutBodySync(name, testHeader, requestOptions, Context.NONE); + return service.spreadCompositeRequestWithoutBodySync(this.client.getEndpoint(), name, testHeader, + requestOptions, Context.NONE); } /** @@ -319,8 +333,8 @@ public Response spreadCompositeRequestWithoutBodyWithResponse(String name, public Mono> spreadCompositeRequestWithResponseAsync(String name, String testHeader, BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext( - context -> service.spreadCompositeRequest(name, testHeader, contentType, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.spreadCompositeRequest(this.client.getEndpoint(), name, + testHeader, contentType, body, requestOptions, context)); } /** @@ -347,7 +361,8 @@ public Mono> spreadCompositeRequestWithResponseAsync(String name, public Response spreadCompositeRequestWithResponse(String name, String testHeader, BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.spreadCompositeRequestSync(name, testHeader, contentType, body, requestOptions, Context.NONE); + return service.spreadCompositeRequestSync(this.client.getEndpoint(), name, testHeader, contentType, body, + requestOptions, Context.NONE); } /** @@ -374,8 +389,8 @@ public Response spreadCompositeRequestWithResponse(String name, String tes public Mono> spreadCompositeRequestMixWithResponseAsync(String name, String testHeader, BinaryData spreadCompositeRequestMixRequest, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.spreadCompositeRequestMix(name, testHeader, contentType, - spreadCompositeRequestMixRequest, requestOptions, context)); + return FluxUtil.withContext(context -> service.spreadCompositeRequestMix(this.client.getEndpoint(), name, + testHeader, contentType, spreadCompositeRequestMixRequest, requestOptions, context)); } /** @@ -402,7 +417,7 @@ public Mono> spreadCompositeRequestMixWithResponseAsync(String na public Response spreadCompositeRequestMixWithResponse(String name, String testHeader, BinaryData spreadCompositeRequestMixRequest, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.spreadCompositeRequestMixSync(name, testHeader, contentType, spreadCompositeRequestMixRequest, - requestOptions, Context.NONE); + return service.spreadCompositeRequestMixSync(this.client.getEndpoint(), name, testHeader, contentType, + spreadCompositeRequestMixRequest, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/spread/implementation/SpreadClientImpl.java b/typespec-tests/src/main/java/com/parameters/spread/implementation/SpreadClientImpl.java index cfb42fd5bf..f9f10e5a40 100644 --- a/typespec-tests/src/main/java/com/parameters/spread/implementation/SpreadClientImpl.java +++ b/typespec-tests/src/main/java/com/parameters/spread/implementation/SpreadClientImpl.java @@ -15,6 +15,20 @@ * Initializes a new instance of the SpreadClient type. */ public final class SpreadClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -73,19 +87,22 @@ public AliasImpl getAlias() { /** * Initializes an instance of SpreadClient client. + * + * @param endpoint Service host. */ - public SpreadClientImpl() { + public SpreadClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of SpreadClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public SpreadClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public SpreadClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -93,10 +110,12 @@ public SpreadClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public SpreadClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public SpreadClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.models = new ModelsImpl(this); this.alias = new AliasImpl(this); } diff --git a/typespec-tests/src/main/java/com/payload/contentnegotiation/ContentNegotiationClientBuilder.java b/typespec-tests/src/main/java/com/payload/contentnegotiation/ContentNegotiationClientBuilder.java index ffa3a20d1d..7c3671fecf 100644 --- a/typespec-tests/src/main/java/com/payload/contentnegotiation/ContentNegotiationClientBuilder.java +++ b/typespec-tests/src/main/java/com/payload/contentnegotiation/ContentNegotiationClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -45,8 +46,8 @@ DifferentBodyClient.class, SameBodyAsyncClient.class, DifferentBodyAsyncClient.class }) -public final class ContentNegotiationClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class ContentNegotiationClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -178,6 +179,22 @@ public ContentNegotiationClientBuilder configuration(Configuration configuration return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ContentNegotiationClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -205,8 +222,8 @@ public ContentNegotiationClientBuilder retryPolicy(RetryPolicy retryPolicy) { private ContentNegotiationClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - ContentNegotiationClientImpl client - = new ContentNegotiationClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + ContentNegotiationClientImpl client = new ContentNegotiationClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -214,6 +231,7 @@ private ContentNegotiationClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/payload/contentnegotiation/implementation/ContentNegotiationClientImpl.java b/typespec-tests/src/main/java/com/payload/contentnegotiation/implementation/ContentNegotiationClientImpl.java index ea207cfe45..2b4d2ab945 100644 --- a/typespec-tests/src/main/java/com/payload/contentnegotiation/implementation/ContentNegotiationClientImpl.java +++ b/typespec-tests/src/main/java/com/payload/contentnegotiation/implementation/ContentNegotiationClientImpl.java @@ -15,6 +15,20 @@ * Initializes a new instance of the ContentNegotiationClient type. */ public final class ContentNegotiationClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -73,19 +87,22 @@ public DifferentBodiesImpl getDifferentBodies() { /** * Initializes an instance of ContentNegotiationClient client. + * + * @param endpoint Service host. */ - public ContentNegotiationClientImpl() { + public ContentNegotiationClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of ContentNegotiationClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public ContentNegotiationClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public ContentNegotiationClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -93,10 +110,13 @@ public ContentNegotiationClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public ContentNegotiationClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public ContentNegotiationClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.sameBodies = new SameBodiesImpl(this); this.differentBodies = new DifferentBodiesImpl(this); } diff --git a/typespec-tests/src/main/java/com/payload/contentnegotiation/implementation/DifferentBodiesImpl.java b/typespec-tests/src/main/java/com/payload/contentnegotiation/implementation/DifferentBodiesImpl.java index ccd0a42ddb..feeb0ea89a 100644 --- a/typespec-tests/src/main/java/com/payload/contentnegotiation/implementation/DifferentBodiesImpl.java +++ b/typespec-tests/src/main/java/com/payload/contentnegotiation/implementation/DifferentBodiesImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; @@ -53,7 +54,7 @@ public final class DifferentBodiesImpl { * The interface defining all the services for ContentNegotiationClientDifferentBodies to be used by the proxy * service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ContentNegotiationCl") public interface DifferentBodiesService { @Get("/content-negotiation/different-body") @@ -62,8 +63,8 @@ public interface DifferentBodiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAvatarAsPng(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getAvatarAsPng(@HostParam("endpoint") String endpoint, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/content-negotiation/different-body") @ExpectedResponses({ 200 }) @@ -71,8 +72,8 @@ Mono> getAvatarAsPng(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAvatarAsPngSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response getAvatarAsPngSync(@HostParam("endpoint") String endpoint, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/content-negotiation/different-body") @ExpectedResponses({ 200 }) @@ -80,8 +81,8 @@ Response getAvatarAsPngSync(@HeaderParam("accept") String accept, Re @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAvatarAsJson(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getAvatarAsJson(@HostParam("endpoint") String endpoint, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/content-negotiation/different-body") @ExpectedResponses({ 200 }) @@ -89,8 +90,8 @@ Mono> getAvatarAsJson(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAvatarAsJsonSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response getAvatarAsJsonSync(@HostParam("endpoint") String endpoint, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -111,7 +112,8 @@ Response getAvatarAsJsonSync(@HeaderParam("accept") String accept, R @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAvatarAsPngWithResponseAsync(RequestOptions requestOptions) { final String accept = "image/png"; - return FluxUtil.withContext(context -> service.getAvatarAsPng(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getAvatarAsPng(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -132,7 +134,7 @@ public Mono> getAvatarAsPngWithResponseAsync(RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response getAvatarAsPngWithResponse(RequestOptions requestOptions) { final String accept = "image/png"; - return service.getAvatarAsPngSync(accept, requestOptions, Context.NONE); + return service.getAvatarAsPngSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -155,7 +157,8 @@ public Response getAvatarAsPngWithResponse(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAvatarAsJsonWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAvatarAsJson(accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.getAvatarAsJson(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -178,6 +181,6 @@ public Mono> getAvatarAsJsonWithResponseAsync(RequestOption @ServiceMethod(returns = ReturnType.SINGLE) public Response getAvatarAsJsonWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getAvatarAsJsonSync(accept, requestOptions, Context.NONE); + return service.getAvatarAsJsonSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/payload/contentnegotiation/implementation/SameBodiesImpl.java b/typespec-tests/src/main/java/com/payload/contentnegotiation/implementation/SameBodiesImpl.java index 0f3d68fb15..ed0f152210 100644 --- a/typespec-tests/src/main/java/com/payload/contentnegotiation/implementation/SameBodiesImpl.java +++ b/typespec-tests/src/main/java/com/payload/contentnegotiation/implementation/SameBodiesImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; @@ -53,7 +54,7 @@ public final class SameBodiesImpl { * The interface defining all the services for ContentNegotiationClientSameBodies to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ContentNegotiationCl") public interface SameBodiesService { @Get("/content-negotiation/same-body") @@ -62,8 +63,8 @@ public interface SameBodiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAvatarAsPng(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getAvatarAsPng(@HostParam("endpoint") String endpoint, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/content-negotiation/same-body") @ExpectedResponses({ 200 }) @@ -71,8 +72,8 @@ Mono> getAvatarAsPng(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAvatarAsPngSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response getAvatarAsPngSync(@HostParam("endpoint") String endpoint, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/content-negotiation/same-body") @ExpectedResponses({ 200 }) @@ -80,8 +81,8 @@ Response getAvatarAsPngSync(@HeaderParam("accept") String accept, Re @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAvatarAsJpeg(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getAvatarAsJpeg(@HostParam("endpoint") String endpoint, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("/content-negotiation/same-body") @ExpectedResponses({ 200 }) @@ -89,8 +90,8 @@ Mono> getAvatarAsJpeg(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAvatarAsJpegSync(@HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); + Response getAvatarAsJpegSync(@HostParam("endpoint") String endpoint, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -111,7 +112,8 @@ Response getAvatarAsJpegSync(@HeaderParam("accept") String accept, R @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAvatarAsPngWithResponseAsync(RequestOptions requestOptions) { final String accept = "image/png"; - return FluxUtil.withContext(context -> service.getAvatarAsPng(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getAvatarAsPng(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -132,7 +134,7 @@ public Mono> getAvatarAsPngWithResponseAsync(RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response getAvatarAsPngWithResponse(RequestOptions requestOptions) { final String accept = "image/png"; - return service.getAvatarAsPngSync(accept, requestOptions, Context.NONE); + return service.getAvatarAsPngSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -153,7 +155,8 @@ public Response getAvatarAsPngWithResponse(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAvatarAsJpegWithResponseAsync(RequestOptions requestOptions) { final String accept = "image/jpeg"; - return FluxUtil.withContext(context -> service.getAvatarAsJpeg(accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.getAvatarAsJpeg(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -174,6 +177,6 @@ public Mono> getAvatarAsJpegWithResponseAsync(RequestOption @ServiceMethod(returns = ReturnType.SINGLE) public Response getAvatarAsJpegWithResponse(RequestOptions requestOptions) { final String accept = "image/jpeg"; - return service.getAvatarAsJpegSync(accept, requestOptions, Context.NONE); + return service.getAvatarAsJpegSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/payload/jsonmergepatch/JsonMergePatchClientBuilder.java b/typespec-tests/src/main/java/com/payload/jsonmergepatch/JsonMergePatchClientBuilder.java index 4c2e2e7484..c02ea4dced 100644 --- a/typespec-tests/src/main/java/com/payload/jsonmergepatch/JsonMergePatchClientBuilder.java +++ b/typespec-tests/src/main/java/com/payload/jsonmergepatch/JsonMergePatchClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,8 +41,8 @@ * A builder for creating a new instance of the JsonMergePatchClient type. */ @ServiceClientBuilder(serviceClients = { JsonMergePatchClient.class, JsonMergePatchAsyncClient.class }) -public final class JsonMergePatchClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class JsonMergePatchClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -172,6 +173,22 @@ public JsonMergePatchClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public JsonMergePatchClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -199,8 +216,8 @@ public JsonMergePatchClientBuilder retryPolicy(RetryPolicy retryPolicy) { private JsonMergePatchClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - JsonMergePatchClientImpl client - = new JsonMergePatchClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + JsonMergePatchClientImpl client = new JsonMergePatchClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -208,6 +225,7 @@ private JsonMergePatchClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/payload/jsonmergepatch/implementation/JsonMergePatchClientImpl.java b/typespec-tests/src/main/java/com/payload/jsonmergepatch/implementation/JsonMergePatchClientImpl.java index bafff60b14..c83fd683c7 100644 --- a/typespec-tests/src/main/java/com/payload/jsonmergepatch/implementation/JsonMergePatchClientImpl.java +++ b/typespec-tests/src/main/java/com/payload/jsonmergepatch/implementation/JsonMergePatchClientImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; @@ -42,6 +43,20 @@ public final class JsonMergePatchClientImpl { */ private final JsonMergePatchClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -72,19 +87,22 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of JsonMergePatchClient client. + * + * @param endpoint Service host. */ - public JsonMergePatchClientImpl() { + public JsonMergePatchClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of JsonMergePatchClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public JsonMergePatchClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public JsonMergePatchClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -92,10 +110,12 @@ public JsonMergePatchClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public JsonMergePatchClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public JsonMergePatchClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.service = RestProxy.create(JsonMergePatchClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -104,7 +124,7 @@ public JsonMergePatchClientImpl(HttpPipeline httpPipeline, SerializerAdapter ser * The interface defining all the services for JsonMergePatchClient to be used by the proxy service to perform REST * calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "JsonMergePatchClient") public interface JsonMergePatchClientService { @Put("/json-merge-patch/create/resource") @@ -113,9 +133,9 @@ public interface JsonMergePatchClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createResource(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> createResource(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/json-merge-patch/create/resource") @ExpectedResponses({ 200 }) @@ -123,9 +143,9 @@ Mono> createResource(@HeaderParam("Content-Type") String co @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createResourceSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response createResourceSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/json-merge-patch/update/resource") @ExpectedResponses({ 200 }) @@ -133,9 +153,9 @@ Response createResourceSync(@HeaderParam("Content-Type") String cont @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> updateResource(@HeaderParam("content-type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> updateResource(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/json-merge-patch/update/resource") @ExpectedResponses({ 200 }) @@ -143,9 +163,9 @@ Mono> updateResource(@HeaderParam("content-type") String co @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response updateResourceSync(@HeaderParam("content-type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, - RequestOptions requestOptions, Context context); + Response updateResourceSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Patch("/json-merge-patch/update/resource/optional") @ExpectedResponses({ 200 }) @@ -153,8 +173,8 @@ Response updateResourceSync(@HeaderParam("content-type") String cont @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> updateOptionalResource(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> updateOptionalResource(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/json-merge-patch/update/resource/optional") @ExpectedResponses({ 200 }) @@ -162,8 +182,8 @@ Mono> updateOptionalResource(@HeaderParam("Accept") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response updateOptionalResourceSync(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Response updateOptionalResourceSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -228,8 +248,8 @@ Response updateOptionalResourceSync(@HeaderParam("Accept") String ac public Mono> createResourceWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createResource(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.createResource(this.getEndpoint(), contentType, accept, body, requestOptions, context)); } /** @@ -294,7 +314,7 @@ public Mono> createResourceWithResponseAsync(BinaryData bod public Response createResourceWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.createResourceSync(contentType, accept, body, requestOptions, Context.NONE); + return service.createResourceSync(this.getEndpoint(), contentType, accept, body, requestOptions, Context.NONE); } /** @@ -358,8 +378,8 @@ public Response createResourceWithResponse(BinaryData body, RequestO public Mono> updateResourceWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.updateResource(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.updateResource(this.getEndpoint(), contentType, accept, body, requestOptions, context)); } /** @@ -423,7 +443,7 @@ public Mono> updateResourceWithResponseAsync(BinaryData bod public Response updateResourceWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; final String accept = "application/json"; - return service.updateResourceSync(contentType, accept, body, requestOptions, Context.NONE); + return service.updateResourceSync(this.getEndpoint(), contentType, accept, body, requestOptions, Context.NONE); } /** @@ -499,7 +519,8 @@ public Mono> updateOptionalResourceWithResponseAsync(Reques requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/merge-patch+json"); } }); - return FluxUtil.withContext(context -> service.updateOptionalResource(accept, requestOptionsLocal, context)); + return FluxUtil.withContext( + context -> service.updateOptionalResource(this.getEndpoint(), accept, requestOptionsLocal, context)); } /** @@ -575,6 +596,6 @@ public Response updateOptionalResourceWithResponse(RequestOptions re requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/merge-patch+json"); } }); - return service.updateOptionalResourceSync(accept, requestOptionsLocal, Context.NONE); + return service.updateOptionalResourceSync(this.getEndpoint(), accept, requestOptionsLocal, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/payload/mediatype/MediaTypeClientBuilder.java b/typespec-tests/src/main/java/com/payload/mediatype/MediaTypeClientBuilder.java index dfd4c2c51b..9cf857ffde 100644 --- a/typespec-tests/src/main/java/com/payload/mediatype/MediaTypeClientBuilder.java +++ b/typespec-tests/src/main/java/com/payload/mediatype/MediaTypeClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,8 +41,8 @@ * A builder for creating a new instance of the MediaTypeClient type. */ @ServiceClientBuilder(serviceClients = { MediaTypeClient.class, MediaTypeAsyncClient.class }) -public final class MediaTypeClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class MediaTypeClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -172,6 +173,22 @@ public MediaTypeClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public MediaTypeClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -200,7 +217,7 @@ private MediaTypeClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); MediaTypeClientImpl client - = new MediaTypeClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + = new MediaTypeClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -208,6 +225,7 @@ private MediaTypeClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/payload/mediatype/implementation/MediaTypeClientImpl.java b/typespec-tests/src/main/java/com/payload/mediatype/implementation/MediaTypeClientImpl.java index 1c622892b9..98398c2533 100644 --- a/typespec-tests/src/main/java/com/payload/mediatype/implementation/MediaTypeClientImpl.java +++ b/typespec-tests/src/main/java/com/payload/mediatype/implementation/MediaTypeClientImpl.java @@ -15,6 +15,20 @@ * Initializes a new instance of the MediaTypeClient type. */ public final class MediaTypeClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -59,19 +73,22 @@ public StringBodiesImpl getStringBodies() { /** * Initializes an instance of MediaTypeClient client. + * + * @param endpoint Service host. */ - public MediaTypeClientImpl() { + public MediaTypeClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of MediaTypeClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public MediaTypeClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public MediaTypeClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -79,10 +96,12 @@ public MediaTypeClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public MediaTypeClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public MediaTypeClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.stringBodies = new StringBodiesImpl(this); } } diff --git a/typespec-tests/src/main/java/com/payload/mediatype/implementation/StringBodiesImpl.java b/typespec-tests/src/main/java/com/payload/mediatype/implementation/StringBodiesImpl.java index 205b382e4c..4acde5ace5 100644 --- a/typespec-tests/src/main/java/com/payload/mediatype/implementation/StringBodiesImpl.java +++ b/typespec-tests/src/main/java/com/payload/mediatype/implementation/StringBodiesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class StringBodiesImpl { * The interface defining all the services for MediaTypeClientStringBodies to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "MediaTypeClientStrin") public interface StringBodiesService { @Post("/payload/media-type/string-body/sendAsText") @@ -64,8 +65,9 @@ public interface StringBodiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> sendAsText(@HeaderParam("content-type") String contentType, - @BodyParam("text/plain") BinaryData text, RequestOptions requestOptions, Context context); + Mono> sendAsText(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("text/plain") BinaryData text, + RequestOptions requestOptions, Context context); @Post("/payload/media-type/string-body/sendAsText") @ExpectedResponses({ 200 }) @@ -73,8 +75,9 @@ Mono> sendAsText(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendAsTextSync(@HeaderParam("content-type") String contentType, - @BodyParam("text/plain") BinaryData text, RequestOptions requestOptions, Context context); + Response sendAsTextSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("text/plain") BinaryData text, + RequestOptions requestOptions, Context context); @Get("/payload/media-type/string-body/getAsText") @ExpectedResponses({ 200 }) @@ -82,8 +85,8 @@ Response sendAsTextSync(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAsText(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getAsText(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/payload/media-type/string-body/getAsText") @ExpectedResponses({ 200 }) @@ -91,8 +94,8 @@ Mono> getAsText(@HeaderParam("Accept") String accept, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAsTextSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getAsTextSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Post("/payload/media-type/string-body/sendAsJson") @ExpectedResponses({ 200 }) @@ -100,8 +103,9 @@ Response getAsTextSync(@HeaderParam("Accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> sendAsJson(@HeaderParam("content-type") String contentType, - @BodyParam("application/json") BinaryData text, RequestOptions requestOptions, Context context); + Mono> sendAsJson(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData text, + RequestOptions requestOptions, Context context); @Post("/payload/media-type/string-body/sendAsJson") @ExpectedResponses({ 200 }) @@ -109,8 +113,9 @@ Mono> sendAsJson(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendAsJsonSync(@HeaderParam("content-type") String contentType, - @BodyParam("application/json") BinaryData text, RequestOptions requestOptions, Context context); + Response sendAsJsonSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData text, + RequestOptions requestOptions, Context context); @Get("/payload/media-type/string-body/getAsJson") @ExpectedResponses({ 200 }) @@ -118,8 +123,8 @@ Response sendAsJsonSync(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAsJson(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getAsJson(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/payload/media-type/string-body/getAsJson") @ExpectedResponses({ 200 }) @@ -127,8 +132,8 @@ Mono> getAsJson(@HeaderParam("Accept") String accept, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAsJsonSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getAsJsonSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); } /** @@ -150,7 +155,8 @@ Response getAsJsonSync(@HeaderParam("Accept") String accept, Request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendAsTextWithResponseAsync(BinaryData text, RequestOptions requestOptions) { final String contentType = "text/plain"; - return FluxUtil.withContext(context -> service.sendAsText(contentType, text, requestOptions, context)); + return FluxUtil.withContext( + context -> service.sendAsText(this.client.getEndpoint(), contentType, text, requestOptions, context)); } /** @@ -172,7 +178,7 @@ public Mono> sendAsTextWithResponseAsync(BinaryData text, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response sendAsTextWithResponse(BinaryData text, RequestOptions requestOptions) { final String contentType = "text/plain"; - return service.sendAsTextSync(contentType, text, requestOptions, Context.NONE); + return service.sendAsTextSync(this.client.getEndpoint(), contentType, text, requestOptions, Context.NONE); } /** @@ -193,7 +199,8 @@ public Response sendAsTextWithResponse(BinaryData text, RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAsTextWithResponseAsync(RequestOptions requestOptions) { final String accept = "text/plain"; - return FluxUtil.withContext(context -> service.getAsText(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getAsText(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -214,7 +221,7 @@ public Mono> getAsTextWithResponseAsync(RequestOptions requ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAsTextWithResponse(RequestOptions requestOptions) { final String accept = "text/plain"; - return service.getAsTextSync(accept, requestOptions, Context.NONE); + return service.getAsTextSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -236,7 +243,8 @@ public Response getAsTextWithResponse(RequestOptions requestOptions) @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendAsJsonWithResponseAsync(BinaryData text, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.sendAsJson(contentType, text, requestOptions, context)); + return FluxUtil.withContext( + context -> service.sendAsJson(this.client.getEndpoint(), contentType, text, requestOptions, context)); } /** @@ -258,7 +266,7 @@ public Mono> sendAsJsonWithResponseAsync(BinaryData text, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response sendAsJsonWithResponse(BinaryData text, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.sendAsJsonSync(contentType, text, requestOptions, Context.NONE); + return service.sendAsJsonSync(this.client.getEndpoint(), contentType, text, requestOptions, Context.NONE); } /** @@ -279,7 +287,8 @@ public Response sendAsJsonWithResponse(BinaryData text, RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAsJsonWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAsJson(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getAsJson(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -300,6 +309,6 @@ public Mono> getAsJsonWithResponseAsync(RequestOptions requ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAsJsonWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getAsJsonSync(accept, requestOptions, Context.NONE); + return service.getAsJsonSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/payload/multipart/MultiPartClientBuilder.java b/typespec-tests/src/main/java/com/payload/multipart/MultiPartClientBuilder.java index 40dbcf9148..536ffb6800 100644 --- a/typespec-tests/src/main/java/com/payload/multipart/MultiPartClientBuilder.java +++ b/typespec-tests/src/main/java/com/payload/multipart/MultiPartClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,8 +41,8 @@ * A builder for creating a new instance of the MultiPartClient type. */ @ServiceClientBuilder(serviceClients = { MultiPartClient.class, MultiPartAsyncClient.class }) -public final class MultiPartClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class MultiPartClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -172,6 +173,22 @@ public MultiPartClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public MultiPartClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -200,7 +217,7 @@ private MultiPartClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); MultiPartClientImpl client - = new MultiPartClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + = new MultiPartClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -208,6 +225,7 @@ private MultiPartClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/payload/multipart/implementation/FormDatasImpl.java b/typespec-tests/src/main/java/com/payload/multipart/implementation/FormDatasImpl.java index d34df545a8..90ac80838a 100644 --- a/typespec-tests/src/main/java/com/payload/multipart/implementation/FormDatasImpl.java +++ b/typespec-tests/src/main/java/com/payload/multipart/implementation/FormDatasImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class FormDatasImpl { * The interface defining all the services for MultiPartClientFormDatas to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "MultiPartClientFormD") public interface FormDatasService { // @Multipart not supported by RestProxy @@ -64,8 +65,9 @@ public interface FormDatasService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> basic(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Mono> basic(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/mixed-parts") @@ -74,8 +76,9 @@ Mono> basic(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response basicSync(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Response basicSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/complex-parts") @@ -84,8 +87,9 @@ Response basicSync(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> complex(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Mono> complex(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/complex-parts") @@ -94,8 +98,9 @@ Mono> complex(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response complexSync(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Response complexSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/json-part") @@ -104,8 +109,9 @@ Response complexSync(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> jsonPart(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Mono> jsonPart(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/json-part") @@ -114,8 +120,9 @@ Mono> jsonPart(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response jsonPartSync(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Response jsonPartSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/binary-array-parts") @@ -124,8 +131,9 @@ Response jsonPartSync(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> binaryArrayParts(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Mono> binaryArrayParts(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/binary-array-parts") @@ -134,8 +142,9 @@ Mono> binaryArrayParts(@HeaderParam("content-type") String conten @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response binaryArrayPartsSync(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Response binaryArrayPartsSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/json-array-parts") @@ -144,8 +153,9 @@ Response binaryArrayPartsSync(@HeaderParam("content-type") String contentT @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> jsonArrayParts(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Mono> jsonArrayParts(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/json-array-parts") @@ -154,8 +164,9 @@ Mono> jsonArrayParts(@HeaderParam("content-type") String contentT @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response jsonArrayPartsSync(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Response jsonArrayPartsSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/multi-binary-parts") @@ -164,8 +175,9 @@ Response jsonArrayPartsSync(@HeaderParam("content-type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> multiBinaryParts(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Mono> multiBinaryParts(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/multi-binary-parts") @@ -174,8 +186,9 @@ Mono> multiBinaryParts(@HeaderParam("content-type") String conten @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response multiBinaryPartsSync(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Response multiBinaryPartsSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/check-filename-and-content-type") @@ -184,8 +197,9 @@ Response multiBinaryPartsSync(@HeaderParam("content-type") String contentT @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> checkFileNameAndContentType(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Mono> checkFileNameAndContentType(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/check-filename-and-content-type") @@ -194,8 +208,9 @@ Mono> checkFileNameAndContentType(@HeaderParam("content-type") St @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response checkFileNameAndContentTypeSync(@HeaderParam("content-type") String contentType, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Response checkFileNameAndContentTypeSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/anonymous-model") @@ -204,7 +219,8 @@ Response checkFileNameAndContentTypeSync(@HeaderParam("content-type") Stri @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> anonymousModel(@HeaderParam("content-type") String contentType, + Mono> anonymousModel(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData anonymousModelRequest, RequestOptions requestOptions, Context context); @@ -215,7 +231,8 @@ Mono> anonymousModel(@HeaderParam("content-type") String contentT @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response anonymousModelSync(@HeaderParam("content-type") String contentType, + Response anonymousModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData anonymousModelRequest, RequestOptions requestOptions, Context context); } @@ -234,7 +251,8 @@ Response anonymousModelSync(@HeaderParam("content-type") String contentTyp @ServiceMethod(returns = ReturnType.SINGLE) public Mono> basicWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return FluxUtil.withContext(context -> service.basic(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.basic(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -251,7 +269,7 @@ public Mono> basicWithResponseAsync(BinaryData body, RequestOptio @ServiceMethod(returns = ReturnType.SINGLE) public Response basicWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return service.basicSync(contentType, body, requestOptions, Context.NONE); + return service.basicSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -268,7 +286,8 @@ public Response basicWithResponse(BinaryData body, RequestOptions requestO @ServiceMethod(returns = ReturnType.SINGLE) public Mono> complexWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return FluxUtil.withContext(context -> service.complex(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.complex(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -285,7 +304,7 @@ public Mono> complexWithResponseAsync(BinaryData body, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response complexWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return service.complexSync(contentType, body, requestOptions, Context.NONE); + return service.complexSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -302,7 +321,8 @@ public Response complexWithResponse(BinaryData body, RequestOptions reques @ServiceMethod(returns = ReturnType.SINGLE) public Mono> jsonPartWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return FluxUtil.withContext(context -> service.jsonPart(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.jsonPart(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -319,7 +339,7 @@ public Mono> jsonPartWithResponseAsync(BinaryData body, RequestOp @ServiceMethod(returns = ReturnType.SINGLE) public Response jsonPartWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return service.jsonPartSync(contentType, body, requestOptions, Context.NONE); + return service.jsonPartSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -336,7 +356,8 @@ public Response jsonPartWithResponse(BinaryData body, RequestOptions reque @ServiceMethod(returns = ReturnType.SINGLE) public Mono> binaryArrayPartsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return FluxUtil.withContext(context -> service.binaryArrayParts(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.binaryArrayParts(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -353,7 +374,7 @@ public Mono> binaryArrayPartsWithResponseAsync(BinaryData body, R @ServiceMethod(returns = ReturnType.SINGLE) public Response binaryArrayPartsWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return service.binaryArrayPartsSync(contentType, body, requestOptions, Context.NONE); + return service.binaryArrayPartsSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -370,7 +391,8 @@ public Response binaryArrayPartsWithResponse(BinaryData body, RequestOptio @ServiceMethod(returns = ReturnType.SINGLE) public Mono> jsonArrayPartsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return FluxUtil.withContext(context -> service.jsonArrayParts(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.jsonArrayParts(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -387,7 +409,7 @@ public Mono> jsonArrayPartsWithResponseAsync(BinaryData body, Req @ServiceMethod(returns = ReturnType.SINGLE) public Response jsonArrayPartsWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return service.jsonArrayPartsSync(contentType, body, requestOptions, Context.NONE); + return service.jsonArrayPartsSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -404,7 +426,8 @@ public Response jsonArrayPartsWithResponse(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> multiBinaryPartsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return FluxUtil.withContext(context -> service.multiBinaryParts(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.multiBinaryParts(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -421,7 +444,7 @@ public Mono> multiBinaryPartsWithResponseAsync(BinaryData body, R @ServiceMethod(returns = ReturnType.SINGLE) public Response multiBinaryPartsWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return service.multiBinaryPartsSync(contentType, body, requestOptions, Context.NONE); + return service.multiBinaryPartsSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -439,8 +462,8 @@ public Response multiBinaryPartsWithResponse(BinaryData body, RequestOptio public Mono> checkFileNameAndContentTypeWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return FluxUtil - .withContext(context -> service.checkFileNameAndContentType(contentType, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.checkFileNameAndContentType(this.client.getEndpoint(), + contentType, body, requestOptions, context)); } /** @@ -457,7 +480,8 @@ public Mono> checkFileNameAndContentTypeWithResponseAsync(BinaryD @ServiceMethod(returns = ReturnType.SINGLE) public Response checkFileNameAndContentTypeWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return service.checkFileNameAndContentTypeSync(contentType, body, requestOptions, Context.NONE); + return service.checkFileNameAndContentTypeSync(this.client.getEndpoint(), contentType, body, requestOptions, + Context.NONE); } /** @@ -475,8 +499,8 @@ public Response checkFileNameAndContentTypeWithResponse(BinaryData body, R public Mono> anonymousModelWithResponseAsync(BinaryData anonymousModelRequest, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return FluxUtil.withContext( - context -> service.anonymousModel(contentType, anonymousModelRequest, requestOptions, context)); + return FluxUtil.withContext(context -> service.anonymousModel(this.client.getEndpoint(), contentType, + anonymousModelRequest, requestOptions, context)); } /** @@ -493,6 +517,7 @@ public Mono> anonymousModelWithResponseAsync(BinaryData anonymous @ServiceMethod(returns = ReturnType.SINGLE) public Response anonymousModelWithResponse(BinaryData anonymousModelRequest, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - return service.anonymousModelSync(contentType, anonymousModelRequest, requestOptions, Context.NONE); + return service.anonymousModelSync(this.client.getEndpoint(), contentType, anonymousModelRequest, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/payload/multipart/implementation/MultiPartClientImpl.java b/typespec-tests/src/main/java/com/payload/multipart/implementation/MultiPartClientImpl.java index 31c1179031..b09a3bf8dc 100644 --- a/typespec-tests/src/main/java/com/payload/multipart/implementation/MultiPartClientImpl.java +++ b/typespec-tests/src/main/java/com/payload/multipart/implementation/MultiPartClientImpl.java @@ -15,6 +15,20 @@ * Initializes a new instance of the MultiPartClient type. */ public final class MultiPartClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -59,19 +73,22 @@ public FormDatasImpl getFormDatas() { /** * Initializes an instance of MultiPartClient client. + * + * @param endpoint Service host. */ - public MultiPartClientImpl() { + public MultiPartClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of MultiPartClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public MultiPartClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public MultiPartClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -79,10 +96,12 @@ public MultiPartClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public MultiPartClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public MultiPartClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.formDatas = new FormDatasImpl(this); } } diff --git a/typespec-tests/src/main/java/com/payload/pageable/PageableClientBuilder.java b/typespec-tests/src/main/java/com/payload/pageable/PageableClientBuilder.java index 37725fcab3..1fee18b6e4 100644 --- a/typespec-tests/src/main/java/com/payload/pageable/PageableClientBuilder.java +++ b/typespec-tests/src/main/java/com/payload/pageable/PageableClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,8 +41,8 @@ * A builder for creating a new instance of the PageableClient type. */ @ServiceClientBuilder(serviceClients = { PageableClient.class, PageableAsyncClient.class }) -public final class PageableClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class PageableClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -172,6 +173,22 @@ public PageableClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public PageableClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -200,7 +217,7 @@ private PageableClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); PageableClientImpl client - = new PageableClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + = new PageableClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -208,6 +225,7 @@ private PageableClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/payload/pageable/implementation/PageableClientImpl.java b/typespec-tests/src/main/java/com/payload/pageable/implementation/PageableClientImpl.java index 7f63146b5f..bc5106cec3 100644 --- a/typespec-tests/src/main/java/com/payload/pageable/implementation/PageableClientImpl.java +++ b/typespec-tests/src/main/java/com/payload/pageable/implementation/PageableClientImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -48,6 +49,20 @@ public final class PageableClientImpl { */ private final PageableClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -78,19 +93,22 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of PageableClient client. + * + * @param endpoint Service host. */ - public PageableClientImpl() { + public PageableClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of PageableClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public PageableClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public PageableClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -98,17 +116,19 @@ public PageableClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public PageableClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public PageableClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.service = RestProxy.create(PageableClientService.class, this.httpPipeline, this.getSerializerAdapter()); } /** * The interface defining all the services for PageableClient to be used by the proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "PageableClient") public interface PageableClientService { @Get("/payload/pageable") @@ -117,8 +137,8 @@ public interface PageableClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> list(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/payload/pageable") @ExpectedResponses({ 200 }) @@ -126,8 +146,8 @@ Mono> list(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response listSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -136,7 +156,8 @@ Response listSync(@HeaderParam("Accept") String accept, RequestOptio @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -145,7 +166,8 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = tru @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); } /** @@ -175,7 +197,7 @@ Response listNextSync(@PathParam(value = "nextLink", encoded = true) @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.list(accept, requestOptions, context)) + return FluxUtil.withContext(context -> service.list(this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -260,7 +282,7 @@ public PagedFlux listAsync(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listSync(accept, requestOptions, Context.NONE); + Response res = service.listSync(this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } @@ -341,7 +363,8 @@ public PagedIterable list(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, accept, requestOptions, context)) + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -369,7 +392,8 @@ private Mono> listNextSinglePageAsync(String nextLink, @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listNextSync(nextLink, accept, requestOptions, Context.NONE); + Response res + = service.listNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } diff --git a/typespec-tests/src/main/java/com/serialization/encodedname/json/JsonClientBuilder.java b/typespec-tests/src/main/java/com/serialization/encodedname/json/JsonClientBuilder.java index b4a2d6600b..9beba07083 100644 --- a/typespec-tests/src/main/java/com/serialization/encodedname/json/JsonClientBuilder.java +++ b/typespec-tests/src/main/java/com/serialization/encodedname/json/JsonClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,7 +41,8 @@ * A builder for creating a new instance of the JsonClient type. */ @ServiceClientBuilder(serviceClients = { JsonClient.class, JsonAsyncClient.class }) -public final class JsonClientBuilder implements HttpTrait, ConfigurationTrait { +public final class JsonClientBuilder + implements HttpTrait, ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -172,6 +174,22 @@ public JsonClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public JsonClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -199,7 +217,8 @@ public JsonClientBuilder retryPolicy(RetryPolicy retryPolicy) { private JsonClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - JsonClientImpl client = new JsonClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + JsonClientImpl client + = new JsonClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -207,6 +226,7 @@ private JsonClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/serialization/encodedname/json/implementation/JsonClientImpl.java b/typespec-tests/src/main/java/com/serialization/encodedname/json/implementation/JsonClientImpl.java index 04feefca94..9d3972323c 100644 --- a/typespec-tests/src/main/java/com/serialization/encodedname/json/implementation/JsonClientImpl.java +++ b/typespec-tests/src/main/java/com/serialization/encodedname/json/implementation/JsonClientImpl.java @@ -15,6 +15,20 @@ * Initializes a new instance of the JsonClient type. */ public final class JsonClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -59,19 +73,22 @@ public PropertiesImpl getProperties() { /** * Initializes an instance of JsonClient client. + * + * @param endpoint Service host. */ - public JsonClientImpl() { + public JsonClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of JsonClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public JsonClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public JsonClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -79,10 +96,12 @@ public JsonClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public JsonClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public JsonClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.properties = new PropertiesImpl(this); } } diff --git a/typespec-tests/src/main/java/com/serialization/encodedname/json/implementation/PropertiesImpl.java b/typespec-tests/src/main/java/com/serialization/encodedname/json/implementation/PropertiesImpl.java index fb64a2b5c7..a72b2daa01 100644 --- a/typespec-tests/src/main/java/com/serialization/encodedname/json/implementation/PropertiesImpl.java +++ b/typespec-tests/src/main/java/com/serialization/encodedname/json/implementation/PropertiesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class PropertiesImpl { * The interface defining all the services for JsonClientProperties to be used by the proxy service to perform REST * calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "JsonClientProperties") public interface PropertiesService { @Post("/serialization/encoded-name/json/property") @@ -64,8 +65,9 @@ public interface PropertiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> send(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/serialization/encoded-name/json/property") @ExpectedResponses({ 204 }) @@ -73,7 +75,7 @@ Mono> send(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("Content-Type") String contentType, + Response sendSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/serialization/encoded-name/json/property") @@ -82,8 +84,8 @@ Response sendSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/serialization/encoded-name/json/property") @ExpectedResponses({ 200 }) @@ -91,8 +93,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); } /** @@ -116,7 +118,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.send(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.send(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -140,7 +143,7 @@ public Mono> sendWithResponseAsync(BinaryData body, RequestOption @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.sendSync(contentType, body, requestOptions, Context.NONE); + return service.sendSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -163,7 +166,7 @@ public Response sendWithResponse(BinaryData body, RequestOptions requestOp @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/specialheaders/conditionalrequest/ConditionalRequestClientBuilder.java b/typespec-tests/src/main/java/com/specialheaders/conditionalrequest/ConditionalRequestClientBuilder.java index 42b0b31550..e56487b10b 100644 --- a/typespec-tests/src/main/java/com/specialheaders/conditionalrequest/ConditionalRequestClientBuilder.java +++ b/typespec-tests/src/main/java/com/specialheaders/conditionalrequest/ConditionalRequestClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,8 +41,8 @@ * A builder for creating a new instance of the ConditionalRequestClient type. */ @ServiceClientBuilder(serviceClients = { ConditionalRequestClient.class, ConditionalRequestAsyncClient.class }) -public final class ConditionalRequestClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class ConditionalRequestClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -173,6 +174,22 @@ public ConditionalRequestClientBuilder configuration(Configuration configuration return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ConditionalRequestClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -200,8 +217,8 @@ public ConditionalRequestClientBuilder retryPolicy(RetryPolicy retryPolicy) { private ConditionalRequestClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - ConditionalRequestClientImpl client - = new ConditionalRequestClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + ConditionalRequestClientImpl client = new ConditionalRequestClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -209,6 +226,7 @@ private ConditionalRequestClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/specialheaders/conditionalrequest/implementation/ConditionalRequestClientImpl.java b/typespec-tests/src/main/java/com/specialheaders/conditionalrequest/implementation/ConditionalRequestClientImpl.java index df7fa365a0..a5d41b886c 100644 --- a/typespec-tests/src/main/java/com/specialheaders/conditionalrequest/implementation/ConditionalRequestClientImpl.java +++ b/typespec-tests/src/main/java/com/specialheaders/conditionalrequest/implementation/ConditionalRequestClientImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -37,6 +38,20 @@ public final class ConditionalRequestClientImpl { */ private final ConditionalRequestClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -67,19 +82,22 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of ConditionalRequestClient client. + * + * @param endpoint Service host. */ - public ConditionalRequestClientImpl() { + public ConditionalRequestClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of ConditionalRequestClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public ConditionalRequestClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public ConditionalRequestClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -87,10 +105,13 @@ public ConditionalRequestClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public ConditionalRequestClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public ConditionalRequestClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.service = RestProxy.create(ConditionalRequestClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -99,7 +120,7 @@ public ConditionalRequestClientImpl(HttpPipeline httpPipeline, SerializerAdapter * The interface defining all the services for ConditionalRequestClient to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ConditionalRequestCl") public interface ConditionalRequestClientService { @Post("/special-headers/conditional-request/if-match") @@ -108,7 +129,8 @@ public interface ConditionalRequestClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> postIfMatch(RequestOptions requestOptions, Context context); + Mono> postIfMatch(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Post("/special-headers/conditional-request/if-match") @ExpectedResponses({ 204 }) @@ -116,7 +138,8 @@ public interface ConditionalRequestClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postIfMatchSync(RequestOptions requestOptions, Context context); + Response postIfMatchSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Post("/special-headers/conditional-request/if-none-match") @ExpectedResponses({ 204 }) @@ -124,7 +147,8 @@ public interface ConditionalRequestClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> postIfNoneMatch(RequestOptions requestOptions, Context context); + Mono> postIfNoneMatch(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Post("/special-headers/conditional-request/if-none-match") @ExpectedResponses({ 204 }) @@ -132,7 +156,8 @@ public interface ConditionalRequestClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postIfNoneMatchSync(RequestOptions requestOptions, Context context); + Response postIfNoneMatchSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); } /** @@ -155,7 +180,7 @@ public interface ConditionalRequestClientService { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postIfMatchWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.postIfMatch(requestOptions, context)); + return FluxUtil.withContext(context -> service.postIfMatch(this.getEndpoint(), requestOptions, context)); } /** @@ -178,7 +203,7 @@ public Mono> postIfMatchWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postIfMatchWithResponse(RequestOptions requestOptions) { - return service.postIfMatchSync(requestOptions, Context.NONE); + return service.postIfMatchSync(this.getEndpoint(), requestOptions, Context.NONE); } /** @@ -201,7 +226,7 @@ public Response postIfMatchWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postIfNoneMatchWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.postIfNoneMatch(requestOptions, context)); + return FluxUtil.withContext(context -> service.postIfNoneMatch(this.getEndpoint(), requestOptions, context)); } /** @@ -224,6 +249,6 @@ public Mono> postIfNoneMatchWithResponseAsync(RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response postIfNoneMatchWithResponse(RequestOptions requestOptions) { - return service.postIfNoneMatchSync(requestOptions, Context.NONE); + return service.postIfNoneMatchSync(this.getEndpoint(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/specialheaders/repeatability/RepeatabilityClientBuilder.java b/typespec-tests/src/main/java/com/specialheaders/repeatability/RepeatabilityClientBuilder.java index 627ad0c303..eacf687e3b 100644 --- a/typespec-tests/src/main/java/com/specialheaders/repeatability/RepeatabilityClientBuilder.java +++ b/typespec-tests/src/main/java/com/specialheaders/repeatability/RepeatabilityClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,8 +41,8 @@ * A builder for creating a new instance of the RepeatabilityClient type. */ @ServiceClientBuilder(serviceClients = { RepeatabilityClient.class, RepeatabilityAsyncClient.class }) -public final class RepeatabilityClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class RepeatabilityClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -173,6 +174,22 @@ public RepeatabilityClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public RepeatabilityClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -200,8 +217,8 @@ public RepeatabilityClientBuilder retryPolicy(RetryPolicy retryPolicy) { private RepeatabilityClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - RepeatabilityClientImpl client - = new RepeatabilityClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + RepeatabilityClientImpl client = new RepeatabilityClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -209,6 +226,7 @@ private RepeatabilityClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/specialheaders/repeatability/implementation/RepeatabilityClientImpl.java b/typespec-tests/src/main/java/com/specialheaders/repeatability/implementation/RepeatabilityClientImpl.java index 2a173296b4..d9263b183b 100644 --- a/typespec-tests/src/main/java/com/specialheaders/repeatability/implementation/RepeatabilityClientImpl.java +++ b/typespec-tests/src/main/java/com/specialheaders/repeatability/implementation/RepeatabilityClientImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -41,6 +42,20 @@ public final class RepeatabilityClientImpl { */ private final RepeatabilityClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -71,19 +86,22 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of RepeatabilityClient client. + * + * @param endpoint Service host. */ - public RepeatabilityClientImpl() { + public RepeatabilityClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of RepeatabilityClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public RepeatabilityClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public RepeatabilityClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -91,10 +109,12 @@ public RepeatabilityClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public RepeatabilityClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public RepeatabilityClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.service = RestProxy.create(RepeatabilityClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -103,7 +123,7 @@ public RepeatabilityClientImpl(HttpPipeline httpPipeline, SerializerAdapter seri * The interface defining all the services for RepeatabilityClient to be used by the proxy service to perform REST * calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "RepeatabilityClient") public interface RepeatabilityClientService { @Post("/special-headers/repeatability/immediateSuccess") @@ -112,7 +132,8 @@ public interface RepeatabilityClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> immediateSuccess(RequestOptions requestOptions, Context context); + Mono> immediateSuccess(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Post("/special-headers/repeatability/immediateSuccess") @ExpectedResponses({ 204 }) @@ -120,7 +141,8 @@ public interface RepeatabilityClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response immediateSuccessSync(RequestOptions requestOptions, Context context); + Response immediateSuccessSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); } /** @@ -158,7 +180,8 @@ public Mono> immediateSuccessWithResponseAsync(RequestOptions req DateTimeRfc1123.toRfc1123String(OffsetDateTime.now())); } }); - return FluxUtil.withContext(context -> service.immediateSuccess(requestOptionsLocal, context)); + return FluxUtil + .withContext(context -> service.immediateSuccess(this.getEndpoint(), requestOptionsLocal, context)); } /** @@ -196,6 +219,6 @@ public Response immediateSuccessWithResponse(RequestOptions requestOptions DateTimeRfc1123.toRfc1123String(OffsetDateTime.now())); } }); - return service.immediateSuccessSync(requestOptionsLocal, Context.NONE); + return service.immediateSuccessSync(this.getEndpoint(), requestOptionsLocal, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/specialwords/SpecialWordsClientBuilder.java b/typespec-tests/src/main/java/com/specialwords/SpecialWordsClientBuilder.java index 3b2ddaf7df..e44a6573cb 100644 --- a/typespec-tests/src/main/java/com/specialwords/SpecialWordsClientBuilder.java +++ b/typespec-tests/src/main/java/com/specialwords/SpecialWordsClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -49,8 +50,8 @@ ModelPropertiesAsyncClient.class, OperationsAsyncClient.class, ParametersAsyncClient.class }) -public final class SpecialWordsClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class SpecialWordsClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -181,6 +182,22 @@ public SpecialWordsClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public SpecialWordsClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -209,7 +226,7 @@ private SpecialWordsClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); SpecialWordsClientImpl client - = new SpecialWordsClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + = new SpecialWordsClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -217,6 +234,7 @@ private SpecialWordsClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/specialwords/implementation/ModelPropertiesImpl.java b/typespec-tests/src/main/java/com/specialwords/implementation/ModelPropertiesImpl.java index 5cafb1140f..bdf0af0544 100644 --- a/typespec-tests/src/main/java/com/specialwords/implementation/ModelPropertiesImpl.java +++ b/typespec-tests/src/main/java/com/specialwords/implementation/ModelPropertiesImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class ModelPropertiesImpl { * The interface defining all the services for SpecialWordsClientModelProperties to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "SpecialWordsClientMo") public interface ModelPropertiesService { @Post("/special-words/model-properties/same-as-model") @@ -63,8 +64,9 @@ public interface ModelPropertiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> sameAsModel(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> sameAsModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/model-properties/same-as-model") @ExpectedResponses({ 204 }) @@ -72,8 +74,9 @@ Mono> sameAsModel(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sameAsModelSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response sameAsModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -97,7 +100,8 @@ Response sameAsModelSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sameAsModelWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.sameAsModel(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.sameAsModel(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -121,6 +125,6 @@ public Mono> sameAsModelWithResponseAsync(BinaryData body, Reques @ServiceMethod(returns = ReturnType.SINGLE) public Response sameAsModelWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.sameAsModelSync(contentType, body, requestOptions, Context.NONE); + return service.sameAsModelSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/specialwords/implementation/ModelsImpl.java b/typespec-tests/src/main/java/com/specialwords/implementation/ModelsImpl.java index 87d74f2309..4b9e9e561d 100644 --- a/typespec-tests/src/main/java/com/specialwords/implementation/ModelsImpl.java +++ b/typespec-tests/src/main/java/com/specialwords/implementation/ModelsImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -53,7 +54,7 @@ public final class ModelsImpl { * The interface defining all the services for SpecialWordsClientModels to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "SpecialWordsClientMo") public interface ModelsService { @Post("/special-words/models/and") @@ -62,8 +63,9 @@ public interface ModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAnd(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withAnd(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/and") @ExpectedResponses({ 204 }) @@ -71,8 +73,9 @@ Mono> withAnd(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAndSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withAndSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/as") @ExpectedResponses({ 204 }) @@ -80,8 +83,9 @@ Response withAndSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAs(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withAs(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/as") @ExpectedResponses({ 204 }) @@ -89,8 +93,9 @@ Mono> withAs(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAsSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withAsSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/assert") @ExpectedResponses({ 204 }) @@ -98,8 +103,9 @@ Response withAsSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAssert(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withAssert(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/assert") @ExpectedResponses({ 204 }) @@ -107,8 +113,9 @@ Mono> withAssert(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAssertSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withAssertSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/async") @ExpectedResponses({ 204 }) @@ -116,8 +123,9 @@ Response withAssertSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAsync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withAsync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/async") @ExpectedResponses({ 204 }) @@ -125,8 +133,9 @@ Mono> withAsync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAsyncSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withAsyncSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/await") @ExpectedResponses({ 204 }) @@ -134,8 +143,9 @@ Response withAsyncSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAwait(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withAwait(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/await") @ExpectedResponses({ 204 }) @@ -143,8 +153,9 @@ Mono> withAwait(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAwaitSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withAwaitSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/break") @ExpectedResponses({ 204 }) @@ -152,8 +163,9 @@ Response withAwaitSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withBreak(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withBreak(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/break") @ExpectedResponses({ 204 }) @@ -161,8 +173,9 @@ Mono> withBreak(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withBreakSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withBreakSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/class") @ExpectedResponses({ 204 }) @@ -170,8 +183,9 @@ Response withBreakSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withClass(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withClass(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/class") @ExpectedResponses({ 204 }) @@ -179,8 +193,9 @@ Mono> withClass(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withClassSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withClassSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/constructor") @ExpectedResponses({ 204 }) @@ -188,8 +203,9 @@ Response withClassSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withConstructor(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withConstructor(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/constructor") @ExpectedResponses({ 204 }) @@ -197,8 +213,9 @@ Mono> withConstructor(@HeaderParam("Content-Type") String content @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withConstructorSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withConstructorSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/continue") @ExpectedResponses({ 204 }) @@ -206,8 +223,9 @@ Response withConstructorSync(@HeaderParam("Content-Type") String contentTy @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withContinue(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withContinue(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/continue") @ExpectedResponses({ 204 }) @@ -215,8 +233,9 @@ Mono> withContinue(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withContinueSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withContinueSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/def") @ExpectedResponses({ 204 }) @@ -224,8 +243,9 @@ Response withContinueSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withDef(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withDef(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/def") @ExpectedResponses({ 204 }) @@ -233,8 +253,9 @@ Mono> withDef(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withDefSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withDefSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/del") @ExpectedResponses({ 204 }) @@ -242,8 +263,9 @@ Response withDefSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withDel(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withDel(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/del") @ExpectedResponses({ 204 }) @@ -251,8 +273,9 @@ Mono> withDel(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withDelSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withDelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/elif") @ExpectedResponses({ 204 }) @@ -260,8 +283,9 @@ Response withDelSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withElif(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withElif(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/elif") @ExpectedResponses({ 204 }) @@ -269,8 +293,9 @@ Mono> withElif(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withElifSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withElifSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/else") @ExpectedResponses({ 204 }) @@ -278,8 +303,9 @@ Response withElifSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withElse(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withElse(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/else") @ExpectedResponses({ 204 }) @@ -287,8 +313,9 @@ Mono> withElse(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withElseSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withElseSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/except") @ExpectedResponses({ 204 }) @@ -296,8 +323,9 @@ Response withElseSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withExcept(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withExcept(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/except") @ExpectedResponses({ 204 }) @@ -305,8 +333,9 @@ Mono> withExcept(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withExceptSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withExceptSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/exec") @ExpectedResponses({ 204 }) @@ -314,8 +343,9 @@ Response withExceptSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withExec(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withExec(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/exec") @ExpectedResponses({ 204 }) @@ -323,8 +353,9 @@ Mono> withExec(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withExecSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withExecSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/finally") @ExpectedResponses({ 204 }) @@ -332,8 +363,9 @@ Response withExecSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withFinally(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withFinally(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/finally") @ExpectedResponses({ 204 }) @@ -341,8 +373,9 @@ Mono> withFinally(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withFinallySync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withFinallySync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/for") @ExpectedResponses({ 204 }) @@ -350,8 +383,9 @@ Response withFinallySync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withFor(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withFor(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/for") @ExpectedResponses({ 204 }) @@ -359,8 +393,9 @@ Mono> withFor(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withForSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withForSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/from") @ExpectedResponses({ 204 }) @@ -368,8 +403,9 @@ Response withForSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withFrom(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withFrom(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/from") @ExpectedResponses({ 204 }) @@ -377,8 +413,9 @@ Mono> withFrom(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withFromSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withFromSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/global") @ExpectedResponses({ 204 }) @@ -386,8 +423,9 @@ Response withFromSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withGlobal(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withGlobal(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/global") @ExpectedResponses({ 204 }) @@ -395,8 +433,9 @@ Mono> withGlobal(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withGlobalSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withGlobalSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/if") @ExpectedResponses({ 204 }) @@ -404,8 +443,9 @@ Response withGlobalSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withIf(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withIf(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/if") @ExpectedResponses({ 204 }) @@ -413,8 +453,9 @@ Mono> withIf(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withIfSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withIfSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/import") @ExpectedResponses({ 204 }) @@ -422,8 +463,9 @@ Response withIfSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withImport(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withImport(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/import") @ExpectedResponses({ 204 }) @@ -431,8 +473,9 @@ Mono> withImport(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withImportSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withImportSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/in") @ExpectedResponses({ 204 }) @@ -440,8 +483,9 @@ Response withImportSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withIn(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withIn(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/in") @ExpectedResponses({ 204 }) @@ -449,8 +493,9 @@ Mono> withIn(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withInSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withInSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/is") @ExpectedResponses({ 204 }) @@ -458,8 +503,9 @@ Response withInSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withIs(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withIs(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/is") @ExpectedResponses({ 204 }) @@ -467,8 +513,9 @@ Mono> withIs(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withIsSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withIsSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/lambda") @ExpectedResponses({ 204 }) @@ -476,8 +523,9 @@ Response withIsSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withLambda(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withLambda(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/lambda") @ExpectedResponses({ 204 }) @@ -485,8 +533,9 @@ Mono> withLambda(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withLambdaSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withLambdaSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/not") @ExpectedResponses({ 204 }) @@ -494,8 +543,9 @@ Response withLambdaSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withNot(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withNot(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/not") @ExpectedResponses({ 204 }) @@ -503,8 +553,9 @@ Mono> withNot(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withNotSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withNotSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/or") @ExpectedResponses({ 204 }) @@ -512,8 +563,9 @@ Response withNotSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withOr(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withOr(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/or") @ExpectedResponses({ 204 }) @@ -521,8 +573,9 @@ Mono> withOr(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withOrSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withOrSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/pass") @ExpectedResponses({ 204 }) @@ -530,8 +583,9 @@ Response withOrSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withPass(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withPass(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/pass") @ExpectedResponses({ 204 }) @@ -539,8 +593,9 @@ Mono> withPass(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withPassSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withPassSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/raise") @ExpectedResponses({ 204 }) @@ -548,8 +603,9 @@ Response withPassSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withRaise(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withRaise(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/raise") @ExpectedResponses({ 204 }) @@ -557,8 +613,9 @@ Mono> withRaise(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withRaiseSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withRaiseSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/return") @ExpectedResponses({ 204 }) @@ -566,8 +623,9 @@ Response withRaiseSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withReturn(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withReturn(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/return") @ExpectedResponses({ 204 }) @@ -575,8 +633,9 @@ Mono> withReturn(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withReturnSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withReturnSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/try") @ExpectedResponses({ 204 }) @@ -584,8 +643,9 @@ Response withReturnSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withTry(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withTry(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/try") @ExpectedResponses({ 204 }) @@ -593,8 +653,9 @@ Mono> withTry(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withTrySync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withTrySync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/while") @ExpectedResponses({ 204 }) @@ -602,8 +663,9 @@ Response withTrySync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withWhile(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withWhile(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/while") @ExpectedResponses({ 204 }) @@ -611,8 +673,9 @@ Mono> withWhile(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withWhileSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withWhileSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/with") @ExpectedResponses({ 204 }) @@ -620,8 +683,9 @@ Response withWhileSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withWith(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withWith(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/with") @ExpectedResponses({ 204 }) @@ -629,8 +693,9 @@ Mono> withWith(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withWithSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withWithSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/yield") @ExpectedResponses({ 204 }) @@ -638,8 +703,9 @@ Response withWithSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withYield(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> withYield(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/special-words/models/yield") @ExpectedResponses({ 204 }) @@ -647,8 +713,9 @@ Mono> withYield(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withYieldSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response withYieldSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -672,7 +739,8 @@ Response withYieldSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAndWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withAnd(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withAnd(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -696,7 +764,7 @@ public Mono> withAndWithResponseAsync(BinaryData body, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response withAndWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withAndSync(contentType, body, requestOptions, Context.NONE); + return service.withAndSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -720,7 +788,8 @@ public Response withAndWithResponse(BinaryData body, RequestOptions reques @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withAs(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withAs(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -744,7 +813,7 @@ public Mono> withAsWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response withAsWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withAsSync(contentType, body, requestOptions, Context.NONE); + return service.withAsSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -768,7 +837,8 @@ public Response withAsWithResponse(BinaryData body, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAssertWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withAssert(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withAssert(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -792,7 +862,7 @@ public Mono> withAssertWithResponseAsync(BinaryData body, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response withAssertWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withAssertSync(contentType, body, requestOptions, Context.NONE); + return service.withAssertSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -816,7 +886,8 @@ public Response withAssertWithResponse(BinaryData body, RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAsyncWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withAsync(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withAsync(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -840,7 +911,7 @@ public Mono> withAsyncWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response withAsyncWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withAsyncSync(contentType, body, requestOptions, Context.NONE); + return service.withAsyncSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -864,7 +935,8 @@ public Response withAsyncWithResponse(BinaryData body, RequestOptions requ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAwaitWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withAwait(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withAwait(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -888,7 +960,7 @@ public Mono> withAwaitWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response withAwaitWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withAwaitSync(contentType, body, requestOptions, Context.NONE); + return service.withAwaitSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -912,7 +984,8 @@ public Response withAwaitWithResponse(BinaryData body, RequestOptions requ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withBreakWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withBreak(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withBreak(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -936,7 +1009,7 @@ public Mono> withBreakWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response withBreakWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withBreakSync(contentType, body, requestOptions, Context.NONE); + return service.withBreakSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -960,7 +1033,8 @@ public Response withBreakWithResponse(BinaryData body, RequestOptions requ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withClassWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withClass(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withClass(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -984,7 +1058,7 @@ public Mono> withClassWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response withClassWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withClassSync(contentType, body, requestOptions, Context.NONE); + return service.withClassSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -1008,7 +1082,8 @@ public Response withClassWithResponse(BinaryData body, RequestOptions requ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withConstructorWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withConstructor(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withConstructor(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -1032,7 +1107,7 @@ public Mono> withConstructorWithResponseAsync(BinaryData body, Re @ServiceMethod(returns = ReturnType.SINGLE) public Response withConstructorWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withConstructorSync(contentType, body, requestOptions, Context.NONE); + return service.withConstructorSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -1056,7 +1131,8 @@ public Response withConstructorWithResponse(BinaryData body, RequestOption @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withContinueWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withContinue(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withContinue(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -1080,7 +1156,7 @@ public Mono> withContinueWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response withContinueWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withContinueSync(contentType, body, requestOptions, Context.NONE); + return service.withContinueSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -1104,7 +1180,8 @@ public Response withContinueWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withDefWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withDef(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withDef(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -1128,7 +1205,7 @@ public Mono> withDefWithResponseAsync(BinaryData body, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response withDefWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withDefSync(contentType, body, requestOptions, Context.NONE); + return service.withDefSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -1152,7 +1229,8 @@ public Response withDefWithResponse(BinaryData body, RequestOptions reques @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withDelWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withDel(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withDel(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -1176,7 +1254,7 @@ public Mono> withDelWithResponseAsync(BinaryData body, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response withDelWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withDelSync(contentType, body, requestOptions, Context.NONE); + return service.withDelSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -1200,7 +1278,8 @@ public Response withDelWithResponse(BinaryData body, RequestOptions reques @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withElifWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withElif(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withElif(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -1224,7 +1303,7 @@ public Mono> withElifWithResponseAsync(BinaryData body, RequestOp @ServiceMethod(returns = ReturnType.SINGLE) public Response withElifWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withElifSync(contentType, body, requestOptions, Context.NONE); + return service.withElifSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -1248,7 +1327,8 @@ public Response withElifWithResponse(BinaryData body, RequestOptions reque @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withElseWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withElse(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withElse(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -1272,7 +1352,7 @@ public Mono> withElseWithResponseAsync(BinaryData body, RequestOp @ServiceMethod(returns = ReturnType.SINGLE) public Response withElseWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withElseSync(contentType, body, requestOptions, Context.NONE); + return service.withElseSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -1296,7 +1376,8 @@ public Response withElseWithResponse(BinaryData body, RequestOptions reque @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withExceptWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withExcept(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withExcept(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -1320,7 +1401,7 @@ public Mono> withExceptWithResponseAsync(BinaryData body, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response withExceptWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withExceptSync(contentType, body, requestOptions, Context.NONE); + return service.withExceptSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -1344,7 +1425,8 @@ public Response withExceptWithResponse(BinaryData body, RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withExecWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withExec(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withExec(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -1368,7 +1450,7 @@ public Mono> withExecWithResponseAsync(BinaryData body, RequestOp @ServiceMethod(returns = ReturnType.SINGLE) public Response withExecWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withExecSync(contentType, body, requestOptions, Context.NONE); + return service.withExecSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -1392,7 +1474,8 @@ public Response withExecWithResponse(BinaryData body, RequestOptions reque @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withFinallyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withFinally(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withFinally(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -1416,7 +1499,7 @@ public Mono> withFinallyWithResponseAsync(BinaryData body, Reques @ServiceMethod(returns = ReturnType.SINGLE) public Response withFinallyWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withFinallySync(contentType, body, requestOptions, Context.NONE); + return service.withFinallySync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -1440,7 +1523,8 @@ public Response withFinallyWithResponse(BinaryData body, RequestOptions re @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withForWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withFor(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withFor(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -1464,7 +1548,7 @@ public Mono> withForWithResponseAsync(BinaryData body, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response withForWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withForSync(contentType, body, requestOptions, Context.NONE); + return service.withForSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -1488,7 +1572,8 @@ public Response withForWithResponse(BinaryData body, RequestOptions reques @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withFromWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withFrom(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withFrom(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -1512,7 +1597,7 @@ public Mono> withFromWithResponseAsync(BinaryData body, RequestOp @ServiceMethod(returns = ReturnType.SINGLE) public Response withFromWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withFromSync(contentType, body, requestOptions, Context.NONE); + return service.withFromSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -1536,7 +1621,8 @@ public Response withFromWithResponse(BinaryData body, RequestOptions reque @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withGlobalWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withGlobal(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withGlobal(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -1560,7 +1646,7 @@ public Mono> withGlobalWithResponseAsync(BinaryData body, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response withGlobalWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withGlobalSync(contentType, body, requestOptions, Context.NONE); + return service.withGlobalSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -1584,7 +1670,8 @@ public Response withGlobalWithResponse(BinaryData body, RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withIfWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withIf(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withIf(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -1608,7 +1695,7 @@ public Mono> withIfWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response withIfWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withIfSync(contentType, body, requestOptions, Context.NONE); + return service.withIfSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -1632,7 +1719,8 @@ public Response withIfWithResponse(BinaryData body, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withImportWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withImport(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withImport(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -1656,7 +1744,7 @@ public Mono> withImportWithResponseAsync(BinaryData body, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response withImportWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withImportSync(contentType, body, requestOptions, Context.NONE); + return service.withImportSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -1680,7 +1768,8 @@ public Response withImportWithResponse(BinaryData body, RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withInWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withIn(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withIn(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -1704,7 +1793,7 @@ public Mono> withInWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response withInWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withInSync(contentType, body, requestOptions, Context.NONE); + return service.withInSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -1728,7 +1817,8 @@ public Response withInWithResponse(BinaryData body, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withIsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withIs(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withIs(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -1752,7 +1842,7 @@ public Mono> withIsWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response withIsWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withIsSync(contentType, body, requestOptions, Context.NONE); + return service.withIsSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -1776,7 +1866,8 @@ public Response withIsWithResponse(BinaryData body, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withLambdaWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withLambda(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withLambda(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -1800,7 +1891,7 @@ public Mono> withLambdaWithResponseAsync(BinaryData body, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response withLambdaWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withLambdaSync(contentType, body, requestOptions, Context.NONE); + return service.withLambdaSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -1824,7 +1915,8 @@ public Response withLambdaWithResponse(BinaryData body, RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withNotWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withNot(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withNot(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -1848,7 +1940,7 @@ public Mono> withNotWithResponseAsync(BinaryData body, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response withNotWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withNotSync(contentType, body, requestOptions, Context.NONE); + return service.withNotSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -1872,7 +1964,8 @@ public Response withNotWithResponse(BinaryData body, RequestOptions reques @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withOrWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withOr(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withOr(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -1896,7 +1989,7 @@ public Mono> withOrWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response withOrWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withOrSync(contentType, body, requestOptions, Context.NONE); + return service.withOrSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -1920,7 +2013,8 @@ public Response withOrWithResponse(BinaryData body, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withPassWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withPass(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withPass(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -1944,7 +2038,7 @@ public Mono> withPassWithResponseAsync(BinaryData body, RequestOp @ServiceMethod(returns = ReturnType.SINGLE) public Response withPassWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withPassSync(contentType, body, requestOptions, Context.NONE); + return service.withPassSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -1968,7 +2062,8 @@ public Response withPassWithResponse(BinaryData body, RequestOptions reque @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withRaiseWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withRaise(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withRaise(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -1992,7 +2087,7 @@ public Mono> withRaiseWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response withRaiseWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withRaiseSync(contentType, body, requestOptions, Context.NONE); + return service.withRaiseSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -2016,7 +2111,8 @@ public Response withRaiseWithResponse(BinaryData body, RequestOptions requ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withReturnWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withReturn(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withReturn(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -2040,7 +2136,7 @@ public Mono> withReturnWithResponseAsync(BinaryData body, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response withReturnWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withReturnSync(contentType, body, requestOptions, Context.NONE); + return service.withReturnSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -2064,7 +2160,8 @@ public Response withReturnWithResponse(BinaryData body, RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withTryWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withTry(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withTry(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -2088,7 +2185,7 @@ public Mono> withTryWithResponseAsync(BinaryData body, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response withTryWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withTrySync(contentType, body, requestOptions, Context.NONE); + return service.withTrySync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -2112,7 +2209,8 @@ public Response withTryWithResponse(BinaryData body, RequestOptions reques @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withWhileWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withWhile(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withWhile(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -2136,7 +2234,7 @@ public Mono> withWhileWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response withWhileWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withWhileSync(contentType, body, requestOptions, Context.NONE); + return service.withWhileSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -2160,7 +2258,8 @@ public Response withWhileWithResponse(BinaryData body, RequestOptions requ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withWithWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withWith(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withWith(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -2184,7 +2283,7 @@ public Mono> withWithWithResponseAsync(BinaryData body, RequestOp @ServiceMethod(returns = ReturnType.SINGLE) public Response withWithWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withWithSync(contentType, body, requestOptions, Context.NONE); + return service.withWithSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -2208,7 +2307,8 @@ public Response withWithWithResponse(BinaryData body, RequestOptions reque @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withYieldWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withYield(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withYield(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -2232,6 +2332,6 @@ public Mono> withYieldWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response withYieldWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.withYieldSync(contentType, body, requestOptions, Context.NONE); + return service.withYieldSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/specialwords/implementation/OperationsImpl.java b/typespec-tests/src/main/java/com/specialwords/implementation/OperationsImpl.java index 56816afd4d..6ab0be29cc 100644 --- a/typespec-tests/src/main/java/com/specialwords/implementation/OperationsImpl.java +++ b/typespec-tests/src/main/java/com/specialwords/implementation/OperationsImpl.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; @@ -51,7 +52,7 @@ public final class OperationsImpl { * The interface defining all the services for SpecialWordsClientOperations to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "SpecialWordsClientOp") public interface OperationsService { @Get("/special-words/operations/and") @@ -60,7 +61,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> and(RequestOptions requestOptions, Context context); + Mono> and(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/and") @ExpectedResponses({ 204 }) @@ -68,7 +70,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response andSync(RequestOptions requestOptions, Context context); + Response andSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); @Get("/special-words/operations/as") @ExpectedResponses({ 204 }) @@ -76,7 +78,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> as(RequestOptions requestOptions, Context context); + Mono> as(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); @Get("/special-words/operations/as") @ExpectedResponses({ 204 }) @@ -84,7 +86,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response asSync(RequestOptions requestOptions, Context context); + Response asSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); @Get("/special-words/operations/assert") @ExpectedResponses({ 204 }) @@ -92,7 +94,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> assertMethod(RequestOptions requestOptions, Context context); + Mono> assertMethod(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/assert") @ExpectedResponses({ 204 }) @@ -100,7 +103,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response assertMethodSync(RequestOptions requestOptions, Context context); + Response assertMethodSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/async") @ExpectedResponses({ 204 }) @@ -108,7 +112,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> async(RequestOptions requestOptions, Context context); + Mono> async(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/async") @ExpectedResponses({ 204 }) @@ -116,7 +121,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response asyncSync(RequestOptions requestOptions, Context context); + Response asyncSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/await") @ExpectedResponses({ 204 }) @@ -124,7 +130,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> await(RequestOptions requestOptions, Context context); + Mono> await(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/await") @ExpectedResponses({ 204 }) @@ -132,7 +139,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response awaitSync(RequestOptions requestOptions, Context context); + Response awaitSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/break") @ExpectedResponses({ 204 }) @@ -140,7 +148,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> breakMethod(RequestOptions requestOptions, Context context); + Mono> breakMethod(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/break") @ExpectedResponses({ 204 }) @@ -148,7 +157,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response breakMethodSync(RequestOptions requestOptions, Context context); + Response breakMethodSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/class") @ExpectedResponses({ 204 }) @@ -156,7 +166,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> classMethod(RequestOptions requestOptions, Context context); + Mono> classMethod(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/class") @ExpectedResponses({ 204 }) @@ -164,7 +175,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response classMethodSync(RequestOptions requestOptions, Context context); + Response classMethodSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/constructor") @ExpectedResponses({ 204 }) @@ -172,7 +184,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> constructor(RequestOptions requestOptions, Context context); + Mono> constructor(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/constructor") @ExpectedResponses({ 204 }) @@ -180,7 +193,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response constructorSync(RequestOptions requestOptions, Context context); + Response constructorSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/continue") @ExpectedResponses({ 204 }) @@ -188,7 +202,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> continueMethod(RequestOptions requestOptions, Context context); + Mono> continueMethod(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/continue") @ExpectedResponses({ 204 }) @@ -196,7 +211,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response continueMethodSync(RequestOptions requestOptions, Context context); + Response continueMethodSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/def") @ExpectedResponses({ 204 }) @@ -204,7 +220,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> def(RequestOptions requestOptions, Context context); + Mono> def(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/def") @ExpectedResponses({ 204 }) @@ -212,7 +229,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response defSync(RequestOptions requestOptions, Context context); + Response defSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); @Get("/special-words/operations/del") @ExpectedResponses({ 204 }) @@ -220,7 +237,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> del(RequestOptions requestOptions, Context context); + Mono> del(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/del") @ExpectedResponses({ 204 }) @@ -228,7 +246,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response delSync(RequestOptions requestOptions, Context context); + Response delSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); @Get("/special-words/operations/elif") @ExpectedResponses({ 204 }) @@ -236,7 +254,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> elif(RequestOptions requestOptions, Context context); + Mono> elif(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/elif") @ExpectedResponses({ 204 }) @@ -244,7 +263,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response elifSync(RequestOptions requestOptions, Context context); + Response elifSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); @Get("/special-words/operations/else") @ExpectedResponses({ 204 }) @@ -252,7 +271,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> elseMethod(RequestOptions requestOptions, Context context); + Mono> elseMethod(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/else") @ExpectedResponses({ 204 }) @@ -260,7 +280,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response elseMethodSync(RequestOptions requestOptions, Context context); + Response elseMethodSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/except") @ExpectedResponses({ 204 }) @@ -268,7 +289,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> except(RequestOptions requestOptions, Context context); + Mono> except(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/except") @ExpectedResponses({ 204 }) @@ -276,7 +298,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response exceptSync(RequestOptions requestOptions, Context context); + Response exceptSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/exec") @ExpectedResponses({ 204 }) @@ -284,7 +307,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> exec(RequestOptions requestOptions, Context context); + Mono> exec(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/exec") @ExpectedResponses({ 204 }) @@ -292,7 +316,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response execSync(RequestOptions requestOptions, Context context); + Response execSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); @Get("/special-words/operations/finally") @ExpectedResponses({ 204 }) @@ -300,7 +324,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> finallyMethod(RequestOptions requestOptions, Context context); + Mono> finallyMethod(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/finally") @ExpectedResponses({ 204 }) @@ -308,7 +333,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response finallyMethodSync(RequestOptions requestOptions, Context context); + Response finallyMethodSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/for") @ExpectedResponses({ 204 }) @@ -316,7 +342,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> forMethod(RequestOptions requestOptions, Context context); + Mono> forMethod(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/for") @ExpectedResponses({ 204 }) @@ -324,7 +351,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response forMethodSync(RequestOptions requestOptions, Context context); + Response forMethodSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/from") @ExpectedResponses({ 204 }) @@ -332,7 +360,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> from(RequestOptions requestOptions, Context context); + Mono> from(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/from") @ExpectedResponses({ 204 }) @@ -340,7 +369,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response fromSync(RequestOptions requestOptions, Context context); + Response fromSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); @Get("/special-words/operations/global") @ExpectedResponses({ 204 }) @@ -348,7 +377,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> global(RequestOptions requestOptions, Context context); + Mono> global(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/global") @ExpectedResponses({ 204 }) @@ -356,7 +386,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response globalSync(RequestOptions requestOptions, Context context); + Response globalSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/if") @ExpectedResponses({ 204 }) @@ -364,7 +395,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> ifMethod(RequestOptions requestOptions, Context context); + Mono> ifMethod(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/if") @ExpectedResponses({ 204 }) @@ -372,7 +404,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response ifMethodSync(RequestOptions requestOptions, Context context); + Response ifMethodSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/import") @ExpectedResponses({ 204 }) @@ -380,7 +413,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> importMethod(RequestOptions requestOptions, Context context); + Mono> importMethod(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/import") @ExpectedResponses({ 204 }) @@ -388,7 +422,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response importMethodSync(RequestOptions requestOptions, Context context); + Response importMethodSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/in") @ExpectedResponses({ 204 }) @@ -396,7 +431,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> in(RequestOptions requestOptions, Context context); + Mono> in(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); @Get("/special-words/operations/in") @ExpectedResponses({ 204 }) @@ -404,7 +439,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response inSync(RequestOptions requestOptions, Context context); + Response inSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); @Get("/special-words/operations/is") @ExpectedResponses({ 204 }) @@ -412,7 +447,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> is(RequestOptions requestOptions, Context context); + Mono> is(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); @Get("/special-words/operations/is") @ExpectedResponses({ 204 }) @@ -420,7 +455,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response isSync(RequestOptions requestOptions, Context context); + Response isSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); @Get("/special-words/operations/lambda") @ExpectedResponses({ 204 }) @@ -428,7 +463,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> lambda(RequestOptions requestOptions, Context context); + Mono> lambda(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/lambda") @ExpectedResponses({ 204 }) @@ -436,7 +472,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response lambdaSync(RequestOptions requestOptions, Context context); + Response lambdaSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/not") @ExpectedResponses({ 204 }) @@ -444,7 +481,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> not(RequestOptions requestOptions, Context context); + Mono> not(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/not") @ExpectedResponses({ 204 }) @@ -452,7 +490,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response notSync(RequestOptions requestOptions, Context context); + Response notSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); @Get("/special-words/operations/or") @ExpectedResponses({ 204 }) @@ -460,7 +498,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> or(RequestOptions requestOptions, Context context); + Mono> or(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); @Get("/special-words/operations/or") @ExpectedResponses({ 204 }) @@ -468,7 +506,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response orSync(RequestOptions requestOptions, Context context); + Response orSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); @Get("/special-words/operations/pass") @ExpectedResponses({ 204 }) @@ -476,7 +514,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> pass(RequestOptions requestOptions, Context context); + Mono> pass(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/pass") @ExpectedResponses({ 204 }) @@ -484,7 +523,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response passSync(RequestOptions requestOptions, Context context); + Response passSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); @Get("/special-words/operations/raise") @ExpectedResponses({ 204 }) @@ -492,7 +531,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> raise(RequestOptions requestOptions, Context context); + Mono> raise(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/raise") @ExpectedResponses({ 204 }) @@ -500,7 +540,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response raiseSync(RequestOptions requestOptions, Context context); + Response raiseSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/return") @ExpectedResponses({ 204 }) @@ -508,7 +549,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> returnMethod(RequestOptions requestOptions, Context context); + Mono> returnMethod(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/return") @ExpectedResponses({ 204 }) @@ -516,7 +558,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response returnMethodSync(RequestOptions requestOptions, Context context); + Response returnMethodSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/try") @ExpectedResponses({ 204 }) @@ -524,7 +567,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> tryMethod(RequestOptions requestOptions, Context context); + Mono> tryMethod(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/try") @ExpectedResponses({ 204 }) @@ -532,7 +576,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response tryMethodSync(RequestOptions requestOptions, Context context); + Response tryMethodSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/while") @ExpectedResponses({ 204 }) @@ -540,7 +585,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> whileMethod(RequestOptions requestOptions, Context context); + Mono> whileMethod(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/while") @ExpectedResponses({ 204 }) @@ -548,7 +594,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response whileMethodSync(RequestOptions requestOptions, Context context); + Response whileMethodSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/with") @ExpectedResponses({ 204 }) @@ -556,7 +603,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> with(RequestOptions requestOptions, Context context); + Mono> with(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/with") @ExpectedResponses({ 204 }) @@ -564,7 +612,7 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withSync(RequestOptions requestOptions, Context context); + Response withSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, Context context); @Get("/special-words/operations/yield") @ExpectedResponses({ 204 }) @@ -572,7 +620,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> yield(RequestOptions requestOptions, Context context); + Mono> yield(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); @Get("/special-words/operations/yield") @ExpectedResponses({ 204 }) @@ -580,7 +629,8 @@ public interface OperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response yieldSync(RequestOptions requestOptions, Context context); + Response yieldSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions, + Context context); } /** @@ -595,7 +645,7 @@ public interface OperationsService { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> andWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.and(requestOptions, context)); + return FluxUtil.withContext(context -> service.and(this.client.getEndpoint(), requestOptions, context)); } /** @@ -610,7 +660,7 @@ public Mono> andWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response andWithResponse(RequestOptions requestOptions) { - return service.andSync(requestOptions, Context.NONE); + return service.andSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -625,7 +675,7 @@ public Response andWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> asWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.as(requestOptions, context)); + return FluxUtil.withContext(context -> service.as(this.client.getEndpoint(), requestOptions, context)); } /** @@ -640,7 +690,7 @@ public Mono> asWithResponseAsync(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response asWithResponse(RequestOptions requestOptions) { - return service.asSync(requestOptions, Context.NONE); + return service.asSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -655,7 +705,8 @@ public Response asWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> assertMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.assertMethod(requestOptions, context)); + return FluxUtil + .withContext(context -> service.assertMethod(this.client.getEndpoint(), requestOptions, context)); } /** @@ -670,7 +721,7 @@ public Mono> assertMethodWithResponseAsync(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response assertMethodWithResponse(RequestOptions requestOptions) { - return service.assertMethodSync(requestOptions, Context.NONE); + return service.assertMethodSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -685,7 +736,7 @@ public Response assertMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> asyncWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.async(requestOptions, context)); + return FluxUtil.withContext(context -> service.async(this.client.getEndpoint(), requestOptions, context)); } /** @@ -700,7 +751,7 @@ public Mono> asyncWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response asyncWithResponse(RequestOptions requestOptions) { - return service.asyncSync(requestOptions, Context.NONE); + return service.asyncSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -715,7 +766,7 @@ public Response asyncWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> awaitWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.await(requestOptions, context)); + return FluxUtil.withContext(context -> service.await(this.client.getEndpoint(), requestOptions, context)); } /** @@ -730,7 +781,7 @@ public Mono> awaitWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response awaitWithResponse(RequestOptions requestOptions) { - return service.awaitSync(requestOptions, Context.NONE); + return service.awaitSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -745,7 +796,7 @@ public Response awaitWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> breakMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.breakMethod(requestOptions, context)); + return FluxUtil.withContext(context -> service.breakMethod(this.client.getEndpoint(), requestOptions, context)); } /** @@ -760,7 +811,7 @@ public Mono> breakMethodWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response breakMethodWithResponse(RequestOptions requestOptions) { - return service.breakMethodSync(requestOptions, Context.NONE); + return service.breakMethodSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -775,7 +826,7 @@ public Response breakMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> classMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.classMethod(requestOptions, context)); + return FluxUtil.withContext(context -> service.classMethod(this.client.getEndpoint(), requestOptions, context)); } /** @@ -790,7 +841,7 @@ public Mono> classMethodWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response classMethodWithResponse(RequestOptions requestOptions) { - return service.classMethodSync(requestOptions, Context.NONE); + return service.classMethodSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -805,7 +856,7 @@ public Response classMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> constructorWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.constructor(requestOptions, context)); + return FluxUtil.withContext(context -> service.constructor(this.client.getEndpoint(), requestOptions, context)); } /** @@ -820,7 +871,7 @@ public Mono> constructorWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response constructorWithResponse(RequestOptions requestOptions) { - return service.constructorSync(requestOptions, Context.NONE); + return service.constructorSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -835,7 +886,8 @@ public Response constructorWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> continueMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.continueMethod(requestOptions, context)); + return FluxUtil + .withContext(context -> service.continueMethod(this.client.getEndpoint(), requestOptions, context)); } /** @@ -850,7 +902,7 @@ public Mono> continueMethodWithResponseAsync(RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Response continueMethodWithResponse(RequestOptions requestOptions) { - return service.continueMethodSync(requestOptions, Context.NONE); + return service.continueMethodSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -865,7 +917,7 @@ public Response continueMethodWithResponse(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> defWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.def(requestOptions, context)); + return FluxUtil.withContext(context -> service.def(this.client.getEndpoint(), requestOptions, context)); } /** @@ -880,7 +932,7 @@ public Mono> defWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response defWithResponse(RequestOptions requestOptions) { - return service.defSync(requestOptions, Context.NONE); + return service.defSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -895,7 +947,7 @@ public Response defWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> delWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.del(requestOptions, context)); + return FluxUtil.withContext(context -> service.del(this.client.getEndpoint(), requestOptions, context)); } /** @@ -910,7 +962,7 @@ public Mono> delWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response delWithResponse(RequestOptions requestOptions) { - return service.delSync(requestOptions, Context.NONE); + return service.delSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -925,7 +977,7 @@ public Response delWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> elifWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.elif(requestOptions, context)); + return FluxUtil.withContext(context -> service.elif(this.client.getEndpoint(), requestOptions, context)); } /** @@ -940,7 +992,7 @@ public Mono> elifWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response elifWithResponse(RequestOptions requestOptions) { - return service.elifSync(requestOptions, Context.NONE); + return service.elifSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -955,7 +1007,7 @@ public Response elifWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> elseMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.elseMethod(requestOptions, context)); + return FluxUtil.withContext(context -> service.elseMethod(this.client.getEndpoint(), requestOptions, context)); } /** @@ -970,7 +1022,7 @@ public Mono> elseMethodWithResponseAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response elseMethodWithResponse(RequestOptions requestOptions) { - return service.elseMethodSync(requestOptions, Context.NONE); + return service.elseMethodSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -985,7 +1037,7 @@ public Response elseMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> exceptWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.except(requestOptions, context)); + return FluxUtil.withContext(context -> service.except(this.client.getEndpoint(), requestOptions, context)); } /** @@ -1000,7 +1052,7 @@ public Mono> exceptWithResponseAsync(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response exceptWithResponse(RequestOptions requestOptions) { - return service.exceptSync(requestOptions, Context.NONE); + return service.exceptSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -1015,7 +1067,7 @@ public Response exceptWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> execWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.exec(requestOptions, context)); + return FluxUtil.withContext(context -> service.exec(this.client.getEndpoint(), requestOptions, context)); } /** @@ -1030,7 +1082,7 @@ public Mono> execWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response execWithResponse(RequestOptions requestOptions) { - return service.execSync(requestOptions, Context.NONE); + return service.execSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -1045,7 +1097,8 @@ public Response execWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> finallyMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.finallyMethod(requestOptions, context)); + return FluxUtil + .withContext(context -> service.finallyMethod(this.client.getEndpoint(), requestOptions, context)); } /** @@ -1060,7 +1113,7 @@ public Mono> finallyMethodWithResponseAsync(RequestOptions reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response finallyMethodWithResponse(RequestOptions requestOptions) { - return service.finallyMethodSync(requestOptions, Context.NONE); + return service.finallyMethodSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -1075,7 +1128,7 @@ public Response finallyMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> forMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.forMethod(requestOptions, context)); + return FluxUtil.withContext(context -> service.forMethod(this.client.getEndpoint(), requestOptions, context)); } /** @@ -1090,7 +1143,7 @@ public Mono> forMethodWithResponseAsync(RequestOptions requestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response forMethodWithResponse(RequestOptions requestOptions) { - return service.forMethodSync(requestOptions, Context.NONE); + return service.forMethodSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -1105,7 +1158,7 @@ public Response forMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fromWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.from(requestOptions, context)); + return FluxUtil.withContext(context -> service.from(this.client.getEndpoint(), requestOptions, context)); } /** @@ -1120,7 +1173,7 @@ public Mono> fromWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fromWithResponse(RequestOptions requestOptions) { - return service.fromSync(requestOptions, Context.NONE); + return service.fromSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -1135,7 +1188,7 @@ public Response fromWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> globalWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.global(requestOptions, context)); + return FluxUtil.withContext(context -> service.global(this.client.getEndpoint(), requestOptions, context)); } /** @@ -1150,7 +1203,7 @@ public Mono> globalWithResponseAsync(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response globalWithResponse(RequestOptions requestOptions) { - return service.globalSync(requestOptions, Context.NONE); + return service.globalSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -1165,7 +1218,7 @@ public Response globalWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> ifMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.ifMethod(requestOptions, context)); + return FluxUtil.withContext(context -> service.ifMethod(this.client.getEndpoint(), requestOptions, context)); } /** @@ -1180,7 +1233,7 @@ public Mono> ifMethodWithResponseAsync(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response ifMethodWithResponse(RequestOptions requestOptions) { - return service.ifMethodSync(requestOptions, Context.NONE); + return service.ifMethodSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -1195,7 +1248,8 @@ public Response ifMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> importMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.importMethod(requestOptions, context)); + return FluxUtil + .withContext(context -> service.importMethod(this.client.getEndpoint(), requestOptions, context)); } /** @@ -1210,7 +1264,7 @@ public Mono> importMethodWithResponseAsync(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response importMethodWithResponse(RequestOptions requestOptions) { - return service.importMethodSync(requestOptions, Context.NONE); + return service.importMethodSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -1225,7 +1279,7 @@ public Response importMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> inWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.in(requestOptions, context)); + return FluxUtil.withContext(context -> service.in(this.client.getEndpoint(), requestOptions, context)); } /** @@ -1240,7 +1294,7 @@ public Mono> inWithResponseAsync(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response inWithResponse(RequestOptions requestOptions) { - return service.inSync(requestOptions, Context.NONE); + return service.inSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -1255,7 +1309,7 @@ public Response inWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> isWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.is(requestOptions, context)); + return FluxUtil.withContext(context -> service.is(this.client.getEndpoint(), requestOptions, context)); } /** @@ -1270,7 +1324,7 @@ public Mono> isWithResponseAsync(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response isWithResponse(RequestOptions requestOptions) { - return service.isSync(requestOptions, Context.NONE); + return service.isSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -1285,7 +1339,7 @@ public Response isWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> lambdaWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.lambda(requestOptions, context)); + return FluxUtil.withContext(context -> service.lambda(this.client.getEndpoint(), requestOptions, context)); } /** @@ -1300,7 +1354,7 @@ public Mono> lambdaWithResponseAsync(RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response lambdaWithResponse(RequestOptions requestOptions) { - return service.lambdaSync(requestOptions, Context.NONE); + return service.lambdaSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -1315,7 +1369,7 @@ public Response lambdaWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> notWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.not(requestOptions, context)); + return FluxUtil.withContext(context -> service.not(this.client.getEndpoint(), requestOptions, context)); } /** @@ -1330,7 +1384,7 @@ public Mono> notWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response notWithResponse(RequestOptions requestOptions) { - return service.notSync(requestOptions, Context.NONE); + return service.notSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -1345,7 +1399,7 @@ public Response notWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> orWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.or(requestOptions, context)); + return FluxUtil.withContext(context -> service.or(this.client.getEndpoint(), requestOptions, context)); } /** @@ -1360,7 +1414,7 @@ public Mono> orWithResponseAsync(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response orWithResponse(RequestOptions requestOptions) { - return service.orSync(requestOptions, Context.NONE); + return service.orSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -1375,7 +1429,7 @@ public Response orWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> passWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.pass(requestOptions, context)); + return FluxUtil.withContext(context -> service.pass(this.client.getEndpoint(), requestOptions, context)); } /** @@ -1390,7 +1444,7 @@ public Mono> passWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response passWithResponse(RequestOptions requestOptions) { - return service.passSync(requestOptions, Context.NONE); + return service.passSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -1405,7 +1459,7 @@ public Response passWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> raiseWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.raise(requestOptions, context)); + return FluxUtil.withContext(context -> service.raise(this.client.getEndpoint(), requestOptions, context)); } /** @@ -1420,7 +1474,7 @@ public Mono> raiseWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response raiseWithResponse(RequestOptions requestOptions) { - return service.raiseSync(requestOptions, Context.NONE); + return service.raiseSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -1435,7 +1489,8 @@ public Response raiseWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> returnMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.returnMethod(requestOptions, context)); + return FluxUtil + .withContext(context -> service.returnMethod(this.client.getEndpoint(), requestOptions, context)); } /** @@ -1450,7 +1505,7 @@ public Mono> returnMethodWithResponseAsync(RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response returnMethodWithResponse(RequestOptions requestOptions) { - return service.returnMethodSync(requestOptions, Context.NONE); + return service.returnMethodSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -1465,7 +1520,7 @@ public Response returnMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> tryMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.tryMethod(requestOptions, context)); + return FluxUtil.withContext(context -> service.tryMethod(this.client.getEndpoint(), requestOptions, context)); } /** @@ -1480,7 +1535,7 @@ public Mono> tryMethodWithResponseAsync(RequestOptions requestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Response tryMethodWithResponse(RequestOptions requestOptions) { - return service.tryMethodSync(requestOptions, Context.NONE); + return service.tryMethodSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -1495,7 +1550,7 @@ public Response tryMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> whileMethodWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.whileMethod(requestOptions, context)); + return FluxUtil.withContext(context -> service.whileMethod(this.client.getEndpoint(), requestOptions, context)); } /** @@ -1510,7 +1565,7 @@ public Mono> whileMethodWithResponseAsync(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response whileMethodWithResponse(RequestOptions requestOptions) { - return service.whileMethodSync(requestOptions, Context.NONE); + return service.whileMethodSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -1525,7 +1580,7 @@ public Response whileMethodWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.with(requestOptions, context)); + return FluxUtil.withContext(context -> service.with(this.client.getEndpoint(), requestOptions, context)); } /** @@ -1540,7 +1595,7 @@ public Mono> withWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withWithResponse(RequestOptions requestOptions) { - return service.withSync(requestOptions, Context.NONE); + return service.withSync(this.client.getEndpoint(), requestOptions, Context.NONE); } /** @@ -1555,7 +1610,7 @@ public Response withWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> yieldWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.yield(requestOptions, context)); + return FluxUtil.withContext(context -> service.yield(this.client.getEndpoint(), requestOptions, context)); } /** @@ -1570,6 +1625,6 @@ public Mono> yieldWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response yieldWithResponse(RequestOptions requestOptions) { - return service.yieldSync(requestOptions, Context.NONE); + return service.yieldSync(this.client.getEndpoint(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/specialwords/implementation/ParametersImpl.java b/typespec-tests/src/main/java/com/specialwords/implementation/ParametersImpl.java index b412b4d91b..a848bcd270 100644 --- a/typespec-tests/src/main/java/com/specialwords/implementation/ParametersImpl.java +++ b/typespec-tests/src/main/java/com/specialwords/implementation/ParametersImpl.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -52,7 +53,7 @@ public final class ParametersImpl { * The interface defining all the services for SpecialWordsClientParameters to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "SpecialWordsClientPa") public interface ParametersService { @Get("/special-words/parameters/and") @@ -61,7 +62,8 @@ public interface ParametersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAnd(@QueryParam("and") String and, RequestOptions requestOptions, Context context); + Mono> withAnd(@HostParam("endpoint") String endpoint, @QueryParam("and") String and, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/and") @ExpectedResponses({ 204 }) @@ -69,7 +71,8 @@ public interface ParametersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAndSync(@QueryParam("and") String and, RequestOptions requestOptions, Context context); + Response withAndSync(@HostParam("endpoint") String endpoint, @QueryParam("and") String and, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/as") @ExpectedResponses({ 204 }) @@ -77,7 +80,8 @@ public interface ParametersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAs(@QueryParam("as") String as, RequestOptions requestOptions, Context context); + Mono> withAs(@HostParam("endpoint") String endpoint, @QueryParam("as") String as, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/as") @ExpectedResponses({ 204 }) @@ -85,7 +89,8 @@ public interface ParametersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAsSync(@QueryParam("as") String as, RequestOptions requestOptions, Context context); + Response withAsSync(@HostParam("endpoint") String endpoint, @QueryParam("as") String as, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/assert") @ExpectedResponses({ 204 }) @@ -93,8 +98,8 @@ public interface ParametersService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAssert(@QueryParam("assert") String assertParameter, RequestOptions requestOptions, - Context context); + Mono> withAssert(@HostParam("endpoint") String endpoint, + @QueryParam("assert") String assertParameter, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/assert") @ExpectedResponses({ 204 }) @@ -102,8 +107,8 @@ Mono> withAssert(@QueryParam("assert") String assertParameter, Re @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAssertSync(@QueryParam("assert") String assertParameter, RequestOptions requestOptions, - Context context); + Response withAssertSync(@HostParam("endpoint") String endpoint, + @QueryParam("assert") String assertParameter, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/async") @ExpectedResponses({ 204 }) @@ -111,8 +116,8 @@ Response withAssertSync(@QueryParam("assert") String assertParameter, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAsync(@QueryParam("async") String async, RequestOptions requestOptions, - Context context); + Mono> withAsync(@HostParam("endpoint") String endpoint, @QueryParam("async") String async, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/async") @ExpectedResponses({ 204 }) @@ -120,7 +125,8 @@ Mono> withAsync(@QueryParam("async") String async, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAsyncSync(@QueryParam("async") String async, RequestOptions requestOptions, Context context); + Response withAsyncSync(@HostParam("endpoint") String endpoint, @QueryParam("async") String async, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/await") @ExpectedResponses({ 204 }) @@ -128,8 +134,8 @@ Mono> withAsync(@QueryParam("async") String async, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAwait(@QueryParam("await") String await, RequestOptions requestOptions, - Context context); + Mono> withAwait(@HostParam("endpoint") String endpoint, @QueryParam("await") String await, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/await") @ExpectedResponses({ 204 }) @@ -137,7 +143,8 @@ Mono> withAwait(@QueryParam("await") String await, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAwaitSync(@QueryParam("await") String await, RequestOptions requestOptions, Context context); + Response withAwaitSync(@HostParam("endpoint") String endpoint, @QueryParam("await") String await, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/break") @ExpectedResponses({ 204 }) @@ -145,8 +152,8 @@ Mono> withAwait(@QueryParam("await") String await, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withBreak(@QueryParam("break") String breakParameter, RequestOptions requestOptions, - Context context); + Mono> withBreak(@HostParam("endpoint") String endpoint, + @QueryParam("break") String breakParameter, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/break") @ExpectedResponses({ 204 }) @@ -154,8 +161,8 @@ Mono> withBreak(@QueryParam("break") String breakParameter, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withBreakSync(@QueryParam("break") String breakParameter, RequestOptions requestOptions, - Context context); + Response withBreakSync(@HostParam("endpoint") String endpoint, @QueryParam("break") String breakParameter, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/class") @ExpectedResponses({ 204 }) @@ -163,8 +170,8 @@ Response withBreakSync(@QueryParam("break") String breakParameter, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withClass(@QueryParam("class") String classParameter, RequestOptions requestOptions, - Context context); + Mono> withClass(@HostParam("endpoint") String endpoint, + @QueryParam("class") String classParameter, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/class") @ExpectedResponses({ 204 }) @@ -172,8 +179,8 @@ Mono> withClass(@QueryParam("class") String classParameter, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withClassSync(@QueryParam("class") String classParameter, RequestOptions requestOptions, - Context context); + Response withClassSync(@HostParam("endpoint") String endpoint, @QueryParam("class") String classParameter, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/constructor") @ExpectedResponses({ 204 }) @@ -181,8 +188,8 @@ Response withClassSync(@QueryParam("class") String classParameter, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withConstructor(@QueryParam("constructor") String constructor, - RequestOptions requestOptions, Context context); + Mono> withConstructor(@HostParam("endpoint") String endpoint, + @QueryParam("constructor") String constructor, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/constructor") @ExpectedResponses({ 204 }) @@ -190,8 +197,8 @@ Mono> withConstructor(@QueryParam("constructor") String construct @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withConstructorSync(@QueryParam("constructor") String constructor, RequestOptions requestOptions, - Context context); + Response withConstructorSync(@HostParam("endpoint") String endpoint, + @QueryParam("constructor") String constructor, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/continue") @ExpectedResponses({ 204 }) @@ -199,8 +206,8 @@ Response withConstructorSync(@QueryParam("constructor") String constructor @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withContinue(@QueryParam("continue") String continueParameter, - RequestOptions requestOptions, Context context); + Mono> withContinue(@HostParam("endpoint") String endpoint, + @QueryParam("continue") String continueParameter, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/continue") @ExpectedResponses({ 204 }) @@ -208,8 +215,8 @@ Mono> withContinue(@QueryParam("continue") String continueParamet @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withContinueSync(@QueryParam("continue") String continueParameter, RequestOptions requestOptions, - Context context); + Response withContinueSync(@HostParam("endpoint") String endpoint, + @QueryParam("continue") String continueParameter, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/def") @ExpectedResponses({ 204 }) @@ -217,7 +224,8 @@ Response withContinueSync(@QueryParam("continue") String continueParameter @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withDef(@QueryParam("def") String def, RequestOptions requestOptions, Context context); + Mono> withDef(@HostParam("endpoint") String endpoint, @QueryParam("def") String def, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/def") @ExpectedResponses({ 204 }) @@ -225,7 +233,8 @@ Response withContinueSync(@QueryParam("continue") String continueParameter @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withDefSync(@QueryParam("def") String def, RequestOptions requestOptions, Context context); + Response withDefSync(@HostParam("endpoint") String endpoint, @QueryParam("def") String def, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/del") @ExpectedResponses({ 204 }) @@ -233,7 +242,8 @@ Response withContinueSync(@QueryParam("continue") String continueParameter @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withDel(@QueryParam("del") String del, RequestOptions requestOptions, Context context); + Mono> withDel(@HostParam("endpoint") String endpoint, @QueryParam("del") String del, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/del") @ExpectedResponses({ 204 }) @@ -241,7 +251,8 @@ Response withContinueSync(@QueryParam("continue") String continueParameter @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withDelSync(@QueryParam("del") String del, RequestOptions requestOptions, Context context); + Response withDelSync(@HostParam("endpoint") String endpoint, @QueryParam("del") String del, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/elif") @ExpectedResponses({ 204 }) @@ -249,7 +260,8 @@ Response withContinueSync(@QueryParam("continue") String continueParameter @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withElif(@QueryParam("elif") String elif, RequestOptions requestOptions, Context context); + Mono> withElif(@HostParam("endpoint") String endpoint, @QueryParam("elif") String elif, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/elif") @ExpectedResponses({ 204 }) @@ -257,7 +269,8 @@ Response withContinueSync(@QueryParam("continue") String continueParameter @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withElifSync(@QueryParam("elif") String elif, RequestOptions requestOptions, Context context); + Response withElifSync(@HostParam("endpoint") String endpoint, @QueryParam("elif") String elif, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/else") @ExpectedResponses({ 204 }) @@ -265,8 +278,8 @@ Response withContinueSync(@QueryParam("continue") String continueParameter @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withElse(@QueryParam("else") String elseParameter, RequestOptions requestOptions, - Context context); + Mono> withElse(@HostParam("endpoint") String endpoint, @QueryParam("else") String elseParameter, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/else") @ExpectedResponses({ 204 }) @@ -274,8 +287,8 @@ Mono> withElse(@QueryParam("else") String elseParameter, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withElseSync(@QueryParam("else") String elseParameter, RequestOptions requestOptions, - Context context); + Response withElseSync(@HostParam("endpoint") String endpoint, @QueryParam("else") String elseParameter, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/except") @ExpectedResponses({ 204 }) @@ -283,8 +296,8 @@ Response withElseSync(@QueryParam("else") String elseParameter, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withExcept(@QueryParam("except") String except, RequestOptions requestOptions, - Context context); + Mono> withExcept(@HostParam("endpoint") String endpoint, @QueryParam("except") String except, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/except") @ExpectedResponses({ 204 }) @@ -292,8 +305,8 @@ Mono> withExcept(@QueryParam("except") String except, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withExceptSync(@QueryParam("except") String except, RequestOptions requestOptions, - Context context); + Response withExceptSync(@HostParam("endpoint") String endpoint, @QueryParam("except") String except, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/exec") @ExpectedResponses({ 204 }) @@ -301,7 +314,8 @@ Response withExceptSync(@QueryParam("except") String except, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withExec(@QueryParam("exec") String exec, RequestOptions requestOptions, Context context); + Mono> withExec(@HostParam("endpoint") String endpoint, @QueryParam("exec") String exec, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/exec") @ExpectedResponses({ 204 }) @@ -309,7 +323,8 @@ Response withExceptSync(@QueryParam("except") String except, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withExecSync(@QueryParam("exec") String exec, RequestOptions requestOptions, Context context); + Response withExecSync(@HostParam("endpoint") String endpoint, @QueryParam("exec") String exec, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/finally") @ExpectedResponses({ 204 }) @@ -317,8 +332,8 @@ Response withExceptSync(@QueryParam("except") String except, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withFinally(@QueryParam("finally") String finallyParameter, RequestOptions requestOptions, - Context context); + Mono> withFinally(@HostParam("endpoint") String endpoint, + @QueryParam("finally") String finallyParameter, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/finally") @ExpectedResponses({ 204 }) @@ -326,8 +341,8 @@ Mono> withFinally(@QueryParam("finally") String finallyParameter, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withFinallySync(@QueryParam("finally") String finallyParameter, RequestOptions requestOptions, - Context context); + Response withFinallySync(@HostParam("endpoint") String endpoint, + @QueryParam("finally") String finallyParameter, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/for") @ExpectedResponses({ 204 }) @@ -335,8 +350,8 @@ Response withFinallySync(@QueryParam("finally") String finallyParameter, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withFor(@QueryParam("for") String forParameter, RequestOptions requestOptions, - Context context); + Mono> withFor(@HostParam("endpoint") String endpoint, @QueryParam("for") String forParameter, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/for") @ExpectedResponses({ 204 }) @@ -344,8 +359,8 @@ Mono> withFor(@QueryParam("for") String forParameter, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withForSync(@QueryParam("for") String forParameter, RequestOptions requestOptions, - Context context); + Response withForSync(@HostParam("endpoint") String endpoint, @QueryParam("for") String forParameter, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/from") @ExpectedResponses({ 204 }) @@ -353,7 +368,8 @@ Response withForSync(@QueryParam("for") String forParameter, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withFrom(@QueryParam("from") String from, RequestOptions requestOptions, Context context); + Mono> withFrom(@HostParam("endpoint") String endpoint, @QueryParam("from") String from, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/from") @ExpectedResponses({ 204 }) @@ -361,7 +377,8 @@ Response withForSync(@QueryParam("for") String forParameter, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withFromSync(@QueryParam("from") String from, RequestOptions requestOptions, Context context); + Response withFromSync(@HostParam("endpoint") String endpoint, @QueryParam("from") String from, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/global") @ExpectedResponses({ 204 }) @@ -369,8 +386,8 @@ Response withForSync(@QueryParam("for") String forParameter, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withGlobal(@QueryParam("global") String global, RequestOptions requestOptions, - Context context); + Mono> withGlobal(@HostParam("endpoint") String endpoint, @QueryParam("global") String global, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/global") @ExpectedResponses({ 204 }) @@ -378,8 +395,8 @@ Mono> withGlobal(@QueryParam("global") String global, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withGlobalSync(@QueryParam("global") String global, RequestOptions requestOptions, - Context context); + Response withGlobalSync(@HostParam("endpoint") String endpoint, @QueryParam("global") String global, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/if") @ExpectedResponses({ 204 }) @@ -387,8 +404,8 @@ Response withGlobalSync(@QueryParam("global") String global, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withIf(@QueryParam("if") String ifParameter, RequestOptions requestOptions, - Context context); + Mono> withIf(@HostParam("endpoint") String endpoint, @QueryParam("if") String ifParameter, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/if") @ExpectedResponses({ 204 }) @@ -396,7 +413,8 @@ Mono> withIf(@QueryParam("if") String ifParameter, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withIfSync(@QueryParam("if") String ifParameter, RequestOptions requestOptions, Context context); + Response withIfSync(@HostParam("endpoint") String endpoint, @QueryParam("if") String ifParameter, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/import") @ExpectedResponses({ 204 }) @@ -404,8 +422,8 @@ Mono> withIf(@QueryParam("if") String ifParameter, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withImport(@QueryParam("import") String importParameter, RequestOptions requestOptions, - Context context); + Mono> withImport(@HostParam("endpoint") String endpoint, + @QueryParam("import") String importParameter, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/import") @ExpectedResponses({ 204 }) @@ -413,8 +431,8 @@ Mono> withImport(@QueryParam("import") String importParameter, Re @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withImportSync(@QueryParam("import") String importParameter, RequestOptions requestOptions, - Context context); + Response withImportSync(@HostParam("endpoint") String endpoint, + @QueryParam("import") String importParameter, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/in") @ExpectedResponses({ 204 }) @@ -422,7 +440,8 @@ Response withImportSync(@QueryParam("import") String importParameter, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withIn(@QueryParam("in") String in, RequestOptions requestOptions, Context context); + Mono> withIn(@HostParam("endpoint") String endpoint, @QueryParam("in") String in, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/in") @ExpectedResponses({ 204 }) @@ -430,7 +449,8 @@ Response withImportSync(@QueryParam("import") String importParameter, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withInSync(@QueryParam("in") String in, RequestOptions requestOptions, Context context); + Response withInSync(@HostParam("endpoint") String endpoint, @QueryParam("in") String in, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/is") @ExpectedResponses({ 204 }) @@ -438,7 +458,8 @@ Response withImportSync(@QueryParam("import") String importParameter, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withIs(@QueryParam("is") String is, RequestOptions requestOptions, Context context); + Mono> withIs(@HostParam("endpoint") String endpoint, @QueryParam("is") String is, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/is") @ExpectedResponses({ 204 }) @@ -446,7 +467,8 @@ Response withImportSync(@QueryParam("import") String importParameter, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withIsSync(@QueryParam("is") String is, RequestOptions requestOptions, Context context); + Response withIsSync(@HostParam("endpoint") String endpoint, @QueryParam("is") String is, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/lambda") @ExpectedResponses({ 204 }) @@ -454,8 +476,8 @@ Response withImportSync(@QueryParam("import") String importParameter, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withLambda(@QueryParam("lambda") String lambda, RequestOptions requestOptions, - Context context); + Mono> withLambda(@HostParam("endpoint") String endpoint, @QueryParam("lambda") String lambda, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/lambda") @ExpectedResponses({ 204 }) @@ -463,8 +485,8 @@ Mono> withLambda(@QueryParam("lambda") String lambda, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withLambdaSync(@QueryParam("lambda") String lambda, RequestOptions requestOptions, - Context context); + Response withLambdaSync(@HostParam("endpoint") String endpoint, @QueryParam("lambda") String lambda, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/not") @ExpectedResponses({ 204 }) @@ -472,7 +494,8 @@ Response withLambdaSync(@QueryParam("lambda") String lambda, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withNot(@QueryParam("not") String not, RequestOptions requestOptions, Context context); + Mono> withNot(@HostParam("endpoint") String endpoint, @QueryParam("not") String not, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/not") @ExpectedResponses({ 204 }) @@ -480,7 +503,8 @@ Response withLambdaSync(@QueryParam("lambda") String lambda, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withNotSync(@QueryParam("not") String not, RequestOptions requestOptions, Context context); + Response withNotSync(@HostParam("endpoint") String endpoint, @QueryParam("not") String not, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/or") @ExpectedResponses({ 204 }) @@ -488,7 +512,8 @@ Response withLambdaSync(@QueryParam("lambda") String lambda, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withOr(@QueryParam("or") String or, RequestOptions requestOptions, Context context); + Mono> withOr(@HostParam("endpoint") String endpoint, @QueryParam("or") String or, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/or") @ExpectedResponses({ 204 }) @@ -496,7 +521,8 @@ Response withLambdaSync(@QueryParam("lambda") String lambda, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withOrSync(@QueryParam("or") String or, RequestOptions requestOptions, Context context); + Response withOrSync(@HostParam("endpoint") String endpoint, @QueryParam("or") String or, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/pass") @ExpectedResponses({ 204 }) @@ -504,7 +530,8 @@ Response withLambdaSync(@QueryParam("lambda") String lambda, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withPass(@QueryParam("pass") String pass, RequestOptions requestOptions, Context context); + Mono> withPass(@HostParam("endpoint") String endpoint, @QueryParam("pass") String pass, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/pass") @ExpectedResponses({ 204 }) @@ -512,7 +539,8 @@ Response withLambdaSync(@QueryParam("lambda") String lambda, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withPassSync(@QueryParam("pass") String pass, RequestOptions requestOptions, Context context); + Response withPassSync(@HostParam("endpoint") String endpoint, @QueryParam("pass") String pass, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/raise") @ExpectedResponses({ 204 }) @@ -520,8 +548,8 @@ Response withLambdaSync(@QueryParam("lambda") String lambda, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withRaise(@QueryParam("raise") String raise, RequestOptions requestOptions, - Context context); + Mono> withRaise(@HostParam("endpoint") String endpoint, @QueryParam("raise") String raise, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/raise") @ExpectedResponses({ 204 }) @@ -529,7 +557,8 @@ Mono> withRaise(@QueryParam("raise") String raise, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withRaiseSync(@QueryParam("raise") String raise, RequestOptions requestOptions, Context context); + Response withRaiseSync(@HostParam("endpoint") String endpoint, @QueryParam("raise") String raise, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/return") @ExpectedResponses({ 204 }) @@ -537,8 +566,8 @@ Mono> withRaise(@QueryParam("raise") String raise, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withReturn(@QueryParam("return") String returnParameter, RequestOptions requestOptions, - Context context); + Mono> withReturn(@HostParam("endpoint") String endpoint, + @QueryParam("return") String returnParameter, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/return") @ExpectedResponses({ 204 }) @@ -546,8 +575,8 @@ Mono> withReturn(@QueryParam("return") String returnParameter, Re @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withReturnSync(@QueryParam("return") String returnParameter, RequestOptions requestOptions, - Context context); + Response withReturnSync(@HostParam("endpoint") String endpoint, + @QueryParam("return") String returnParameter, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/try") @ExpectedResponses({ 204 }) @@ -555,8 +584,8 @@ Response withReturnSync(@QueryParam("return") String returnParameter, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withTry(@QueryParam("try") String tryParameter, RequestOptions requestOptions, - Context context); + Mono> withTry(@HostParam("endpoint") String endpoint, @QueryParam("try") String tryParameter, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/try") @ExpectedResponses({ 204 }) @@ -564,8 +593,8 @@ Mono> withTry(@QueryParam("try") String tryParameter, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withTrySync(@QueryParam("try") String tryParameter, RequestOptions requestOptions, - Context context); + Response withTrySync(@HostParam("endpoint") String endpoint, @QueryParam("try") String tryParameter, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/while") @ExpectedResponses({ 204 }) @@ -573,8 +602,8 @@ Response withTrySync(@QueryParam("try") String tryParameter, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withWhile(@QueryParam("while") String whileParameter, RequestOptions requestOptions, - Context context); + Mono> withWhile(@HostParam("endpoint") String endpoint, + @QueryParam("while") String whileParameter, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/while") @ExpectedResponses({ 204 }) @@ -582,8 +611,8 @@ Mono> withWhile(@QueryParam("while") String whileParameter, Reque @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withWhileSync(@QueryParam("while") String whileParameter, RequestOptions requestOptions, - Context context); + Response withWhileSync(@HostParam("endpoint") String endpoint, @QueryParam("while") String whileParameter, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/with") @ExpectedResponses({ 204 }) @@ -591,7 +620,8 @@ Response withWhileSync(@QueryParam("while") String whileParameter, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withWith(@QueryParam("with") String with, RequestOptions requestOptions, Context context); + Mono> withWith(@HostParam("endpoint") String endpoint, @QueryParam("with") String with, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/with") @ExpectedResponses({ 204 }) @@ -599,7 +629,8 @@ Response withWhileSync(@QueryParam("while") String whileParameter, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withWithSync(@QueryParam("with") String with, RequestOptions requestOptions, Context context); + Response withWithSync(@HostParam("endpoint") String endpoint, @QueryParam("with") String with, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/yield") @ExpectedResponses({ 204 }) @@ -607,8 +638,8 @@ Response withWhileSync(@QueryParam("while") String whileParameter, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withYield(@QueryParam("yield") String yield, RequestOptions requestOptions, - Context context); + Mono> withYield(@HostParam("endpoint") String endpoint, @QueryParam("yield") String yield, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/yield") @ExpectedResponses({ 204 }) @@ -616,7 +647,8 @@ Mono> withYield(@QueryParam("yield") String yield, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withYieldSync(@QueryParam("yield") String yield, RequestOptions requestOptions, Context context); + Response withYieldSync(@HostParam("endpoint") String endpoint, @QueryParam("yield") String yield, + RequestOptions requestOptions, Context context); @Get("/special-words/parameters/cancellationToken") @ExpectedResponses({ 204 }) @@ -624,8 +656,8 @@ Mono> withYield(@QueryParam("yield") String yield, RequestOptions @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withCancellationToken(@QueryParam("cancellationToken") String cancellationToken, - RequestOptions requestOptions, Context context); + Mono> withCancellationToken(@HostParam("endpoint") String endpoint, + @QueryParam("cancellationToken") String cancellationToken, RequestOptions requestOptions, Context context); @Get("/special-words/parameters/cancellationToken") @ExpectedResponses({ 204 }) @@ -633,8 +665,8 @@ Mono> withCancellationToken(@QueryParam("cancellationToken") Stri @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withCancellationTokenSync(@QueryParam("cancellationToken") String cancellationToken, - RequestOptions requestOptions, Context context); + Response withCancellationTokenSync(@HostParam("endpoint") String endpoint, + @QueryParam("cancellationToken") String cancellationToken, RequestOptions requestOptions, Context context); } /** @@ -650,7 +682,8 @@ Response withCancellationTokenSync(@QueryParam("cancellationToken") String */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAndWithResponseAsync(String and, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withAnd(and, requestOptions, context)); + return FluxUtil + .withContext(context -> service.withAnd(this.client.getEndpoint(), and, requestOptions, context)); } /** @@ -666,7 +699,7 @@ public Mono> withAndWithResponseAsync(String and, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAndWithResponse(String and, RequestOptions requestOptions) { - return service.withAndSync(and, requestOptions, Context.NONE); + return service.withAndSync(this.client.getEndpoint(), and, requestOptions, Context.NONE); } /** @@ -682,7 +715,7 @@ public Response withAndWithResponse(String and, RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAsWithResponseAsync(String as, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withAs(as, requestOptions, context)); + return FluxUtil.withContext(context -> service.withAs(this.client.getEndpoint(), as, requestOptions, context)); } /** @@ -698,7 +731,7 @@ public Mono> withAsWithResponseAsync(String as, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAsWithResponse(String as, RequestOptions requestOptions) { - return service.withAsSync(as, requestOptions, Context.NONE); + return service.withAsSync(this.client.getEndpoint(), as, requestOptions, Context.NONE); } /** @@ -714,7 +747,8 @@ public Response withAsWithResponse(String as, RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAssertWithResponseAsync(String assertParameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withAssert(assertParameter, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withAssert(this.client.getEndpoint(), assertParameter, requestOptions, context)); } /** @@ -730,7 +764,7 @@ public Mono> withAssertWithResponseAsync(String assertParameter, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAssertWithResponse(String assertParameter, RequestOptions requestOptions) { - return service.withAssertSync(assertParameter, requestOptions, Context.NONE); + return service.withAssertSync(this.client.getEndpoint(), assertParameter, requestOptions, Context.NONE); } /** @@ -746,7 +780,8 @@ public Response withAssertWithResponse(String assertParameter, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAsyncWithResponseAsync(String async, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withAsync(async, requestOptions, context)); + return FluxUtil + .withContext(context -> service.withAsync(this.client.getEndpoint(), async, requestOptions, context)); } /** @@ -762,7 +797,7 @@ public Mono> withAsyncWithResponseAsync(String async, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAsyncWithResponse(String async, RequestOptions requestOptions) { - return service.withAsyncSync(async, requestOptions, Context.NONE); + return service.withAsyncSync(this.client.getEndpoint(), async, requestOptions, Context.NONE); } /** @@ -778,7 +813,8 @@ public Response withAsyncWithResponse(String async, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withAwaitWithResponseAsync(String await, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withAwait(await, requestOptions, context)); + return FluxUtil + .withContext(context -> service.withAwait(this.client.getEndpoint(), await, requestOptions, context)); } /** @@ -794,7 +830,7 @@ public Mono> withAwaitWithResponseAsync(String await, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withAwaitWithResponse(String await, RequestOptions requestOptions) { - return service.withAwaitSync(await, requestOptions, Context.NONE); + return service.withAwaitSync(this.client.getEndpoint(), await, requestOptions, Context.NONE); } /** @@ -810,7 +846,8 @@ public Response withAwaitWithResponse(String await, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withBreakWithResponseAsync(String breakParameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withBreak(breakParameter, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withBreak(this.client.getEndpoint(), breakParameter, requestOptions, context)); } /** @@ -826,7 +863,7 @@ public Mono> withBreakWithResponseAsync(String breakParameter, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withBreakWithResponse(String breakParameter, RequestOptions requestOptions) { - return service.withBreakSync(breakParameter, requestOptions, Context.NONE); + return service.withBreakSync(this.client.getEndpoint(), breakParameter, requestOptions, Context.NONE); } /** @@ -842,7 +879,8 @@ public Response withBreakWithResponse(String breakParameter, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withClassWithResponseAsync(String classParameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withClass(classParameter, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withClass(this.client.getEndpoint(), classParameter, requestOptions, context)); } /** @@ -858,7 +896,7 @@ public Mono> withClassWithResponseAsync(String classParameter, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withClassWithResponse(String classParameter, RequestOptions requestOptions) { - return service.withClassSync(classParameter, requestOptions, Context.NONE); + return service.withClassSync(this.client.getEndpoint(), classParameter, requestOptions, Context.NONE); } /** @@ -874,7 +912,8 @@ public Response withClassWithResponse(String classParameter, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withConstructorWithResponseAsync(String constructor, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withConstructor(constructor, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withConstructor(this.client.getEndpoint(), constructor, requestOptions, context)); } /** @@ -890,7 +929,7 @@ public Mono> withConstructorWithResponseAsync(String constructor, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withConstructorWithResponse(String constructor, RequestOptions requestOptions) { - return service.withConstructorSync(constructor, requestOptions, Context.NONE); + return service.withConstructorSync(this.client.getEndpoint(), constructor, requestOptions, Context.NONE); } /** @@ -906,7 +945,8 @@ public Response withConstructorWithResponse(String constructor, RequestOpt */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withContinueWithResponseAsync(String continueParameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withContinue(continueParameter, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withContinue(this.client.getEndpoint(), continueParameter, requestOptions, context)); } /** @@ -922,7 +962,7 @@ public Mono> withContinueWithResponseAsync(String continueParamet */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withContinueWithResponse(String continueParameter, RequestOptions requestOptions) { - return service.withContinueSync(continueParameter, requestOptions, Context.NONE); + return service.withContinueSync(this.client.getEndpoint(), continueParameter, requestOptions, Context.NONE); } /** @@ -938,7 +978,8 @@ public Response withContinueWithResponse(String continueParameter, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withDefWithResponseAsync(String def, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withDef(def, requestOptions, context)); + return FluxUtil + .withContext(context -> service.withDef(this.client.getEndpoint(), def, requestOptions, context)); } /** @@ -954,7 +995,7 @@ public Mono> withDefWithResponseAsync(String def, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withDefWithResponse(String def, RequestOptions requestOptions) { - return service.withDefSync(def, requestOptions, Context.NONE); + return service.withDefSync(this.client.getEndpoint(), def, requestOptions, Context.NONE); } /** @@ -970,7 +1011,8 @@ public Response withDefWithResponse(String def, RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withDelWithResponseAsync(String del, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withDel(del, requestOptions, context)); + return FluxUtil + .withContext(context -> service.withDel(this.client.getEndpoint(), del, requestOptions, context)); } /** @@ -986,7 +1028,7 @@ public Mono> withDelWithResponseAsync(String del, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withDelWithResponse(String del, RequestOptions requestOptions) { - return service.withDelSync(del, requestOptions, Context.NONE); + return service.withDelSync(this.client.getEndpoint(), del, requestOptions, Context.NONE); } /** @@ -1002,7 +1044,8 @@ public Response withDelWithResponse(String del, RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withElifWithResponseAsync(String elif, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withElif(elif, requestOptions, context)); + return FluxUtil + .withContext(context -> service.withElif(this.client.getEndpoint(), elif, requestOptions, context)); } /** @@ -1018,7 +1061,7 @@ public Mono> withElifWithResponseAsync(String elif, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withElifWithResponse(String elif, RequestOptions requestOptions) { - return service.withElifSync(elif, requestOptions, Context.NONE); + return service.withElifSync(this.client.getEndpoint(), elif, requestOptions, Context.NONE); } /** @@ -1034,7 +1077,8 @@ public Response withElifWithResponse(String elif, RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withElseWithResponseAsync(String elseParameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withElse(elseParameter, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withElse(this.client.getEndpoint(), elseParameter, requestOptions, context)); } /** @@ -1050,7 +1094,7 @@ public Mono> withElseWithResponseAsync(String elseParameter, Requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withElseWithResponse(String elseParameter, RequestOptions requestOptions) { - return service.withElseSync(elseParameter, requestOptions, Context.NONE); + return service.withElseSync(this.client.getEndpoint(), elseParameter, requestOptions, Context.NONE); } /** @@ -1066,7 +1110,8 @@ public Response withElseWithResponse(String elseParameter, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withExceptWithResponseAsync(String except, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withExcept(except, requestOptions, context)); + return FluxUtil + .withContext(context -> service.withExcept(this.client.getEndpoint(), except, requestOptions, context)); } /** @@ -1082,7 +1127,7 @@ public Mono> withExceptWithResponseAsync(String except, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withExceptWithResponse(String except, RequestOptions requestOptions) { - return service.withExceptSync(except, requestOptions, Context.NONE); + return service.withExceptSync(this.client.getEndpoint(), except, requestOptions, Context.NONE); } /** @@ -1098,7 +1143,8 @@ public Response withExceptWithResponse(String except, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withExecWithResponseAsync(String exec, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withExec(exec, requestOptions, context)); + return FluxUtil + .withContext(context -> service.withExec(this.client.getEndpoint(), exec, requestOptions, context)); } /** @@ -1114,7 +1160,7 @@ public Mono> withExecWithResponseAsync(String exec, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withExecWithResponse(String exec, RequestOptions requestOptions) { - return service.withExecSync(exec, requestOptions, Context.NONE); + return service.withExecSync(this.client.getEndpoint(), exec, requestOptions, Context.NONE); } /** @@ -1130,7 +1176,8 @@ public Response withExecWithResponse(String exec, RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withFinallyWithResponseAsync(String finallyParameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withFinally(finallyParameter, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withFinally(this.client.getEndpoint(), finallyParameter, requestOptions, context)); } /** @@ -1146,7 +1193,7 @@ public Mono> withFinallyWithResponseAsync(String finallyParameter */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withFinallyWithResponse(String finallyParameter, RequestOptions requestOptions) { - return service.withFinallySync(finallyParameter, requestOptions, Context.NONE); + return service.withFinallySync(this.client.getEndpoint(), finallyParameter, requestOptions, Context.NONE); } /** @@ -1162,7 +1209,8 @@ public Response withFinallyWithResponse(String finallyParameter, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withForWithResponseAsync(String forParameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withFor(forParameter, requestOptions, context)); + return FluxUtil + .withContext(context -> service.withFor(this.client.getEndpoint(), forParameter, requestOptions, context)); } /** @@ -1178,7 +1226,7 @@ public Mono> withForWithResponseAsync(String forParameter, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withForWithResponse(String forParameter, RequestOptions requestOptions) { - return service.withForSync(forParameter, requestOptions, Context.NONE); + return service.withForSync(this.client.getEndpoint(), forParameter, requestOptions, Context.NONE); } /** @@ -1194,7 +1242,8 @@ public Response withForWithResponse(String forParameter, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withFromWithResponseAsync(String from, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withFrom(from, requestOptions, context)); + return FluxUtil + .withContext(context -> service.withFrom(this.client.getEndpoint(), from, requestOptions, context)); } /** @@ -1210,7 +1259,7 @@ public Mono> withFromWithResponseAsync(String from, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withFromWithResponse(String from, RequestOptions requestOptions) { - return service.withFromSync(from, requestOptions, Context.NONE); + return service.withFromSync(this.client.getEndpoint(), from, requestOptions, Context.NONE); } /** @@ -1226,7 +1275,8 @@ public Response withFromWithResponse(String from, RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withGlobalWithResponseAsync(String global, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withGlobal(global, requestOptions, context)); + return FluxUtil + .withContext(context -> service.withGlobal(this.client.getEndpoint(), global, requestOptions, context)); } /** @@ -1242,7 +1292,7 @@ public Mono> withGlobalWithResponseAsync(String global, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withGlobalWithResponse(String global, RequestOptions requestOptions) { - return service.withGlobalSync(global, requestOptions, Context.NONE); + return service.withGlobalSync(this.client.getEndpoint(), global, requestOptions, Context.NONE); } /** @@ -1258,7 +1308,8 @@ public Response withGlobalWithResponse(String global, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withIfWithResponseAsync(String ifParameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withIf(ifParameter, requestOptions, context)); + return FluxUtil + .withContext(context -> service.withIf(this.client.getEndpoint(), ifParameter, requestOptions, context)); } /** @@ -1274,7 +1325,7 @@ public Mono> withIfWithResponseAsync(String ifParameter, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withIfWithResponse(String ifParameter, RequestOptions requestOptions) { - return service.withIfSync(ifParameter, requestOptions, Context.NONE); + return service.withIfSync(this.client.getEndpoint(), ifParameter, requestOptions, Context.NONE); } /** @@ -1290,7 +1341,8 @@ public Response withIfWithResponse(String ifParameter, RequestOptions requ */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withImportWithResponseAsync(String importParameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withImport(importParameter, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withImport(this.client.getEndpoint(), importParameter, requestOptions, context)); } /** @@ -1306,7 +1358,7 @@ public Mono> withImportWithResponseAsync(String importParameter, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withImportWithResponse(String importParameter, RequestOptions requestOptions) { - return service.withImportSync(importParameter, requestOptions, Context.NONE); + return service.withImportSync(this.client.getEndpoint(), importParameter, requestOptions, Context.NONE); } /** @@ -1322,7 +1374,7 @@ public Response withImportWithResponse(String importParameter, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withInWithResponseAsync(String in, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withIn(in, requestOptions, context)); + return FluxUtil.withContext(context -> service.withIn(this.client.getEndpoint(), in, requestOptions, context)); } /** @@ -1338,7 +1390,7 @@ public Mono> withInWithResponseAsync(String in, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withInWithResponse(String in, RequestOptions requestOptions) { - return service.withInSync(in, requestOptions, Context.NONE); + return service.withInSync(this.client.getEndpoint(), in, requestOptions, Context.NONE); } /** @@ -1354,7 +1406,7 @@ public Response withInWithResponse(String in, RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withIsWithResponseAsync(String is, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withIs(is, requestOptions, context)); + return FluxUtil.withContext(context -> service.withIs(this.client.getEndpoint(), is, requestOptions, context)); } /** @@ -1370,7 +1422,7 @@ public Mono> withIsWithResponseAsync(String is, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withIsWithResponse(String is, RequestOptions requestOptions) { - return service.withIsSync(is, requestOptions, Context.NONE); + return service.withIsSync(this.client.getEndpoint(), is, requestOptions, Context.NONE); } /** @@ -1386,7 +1438,8 @@ public Response withIsWithResponse(String is, RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withLambdaWithResponseAsync(String lambda, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withLambda(lambda, requestOptions, context)); + return FluxUtil + .withContext(context -> service.withLambda(this.client.getEndpoint(), lambda, requestOptions, context)); } /** @@ -1402,7 +1455,7 @@ public Mono> withLambdaWithResponseAsync(String lambda, RequestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withLambdaWithResponse(String lambda, RequestOptions requestOptions) { - return service.withLambdaSync(lambda, requestOptions, Context.NONE); + return service.withLambdaSync(this.client.getEndpoint(), lambda, requestOptions, Context.NONE); } /** @@ -1418,7 +1471,8 @@ public Response withLambdaWithResponse(String lambda, RequestOptions reque */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withNotWithResponseAsync(String not, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withNot(not, requestOptions, context)); + return FluxUtil + .withContext(context -> service.withNot(this.client.getEndpoint(), not, requestOptions, context)); } /** @@ -1434,7 +1488,7 @@ public Mono> withNotWithResponseAsync(String not, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withNotWithResponse(String not, RequestOptions requestOptions) { - return service.withNotSync(not, requestOptions, Context.NONE); + return service.withNotSync(this.client.getEndpoint(), not, requestOptions, Context.NONE); } /** @@ -1450,7 +1504,7 @@ public Response withNotWithResponse(String not, RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withOrWithResponseAsync(String or, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withOr(or, requestOptions, context)); + return FluxUtil.withContext(context -> service.withOr(this.client.getEndpoint(), or, requestOptions, context)); } /** @@ -1466,7 +1520,7 @@ public Mono> withOrWithResponseAsync(String or, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withOrWithResponse(String or, RequestOptions requestOptions) { - return service.withOrSync(or, requestOptions, Context.NONE); + return service.withOrSync(this.client.getEndpoint(), or, requestOptions, Context.NONE); } /** @@ -1482,7 +1536,8 @@ public Response withOrWithResponse(String or, RequestOptions requestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withPassWithResponseAsync(String pass, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withPass(pass, requestOptions, context)); + return FluxUtil + .withContext(context -> service.withPass(this.client.getEndpoint(), pass, requestOptions, context)); } /** @@ -1498,7 +1553,7 @@ public Mono> withPassWithResponseAsync(String pass, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withPassWithResponse(String pass, RequestOptions requestOptions) { - return service.withPassSync(pass, requestOptions, Context.NONE); + return service.withPassSync(this.client.getEndpoint(), pass, requestOptions, Context.NONE); } /** @@ -1514,7 +1569,8 @@ public Response withPassWithResponse(String pass, RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withRaiseWithResponseAsync(String raise, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withRaise(raise, requestOptions, context)); + return FluxUtil + .withContext(context -> service.withRaise(this.client.getEndpoint(), raise, requestOptions, context)); } /** @@ -1530,7 +1586,7 @@ public Mono> withRaiseWithResponseAsync(String raise, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withRaiseWithResponse(String raise, RequestOptions requestOptions) { - return service.withRaiseSync(raise, requestOptions, Context.NONE); + return service.withRaiseSync(this.client.getEndpoint(), raise, requestOptions, Context.NONE); } /** @@ -1546,7 +1602,8 @@ public Response withRaiseWithResponse(String raise, RequestOptions request */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withReturnWithResponseAsync(String returnParameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withReturn(returnParameter, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withReturn(this.client.getEndpoint(), returnParameter, requestOptions, context)); } /** @@ -1562,7 +1619,7 @@ public Mono> withReturnWithResponseAsync(String returnParameter, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withReturnWithResponse(String returnParameter, RequestOptions requestOptions) { - return service.withReturnSync(returnParameter, requestOptions, Context.NONE); + return service.withReturnSync(this.client.getEndpoint(), returnParameter, requestOptions, Context.NONE); } /** @@ -1578,7 +1635,8 @@ public Response withReturnWithResponse(String returnParameter, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withTryWithResponseAsync(String tryParameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withTry(tryParameter, requestOptions, context)); + return FluxUtil + .withContext(context -> service.withTry(this.client.getEndpoint(), tryParameter, requestOptions, context)); } /** @@ -1594,7 +1652,7 @@ public Mono> withTryWithResponseAsync(String tryParameter, Reques */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withTryWithResponse(String tryParameter, RequestOptions requestOptions) { - return service.withTrySync(tryParameter, requestOptions, Context.NONE); + return service.withTrySync(this.client.getEndpoint(), tryParameter, requestOptions, Context.NONE); } /** @@ -1610,7 +1668,8 @@ public Response withTryWithResponse(String tryParameter, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withWhileWithResponseAsync(String whileParameter, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withWhile(whileParameter, requestOptions, context)); + return FluxUtil.withContext( + context -> service.withWhile(this.client.getEndpoint(), whileParameter, requestOptions, context)); } /** @@ -1626,7 +1685,7 @@ public Mono> withWhileWithResponseAsync(String whileParameter, Re */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withWhileWithResponse(String whileParameter, RequestOptions requestOptions) { - return service.withWhileSync(whileParameter, requestOptions, Context.NONE); + return service.withWhileSync(this.client.getEndpoint(), whileParameter, requestOptions, Context.NONE); } /** @@ -1642,7 +1701,8 @@ public Response withWhileWithResponse(String whileParameter, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withWithWithResponseAsync(String with, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withWith(with, requestOptions, context)); + return FluxUtil + .withContext(context -> service.withWith(this.client.getEndpoint(), with, requestOptions, context)); } /** @@ -1658,7 +1718,7 @@ public Mono> withWithWithResponseAsync(String with, RequestOption */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withWithWithResponse(String with, RequestOptions requestOptions) { - return service.withWithSync(with, requestOptions, Context.NONE); + return service.withWithSync(this.client.getEndpoint(), with, requestOptions, Context.NONE); } /** @@ -1674,7 +1734,8 @@ public Response withWithWithResponse(String with, RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withYieldWithResponseAsync(String yield, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withYield(yield, requestOptions, context)); + return FluxUtil + .withContext(context -> service.withYield(this.client.getEndpoint(), yield, requestOptions, context)); } /** @@ -1690,7 +1751,7 @@ public Mono> withYieldWithResponseAsync(String yield, RequestOpti */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withYieldWithResponse(String yield, RequestOptions requestOptions) { - return service.withYieldSync(yield, requestOptions, Context.NONE); + return service.withYieldSync(this.client.getEndpoint(), yield, requestOptions, Context.NONE); } /** @@ -1707,8 +1768,8 @@ public Response withYieldWithResponse(String yield, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> withCancellationTokenWithResponseAsync(String cancellationToken, RequestOptions requestOptions) { - return FluxUtil - .withContext(context -> service.withCancellationToken(cancellationToken, requestOptions, context)); + return FluxUtil.withContext(context -> service.withCancellationToken(this.client.getEndpoint(), + cancellationToken, requestOptions, context)); } /** @@ -1724,6 +1785,7 @@ public Mono> withCancellationTokenWithResponseAsync(String cancel */ @ServiceMethod(returns = ReturnType.SINGLE) public Response withCancellationTokenWithResponse(String cancellationToken, RequestOptions requestOptions) { - return service.withCancellationTokenSync(cancellationToken, requestOptions, Context.NONE); + return service.withCancellationTokenSync(this.client.getEndpoint(), cancellationToken, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/specialwords/implementation/SpecialWordsClientImpl.java b/typespec-tests/src/main/java/com/specialwords/implementation/SpecialWordsClientImpl.java index ad1725213a..8ffa098671 100644 --- a/typespec-tests/src/main/java/com/specialwords/implementation/SpecialWordsClientImpl.java +++ b/typespec-tests/src/main/java/com/specialwords/implementation/SpecialWordsClientImpl.java @@ -15,6 +15,20 @@ * Initializes a new instance of the SpecialWordsClient type. */ public final class SpecialWordsClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -101,19 +115,22 @@ public ParametersImpl getParameters() { /** * Initializes an instance of SpecialWordsClient client. + * + * @param endpoint Service host. */ - public SpecialWordsClientImpl() { + public SpecialWordsClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of SpecialWordsClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public SpecialWordsClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public SpecialWordsClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -121,10 +138,12 @@ public SpecialWordsClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public SpecialWordsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public SpecialWordsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.models = new ModelsImpl(this); this.modelProperties = new ModelPropertiesImpl(this); this.operations = new OperationsImpl(this); diff --git a/typespec-tests/src/main/java/com/type/array/ArrayClientBuilder.java b/typespec-tests/src/main/java/com/type/array/ArrayClientBuilder.java index 5ac537539d..f7ea22007f 100644 --- a/typespec-tests/src/main/java/com/type/array/ArrayClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/array/ArrayClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -69,7 +70,8 @@ NullableBooleanValueAsyncClient.class, NullableStringValueAsyncClient.class, NullableModelValueAsyncClient.class }) -public final class ArrayClientBuilder implements HttpTrait, ConfigurationTrait { +public final class ArrayClientBuilder implements HttpTrait, ConfigurationTrait, + EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -200,6 +202,22 @@ public ArrayClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ArrayClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -227,7 +245,8 @@ public ArrayClientBuilder retryPolicy(RetryPolicy retryPolicy) { private ArrayClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - ArrayClientImpl client = new ArrayClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + ArrayClientImpl client + = new ArrayClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -235,6 +254,7 @@ private ArrayClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/array/implementation/ArrayClientImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/ArrayClientImpl.java index cc873e7457..f2cac991f5 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/ArrayClientImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/ArrayClientImpl.java @@ -15,6 +15,20 @@ * Initializes a new instance of the ArrayClient type. */ public final class ArrayClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -241,19 +255,22 @@ public NullableModelValuesImpl getNullableModelValues() { /** * Initializes an instance of ArrayClient client. + * + * @param endpoint Service host. */ - public ArrayClientImpl() { + public ArrayClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of ArrayClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public ArrayClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public ArrayClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -261,10 +278,12 @@ public ArrayClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public ArrayClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public ArrayClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.int32Values = new Int32ValuesImpl(this); this.int64Values = new Int64ValuesImpl(this); this.booleanValues = new BooleanValuesImpl(this); diff --git a/typespec-tests/src/main/java/com/type/array/implementation/BooleanValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/BooleanValuesImpl.java index f5491cda2e..3f0d5b06a3 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/BooleanValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/BooleanValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class BooleanValuesImpl { * The interface defining all the services for ArrayClientBooleanValues to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ArrayClientBooleanVa") public interface BooleanValuesService { @Get("/type/array/boolean") @@ -64,8 +65,8 @@ public interface BooleanValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/array/boolean") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/array/boolean") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/boolean") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/DatetimeValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/DatetimeValuesImpl.java index 23fc8a8a32..7878448bf2 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/DatetimeValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/DatetimeValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class DatetimeValuesImpl { * The interface defining all the services for ArrayClientDatetimeValues to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ArrayClientDatetimeV") public interface DatetimeValuesService { @Get("/type/array/datetime") @@ -64,8 +65,8 @@ public interface DatetimeValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/array/datetime") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/array/datetime") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/datetime") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/DurationValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/DurationValuesImpl.java index 76cacdd710..bdb0253104 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/DurationValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/DurationValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class DurationValuesImpl { * The interface defining all the services for ArrayClientDurationValues to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ArrayClientDurationV") public interface DurationValuesService { @Get("/type/array/duration") @@ -64,8 +65,8 @@ public interface DurationValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/array/duration") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/array/duration") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/duration") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/Float32ValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/Float32ValuesImpl.java index f76500d8f5..3090e9b8cc 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/Float32ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/Float32ValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class Float32ValuesImpl { * The interface defining all the services for ArrayClientFloat32Values to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ArrayClientFloat32Va") public interface Float32ValuesService { @Get("/type/array/float32") @@ -64,8 +65,8 @@ public interface Float32ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/array/float32") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/array/float32") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/float32") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/Int32ValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/Int32ValuesImpl.java index 7abdd7ba1f..7a32bda1c4 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/Int32ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/Int32ValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class Int32ValuesImpl { * The interface defining all the services for ArrayClientInt32Values to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ArrayClientInt32Valu") public interface Int32ValuesService { @Get("/type/array/int32") @@ -64,8 +65,8 @@ public interface Int32ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/array/int32") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/array/int32") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/int32") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/Int64ValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/Int64ValuesImpl.java index 1acefeb409..0ee68b4174 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/Int64ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/Int64ValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class Int64ValuesImpl { * The interface defining all the services for ArrayClientInt64Values to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ArrayClientInt64Valu") public interface Int64ValuesService { @Get("/type/array/int64") @@ -64,8 +65,8 @@ public interface Int64ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/array/int64") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/array/int64") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/int64") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/ModelValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/ModelValuesImpl.java index 62ea7c7061..a9b4bbdf18 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/ModelValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/ModelValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class ModelValuesImpl { * The interface defining all the services for ArrayClientModelValues to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ArrayClientModelValu") public interface ModelValuesService { @Get("/type/array/model") @@ -64,8 +65,8 @@ public interface ModelValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/array/model") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/array/model") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/model") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -120,7 +122,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -148,7 +150,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -177,7 +179,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -206,6 +209,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/NullableBooleanValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/NullableBooleanValuesImpl.java index dbd68b10a9..4fdf0dd3ed 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/NullableBooleanValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/NullableBooleanValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class NullableBooleanValuesImpl { * The interface defining all the services for ArrayClientNullableBooleanValues to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ArrayClientNullableB") public interface NullableBooleanValuesService { @Get("/type/array/nullable-boolean") @@ -64,8 +65,8 @@ public interface NullableBooleanValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/array/nullable-boolean") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/array/nullable-boolean") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/nullable-boolean") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/NullableFloatValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/NullableFloatValuesImpl.java index f8b29edffe..7c5932bec5 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/NullableFloatValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/NullableFloatValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class NullableFloatValuesImpl { * The interface defining all the services for ArrayClientNullableFloatValues to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ArrayClientNullableF") public interface NullableFloatValuesService { @Get("/type/array/nullable-float") @@ -64,8 +65,8 @@ public interface NullableFloatValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/array/nullable-float") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/array/nullable-float") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/nullable-float") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/NullableInt32ValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/NullableInt32ValuesImpl.java index 0fb9ab3586..b4c447bfab 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/NullableInt32ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/NullableInt32ValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class NullableInt32ValuesImpl { * The interface defining all the services for ArrayClientNullableInt32Values to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ArrayClientNullableI") public interface NullableInt32ValuesService { @Get("/type/array/nullable-int32") @@ -64,8 +65,8 @@ public interface NullableInt32ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/array/nullable-int32") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/array/nullable-int32") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/nullable-int32") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/NullableModelValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/NullableModelValuesImpl.java index 76b06b3e8d..643063bfb7 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/NullableModelValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/NullableModelValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class NullableModelValuesImpl { * The interface defining all the services for ArrayClientNullableModelValues to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ArrayClientNullableM") public interface NullableModelValuesService { @Get("/type/array/nullable-model") @@ -64,8 +65,8 @@ public interface NullableModelValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/array/nullable-model") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/array/nullable-model") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/nullable-model") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -120,7 +122,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -148,7 +150,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -177,7 +179,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -206,6 +209,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/NullableStringValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/NullableStringValuesImpl.java index 46748cc964..bbf0ce8b3b 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/NullableStringValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/NullableStringValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class NullableStringValuesImpl { * The interface defining all the services for ArrayClientNullableStringValues to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ArrayClientNullableS") public interface NullableStringValuesService { @Get("/type/array/nullable-string") @@ -64,8 +65,8 @@ public interface NullableStringValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/array/nullable-string") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/array/nullable-string") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/nullable-string") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/StringValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/StringValuesImpl.java index e8d96abd38..a4f654a3d5 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/StringValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/StringValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class StringValuesImpl { * The interface defining all the services for ArrayClientStringValues to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ArrayClientStringVal") public interface StringValuesService { @Get("/type/array/string") @@ -64,8 +65,8 @@ public interface StringValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/array/string") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/array/string") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/string") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/array/implementation/UnknownValuesImpl.java b/typespec-tests/src/main/java/com/type/array/implementation/UnknownValuesImpl.java index 3fb3a49567..278340bf3c 100644 --- a/typespec-tests/src/main/java/com/type/array/implementation/UnknownValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/array/implementation/UnknownValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class UnknownValuesImpl { * The interface defining all the services for ArrayClientUnknownValues to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ArrayClientUnknownVa") public interface UnknownValuesService { @Get("/type/array/unknown") @@ -64,8 +65,8 @@ public interface UnknownValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/array/unknown") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/array/unknown") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/array/unknown") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/DictionaryClientBuilder.java b/typespec-tests/src/main/java/com/type/dictionary/DictionaryClientBuilder.java index 5207e105a7..e5ffe0c0ca 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/DictionaryClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/dictionary/DictionaryClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -63,8 +64,8 @@ ModelValueAsyncClient.class, RecursiveModelValueAsyncClient.class, NullableFloatValueAsyncClient.class }) -public final class DictionaryClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class DictionaryClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -195,6 +196,22 @@ public DictionaryClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public DictionaryClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -223,7 +240,7 @@ private DictionaryClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); DictionaryClientImpl client - = new DictionaryClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + = new DictionaryClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -231,6 +248,7 @@ private DictionaryClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/BooleanValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/BooleanValuesImpl.java index 54dcdb8e2d..4252c4d7f2 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/BooleanValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/BooleanValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class BooleanValuesImpl { * The interface defining all the services for DictionaryClientBooleanValues to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "DictionaryClientBool") public interface BooleanValuesService { @Get("/type/dictionary/boolean") @@ -64,8 +65,8 @@ public interface BooleanValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/dictionary/boolean") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/boolean") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/boolean") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/DatetimeValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/DatetimeValuesImpl.java index ea55d7e8af..c69e91000f 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/DatetimeValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/DatetimeValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class DatetimeValuesImpl { * The interface defining all the services for DictionaryClientDatetimeValues to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "DictionaryClientDate") public interface DatetimeValuesService { @Get("/type/dictionary/datetime") @@ -64,8 +65,8 @@ public interface DatetimeValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/dictionary/datetime") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/datetime") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/datetime") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/DictionaryClientImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/DictionaryClientImpl.java index c913de3bf4..e102ac6198 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/DictionaryClientImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/DictionaryClientImpl.java @@ -15,6 +15,20 @@ * Initializes a new instance of the DictionaryClient type. */ public final class DictionaryClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -199,19 +213,22 @@ public NullableFloatValuesImpl getNullableFloatValues() { /** * Initializes an instance of DictionaryClient client. + * + * @param endpoint Service host. */ - public DictionaryClientImpl() { + public DictionaryClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of DictionaryClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public DictionaryClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public DictionaryClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -219,10 +236,12 @@ public DictionaryClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public DictionaryClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public DictionaryClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.int32Values = new Int32ValuesImpl(this); this.int64Values = new Int64ValuesImpl(this); this.booleanValues = new BooleanValuesImpl(this); diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/DurationValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/DurationValuesImpl.java index bed505de4e..fd34b374c1 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/DurationValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/DurationValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class DurationValuesImpl { * The interface defining all the services for DictionaryClientDurationValues to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "DictionaryClientDura") public interface DurationValuesService { @Get("/type/dictionary/duration") @@ -64,8 +65,8 @@ public interface DurationValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/dictionary/duration") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/duration") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/duration") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/Float32ValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/Float32ValuesImpl.java index bdf89ed2f5..31c0c48d5b 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/Float32ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/Float32ValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class Float32ValuesImpl { * The interface defining all the services for DictionaryClientFloat32Values to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "DictionaryClientFloa") public interface Float32ValuesService { @Get("/type/dictionary/float32") @@ -64,8 +65,8 @@ public interface Float32ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/dictionary/float32") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/float32") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/float32") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/Int32ValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/Int32ValuesImpl.java index a4f1e9d61c..218a66342b 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/Int32ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/Int32ValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class Int32ValuesImpl { * The interface defining all the services for DictionaryClientInt32Values to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "DictionaryClientInt3") public interface Int32ValuesService { @Get("/type/dictionary/int32") @@ -64,8 +65,8 @@ public interface Int32ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/dictionary/int32") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/int32") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/int32") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/Int64ValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/Int64ValuesImpl.java index 168df55ef0..0a4f18ef6a 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/Int64ValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/Int64ValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class Int64ValuesImpl { * The interface defining all the services for DictionaryClientInt64Values to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "DictionaryClientInt6") public interface Int64ValuesService { @Get("/type/dictionary/int64") @@ -64,8 +65,8 @@ public interface Int64ValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/dictionary/int64") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/int64") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/int64") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/ModelValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/ModelValuesImpl.java index be1e1e900c..67b28966e9 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/ModelValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/ModelValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class ModelValuesImpl { * The interface defining all the services for DictionaryClientModelValues to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "DictionaryClientMode") public interface ModelValuesService { @Get("/type/dictionary/model") @@ -64,8 +65,8 @@ public interface ModelValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/dictionary/model") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/model") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/model") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -120,7 +122,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -148,7 +150,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -177,7 +179,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -206,6 +209,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/NullableFloatValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/NullableFloatValuesImpl.java index c9de0c5e27..4bbec7bc7f 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/NullableFloatValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/NullableFloatValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class NullableFloatValuesImpl { * The interface defining all the services for DictionaryClientNullableFloatValues to be used by the proxy service * to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "DictionaryClientNull") public interface NullableFloatValuesService { @Get("/type/dictionary/nullable-float") @@ -64,8 +65,8 @@ public interface NullableFloatValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/dictionary/nullable-float") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/nullable-float") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/nullable-float") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/RecursiveModelValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/RecursiveModelValuesImpl.java index eb9cf58a84..ee8fad64fe 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/RecursiveModelValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/RecursiveModelValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class RecursiveModelValuesImpl { * The interface defining all the services for DictionaryClientRecursiveModelValues to be used by the proxy service * to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "DictionaryClientRecu") public interface RecursiveModelValuesService { @Get("/type/dictionary/model/recursive") @@ -64,8 +65,8 @@ public interface RecursiveModelValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/dictionary/model/recursive") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/model/recursive") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/model/recursive") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -120,7 +122,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -148,7 +150,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -177,7 +179,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -206,6 +209,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/StringValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/StringValuesImpl.java index 84dcefbc08..185d11e415 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/StringValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/StringValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class StringValuesImpl { * The interface defining all the services for DictionaryClientStringValues to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "DictionaryClientStri") public interface StringValuesService { @Get("/type/dictionary/string") @@ -64,8 +65,8 @@ public interface StringValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/dictionary/string") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/string") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/string") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/dictionary/implementation/UnknownValuesImpl.java b/typespec-tests/src/main/java/com/type/dictionary/implementation/UnknownValuesImpl.java index 7726abff65..c8669d7a4c 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/implementation/UnknownValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/dictionary/implementation/UnknownValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class UnknownValuesImpl { * The interface defining all the services for DictionaryClientUnknownValues to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "DictionaryClientUnkn") public interface UnknownValuesService { @Get("/type/dictionary/unknown") @@ -64,8 +65,8 @@ public interface UnknownValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/dictionary/unknown") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/unknown") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/dictionary/unknown") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/enums/extensible/ExtensibleClientBuilder.java b/typespec-tests/src/main/java/com/type/enums/extensible/ExtensibleClientBuilder.java index 6a3540b59f..bcd992c9b9 100644 --- a/typespec-tests/src/main/java/com/type/enums/extensible/ExtensibleClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/enums/extensible/ExtensibleClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,8 +41,8 @@ * A builder for creating a new instance of the ExtensibleClient type. */ @ServiceClientBuilder(serviceClients = { ExtensibleClient.class, ExtensibleAsyncClient.class }) -public final class ExtensibleClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class ExtensibleClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -172,6 +173,22 @@ public ExtensibleClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ExtensibleClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -200,7 +217,7 @@ private ExtensibleClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); ExtensibleClientImpl client - = new ExtensibleClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + = new ExtensibleClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -208,6 +225,7 @@ private ExtensibleClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/enums/extensible/implementation/ExtensibleClientImpl.java b/typespec-tests/src/main/java/com/type/enums/extensible/implementation/ExtensibleClientImpl.java index ea61e06301..6f5732026d 100644 --- a/typespec-tests/src/main/java/com/type/enums/extensible/implementation/ExtensibleClientImpl.java +++ b/typespec-tests/src/main/java/com/type/enums/extensible/implementation/ExtensibleClientImpl.java @@ -15,6 +15,20 @@ * Initializes a new instance of the ExtensibleClient type. */ public final class ExtensibleClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -59,19 +73,22 @@ public StringOperationsImpl getStringOperations() { /** * Initializes an instance of ExtensibleClient client. + * + * @param endpoint Service host. */ - public ExtensibleClientImpl() { + public ExtensibleClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of ExtensibleClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public ExtensibleClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public ExtensibleClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -79,10 +96,12 @@ public ExtensibleClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public ExtensibleClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public ExtensibleClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.stringOperations = new StringOperationsImpl(this); } } diff --git a/typespec-tests/src/main/java/com/type/enums/extensible/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/enums/extensible/implementation/StringOperationsImpl.java index 1bd58d59f1..fa6ded7cef 100644 --- a/typespec-tests/src/main/java/com/type/enums/extensible/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/enums/extensible/implementation/StringOperationsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class StringOperationsImpl { * The interface defining all the services for ExtensibleClientStringOperations to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ExtensibleClientStri") public interface StringOperationsService { @Get("/type/enum/extensible/string/known-value") @@ -64,8 +65,8 @@ public interface StringOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getKnownValue(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getKnownValue(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/enum/extensible/string/known-value") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> getKnownValue(@HeaderParam("Accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getKnownValueSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getKnownValueSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/enum/extensible/string/unknown-value") @ExpectedResponses({ 200 }) @@ -82,8 +83,8 @@ Response getKnownValueSync(@HeaderParam("Accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getUnknownValue(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getUnknownValue(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/enum/extensible/string/unknown-value") @ExpectedResponses({ 200 }) @@ -91,8 +92,8 @@ Mono> getUnknownValue(@HeaderParam("Accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getUnknownValueSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getUnknownValueSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/enum/extensible/string/known-value") @ExpectedResponses({ 204 }) @@ -100,8 +101,9 @@ Response getUnknownValueSync(@HeaderParam("Accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putKnownValue(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putKnownValue(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/enum/extensible/string/known-value") @ExpectedResponses({ 204 }) @@ -109,8 +111,9 @@ Mono> putKnownValue(@HeaderParam("Content-Type") String contentTy @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putKnownValueSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putKnownValueSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/enum/extensible/string/unknown-value") @ExpectedResponses({ 204 }) @@ -118,8 +121,9 @@ Response putKnownValueSync(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putUnknownValue(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putUnknownValue(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/enum/extensible/string/unknown-value") @ExpectedResponses({ 204 }) @@ -127,8 +131,9 @@ Mono> putUnknownValue(@HeaderParam("Content-Type") String content @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putUnknownValueSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putUnknownValueSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -149,7 +154,8 @@ Response putUnknownValueSync(@HeaderParam("Content-Type") String contentTy @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getKnownValueWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getKnownValue(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getKnownValue(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -170,7 +176,7 @@ public Mono> getKnownValueWithResponseAsync(RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response getKnownValueWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getKnownValueSync(accept, requestOptions, Context.NONE); + return service.getKnownValueSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -191,7 +197,8 @@ public Response getKnownValueWithResponse(RequestOptions requestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getUnknownValueWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getUnknownValue(accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.getUnknownValue(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -212,7 +219,7 @@ public Mono> getUnknownValueWithResponseAsync(RequestOption @ServiceMethod(returns = ReturnType.SINGLE) public Response getUnknownValueWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getUnknownValueSync(accept, requestOptions, Context.NONE); + return service.getUnknownValueSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -234,7 +241,8 @@ public Response getUnknownValueWithResponse(RequestOptions requestOp @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putKnownValueWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putKnownValue(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putKnownValue(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -256,7 +264,7 @@ public Mono> putKnownValueWithResponseAsync(BinaryData body, Requ @ServiceMethod(returns = ReturnType.SINGLE) public Response putKnownValueWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putKnownValueSync(contentType, body, requestOptions, Context.NONE); + return service.putKnownValueSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -278,7 +286,8 @@ public Response putKnownValueWithResponse(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putUnknownValueWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putUnknownValue(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putUnknownValue(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -300,6 +309,6 @@ public Mono> putUnknownValueWithResponseAsync(BinaryData body, Re @ServiceMethod(returns = ReturnType.SINGLE) public Response putUnknownValueWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putUnknownValueSync(contentType, body, requestOptions, Context.NONE); + return service.putUnknownValueSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/enums/fixed/FixedClientBuilder.java b/typespec-tests/src/main/java/com/type/enums/fixed/FixedClientBuilder.java index ff2435b80a..4c7362b9df 100644 --- a/typespec-tests/src/main/java/com/type/enums/fixed/FixedClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/enums/fixed/FixedClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,7 +41,8 @@ * A builder for creating a new instance of the FixedClient type. */ @ServiceClientBuilder(serviceClients = { FixedClient.class, FixedAsyncClient.class }) -public final class FixedClientBuilder implements HttpTrait, ConfigurationTrait { +public final class FixedClientBuilder implements HttpTrait, ConfigurationTrait, + EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -171,6 +173,22 @@ public FixedClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FixedClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -198,7 +216,8 @@ public FixedClientBuilder retryPolicy(RetryPolicy retryPolicy) { private FixedClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FixedClientImpl client = new FixedClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + FixedClientImpl client + = new FixedClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -206,6 +225,7 @@ private FixedClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/enums/fixed/implementation/FixedClientImpl.java b/typespec-tests/src/main/java/com/type/enums/fixed/implementation/FixedClientImpl.java index 7cdbd69213..361d8fa839 100644 --- a/typespec-tests/src/main/java/com/type/enums/fixed/implementation/FixedClientImpl.java +++ b/typespec-tests/src/main/java/com/type/enums/fixed/implementation/FixedClientImpl.java @@ -15,6 +15,20 @@ * Initializes a new instance of the FixedClient type. */ public final class FixedClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -59,19 +73,22 @@ public StringOperationsImpl getStringOperations() { /** * Initializes an instance of FixedClient client. + * + * @param endpoint Service host. */ - public FixedClientImpl() { + public FixedClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of FixedClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public FixedClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public FixedClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -79,10 +96,12 @@ public FixedClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public FixedClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public FixedClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.stringOperations = new StringOperationsImpl(this); } } diff --git a/typespec-tests/src/main/java/com/type/enums/fixed/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/enums/fixed/implementation/StringOperationsImpl.java index e5b90d1241..0bf97bfa46 100644 --- a/typespec-tests/src/main/java/com/type/enums/fixed/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/enums/fixed/implementation/StringOperationsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class StringOperationsImpl { * The interface defining all the services for FixedClientStringOperations to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "FixedClientStringOpe") public interface StringOperationsService { @Get("/type/enum/fixed/string/known-value") @@ -64,8 +65,8 @@ public interface StringOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getKnownValue(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getKnownValue(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/enum/fixed/string/known-value") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> getKnownValue(@HeaderParam("Accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getKnownValueSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getKnownValueSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/enum/fixed/string/known-value") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getKnownValueSync(@HeaderParam("Accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putKnownValue(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putKnownValue(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/enum/fixed/string/known-value") @ExpectedResponses({ 204 }) @@ -91,8 +93,9 @@ Mono> putKnownValue(@HeaderParam("Content-Type") String contentTy @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putKnownValueSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putKnownValueSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/enum/fixed/string/unknown-value") @ExpectedResponses({ 204 }) @@ -100,8 +103,9 @@ Response putKnownValueSync(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putUnknownValue(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putUnknownValue(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/enum/fixed/string/unknown-value") @ExpectedResponses({ 204 }) @@ -109,8 +113,9 @@ Mono> putUnknownValue(@HeaderParam("Content-Type") String content @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putUnknownValueSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putUnknownValueSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -131,7 +136,8 @@ Response putUnknownValueSync(@HeaderParam("Content-Type") String contentTy @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getKnownValueWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getKnownValue(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getKnownValue(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -152,7 +158,7 @@ public Mono> getKnownValueWithResponseAsync(RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response getKnownValueWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getKnownValueSync(accept, requestOptions, Context.NONE); + return service.getKnownValueSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -174,7 +180,8 @@ public Response getKnownValueWithResponse(RequestOptions requestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putKnownValueWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putKnownValue(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putKnownValue(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -196,7 +203,7 @@ public Mono> putKnownValueWithResponseAsync(BinaryData body, Requ @ServiceMethod(returns = ReturnType.SINGLE) public Response putKnownValueWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putKnownValueSync(contentType, body, requestOptions, Context.NONE); + return service.putKnownValueSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -218,7 +225,8 @@ public Response putKnownValueWithResponse(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putUnknownValueWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putUnknownValue(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putUnknownValue(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -240,6 +248,6 @@ public Mono> putUnknownValueWithResponseAsync(BinaryData body, Re @ServiceMethod(returns = ReturnType.SINGLE) public Response putUnknownValueWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putUnknownValueSync(contentType, body, requestOptions, Context.NONE); + return service.putUnknownValueSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/model/empty/EmptyClientBuilder.java b/typespec-tests/src/main/java/com/type/model/empty/EmptyClientBuilder.java index e51aee1be0..88e74bda25 100644 --- a/typespec-tests/src/main/java/com/type/model/empty/EmptyClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/model/empty/EmptyClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,7 +41,8 @@ * A builder for creating a new instance of the EmptyClient type. */ @ServiceClientBuilder(serviceClients = { EmptyClient.class, EmptyAsyncClient.class }) -public final class EmptyClientBuilder implements HttpTrait, ConfigurationTrait { +public final class EmptyClientBuilder implements HttpTrait, ConfigurationTrait, + EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -171,6 +173,22 @@ public EmptyClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public EmptyClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -198,7 +216,8 @@ public EmptyClientBuilder retryPolicy(RetryPolicy retryPolicy) { private EmptyClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - EmptyClientImpl client = new EmptyClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + EmptyClientImpl client + = new EmptyClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -206,6 +225,7 @@ private EmptyClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/model/empty/implementation/EmptyClientImpl.java b/typespec-tests/src/main/java/com/type/model/empty/implementation/EmptyClientImpl.java index 38edf448b7..1efee1de49 100644 --- a/typespec-tests/src/main/java/com/type/model/empty/implementation/EmptyClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/empty/implementation/EmptyClientImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; @@ -42,6 +43,20 @@ public final class EmptyClientImpl { */ private final EmptyClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -72,19 +87,22 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of EmptyClient client. + * + * @param endpoint Service host. */ - public EmptyClientImpl() { + public EmptyClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of EmptyClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public EmptyClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public EmptyClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -92,17 +110,19 @@ public EmptyClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public EmptyClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public EmptyClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.service = RestProxy.create(EmptyClientService.class, this.httpPipeline, this.getSerializerAdapter()); } /** * The interface defining all the services for EmptyClient to be used by the proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "EmptyClient") public interface EmptyClientService { @Put("/type/model/empty/alone") @@ -111,8 +131,9 @@ public interface EmptyClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putEmpty(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> putEmpty(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Put("/type/model/empty/alone") @ExpectedResponses({ 204 }) @@ -120,8 +141,9 @@ Mono> putEmpty(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putEmptySync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response putEmptySync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Get("/type/model/empty/alone") @ExpectedResponses({ 200 }) @@ -129,8 +151,8 @@ Response putEmptySync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getEmpty(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getEmpty(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/empty/alone") @ExpectedResponses({ 200 }) @@ -138,8 +160,8 @@ Mono> getEmpty(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getEmptySync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getEmptySync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Post("/type/model/empty/round-trip") @ExpectedResponses({ 200 }) @@ -147,9 +169,9 @@ Response getEmptySync(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> postRoundTripEmpty(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> postRoundTripEmpty(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/type/model/empty/round-trip") @ExpectedResponses({ 200 }) @@ -157,9 +179,9 @@ Mono> postRoundTripEmpty(@HeaderParam("Content-Type") Strin @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postRoundTripEmptySync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response postRoundTripEmptySync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -181,7 +203,8 @@ Response postRoundTripEmptySync(@HeaderParam("Content-Type") String @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putEmptyWithResponseAsync(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putEmpty(contentType, input, requestOptions, context)); + return FluxUtil + .withContext(context -> service.putEmpty(this.getEndpoint(), contentType, input, requestOptions, context)); } /** @@ -203,7 +226,7 @@ public Mono> putEmptyWithResponseAsync(BinaryData input, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response putEmptyWithResponse(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putEmptySync(contentType, input, requestOptions, Context.NONE); + return service.putEmptySync(this.getEndpoint(), contentType, input, requestOptions, Context.NONE); } /** @@ -225,7 +248,7 @@ public Response putEmptyWithResponse(BinaryData input, RequestOptions requ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getEmptyWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEmpty(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getEmpty(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -246,7 +269,7 @@ public Mono> getEmptyWithResponseAsync(RequestOptions reque @ServiceMethod(returns = ReturnType.SINGLE) public Response getEmptyWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getEmptySync(accept, requestOptions, Context.NONE); + return service.getEmptySync(this.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -277,8 +300,8 @@ public Mono> postRoundTripEmptyWithResponseAsync(BinaryData RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.postRoundTripEmpty(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.postRoundTripEmpty(this.getEndpoint(), contentType, accept, body, + requestOptions, context)); } /** @@ -307,6 +330,7 @@ public Mono> postRoundTripEmptyWithResponseAsync(BinaryData public Response postRoundTripEmptyWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.postRoundTripEmptySync(contentType, accept, body, requestOptions, Context.NONE); + return service.postRoundTripEmptySync(this.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/model/flatten/FlattenClientBuilder.java b/typespec-tests/src/main/java/com/type/model/flatten/FlattenClientBuilder.java index 45dae65247..642b059314 100644 --- a/typespec-tests/src/main/java/com/type/model/flatten/FlattenClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/model/flatten/FlattenClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,8 +41,8 @@ * A builder for creating a new instance of the FlattenClient type. */ @ServiceClientBuilder(serviceClients = { FlattenClient.class, FlattenAsyncClient.class }) -public final class FlattenClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class FlattenClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -172,6 +173,22 @@ public FlattenClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FlattenClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -200,7 +217,7 @@ private FlattenClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); FlattenClientImpl client - = new FlattenClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + = new FlattenClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -208,6 +225,7 @@ private FlattenClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/model/flatten/implementation/FlattenClientImpl.java b/typespec-tests/src/main/java/com/type/model/flatten/implementation/FlattenClientImpl.java index 78c29caa76..b80ac47c8a 100644 --- a/typespec-tests/src/main/java/com/type/model/flatten/implementation/FlattenClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/flatten/implementation/FlattenClientImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -40,6 +41,20 @@ public final class FlattenClientImpl { */ private final FlattenClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -70,19 +85,22 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of FlattenClient client. + * + * @param endpoint Service host. */ - public FlattenClientImpl() { + public FlattenClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of FlattenClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public FlattenClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public FlattenClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -90,17 +108,19 @@ public FlattenClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public FlattenClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public FlattenClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.service = RestProxy.create(FlattenClientService.class, this.httpPipeline, this.getSerializerAdapter()); } /** * The interface defining all the services for FlattenClient to be used by the proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "FlattenClient") public interface FlattenClientService { @Put("/type/model/flatten/flattenModel") @@ -109,9 +129,9 @@ public interface FlattenClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putFlattenModel(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, - RequestOptions requestOptions, Context context); + Mono> putFlattenModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/flatten/flattenModel") @ExpectedResponses({ 200 }) @@ -119,9 +139,9 @@ Mono> putFlattenModel(@HeaderParam("Content-Type") String c @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putFlattenModelSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, - RequestOptions requestOptions, Context context); + Response putFlattenModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/flatten/nestedFlattenModel") @ExpectedResponses({ 200 }) @@ -129,9 +149,9 @@ Response putFlattenModelSync(@HeaderParam("Content-Type") String con @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putNestedFlattenModel(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, - RequestOptions requestOptions, Context context); + Mono> putNestedFlattenModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/flatten/nestedFlattenModel") @ExpectedResponses({ 200 }) @@ -139,9 +159,9 @@ Mono> putNestedFlattenModel(@HeaderParam("Content-Type") St @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putNestedFlattenModelSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, - RequestOptions requestOptions, Context context); + Response putNestedFlattenModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); } /** @@ -184,8 +204,8 @@ public Mono> putFlattenModelWithResponseAsync(BinaryData in RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putFlattenModel(contentType, accept, input, requestOptions, context)); + return FluxUtil.withContext(context -> service.putFlattenModel(this.getEndpoint(), contentType, accept, input, + requestOptions, context)); } /** @@ -226,7 +246,8 @@ public Mono> putFlattenModelWithResponseAsync(BinaryData in public Response putFlattenModelWithResponse(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.putFlattenModelSync(contentType, accept, input, requestOptions, Context.NONE); + return service.putFlattenModelSync(this.getEndpoint(), contentType, accept, input, requestOptions, + Context.NONE); } /** @@ -275,8 +296,8 @@ public Mono> putNestedFlattenModelWithResponseAsync(BinaryD RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putNestedFlattenModel(contentType, accept, input, requestOptions, context)); + return FluxUtil.withContext(context -> service.putNestedFlattenModel(this.getEndpoint(), contentType, accept, + input, requestOptions, context)); } /** @@ -323,6 +344,7 @@ public Mono> putNestedFlattenModelWithResponseAsync(BinaryD public Response putNestedFlattenModelWithResponse(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.putNestedFlattenModelSync(contentType, accept, input, requestOptions, Context.NONE); + return service.putNestedFlattenModelSync(this.getEndpoint(), contentType, accept, input, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorClientBuilder.java b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorClientBuilder.java index 8f52e6ae7c..065dcdd777 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,8 +41,8 @@ * A builder for creating a new instance of the EnumDiscriminatorClient type. */ @ServiceClientBuilder(serviceClients = { EnumDiscriminatorClient.class, EnumDiscriminatorAsyncClient.class }) -public final class EnumDiscriminatorClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class EnumDiscriminatorClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -173,6 +174,22 @@ public EnumDiscriminatorClientBuilder configuration(Configuration configuration) return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public EnumDiscriminatorClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -200,8 +217,8 @@ public EnumDiscriminatorClientBuilder retryPolicy(RetryPolicy retryPolicy) { private EnumDiscriminatorClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - EnumDiscriminatorClientImpl client - = new EnumDiscriminatorClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + EnumDiscriminatorClientImpl client = new EnumDiscriminatorClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -209,6 +226,7 @@ private EnumDiscriminatorClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/implementation/EnumDiscriminatorClientImpl.java b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/implementation/EnumDiscriminatorClientImpl.java index 084e032e36..7fd484ee8c 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/implementation/EnumDiscriminatorClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/implementation/EnumDiscriminatorClientImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -41,6 +42,20 @@ public final class EnumDiscriminatorClientImpl { */ private final EnumDiscriminatorClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -71,19 +86,22 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of EnumDiscriminatorClient client. + * + * @param endpoint Service host. */ - public EnumDiscriminatorClientImpl() { + public EnumDiscriminatorClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of EnumDiscriminatorClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public EnumDiscriminatorClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public EnumDiscriminatorClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -91,10 +109,13 @@ public EnumDiscriminatorClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public EnumDiscriminatorClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public EnumDiscriminatorClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.service = RestProxy.create(EnumDiscriminatorClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -103,7 +124,7 @@ public EnumDiscriminatorClientImpl(HttpPipeline httpPipeline, SerializerAdapter * The interface defining all the services for EnumDiscriminatorClient to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "EnumDiscriminatorCli") public interface EnumDiscriminatorClientService { @Get("/type/model/inheritance/enum-discriminator/extensible-enum") @@ -112,8 +133,8 @@ public interface EnumDiscriminatorClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getExtensibleModel(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> getExtensibleModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/extensible-enum") @ExpectedResponses({ 200 }) @@ -121,8 +142,8 @@ Mono> getExtensibleModel(@HeaderParam("Accept") String acce @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getExtensibleModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getExtensibleModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-discriminator/extensible-enum") @ExpectedResponses({ 204 }) @@ -130,8 +151,9 @@ Response getExtensibleModelSync(@HeaderParam("Accept") String accept @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putExtensibleModel(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> putExtensibleModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-discriminator/extensible-enum") @ExpectedResponses({ 204 }) @@ -139,8 +161,9 @@ Mono> putExtensibleModel(@HeaderParam("Content-Type") String cont @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putExtensibleModelSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response putExtensibleModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/extensible-enum/missingdiscriminator") @ExpectedResponses({ 200 }) @@ -148,8 +171,8 @@ Response putExtensibleModelSync(@HeaderParam("Content-Type") String conten @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getExtensibleModelMissingDiscriminator(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> getExtensibleModelMissingDiscriminator(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/extensible-enum/missingdiscriminator") @ExpectedResponses({ 200 }) @@ -157,8 +180,8 @@ Mono> getExtensibleModelMissingDiscriminator(@HeaderParam(" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getExtensibleModelMissingDiscriminatorSync(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Response getExtensibleModelMissingDiscriminatorSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/extensible-enum/wrongdiscriminator") @ExpectedResponses({ 200 }) @@ -166,8 +189,8 @@ Response getExtensibleModelMissingDiscriminatorSync(@HeaderParam("Ac @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getExtensibleModelWrongDiscriminator(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> getExtensibleModelWrongDiscriminator(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/extensible-enum/wrongdiscriminator") @ExpectedResponses({ 200 }) @@ -175,8 +198,8 @@ Mono> getExtensibleModelWrongDiscriminator(@HeaderParam("Ac @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getExtensibleModelWrongDiscriminatorSync(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Response getExtensibleModelWrongDiscriminatorSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/fixed-enum") @ExpectedResponses({ 200 }) @@ -184,8 +207,8 @@ Response getExtensibleModelWrongDiscriminatorSync(@HeaderParam("Acce @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getFixedModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getFixedModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/fixed-enum") @ExpectedResponses({ 200 }) @@ -193,8 +216,8 @@ Mono> getFixedModel(@HeaderParam("Accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getFixedModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getFixedModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-discriminator/fixed-enum") @ExpectedResponses({ 204 }) @@ -202,8 +225,9 @@ Response getFixedModelSync(@HeaderParam("Accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putFixedModel(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> putFixedModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-discriminator/fixed-enum") @ExpectedResponses({ 204 }) @@ -211,8 +235,9 @@ Mono> putFixedModel(@HeaderParam("Content-Type") String contentTy @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putFixedModelSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response putFixedModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/fixed-enum/missingdiscriminator") @ExpectedResponses({ 200 }) @@ -220,8 +245,8 @@ Response putFixedModelSync(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getFixedModelMissingDiscriminator(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> getFixedModelMissingDiscriminator(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/fixed-enum/missingdiscriminator") @ExpectedResponses({ 200 }) @@ -229,8 +254,8 @@ Mono> getFixedModelMissingDiscriminator(@HeaderParam("Accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getFixedModelMissingDiscriminatorSync(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Response getFixedModelMissingDiscriminatorSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/fixed-enum/wrongdiscriminator") @ExpectedResponses({ 200 }) @@ -238,8 +263,8 @@ Response getFixedModelMissingDiscriminatorSync(@HeaderParam("Accept" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getFixedModelWrongDiscriminator(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> getFixedModelWrongDiscriminator(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-discriminator/fixed-enum/wrongdiscriminator") @ExpectedResponses({ 200 }) @@ -247,8 +272,8 @@ Mono> getFixedModelWrongDiscriminator(@HeaderParam("Accept" @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getFixedModelWrongDiscriminatorSync(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Response getFixedModelWrongDiscriminatorSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -273,7 +298,8 @@ Response getFixedModelWrongDiscriminatorSync(@HeaderParam("Accept") @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getExtensibleModelWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getExtensibleModel(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getExtensibleModel(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -297,7 +323,7 @@ public Mono> getExtensibleModelWithResponseAsync(RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getExtensibleModelWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getExtensibleModelSync(accept, requestOptions, Context.NONE); + return service.getExtensibleModelSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -322,7 +348,8 @@ public Response getExtensibleModelWithResponse(RequestOptions reques @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putExtensibleModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putExtensibleModel(contentType, input, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putExtensibleModel(this.getEndpoint(), contentType, input, requestOptions, context)); } /** @@ -347,7 +374,7 @@ public Mono> putExtensibleModelWithResponseAsync(BinaryData input @ServiceMethod(returns = ReturnType.SINGLE) public Response putExtensibleModelWithResponse(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putExtensibleModelSync(contentType, input, requestOptions, Context.NONE); + return service.putExtensibleModelSync(this.getEndpoint(), contentType, input, requestOptions, Context.NONE); } /** @@ -372,8 +399,8 @@ public Response putExtensibleModelWithResponse(BinaryData input, RequestOp public Mono> getExtensibleModelMissingDiscriminatorWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getExtensibleModelMissingDiscriminator(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getExtensibleModelMissingDiscriminator(this.getEndpoint(), + accept, requestOptions, context)); } /** @@ -397,7 +424,8 @@ public Response putExtensibleModelWithResponse(BinaryData input, RequestOp @ServiceMethod(returns = ReturnType.SINGLE) public Response getExtensibleModelMissingDiscriminatorWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getExtensibleModelMissingDiscriminatorSync(accept, requestOptions, Context.NONE); + return service.getExtensibleModelMissingDiscriminatorSync(this.getEndpoint(), accept, requestOptions, + Context.NONE); } /** @@ -423,8 +451,8 @@ public Response getExtensibleModelMissingDiscriminatorWithResponse(R public Mono> getExtensibleModelWrongDiscriminatorWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getExtensibleModelWrongDiscriminator(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getExtensibleModelWrongDiscriminator(this.getEndpoint(), accept, + requestOptions, context)); } /** @@ -448,7 +476,8 @@ public Response getExtensibleModelMissingDiscriminatorWithResponse(R @ServiceMethod(returns = ReturnType.SINGLE) public Response getExtensibleModelWrongDiscriminatorWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getExtensibleModelWrongDiscriminatorSync(accept, requestOptions, Context.NONE); + return service.getExtensibleModelWrongDiscriminatorSync(this.getEndpoint(), accept, requestOptions, + Context.NONE); } /** @@ -473,7 +502,8 @@ public Response getExtensibleModelWrongDiscriminatorWithResponse(Req @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getFixedModelWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getFixedModel(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getFixedModel(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -497,7 +527,7 @@ public Mono> getFixedModelWithResponseAsync(RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response getFixedModelWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getFixedModelSync(accept, requestOptions, Context.NONE); + return service.getFixedModelSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -522,7 +552,8 @@ public Response getFixedModelWithResponse(RequestOptions requestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putFixedModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putFixedModel(contentType, input, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putFixedModel(this.getEndpoint(), contentType, input, requestOptions, context)); } /** @@ -547,7 +578,7 @@ public Mono> putFixedModelWithResponseAsync(BinaryData input, Req @ServiceMethod(returns = ReturnType.SINGLE) public Response putFixedModelWithResponse(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putFixedModelSync(contentType, input, requestOptions, Context.NONE); + return service.putFixedModelSync(this.getEndpoint(), contentType, input, requestOptions, Context.NONE); } /** @@ -572,8 +603,8 @@ public Response putFixedModelWithResponse(BinaryData input, RequestOptions public Mono> getFixedModelMissingDiscriminatorWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getFixedModelMissingDiscriminator(accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.getFixedModelMissingDiscriminator(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -597,7 +628,7 @@ public Response putFixedModelWithResponse(BinaryData input, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response getFixedModelMissingDiscriminatorWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getFixedModelMissingDiscriminatorSync(accept, requestOptions, Context.NONE); + return service.getFixedModelMissingDiscriminatorSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -622,8 +653,8 @@ public Response getFixedModelMissingDiscriminatorWithResponse(Reques @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getFixedModelWrongDiscriminatorWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getFixedModelWrongDiscriminator(accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.getFixedModelWrongDiscriminator(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -647,6 +678,6 @@ public Mono> getFixedModelWrongDiscriminatorWithResponseAsy @ServiceMethod(returns = ReturnType.SINGLE) public Response getFixedModelWrongDiscriminatorWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getFixedModelWrongDiscriminatorSync(accept, requestOptions, Context.NONE); + return service.getFixedModelWrongDiscriminatorSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/enumnesteddiscriminator/EnumNestedDiscriminatorClientBuilder.java b/typespec-tests/src/main/java/com/type/model/inheritance/enumnesteddiscriminator/EnumNestedDiscriminatorClientBuilder.java index ca6f9c6315..0b3300c939 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/enumnesteddiscriminator/EnumNestedDiscriminatorClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/enumnesteddiscriminator/EnumNestedDiscriminatorClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -42,7 +43,7 @@ @ServiceClientBuilder( serviceClients = { EnumNestedDiscriminatorClient.class, EnumNestedDiscriminatorAsyncClient.class }) public final class EnumNestedDiscriminatorClientBuilder implements HttpTrait, - ConfigurationTrait { + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -174,6 +175,22 @@ public EnumNestedDiscriminatorClientBuilder configuration(Configuration configur return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public EnumNestedDiscriminatorClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -201,8 +218,8 @@ public EnumNestedDiscriminatorClientBuilder retryPolicy(RetryPolicy retryPolicy) private EnumNestedDiscriminatorClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - EnumNestedDiscriminatorClientImpl client - = new EnumNestedDiscriminatorClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + EnumNestedDiscriminatorClientImpl client = new EnumNestedDiscriminatorClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -210,6 +227,7 @@ private EnumNestedDiscriminatorClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/enumnesteddiscriminator/implementation/EnumNestedDiscriminatorClientImpl.java b/typespec-tests/src/main/java/com/type/model/inheritance/enumnesteddiscriminator/implementation/EnumNestedDiscriminatorClientImpl.java index eec907b6e9..b98c4ecb03 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/enumnesteddiscriminator/implementation/EnumNestedDiscriminatorClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/enumnesteddiscriminator/implementation/EnumNestedDiscriminatorClientImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -41,6 +42,20 @@ public final class EnumNestedDiscriminatorClientImpl { */ private final EnumNestedDiscriminatorClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -71,19 +86,22 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of EnumNestedDiscriminatorClient client. + * + * @param endpoint Service host. */ - public EnumNestedDiscriminatorClientImpl() { + public EnumNestedDiscriminatorClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of EnumNestedDiscriminatorClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public EnumNestedDiscriminatorClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public EnumNestedDiscriminatorClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -91,10 +109,13 @@ public EnumNestedDiscriminatorClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public EnumNestedDiscriminatorClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public EnumNestedDiscriminatorClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.service = RestProxy.create(EnumNestedDiscriminatorClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -103,7 +124,7 @@ public EnumNestedDiscriminatorClientImpl(HttpPipeline httpPipeline, SerializerAd * The interface defining all the services for EnumNestedDiscriminatorClient to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "EnumNestedDiscrimina") public interface EnumNestedDiscriminatorClientService { @Get("/type/model/inheritance/enum-nested-discriminator/model") @@ -112,8 +133,8 @@ public interface EnumNestedDiscriminatorClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/model") @ExpectedResponses({ 200 }) @@ -121,8 +142,8 @@ Mono> getModel(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getModelSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-nested-discriminator/model") @ExpectedResponses({ 204 }) @@ -130,8 +151,9 @@ Response getModelSync(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putModel(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> putModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-nested-discriminator/model") @ExpectedResponses({ 204 }) @@ -139,8 +161,9 @@ Mono> putModel(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putModelSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response putModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/recursivemodel") @ExpectedResponses({ 200 }) @@ -148,8 +171,8 @@ Response putModelSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getRecursiveModel(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> getRecursiveModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/recursivemodel") @ExpectedResponses({ 200 }) @@ -157,8 +180,8 @@ Mono> getRecursiveModel(@HeaderParam("Accept") String accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getRecursiveModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getRecursiveModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-nested-discriminator/recursivemodel") @ExpectedResponses({ 204 }) @@ -166,8 +189,9 @@ Response getRecursiveModelSync(@HeaderParam("Accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putRecursiveModel(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> putRecursiveModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/enum-nested-discriminator/recursivemodel") @ExpectedResponses({ 204 }) @@ -175,8 +199,9 @@ Mono> putRecursiveModel(@HeaderParam("Content-Type") String conte @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putRecursiveModelSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response putRecursiveModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/missingdiscriminator") @ExpectedResponses({ 200 }) @@ -184,8 +209,8 @@ Response putRecursiveModelSync(@HeaderParam("Content-Type") String content @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getMissingDiscriminator(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> getMissingDiscriminator(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/missingdiscriminator") @ExpectedResponses({ 200 }) @@ -193,8 +218,8 @@ Mono> getMissingDiscriminator(@HeaderParam("Accept") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getMissingDiscriminatorSync(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Response getMissingDiscriminatorSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/wrongdiscriminator") @ExpectedResponses({ 200 }) @@ -202,8 +227,8 @@ Response getMissingDiscriminatorSync(@HeaderParam("Accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getWrongDiscriminator(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> getWrongDiscriminator(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/enum-nested-discriminator/wrongdiscriminator") @ExpectedResponses({ 200 }) @@ -211,8 +236,8 @@ Mono> getWrongDiscriminator(@HeaderParam("Accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getWrongDiscriminatorSync(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Response getWrongDiscriminatorSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -237,7 +262,7 @@ Response getWrongDiscriminatorSync(@HeaderParam("Accept") String acc @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getModelWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getModel(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getModel(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -262,7 +287,7 @@ public Mono> getModelWithResponseAsync(RequestOptions reque @ServiceMethod(returns = ReturnType.SINGLE) public Response getModelWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getModelSync(accept, requestOptions, Context.NONE); + return service.getModelSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -287,7 +312,8 @@ public Response getModelWithResponse(RequestOptions requestOptions) @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putModel(contentType, input, requestOptions, context)); + return FluxUtil + .withContext(context -> service.putModel(this.getEndpoint(), contentType, input, requestOptions, context)); } /** @@ -312,7 +338,7 @@ public Mono> putModelWithResponseAsync(BinaryData input, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response putModelWithResponse(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putModelSync(contentType, input, requestOptions, Context.NONE); + return service.putModelSync(this.getEndpoint(), contentType, input, requestOptions, Context.NONE); } /** @@ -337,7 +363,8 @@ public Response putModelWithResponse(BinaryData input, RequestOptions requ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getRecursiveModelWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getRecursiveModel(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getRecursiveModel(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -362,7 +389,7 @@ public Mono> getRecursiveModelWithResponseAsync(RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response getRecursiveModelWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getRecursiveModelSync(accept, requestOptions, Context.NONE); + return service.getRecursiveModelSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -387,7 +414,8 @@ public Response getRecursiveModelWithResponse(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putRecursiveModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putRecursiveModel(contentType, input, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putRecursiveModel(this.getEndpoint(), contentType, input, requestOptions, context)); } /** @@ -412,7 +440,7 @@ public Mono> putRecursiveModelWithResponseAsync(BinaryData input, @ServiceMethod(returns = ReturnType.SINGLE) public Response putRecursiveModelWithResponse(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putRecursiveModelSync(contentType, input, requestOptions, Context.NONE); + return service.putRecursiveModelSync(this.getEndpoint(), contentType, input, requestOptions, Context.NONE); } /** @@ -437,7 +465,8 @@ public Response putRecursiveModelWithResponse(BinaryData input, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getMissingDiscriminatorWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getMissingDiscriminator(accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.getMissingDiscriminator(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -462,7 +491,7 @@ public Mono> getMissingDiscriminatorWithResponseAsync(Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response getMissingDiscriminatorWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getMissingDiscriminatorSync(accept, requestOptions, Context.NONE); + return service.getMissingDiscriminatorSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -487,7 +516,8 @@ public Response getMissingDiscriminatorWithResponse(RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWrongDiscriminatorWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getWrongDiscriminator(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getWrongDiscriminator(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -512,6 +542,6 @@ public Mono> getWrongDiscriminatorWithResponseAsync(Request @ServiceMethod(returns = ReturnType.SINGLE) public Response getWrongDiscriminatorWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getWrongDiscriminatorSync(accept, requestOptions, Context.NONE); + return service.getWrongDiscriminatorSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/nesteddiscriminator/NestedDiscriminatorClientBuilder.java b/typespec-tests/src/main/java/com/type/model/inheritance/nesteddiscriminator/NestedDiscriminatorClientBuilder.java index e99a536486..2859120a39 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/nesteddiscriminator/NestedDiscriminatorClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/nesteddiscriminator/NestedDiscriminatorClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,8 +41,8 @@ * A builder for creating a new instance of the NestedDiscriminatorClient type. */ @ServiceClientBuilder(serviceClients = { NestedDiscriminatorClient.class, NestedDiscriminatorAsyncClient.class }) -public final class NestedDiscriminatorClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class NestedDiscriminatorClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -173,6 +174,22 @@ public NestedDiscriminatorClientBuilder configuration(Configuration configuratio return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public NestedDiscriminatorClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -200,8 +217,8 @@ public NestedDiscriminatorClientBuilder retryPolicy(RetryPolicy retryPolicy) { private NestedDiscriminatorClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - NestedDiscriminatorClientImpl client - = new NestedDiscriminatorClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + NestedDiscriminatorClientImpl client = new NestedDiscriminatorClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -209,6 +226,7 @@ private NestedDiscriminatorClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/nesteddiscriminator/implementation/NestedDiscriminatorClientImpl.java b/typespec-tests/src/main/java/com/type/model/inheritance/nesteddiscriminator/implementation/NestedDiscriminatorClientImpl.java index b6b85a870f..7b9917ffe7 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/nesteddiscriminator/implementation/NestedDiscriminatorClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/nesteddiscriminator/implementation/NestedDiscriminatorClientImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -41,6 +42,20 @@ public final class NestedDiscriminatorClientImpl { */ private final NestedDiscriminatorClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -71,19 +86,22 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of NestedDiscriminatorClient client. + * + * @param endpoint Service host. */ - public NestedDiscriminatorClientImpl() { + public NestedDiscriminatorClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of NestedDiscriminatorClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public NestedDiscriminatorClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public NestedDiscriminatorClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -91,10 +109,13 @@ public NestedDiscriminatorClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public NestedDiscriminatorClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public NestedDiscriminatorClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.service = RestProxy.create(NestedDiscriminatorClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -103,7 +124,7 @@ public NestedDiscriminatorClientImpl(HttpPipeline httpPipeline, SerializerAdapte * The interface defining all the services for NestedDiscriminatorClient to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "NestedDiscriminatorC") public interface NestedDiscriminatorClientService { @Get("/type/model/inheritance/nested-discriminator/model") @@ -112,8 +133,8 @@ public interface NestedDiscriminatorClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/model") @ExpectedResponses({ 200 }) @@ -121,8 +142,8 @@ Mono> getModel(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getModelSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/nested-discriminator/model") @ExpectedResponses({ 204 }) @@ -130,8 +151,9 @@ Response getModelSync(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putModel(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> putModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/nested-discriminator/model") @ExpectedResponses({ 204 }) @@ -139,8 +161,9 @@ Mono> putModel(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putModelSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response putModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/recursivemodel") @ExpectedResponses({ 200 }) @@ -148,8 +171,8 @@ Response putModelSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getRecursiveModel(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> getRecursiveModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/recursivemodel") @ExpectedResponses({ 200 }) @@ -157,8 +180,8 @@ Mono> getRecursiveModel(@HeaderParam("Accept") String accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getRecursiveModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getRecursiveModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/nested-discriminator/recursivemodel") @ExpectedResponses({ 204 }) @@ -166,8 +189,9 @@ Response getRecursiveModelSync(@HeaderParam("Accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putRecursiveModel(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> putRecursiveModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/nested-discriminator/recursivemodel") @ExpectedResponses({ 204 }) @@ -175,8 +199,9 @@ Mono> putRecursiveModel(@HeaderParam("Content-Type") String conte @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putRecursiveModelSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response putRecursiveModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/missingdiscriminator") @ExpectedResponses({ 200 }) @@ -184,8 +209,8 @@ Response putRecursiveModelSync(@HeaderParam("Content-Type") String content @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getMissingDiscriminator(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> getMissingDiscriminator(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/missingdiscriminator") @ExpectedResponses({ 200 }) @@ -193,8 +218,8 @@ Mono> getMissingDiscriminator(@HeaderParam("Accept") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getMissingDiscriminatorSync(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Response getMissingDiscriminatorSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/wrongdiscriminator") @ExpectedResponses({ 200 }) @@ -202,8 +227,8 @@ Response getMissingDiscriminatorSync(@HeaderParam("Accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getWrongDiscriminator(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> getWrongDiscriminator(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/nested-discriminator/wrongdiscriminator") @ExpectedResponses({ 200 }) @@ -211,8 +236,8 @@ Mono> getWrongDiscriminator(@HeaderParam("Accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getWrongDiscriminatorSync(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Response getWrongDiscriminatorSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -237,7 +262,7 @@ Response getWrongDiscriminatorSync(@HeaderParam("Accept") String acc @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getModelWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getModel(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getModel(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -262,7 +287,7 @@ public Mono> getModelWithResponseAsync(RequestOptions reque @ServiceMethod(returns = ReturnType.SINGLE) public Response getModelWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getModelSync(accept, requestOptions, Context.NONE); + return service.getModelSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -287,7 +312,8 @@ public Response getModelWithResponse(RequestOptions requestOptions) @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putModel(contentType, input, requestOptions, context)); + return FluxUtil + .withContext(context -> service.putModel(this.getEndpoint(), contentType, input, requestOptions, context)); } /** @@ -312,7 +338,7 @@ public Mono> putModelWithResponseAsync(BinaryData input, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response putModelWithResponse(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putModelSync(contentType, input, requestOptions, Context.NONE); + return service.putModelSync(this.getEndpoint(), contentType, input, requestOptions, Context.NONE); } /** @@ -337,7 +363,8 @@ public Response putModelWithResponse(BinaryData input, RequestOptions requ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getRecursiveModelWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getRecursiveModel(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getRecursiveModel(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -362,7 +389,7 @@ public Mono> getRecursiveModelWithResponseAsync(RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response getRecursiveModelWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getRecursiveModelSync(accept, requestOptions, Context.NONE); + return service.getRecursiveModelSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -387,7 +414,8 @@ public Response getRecursiveModelWithResponse(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putRecursiveModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putRecursiveModel(contentType, input, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putRecursiveModel(this.getEndpoint(), contentType, input, requestOptions, context)); } /** @@ -412,7 +440,7 @@ public Mono> putRecursiveModelWithResponseAsync(BinaryData input, @ServiceMethod(returns = ReturnType.SINGLE) public Response putRecursiveModelWithResponse(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putRecursiveModelSync(contentType, input, requestOptions, Context.NONE); + return service.putRecursiveModelSync(this.getEndpoint(), contentType, input, requestOptions, Context.NONE); } /** @@ -437,7 +465,8 @@ public Response putRecursiveModelWithResponse(BinaryData input, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getMissingDiscriminatorWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getMissingDiscriminator(accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.getMissingDiscriminator(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -462,7 +491,7 @@ public Mono> getMissingDiscriminatorWithResponseAsync(Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response getMissingDiscriminatorWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getMissingDiscriminatorSync(accept, requestOptions, Context.NONE); + return service.getMissingDiscriminatorSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -487,7 +516,8 @@ public Response getMissingDiscriminatorWithResponse(RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWrongDiscriminatorWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getWrongDiscriminator(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getWrongDiscriminator(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -512,6 +542,6 @@ public Mono> getWrongDiscriminatorWithResponseAsync(Request @ServiceMethod(returns = ReturnType.SINGLE) public Response getWrongDiscriminatorWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getWrongDiscriminatorSync(accept, requestOptions, Context.NONE); + return service.getWrongDiscriminatorSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/notdiscriminated/NotDiscriminatedClientBuilder.java b/typespec-tests/src/main/java/com/type/model/inheritance/notdiscriminated/NotDiscriminatedClientBuilder.java index d9143fe96e..e0de40fca3 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/notdiscriminated/NotDiscriminatedClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/notdiscriminated/NotDiscriminatedClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,8 +41,8 @@ * A builder for creating a new instance of the NotDiscriminatedClient type. */ @ServiceClientBuilder(serviceClients = { NotDiscriminatedClient.class, NotDiscriminatedAsyncClient.class }) -public final class NotDiscriminatedClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class NotDiscriminatedClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -173,6 +174,22 @@ public NotDiscriminatedClientBuilder configuration(Configuration configuration) return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public NotDiscriminatedClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -200,8 +217,8 @@ public NotDiscriminatedClientBuilder retryPolicy(RetryPolicy retryPolicy) { private NotDiscriminatedClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - NotDiscriminatedClientImpl client - = new NotDiscriminatedClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + NotDiscriminatedClientImpl client = new NotDiscriminatedClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -209,6 +226,7 @@ private NotDiscriminatedClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/notdiscriminated/implementation/NotDiscriminatedClientImpl.java b/typespec-tests/src/main/java/com/type/model/inheritance/notdiscriminated/implementation/NotDiscriminatedClientImpl.java index e1917b4818..8bbbad56a7 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/notdiscriminated/implementation/NotDiscriminatedClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/notdiscriminated/implementation/NotDiscriminatedClientImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; @@ -42,6 +43,20 @@ public final class NotDiscriminatedClientImpl { */ private final NotDiscriminatedClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -72,19 +87,22 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of NotDiscriminatedClient client. + * + * @param endpoint Service host. */ - public NotDiscriminatedClientImpl() { + public NotDiscriminatedClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of NotDiscriminatedClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public NotDiscriminatedClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public NotDiscriminatedClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -92,10 +110,12 @@ public NotDiscriminatedClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public NotDiscriminatedClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public NotDiscriminatedClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.service = RestProxy.create(NotDiscriminatedClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -104,7 +124,7 @@ public NotDiscriminatedClientImpl(HttpPipeline httpPipeline, SerializerAdapter s * The interface defining all the services for NotDiscriminatedClient to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "NotDiscriminatedClie") public interface NotDiscriminatedClientService { @Post("/type/model/inheritance/not-discriminated/valid") @@ -113,8 +133,9 @@ public interface NotDiscriminatedClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> postValid(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> postValid(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Post("/type/model/inheritance/not-discriminated/valid") @ExpectedResponses({ 204 }) @@ -122,8 +143,9 @@ Mono> postValid(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postValidSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response postValidSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/not-discriminated/valid") @ExpectedResponses({ 200 }) @@ -131,8 +153,8 @@ Response postValidSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getValid(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getValid(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/not-discriminated/valid") @ExpectedResponses({ 200 }) @@ -140,8 +162,8 @@ Mono> getValid(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getValidSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getValidSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/not-discriminated/valid") @ExpectedResponses({ 200 }) @@ -149,9 +171,9 @@ Response getValidSync(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putValid(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, - RequestOptions requestOptions, Context context); + Mono> putValid(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/not-discriminated/valid") @ExpectedResponses({ 200 }) @@ -159,9 +181,9 @@ Mono> putValid(@HeaderParam("Content-Type") String contentT @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putValidSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, - RequestOptions requestOptions, Context context); + Response putValidSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); } /** @@ -187,7 +209,8 @@ Response putValidSync(@HeaderParam("Content-Type") String contentTyp @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postValidWithResponseAsync(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.postValid(contentType, input, requestOptions, context)); + return FluxUtil + .withContext(context -> service.postValid(this.getEndpoint(), contentType, input, requestOptions, context)); } /** @@ -213,7 +236,7 @@ public Mono> postValidWithResponseAsync(BinaryData input, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response postValidWithResponse(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.postValidSync(contentType, input, requestOptions, Context.NONE); + return service.postValidSync(this.getEndpoint(), contentType, input, requestOptions, Context.NONE); } /** @@ -239,7 +262,7 @@ public Response postValidWithResponse(BinaryData input, RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getValidWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getValid(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getValid(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -264,7 +287,7 @@ public Mono> getValidWithResponseAsync(RequestOptions reque @ServiceMethod(returns = ReturnType.SINGLE) public Response getValidWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getValidSync(accept, requestOptions, Context.NONE); + return service.getValidSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -302,7 +325,8 @@ public Response getValidWithResponse(RequestOptions requestOptions) public Mono> putValidWithResponseAsync(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putValid(contentType, accept, input, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putValid(this.getEndpoint(), contentType, accept, input, requestOptions, context)); } /** @@ -339,6 +363,6 @@ public Mono> putValidWithResponseAsync(BinaryData input, Re public Response putValidWithResponse(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.putValidSync(contentType, accept, input, requestOptions, Context.NONE); + return service.putValidSync(this.getEndpoint(), contentType, accept, input, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/recursive/RecursiveClientBuilder.java b/typespec-tests/src/main/java/com/type/model/inheritance/recursive/RecursiveClientBuilder.java index b5a98ea2e0..9f61dd0b56 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/recursive/RecursiveClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/recursive/RecursiveClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,8 +41,8 @@ * A builder for creating a new instance of the RecursiveClient type. */ @ServiceClientBuilder(serviceClients = { RecursiveClient.class, RecursiveAsyncClient.class }) -public final class RecursiveClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class RecursiveClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -173,6 +174,22 @@ public RecursiveClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public RecursiveClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -201,7 +218,7 @@ private RecursiveClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); RecursiveClientImpl client - = new RecursiveClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + = new RecursiveClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -209,6 +226,7 @@ private RecursiveClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/recursive/implementation/RecursiveClientImpl.java b/typespec-tests/src/main/java/com/type/model/inheritance/recursive/implementation/RecursiveClientImpl.java index c322a2eabe..97f4a67141 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/recursive/implementation/RecursiveClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/recursive/implementation/RecursiveClientImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -41,6 +42,20 @@ public final class RecursiveClientImpl { */ private final RecursiveClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -71,19 +86,22 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of RecursiveClient client. + * + * @param endpoint Service host. */ - public RecursiveClientImpl() { + public RecursiveClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of RecursiveClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public RecursiveClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public RecursiveClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -91,10 +109,12 @@ public RecursiveClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public RecursiveClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public RecursiveClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.service = RestProxy.create(RecursiveClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -102,7 +122,7 @@ public RecursiveClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializ * The interface defining all the services for RecursiveClient to be used by the proxy service to perform REST * calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "RecursiveClient") public interface RecursiveClientService { @Put("/type/model/inheritance/recursive") @@ -111,8 +131,9 @@ public interface RecursiveClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/recursive") @ExpectedResponses({ 204 }) @@ -120,7 +141,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/recursive") @@ -129,8 +150,8 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/recursive") @ExpectedResponses({ 200 }) @@ -138,8 +159,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); } /** @@ -166,7 +187,8 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, input, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.getEndpoint(), contentType, input, requestOptions, context)); } /** @@ -193,7 +215,7 @@ public Mono> putWithResponseAsync(BinaryData input, RequestOption @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, input, requestOptions, Context.NONE); + return service.putSync(this.getEndpoint(), contentType, input, requestOptions, Context.NONE); } /** @@ -219,7 +241,7 @@ public Response putWithResponse(BinaryData input, RequestOptions requestOp @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -245,6 +267,6 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/singlediscriminator/SingleDiscriminatorClientBuilder.java b/typespec-tests/src/main/java/com/type/model/inheritance/singlediscriminator/SingleDiscriminatorClientBuilder.java index aee0efa4bb..ce48c6d61b 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/singlediscriminator/SingleDiscriminatorClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/singlediscriminator/SingleDiscriminatorClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,8 +41,8 @@ * A builder for creating a new instance of the SingleDiscriminatorClient type. */ @ServiceClientBuilder(serviceClients = { SingleDiscriminatorClient.class, SingleDiscriminatorAsyncClient.class }) -public final class SingleDiscriminatorClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class SingleDiscriminatorClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -173,6 +174,22 @@ public SingleDiscriminatorClientBuilder configuration(Configuration configuratio return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public SingleDiscriminatorClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -200,8 +217,8 @@ public SingleDiscriminatorClientBuilder retryPolicy(RetryPolicy retryPolicy) { private SingleDiscriminatorClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - SingleDiscriminatorClientImpl client - = new SingleDiscriminatorClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + SingleDiscriminatorClientImpl client = new SingleDiscriminatorClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -209,6 +226,7 @@ private SingleDiscriminatorClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/singlediscriminator/implementation/SingleDiscriminatorClientImpl.java b/typespec-tests/src/main/java/com/type/model/inheritance/singlediscriminator/implementation/SingleDiscriminatorClientImpl.java index fa7e8515da..5552826260 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/singlediscriminator/implementation/SingleDiscriminatorClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/singlediscriminator/implementation/SingleDiscriminatorClientImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -41,6 +42,20 @@ public final class SingleDiscriminatorClientImpl { */ private final SingleDiscriminatorClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -71,19 +86,22 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of SingleDiscriminatorClient client. + * + * @param endpoint Service host. */ - public SingleDiscriminatorClientImpl() { + public SingleDiscriminatorClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of SingleDiscriminatorClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public SingleDiscriminatorClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public SingleDiscriminatorClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -91,10 +109,13 @@ public SingleDiscriminatorClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public SingleDiscriminatorClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public SingleDiscriminatorClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.service = RestProxy.create(SingleDiscriminatorClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -103,7 +124,7 @@ public SingleDiscriminatorClientImpl(HttpPipeline httpPipeline, SerializerAdapte * The interface defining all the services for SingleDiscriminatorClient to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "SingleDiscriminatorC") public interface SingleDiscriminatorClientService { @Get("/type/model/inheritance/single-discriminator/model") @@ -112,8 +133,8 @@ public interface SingleDiscriminatorClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/model") @ExpectedResponses({ 200 }) @@ -121,8 +142,8 @@ Mono> getModel(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getModelSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/single-discriminator/model") @ExpectedResponses({ 204 }) @@ -130,8 +151,9 @@ Response getModelSync(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putModel(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> putModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/single-discriminator/model") @ExpectedResponses({ 204 }) @@ -139,8 +161,9 @@ Mono> putModel(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putModelSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response putModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/recursivemodel") @ExpectedResponses({ 200 }) @@ -148,8 +171,8 @@ Response putModelSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getRecursiveModel(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> getRecursiveModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/recursivemodel") @ExpectedResponses({ 200 }) @@ -157,8 +180,8 @@ Mono> getRecursiveModel(@HeaderParam("Accept") String accep @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getRecursiveModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getRecursiveModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/single-discriminator/recursivemodel") @ExpectedResponses({ 204 }) @@ -166,8 +189,9 @@ Response getRecursiveModelSync(@HeaderParam("Accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putRecursiveModel(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> putRecursiveModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Put("/type/model/inheritance/single-discriminator/recursivemodel") @ExpectedResponses({ 204 }) @@ -175,8 +199,9 @@ Mono> putRecursiveModel(@HeaderParam("Content-Type") String conte @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putRecursiveModelSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response putRecursiveModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/missingdiscriminator") @ExpectedResponses({ 200 }) @@ -184,8 +209,8 @@ Response putRecursiveModelSync(@HeaderParam("Content-Type") String content @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getMissingDiscriminator(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> getMissingDiscriminator(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/missingdiscriminator") @ExpectedResponses({ 200 }) @@ -193,8 +218,8 @@ Mono> getMissingDiscriminator(@HeaderParam("Accept") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getMissingDiscriminatorSync(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Response getMissingDiscriminatorSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/wrongdiscriminator") @ExpectedResponses({ 200 }) @@ -202,8 +227,8 @@ Response getMissingDiscriminatorSync(@HeaderParam("Accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getWrongDiscriminator(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> getWrongDiscriminator(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/wrongdiscriminator") @ExpectedResponses({ 200 }) @@ -211,8 +236,8 @@ Mono> getWrongDiscriminator(@HeaderParam("Accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getWrongDiscriminatorSync(@HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Response getWrongDiscriminatorSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/legacy-model") @ExpectedResponses({ 200 }) @@ -220,8 +245,8 @@ Response getWrongDiscriminatorSync(@HeaderParam("Accept") String acc @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getLegacyModel(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getLegacyModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/model/inheritance/single-discriminator/legacy-model") @ExpectedResponses({ 200 }) @@ -229,8 +254,8 @@ Mono> getLegacyModel(@HeaderParam("Accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getLegacyModelSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getLegacyModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -255,7 +280,7 @@ Response getLegacyModelSync(@HeaderParam("Accept") String accept, Re @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getModelWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getModel(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getModel(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -280,7 +305,7 @@ public Mono> getModelWithResponseAsync(RequestOptions reque @ServiceMethod(returns = ReturnType.SINGLE) public Response getModelWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getModelSync(accept, requestOptions, Context.NONE); + return service.getModelSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -305,7 +330,8 @@ public Response getModelWithResponse(RequestOptions requestOptions) @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putModel(contentType, input, requestOptions, context)); + return FluxUtil + .withContext(context -> service.putModel(this.getEndpoint(), contentType, input, requestOptions, context)); } /** @@ -330,7 +356,7 @@ public Mono> putModelWithResponseAsync(BinaryData input, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response putModelWithResponse(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putModelSync(contentType, input, requestOptions, Context.NONE); + return service.putModelSync(this.getEndpoint(), contentType, input, requestOptions, Context.NONE); } /** @@ -355,7 +381,8 @@ public Response putModelWithResponse(BinaryData input, RequestOptions requ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getRecursiveModelWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getRecursiveModel(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getRecursiveModel(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -380,7 +407,7 @@ public Mono> getRecursiveModelWithResponseAsync(RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response getRecursiveModelWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getRecursiveModelSync(accept, requestOptions, Context.NONE); + return service.getRecursiveModelSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -405,7 +432,8 @@ public Response getRecursiveModelWithResponse(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putRecursiveModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putRecursiveModel(contentType, input, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putRecursiveModel(this.getEndpoint(), contentType, input, requestOptions, context)); } /** @@ -430,7 +458,7 @@ public Mono> putRecursiveModelWithResponseAsync(BinaryData input, @ServiceMethod(returns = ReturnType.SINGLE) public Response putRecursiveModelWithResponse(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putRecursiveModelSync(contentType, input, requestOptions, Context.NONE); + return service.putRecursiveModelSync(this.getEndpoint(), contentType, input, requestOptions, Context.NONE); } /** @@ -455,7 +483,8 @@ public Response putRecursiveModelWithResponse(BinaryData input, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getMissingDiscriminatorWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getMissingDiscriminator(accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.getMissingDiscriminator(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -480,7 +509,7 @@ public Mono> getMissingDiscriminatorWithResponseAsync(Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response getMissingDiscriminatorWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getMissingDiscriminatorSync(accept, requestOptions, Context.NONE); + return service.getMissingDiscriminatorSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -505,7 +534,8 @@ public Response getMissingDiscriminatorWithResponse(RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWrongDiscriminatorWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getWrongDiscriminator(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getWrongDiscriminator(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -530,7 +560,7 @@ public Mono> getWrongDiscriminatorWithResponseAsync(Request @ServiceMethod(returns = ReturnType.SINGLE) public Response getWrongDiscriminatorWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getWrongDiscriminatorSync(accept, requestOptions, Context.NONE); + return service.getWrongDiscriminatorSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -555,7 +585,8 @@ public Response getWrongDiscriminatorWithResponse(RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getLegacyModelWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getLegacyModel(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getLegacyModel(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -579,6 +610,6 @@ public Mono> getLegacyModelWithResponseAsync(RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response getLegacyModelWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getLegacyModelSync(accept, requestOptions, Context.NONE); + return service.getLegacyModelSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/model/usage/UsageClientBuilder.java b/typespec-tests/src/main/java/com/type/model/usage/UsageClientBuilder.java index 1ee385947e..dab14b45b6 100644 --- a/typespec-tests/src/main/java/com/type/model/usage/UsageClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/model/usage/UsageClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,7 +41,8 @@ * A builder for creating a new instance of the UsageClient type. */ @ServiceClientBuilder(serviceClients = { UsageClient.class, UsageAsyncClient.class }) -public final class UsageClientBuilder implements HttpTrait, ConfigurationTrait { +public final class UsageClientBuilder implements HttpTrait, ConfigurationTrait, + EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -171,6 +173,22 @@ public UsageClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public UsageClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -198,7 +216,8 @@ public UsageClientBuilder retryPolicy(RetryPolicy retryPolicy) { private UsageClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - UsageClientImpl client = new UsageClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + UsageClientImpl client + = new UsageClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -206,6 +225,7 @@ private UsageClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/model/usage/implementation/UsageClientImpl.java b/typespec-tests/src/main/java/com/type/model/usage/implementation/UsageClientImpl.java index 49ac156331..c39f723ea6 100644 --- a/typespec-tests/src/main/java/com/type/model/usage/implementation/UsageClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/usage/implementation/UsageClientImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -41,6 +42,20 @@ public final class UsageClientImpl { */ private final UsageClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -71,19 +86,22 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of UsageClient client. + * + * @param endpoint Service host. */ - public UsageClientImpl() { + public UsageClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of UsageClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public UsageClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public UsageClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -91,17 +109,19 @@ public UsageClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public UsageClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public UsageClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.service = RestProxy.create(UsageClientService.class, this.httpPipeline, this.getSerializerAdapter()); } /** * The interface defining all the services for UsageClient to be used by the proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "UsageClient") public interface UsageClientService { @Post("/type/model/usage/input") @@ -110,8 +130,9 @@ public interface UsageClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> input(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> input(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Post("/type/model/usage/input") @ExpectedResponses({ 204 }) @@ -119,8 +140,9 @@ Mono> input(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response inputSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response inputSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Get("/type/model/usage/output") @ExpectedResponses({ 200 }) @@ -128,8 +150,8 @@ Response inputSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> output(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> output(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/model/usage/output") @ExpectedResponses({ 200 }) @@ -137,8 +159,8 @@ Mono> output(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response outputSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response outputSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Post("/type/model/usage/input-output") @ExpectedResponses({ 200 }) @@ -146,9 +168,9 @@ Response outputSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> inputAndOutput(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Mono> inputAndOutput(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/type/model/usage/input-output") @ExpectedResponses({ 200 }) @@ -156,9 +178,9 @@ Mono> inputAndOutput(@HeaderParam("Content-Type") String co @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response inputAndOutputSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); + Response inputAndOutputSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } /** @@ -182,7 +204,8 @@ Response inputAndOutputSync(@HeaderParam("Content-Type") String cont @ServiceMethod(returns = ReturnType.SINGLE) public Mono> inputWithResponseAsync(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.input(contentType, input, requestOptions, context)); + return FluxUtil + .withContext(context -> service.input(this.getEndpoint(), contentType, input, requestOptions, context)); } /** @@ -206,7 +229,7 @@ public Mono> inputWithResponseAsync(BinaryData input, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response inputWithResponse(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.inputSync(contentType, input, requestOptions, Context.NONE); + return service.inputSync(this.getEndpoint(), contentType, input, requestOptions, Context.NONE); } /** @@ -230,7 +253,7 @@ public Response inputWithResponse(BinaryData input, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> outputWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.output(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.output(this.getEndpoint(), accept, requestOptions, context)); } /** @@ -253,7 +276,7 @@ public Mono> outputWithResponseAsync(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Response outputWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.outputSync(accept, requestOptions, Context.NONE); + return service.outputSync(this.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -287,8 +310,8 @@ public Response outputWithResponse(RequestOptions requestOptions) { public Mono> inputAndOutputWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.inputAndOutput(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.inputAndOutput(this.getEndpoint(), contentType, accept, body, requestOptions, context)); } /** @@ -321,6 +344,6 @@ public Mono> inputAndOutputWithResponseAsync(BinaryData bod public Response inputAndOutputWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.inputAndOutputSync(contentType, accept, body, requestOptions, Context.NONE); + return service.inputAndOutputSync(this.getEndpoint(), contentType, accept, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/model/visibility/VisibilityClientBuilder.java b/typespec-tests/src/main/java/com/type/model/visibility/VisibilityClientBuilder.java index 0ff1694036..5877c0ceed 100644 --- a/typespec-tests/src/main/java/com/type/model/visibility/VisibilityClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/model/visibility/VisibilityClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,8 +41,8 @@ * A builder for creating a new instance of the VisibilityClient type. */ @ServiceClientBuilder(serviceClients = { VisibilityClient.class, VisibilityAsyncClient.class }) -public final class VisibilityClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class VisibilityClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -172,6 +173,22 @@ public VisibilityClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public VisibilityClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -200,7 +217,7 @@ private VisibilityClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); VisibilityClientImpl client - = new VisibilityClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + = new VisibilityClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -208,6 +225,7 @@ private VisibilityClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/model/visibility/implementation/VisibilityClientImpl.java b/typespec-tests/src/main/java/com/type/model/visibility/implementation/VisibilityClientImpl.java index c1d9aec0b1..323e87eedb 100644 --- a/typespec-tests/src/main/java/com/type/model/visibility/implementation/VisibilityClientImpl.java +++ b/typespec-tests/src/main/java/com/type/model/visibility/implementation/VisibilityClientImpl.java @@ -11,6 +11,7 @@ import com.azure.core.annotation.Head; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; @@ -45,6 +46,20 @@ public final class VisibilityClientImpl { */ private final VisibilityClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -75,19 +90,22 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of VisibilityClient client. + * + * @param endpoint Service host. */ - public VisibilityClientImpl() { + public VisibilityClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of VisibilityClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public VisibilityClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public VisibilityClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -95,10 +113,12 @@ public VisibilityClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public VisibilityClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public VisibilityClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.service = RestProxy.create(VisibilityClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -106,7 +126,7 @@ public VisibilityClientImpl(HttpPipeline httpPipeline, SerializerAdapter seriali * The interface defining all the services for VisibilityClient to be used by the proxy service to perform REST * calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "VisibilityClient") public interface VisibilityClientService { @Get("/type/model/visibility") @@ -115,9 +135,9 @@ public interface VisibilityClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getModel(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, - RequestOptions requestOptions, Context context); + Mono> getModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Get("/type/model/visibility") @ExpectedResponses({ 200 }) @@ -125,9 +145,9 @@ Mono> getModel(@HeaderParam("Content-Type") String contentT @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getModelSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, - RequestOptions requestOptions, Context context); + Response getModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Head("/type/model/visibility") @ExpectedResponses({ 200 }) @@ -135,8 +155,9 @@ Response getModelSync(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> headModel(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> headModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Head("/type/model/visibility") @ExpectedResponses({ 200 }) @@ -144,8 +165,9 @@ Mono> headModel(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response headModelSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response headModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Put("/type/model/visibility") @ExpectedResponses({ 204 }) @@ -153,8 +175,9 @@ Response headModelSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putModel(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> putModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Put("/type/model/visibility") @ExpectedResponses({ 204 }) @@ -162,8 +185,9 @@ Mono> putModel(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putModelSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response putModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Patch("/type/model/visibility") @ExpectedResponses({ 204 }) @@ -171,8 +195,9 @@ Response putModelSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> patchModel(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> patchModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Patch("/type/model/visibility") @ExpectedResponses({ 204 }) @@ -180,8 +205,9 @@ Mono> patchModel(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response patchModelSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response patchModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Post("/type/model/visibility") @ExpectedResponses({ 204 }) @@ -189,8 +215,9 @@ Response patchModelSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> postModel(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> postModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Post("/type/model/visibility") @ExpectedResponses({ 204 }) @@ -198,8 +225,9 @@ Mono> postModel(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response postModelSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response postModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Delete("/type/model/visibility") @ExpectedResponses({ 204 }) @@ -207,8 +235,9 @@ Response postModelSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteModel(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Mono> deleteModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Delete("/type/model/visibility") @ExpectedResponses({ 204 }) @@ -216,8 +245,9 @@ Mono> deleteModel(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteModelSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); + Response deleteModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData input, + RequestOptions requestOptions, Context context); @Put("/type/model/visibility/readonlyroundtrip") @ExpectedResponses({ 200 }) @@ -225,9 +255,9 @@ Response deleteModelSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putReadOnlyModel(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, - RequestOptions requestOptions, Context context); + Mono> putReadOnlyModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/type/model/visibility/readonlyroundtrip") @ExpectedResponses({ 200 }) @@ -235,9 +265,9 @@ Mono> putReadOnlyModel(@HeaderParam("Content-Type") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putReadOnlyModelSync(@HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, - RequestOptions requestOptions, Context context); + Response putReadOnlyModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); } /** @@ -287,7 +317,8 @@ Response putReadOnlyModelSync(@HeaderParam("Content-Type") String co public Mono> getModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getModel(contentType, accept, input, requestOptions, context)); + return FluxUtil.withContext( + context -> service.getModel(this.getEndpoint(), contentType, accept, input, requestOptions, context)); } /** @@ -336,7 +367,7 @@ public Mono> getModelWithResponseAsync(BinaryData input, Re public Response getModelWithResponse(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.getModelSync(contentType, accept, input, requestOptions, Context.NONE); + return service.getModelSync(this.getEndpoint(), contentType, accept, input, requestOptions, Context.NONE); } /** @@ -368,7 +399,8 @@ public Response getModelWithResponse(BinaryData input, RequestOption @ServiceMethod(returns = ReturnType.SINGLE) public Mono> headModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.headModel(contentType, input, requestOptions, context)); + return FluxUtil + .withContext(context -> service.headModel(this.getEndpoint(), contentType, input, requestOptions, context)); } /** @@ -400,7 +432,7 @@ public Mono> headModelWithResponseAsync(BinaryData input, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response headModelWithResponse(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.headModelSync(contentType, input, requestOptions, Context.NONE); + return service.headModelSync(this.getEndpoint(), contentType, input, requestOptions, Context.NONE); } /** @@ -432,7 +464,8 @@ public Response headModelWithResponse(BinaryData input, RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putModel(contentType, input, requestOptions, context)); + return FluxUtil + .withContext(context -> service.putModel(this.getEndpoint(), contentType, input, requestOptions, context)); } /** @@ -464,7 +497,7 @@ public Mono> putModelWithResponseAsync(BinaryData input, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response putModelWithResponse(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putModelSync(contentType, input, requestOptions, Context.NONE); + return service.putModelSync(this.getEndpoint(), contentType, input, requestOptions, Context.NONE); } /** @@ -496,7 +529,8 @@ public Response putModelWithResponse(BinaryData input, RequestOptions requ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.patchModel(contentType, input, requestOptions, context)); + return FluxUtil.withContext( + context -> service.patchModel(this.getEndpoint(), contentType, input, requestOptions, context)); } /** @@ -528,7 +562,7 @@ public Mono> patchModelWithResponseAsync(BinaryData input, Reques @ServiceMethod(returns = ReturnType.SINGLE) public Response patchModelWithResponse(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.patchModelSync(contentType, input, requestOptions, Context.NONE); + return service.patchModelSync(this.getEndpoint(), contentType, input, requestOptions, Context.NONE); } /** @@ -560,7 +594,8 @@ public Response patchModelWithResponse(BinaryData input, RequestOptions re @ServiceMethod(returns = ReturnType.SINGLE) public Mono> postModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.postModel(contentType, input, requestOptions, context)); + return FluxUtil + .withContext(context -> service.postModel(this.getEndpoint(), contentType, input, requestOptions, context)); } /** @@ -592,7 +627,7 @@ public Mono> postModelWithResponseAsync(BinaryData input, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response postModelWithResponse(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.postModelSync(contentType, input, requestOptions, Context.NONE); + return service.postModelSync(this.getEndpoint(), contentType, input, requestOptions, Context.NONE); } /** @@ -624,7 +659,8 @@ public Response postModelWithResponse(BinaryData input, RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.deleteModel(contentType, input, requestOptions, context)); + return FluxUtil.withContext( + context -> service.deleteModel(this.getEndpoint(), contentType, input, requestOptions, context)); } /** @@ -656,7 +692,7 @@ public Mono> deleteModelWithResponseAsync(BinaryData input, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteModelWithResponse(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.deleteModelSync(contentType, input, requestOptions, Context.NONE); + return service.deleteModelSync(this.getEndpoint(), contentType, input, requestOptions, Context.NONE); } /** @@ -701,8 +737,8 @@ public Mono> putReadOnlyModelWithResponseAsync(BinaryData i RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.putReadOnlyModel(contentType, accept, input, requestOptions, context)); + return FluxUtil.withContext(context -> service.putReadOnlyModel(this.getEndpoint(), contentType, accept, input, + requestOptions, context)); } /** @@ -745,6 +781,7 @@ public Mono> putReadOnlyModelWithResponseAsync(BinaryData i public Response putReadOnlyModelWithResponse(BinaryData input, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.putReadOnlyModelSync(contentType, accept, input, requestOptions, Context.NONE); + return service.putReadOnlyModelSync(this.getEndpoint(), contentType, accept, input, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/AdditionalPropertiesClientBuilder.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/AdditionalPropertiesClientBuilder.java index c315f37901..a6b3ffd19c 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/AdditionalPropertiesClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/AdditionalPropertiesClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -105,8 +106,8 @@ SpreadRecordNonDiscriminatedUnionAsyncClient.class, SpreadRecordNonDiscriminatedUnion2AsyncClient.class, SpreadRecordNonDiscriminatedUnion3AsyncClient.class }) -public final class AdditionalPropertiesClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class AdditionalPropertiesClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -238,6 +239,22 @@ public AdditionalPropertiesClientBuilder configuration(Configuration configurati return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public AdditionalPropertiesClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -265,8 +282,8 @@ public AdditionalPropertiesClientBuilder retryPolicy(RetryPolicy retryPolicy) { private AdditionalPropertiesClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - AdditionalPropertiesClientImpl client - = new AdditionalPropertiesClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + AdditionalPropertiesClientImpl client = new AdditionalPropertiesClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -274,6 +291,7 @@ private AdditionalPropertiesClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/AdditionalPropertiesClientImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/AdditionalPropertiesClientImpl.java index ba963130d8..bc91cfeee7 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/AdditionalPropertiesClientImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/AdditionalPropertiesClientImpl.java @@ -15,6 +15,20 @@ * Initializes a new instance of the AdditionalPropertiesClient type. */ public final class AdditionalPropertiesClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -493,19 +507,22 @@ public SpreadRecordNonDiscriminatedUnion3sImpl getSpreadRecordNonDiscriminatedUn /** * Initializes an instance of AdditionalPropertiesClient client. + * + * @param endpoint Service host. */ - public AdditionalPropertiesClientImpl() { + public AdditionalPropertiesClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of AdditionalPropertiesClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public AdditionalPropertiesClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public AdditionalPropertiesClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -513,10 +530,13 @@ public AdditionalPropertiesClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public AdditionalPropertiesClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public AdditionalPropertiesClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.extendsUnknowns = new ExtendsUnknownsImpl(this); this.extendsUnknownDeriveds = new ExtendsUnknownDerivedsImpl(this); this.extendsUnknownDiscriminateds = new ExtendsUnknownDiscriminatedsImpl(this); diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadFloatsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadFloatsImpl.java index ffb0197353..d62be52179 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadFloatsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadFloatsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class ExtendsDifferentSpreadFloatsImpl { * The interface defining all the services for AdditionalPropertiesClientExtendsDifferentSpreadFloats to be used by * the proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface ExtendsDifferentSpreadFloatsService { @Get("/type/property/additionalProperties/extendsDifferentSpreadFloat") @@ -64,8 +65,8 @@ public interface ExtendsDifferentSpreadFloatsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsDifferentSpreadFloat") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadFloat") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadFloat") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -119,7 +121,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -146,7 +148,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -174,7 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -202,6 +205,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelArraysImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelArraysImpl.java index b9a2ffa301..8c75fb14cd 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelArraysImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class ExtendsDifferentSpreadModelArraysImpl { * The interface defining all the services for AdditionalPropertiesClientExtendsDifferentSpreadModelArrays to be * used by the proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface ExtendsDifferentSpreadModelArraysService { @Get("/type/property/additionalProperties/extendsDifferentSpreadModelArray") @@ -64,8 +65,8 @@ public interface ExtendsDifferentSpreadModelArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsDifferentSpreadModelArray") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadModelArray") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadModelArray") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -125,7 +127,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -158,7 +160,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -192,7 +194,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -226,6 +229,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelsImpl.java index 3f59e42f7f..8e55e04e63 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadModelsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class ExtendsDifferentSpreadModelsImpl { * The interface defining all the services for AdditionalPropertiesClientExtendsDifferentSpreadModels to be used by * the proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface ExtendsDifferentSpreadModelsService { @Get("/type/property/additionalProperties/extendsDifferentSpreadModel") @@ -64,8 +65,8 @@ public interface ExtendsDifferentSpreadModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsDifferentSpreadModel") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadModel") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadModel") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -121,7 +123,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -150,7 +152,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -180,7 +182,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -210,6 +213,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadStringsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadStringsImpl.java index 7a2179bcc4..bfd2dd11f1 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsDifferentSpreadStringsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class ExtendsDifferentSpreadStringsImpl { * The interface defining all the services for AdditionalPropertiesClientExtendsDifferentSpreadStrings to be used by * the proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface ExtendsDifferentSpreadStringsService { @Get("/type/property/additionalProperties/extendsDifferentSpreadString") @@ -64,8 +65,8 @@ public interface ExtendsDifferentSpreadStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsDifferentSpreadString") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadString") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsDifferentSpreadString") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -119,7 +121,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -146,7 +148,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -174,7 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -202,6 +205,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsFloatsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsFloatsImpl.java index 9ea95e3469..11ac9cc0b3 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsFloatsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsFloatsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class ExtendsFloatsImpl { * The interface defining all the services for AdditionalPropertiesClientExtendsFloats to be used by the proxy * service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface ExtendsFloatsService { @Get("/type/property/additionalProperties/extendsRecordFloat") @@ -64,8 +65,8 @@ public interface ExtendsFloatsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsRecordFloat") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordFloat") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordFloat") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -118,7 +120,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -144,7 +146,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -171,7 +173,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -198,6 +201,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelArraysImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelArraysImpl.java index d2a6618961..e48e96e72c 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelArraysImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class ExtendsModelArraysImpl { * The interface defining all the services for AdditionalPropertiesClientExtendsModelArrays to be used by the proxy * service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface ExtendsModelArraysService { @Get("/type/property/additionalProperties/extendsRecordModelArray") @@ -64,8 +65,8 @@ public interface ExtendsModelArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsRecordModelArray") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordModelArray") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordModelArray") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -124,7 +126,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -156,7 +158,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -189,7 +191,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -222,6 +225,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelsImpl.java index e1a0f32006..37d6a056c3 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsModelsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class ExtendsModelsImpl { * The interface defining all the services for AdditionalPropertiesClientExtendsModels to be used by the proxy * service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface ExtendsModelsService { @Get("/type/property/additionalProperties/extendsRecordModel") @@ -64,8 +65,8 @@ public interface ExtendsModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsRecordModel") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordModel") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordModel") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -120,7 +122,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -148,7 +150,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -177,7 +179,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -206,6 +209,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsStringsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsStringsImpl.java index ec90ab0851..2ee4476668 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsStringsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class ExtendsStringsImpl { * The interface defining all the services for AdditionalPropertiesClientExtendsStrings to be used by the proxy * service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface ExtendsStringsService { @Get("/type/property/additionalProperties/extendsRecordString") @@ -64,8 +65,8 @@ public interface ExtendsStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsRecordString") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordString") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordString") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -118,7 +120,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -144,7 +146,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -171,7 +173,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -198,6 +201,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDerivedsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDerivedsImpl.java index 28306a44ac..2aaf5b14d6 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDerivedsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDerivedsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class ExtendsUnknownDerivedsImpl { * The interface defining all the services for AdditionalPropertiesClientExtendsUnknownDeriveds to be used by the * proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface ExtendsUnknownDerivedsService { @Get("/type/property/additionalProperties/extendsRecordUnknownDerived") @@ -64,8 +65,8 @@ public interface ExtendsUnknownDerivedsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsRecordUnknownDerived") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordUnknownDerived") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordUnknownDerived") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -120,7 +122,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -148,7 +150,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -177,7 +179,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -206,6 +209,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDiscriminatedsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDiscriminatedsImpl.java index c76d93b58d..5e67fb8e72 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDiscriminatedsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownDiscriminatedsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class ExtendsUnknownDiscriminatedsImpl { * The interface defining all the services for AdditionalPropertiesClientExtendsUnknownDiscriminateds to be used by * the proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface ExtendsUnknownDiscriminatedsService { @Get("/type/property/additionalProperties/extendsUnknownDiscriminated") @@ -64,8 +65,8 @@ public interface ExtendsUnknownDiscriminatedsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsUnknownDiscriminated") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsUnknownDiscriminated") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsUnknownDiscriminated") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -119,7 +121,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -146,7 +148,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -174,7 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -202,6 +205,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownsImpl.java index 9dad3c7556..28f682fb1d 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/ExtendsUnknownsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class ExtendsUnknownsImpl { * The interface defining all the services for AdditionalPropertiesClientExtendsUnknowns to be used by the proxy * service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface ExtendsUnknownsService { @Get("/type/property/additionalProperties/extendsRecordUnknown") @@ -64,8 +65,8 @@ public interface ExtendsUnknownsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/extendsRecordUnknown") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordUnknown") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/extendsRecordUnknown") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -118,7 +120,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -144,7 +146,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -171,7 +173,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -198,6 +201,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsFloatsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsFloatsImpl.java index 8dfe82de6a..c652616256 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsFloatsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsFloatsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class IsFloatsImpl { * The interface defining all the services for AdditionalPropertiesClientIsFloats to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface IsFloatsService { @Get("/type/property/additionalProperties/isRecordFloat") @@ -63,8 +64,8 @@ public interface IsFloatsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isRecordFloat") @ExpectedResponses({ 200 }) @@ -72,8 +73,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordFloat") @ExpectedResponses({ 204 }) @@ -81,8 +82,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordFloat") @ExpectedResponses({ 204 }) @@ -90,7 +92,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -117,7 +119,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -143,7 +145,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -170,7 +172,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -197,6 +200,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelArraysImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelArraysImpl.java index b31e829d3c..8d95467fb6 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelArraysImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class IsModelArraysImpl { * The interface defining all the services for AdditionalPropertiesClientIsModelArrays to be used by the proxy * service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface IsModelArraysService { @Get("/type/property/additionalProperties/isRecordModelArray") @@ -64,8 +65,8 @@ public interface IsModelArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isRecordModelArray") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordModelArray") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordModelArray") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -124,7 +126,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -156,7 +158,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -189,7 +191,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -222,6 +225,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelsImpl.java index 85e31cdeef..44b0c52fb1 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsModelsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class IsModelsImpl { * The interface defining all the services for AdditionalPropertiesClientIsModels to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface IsModelsService { @Get("/type/property/additionalProperties/isRecordModel") @@ -63,8 +64,8 @@ public interface IsModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isRecordModel") @ExpectedResponses({ 200 }) @@ -72,8 +73,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordModel") @ExpectedResponses({ 204 }) @@ -81,8 +82,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordModel") @ExpectedResponses({ 204 }) @@ -90,7 +92,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -119,7 +121,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -147,7 +149,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -176,7 +178,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -205,6 +208,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsStringsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsStringsImpl.java index c5157a675c..35198e065c 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsStringsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class IsStringsImpl { * The interface defining all the services for AdditionalPropertiesClientIsStrings to be used by the proxy service * to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface IsStringsService { @Get("/type/property/additionalProperties/isRecordstring") @@ -64,8 +65,8 @@ public interface IsStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isRecordstring") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordstring") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordstring") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -118,7 +120,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -144,7 +146,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -171,7 +173,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -198,6 +201,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDerivedsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDerivedsImpl.java index eff4ab4bc0..05a68b6bb3 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDerivedsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDerivedsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class IsUnknownDerivedsImpl { * The interface defining all the services for AdditionalPropertiesClientIsUnknownDeriveds to be used by the proxy * service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface IsUnknownDerivedsService { @Get("/type/property/additionalProperties/isRecordUnknownDerived") @@ -64,8 +65,8 @@ public interface IsUnknownDerivedsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isRecordUnknownDerived") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordUnknownDerived") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordUnknownDerived") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -120,7 +122,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -148,7 +150,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -177,7 +179,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -206,6 +209,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDiscriminatedsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDiscriminatedsImpl.java index 62e8c5db42..11d80df74d 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDiscriminatedsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownDiscriminatedsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class IsUnknownDiscriminatedsImpl { * The interface defining all the services for AdditionalPropertiesClientIsUnknownDiscriminateds to be used by the * proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface IsUnknownDiscriminatedsService { @Get("/type/property/additionalProperties/isUnknownDiscriminated") @@ -64,8 +65,8 @@ public interface IsUnknownDiscriminatedsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isUnknownDiscriminated") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isUnknownDiscriminated") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isUnknownDiscriminated") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -119,7 +121,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -146,7 +148,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -174,7 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -202,6 +205,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownsImpl.java index 3e12bf7921..14af79a153 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/IsUnknownsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class IsUnknownsImpl { * The interface defining all the services for AdditionalPropertiesClientIsUnknowns to be used by the proxy service * to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface IsUnknownsService { @Get("/type/property/additionalProperties/isRecordUnknown") @@ -64,8 +65,8 @@ public interface IsUnknownsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/isRecordUnknown") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordUnknown") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/isRecordUnknown") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -118,7 +120,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -144,7 +146,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -171,7 +173,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -198,6 +201,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/MultipleSpreadsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/MultipleSpreadsImpl.java index 8a3dbe5b28..77c14978b2 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/MultipleSpreadsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/MultipleSpreadsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class MultipleSpreadsImpl { * The interface defining all the services for AdditionalPropertiesClientMultipleSpreads to be used by the proxy * service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface MultipleSpreadsService { @Get("/type/property/additionalProperties/multipleSpreadRecord") @@ -64,8 +65,8 @@ public interface MultipleSpreadsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/multipleSpreadRecord") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/multipleSpreadRecord") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/multipleSpreadRecord") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -118,7 +120,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -144,7 +146,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -171,7 +173,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -198,6 +201,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentFloatsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentFloatsImpl.java index f57e7c2327..0141e36ac4 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentFloatsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentFloatsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class SpreadDifferentFloatsImpl { * The interface defining all the services for AdditionalPropertiesClientSpreadDifferentFloats to be used by the * proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface SpreadDifferentFloatsService { @Get("/type/property/additionalProperties/spreadDifferentRecordFloat") @@ -64,8 +65,8 @@ public interface SpreadDifferentFloatsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadDifferentRecordFloat") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordFloat") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordFloat") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -118,7 +120,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -144,7 +146,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -171,7 +173,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -198,6 +201,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelArraysImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelArraysImpl.java index 4588c2288b..c1e3aa384f 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelArraysImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class SpreadDifferentModelArraysImpl { * The interface defining all the services for AdditionalPropertiesClientSpreadDifferentModelArrays to be used by * the proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface SpreadDifferentModelArraysService { @Get("/type/property/additionalProperties/spreadDifferentRecordModelArray") @@ -64,8 +65,8 @@ public interface SpreadDifferentModelArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadDifferentRecordModelArray") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordModelArray") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordModelArray") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -122,7 +124,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -152,7 +154,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -183,7 +185,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -214,6 +217,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelsImpl.java index edf1540a70..fed8bd79de 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentModelsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class SpreadDifferentModelsImpl { * The interface defining all the services for AdditionalPropertiesClientSpreadDifferentModels to be used by the * proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface SpreadDifferentModelsService { @Get("/type/property/additionalProperties/spreadDifferentRecordModel") @@ -64,8 +65,8 @@ public interface SpreadDifferentModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadDifferentRecordModel") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordModel") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordModel") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -120,7 +122,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -148,7 +150,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -177,7 +179,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -206,6 +209,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentStringsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentStringsImpl.java index 37710f6e8a..a8056c035e 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadDifferentStringsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class SpreadDifferentStringsImpl { * The interface defining all the services for AdditionalPropertiesClientSpreadDifferentStrings to be used by the * proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface SpreadDifferentStringsService { @Get("/type/property/additionalProperties/spreadDifferentRecordString") @@ -64,8 +65,8 @@ public interface SpreadDifferentStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadDifferentRecordString") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordString") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadDifferentRecordString") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -118,7 +120,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -144,7 +146,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -171,7 +173,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -198,6 +201,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadFloatsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadFloatsImpl.java index e704c12195..a6e5600d38 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadFloatsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadFloatsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class SpreadFloatsImpl { * The interface defining all the services for AdditionalPropertiesClientSpreadFloats to be used by the proxy * service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface SpreadFloatsService { @Get("/type/property/additionalProperties/spreadRecordFloat") @@ -64,8 +65,8 @@ public interface SpreadFloatsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordFloat") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordFloat") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordFloat") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -118,7 +120,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -144,7 +146,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -171,7 +173,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -198,6 +201,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelArraysImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelArraysImpl.java index 24b3640e1b..25eb98c761 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelArraysImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class SpreadModelArraysImpl { * The interface defining all the services for AdditionalPropertiesClientSpreadModelArrays to be used by the proxy * service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface SpreadModelArraysService { @Get("/type/property/additionalProperties/spreadRecordModelArray") @@ -64,8 +65,8 @@ public interface SpreadModelArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordModelArray") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordModelArray") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordModelArray") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -124,7 +126,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -156,7 +158,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -189,7 +191,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -222,6 +225,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelsImpl.java index 92f6e49681..fdd2a2fd9a 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadModelsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class SpreadModelsImpl { * The interface defining all the services for AdditionalPropertiesClientSpreadModels to be used by the proxy * service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface SpreadModelsService { @Get("/type/property/additionalProperties/spreadRecordModel") @@ -64,8 +65,8 @@ public interface SpreadModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordModel") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordModel") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordModel") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -120,7 +122,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -148,7 +150,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -177,7 +179,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -206,6 +209,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordDiscriminatedUnionsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordDiscriminatedUnionsImpl.java index 181c50a924..08605622c4 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordDiscriminatedUnionsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordDiscriminatedUnionsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class SpreadRecordDiscriminatedUnionsImpl { * The interface defining all the services for AdditionalPropertiesClientSpreadRecordDiscriminatedUnions to be used * by the proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface SpreadRecordDiscriminatedUnionsService { @Get("/type/property/additionalProperties/spreadRecordDiscriminatedUnion") @@ -64,8 +65,8 @@ public interface SpreadRecordDiscriminatedUnionsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordDiscriminatedUnion") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordDiscriminatedUnion") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordDiscriminatedUnion") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -118,7 +120,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -144,7 +146,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -171,7 +173,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -198,6 +201,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion2sImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion2sImpl.java index a28ff3d370..774b0db139 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion2sImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion2sImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class SpreadRecordNonDiscriminatedUnion2sImpl { * The interface defining all the services for AdditionalPropertiesClientSpreadRecordNonDiscriminatedUnion2s to be * used by the proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface SpreadRecordNonDiscriminatedUnion2sService { @Get("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion2") @@ -64,8 +65,8 @@ public interface SpreadRecordNonDiscriminatedUnion2sService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion2") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion2") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion2") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -118,7 +120,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -144,7 +146,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -171,7 +173,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -198,6 +201,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion3sImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion3sImpl.java index 198bace3bd..29f7579eb5 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion3sImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnion3sImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class SpreadRecordNonDiscriminatedUnion3sImpl { * The interface defining all the services for AdditionalPropertiesClientSpreadRecordNonDiscriminatedUnion3s to be * used by the proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface SpreadRecordNonDiscriminatedUnion3sService { @Get("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion3") @@ -64,8 +65,8 @@ public interface SpreadRecordNonDiscriminatedUnion3sService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion3") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion3") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion3") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -118,7 +120,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -144,7 +146,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -171,7 +173,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -198,6 +201,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnionsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnionsImpl.java index becaa4329b..f438e1fa77 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnionsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordNonDiscriminatedUnionsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class SpreadRecordNonDiscriminatedUnionsImpl { * The interface defining all the services for AdditionalPropertiesClientSpreadRecordNonDiscriminatedUnions to be * used by the proxy service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface SpreadRecordNonDiscriminatedUnionsService { @Get("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion") @@ -64,8 +65,8 @@ public interface SpreadRecordNonDiscriminatedUnionsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordNonDiscriminatedUnion") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -118,7 +120,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -144,7 +146,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -171,7 +173,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -198,6 +201,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordUnionsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordUnionsImpl.java index 9d128dac44..381cf3286d 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordUnionsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadRecordUnionsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class SpreadRecordUnionsImpl { * The interface defining all the services for AdditionalPropertiesClientSpreadRecordUnions to be used by the proxy * service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface SpreadRecordUnionsService { @Get("/type/property/additionalProperties/spreadRecordUnion") @@ -64,8 +65,8 @@ public interface SpreadRecordUnionsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordUnion") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordUnion") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordUnion") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -118,7 +120,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -144,7 +146,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -171,7 +173,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -198,6 +201,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadStringsImpl.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadStringsImpl.java index 2bb5668e9f..8c744222c5 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/implementation/SpreadStringsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class SpreadStringsImpl { * The interface defining all the services for AdditionalPropertiesClientSpreadStrings to be used by the proxy * service to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "AdditionalProperties") public interface SpreadStringsService { @Get("/type/property/additionalProperties/spreadRecordString") @@ -64,8 +65,8 @@ public interface SpreadStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/additionalProperties/spreadRecordString") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordString") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/additionalProperties/spreadRecordString") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -118,7 +120,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -144,7 +146,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -171,7 +173,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -198,6 +201,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/NullableClientBuilder.java b/typespec-tests/src/main/java/com/type/property/nullable/NullableClientBuilder.java index 173f2426a6..e17e17aaf3 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/NullableClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/NullableClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -55,8 +56,8 @@ CollectionsByteAsyncClient.class, CollectionsModelAsyncClient.class, CollectionsStringAsyncClient.class }) -public final class NullableClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class NullableClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -187,6 +188,22 @@ public NullableClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public NullableClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -215,7 +232,7 @@ private NullableClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); NullableClientImpl client - = new NullableClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + = new NullableClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -223,6 +240,7 @@ private NullableClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/BytesImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/BytesImpl.java index 0920e15575..a84d26ea0f 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/BytesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/BytesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class BytesImpl { * The interface defining all the services for NullableClientBytes to be used by the proxy service to perform REST * calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "NullableClientBytes") public interface BytesService { @Get("/type/property/nullable/bytes/non-null") @@ -63,8 +64,8 @@ public interface BytesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getNonNull(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/bytes/non-null") @ExpectedResponses({ 200 }) @@ -72,8 +73,8 @@ Mono> getNonNull(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getNonNullSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/bytes/null") @ExpectedResponses({ 200 }) @@ -81,8 +82,8 @@ Response getNonNullSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getNull(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/nullable/bytes/null") @ExpectedResponses({ 200 }) @@ -90,8 +91,8 @@ Mono> getNull(@HeaderParam("Accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getNullSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/bytes/non-null") @ExpectedResponses({ 204 }) @@ -99,8 +100,9 @@ Response getNullSync(@HeaderParam("Accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> patchNonNull(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/bytes/non-null") @ExpectedResponses({ 204 }) @@ -108,8 +110,9 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Response patchNonNullSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/bytes/null") @ExpectedResponses({ 204 }) @@ -117,8 +120,9 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> patchNull(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/bytes/null") @ExpectedResponses({ 204 }) @@ -126,8 +130,9 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Response patchNullSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -152,7 +157,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNonNull(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getNonNull(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -176,7 +182,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getNonNullSync(accept, requestOptions, Context.NONE); + return service.getNonNullSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -201,7 +207,8 @@ public Response getNonNullWithResponse(RequestOptions requestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getNull(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -225,7 +232,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getNullSync(accept, requestOptions, Context.NONE); + return service.getNullSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -250,7 +257,8 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.patchNonNull(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -275,7 +283,7 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); + return service.patchNonNullSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -300,7 +308,8 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.patchNull(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -325,6 +334,6 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNullSync(contentType, body, requestOptions, Context.NONE); + return service.patchNullSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsBytesImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsBytesImpl.java index ea56c0a9ed..6d1cccfcbd 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsBytesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsBytesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class CollectionsBytesImpl { * The interface defining all the services for NullableClientCollectionsBytes to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "NullableClientCollec") public interface CollectionsBytesService { @Get("/type/property/nullable/collections/bytes/non-null") @@ -64,8 +65,8 @@ public interface CollectionsBytesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getNonNull(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/bytes/non-null") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> getNonNull(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getNonNullSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/bytes/null") @ExpectedResponses({ 200 }) @@ -82,8 +83,8 @@ Response getNonNullSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getNull(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/bytes/null") @ExpectedResponses({ 200 }) @@ -91,8 +92,8 @@ Mono> getNull(@HeaderParam("Accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getNullSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/bytes/non-null") @ExpectedResponses({ 204 }) @@ -100,8 +101,9 @@ Response getNullSync(@HeaderParam("Accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> patchNonNull(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/bytes/non-null") @ExpectedResponses({ 204 }) @@ -109,8 +111,9 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Response patchNonNullSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/bytes/null") @ExpectedResponses({ 204 }) @@ -118,8 +121,9 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> patchNull(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/bytes/null") @ExpectedResponses({ 204 }) @@ -127,8 +131,9 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Response patchNullSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -155,7 +160,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNonNull(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getNonNull(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -181,7 +187,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getNonNullSync(accept, requestOptions, Context.NONE); + return service.getNonNullSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -208,7 +214,8 @@ public Response getNonNullWithResponse(RequestOptions requestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getNull(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -234,7 +241,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getNullSync(accept, requestOptions, Context.NONE); + return service.getNullSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -261,7 +268,8 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.patchNonNull(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -288,7 +296,7 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); + return service.patchNonNullSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -315,7 +323,8 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.patchNull(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -342,6 +351,6 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNullSync(contentType, body, requestOptions, Context.NONE); + return service.patchNullSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsModelsImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsModelsImpl.java index 8dab16f2a0..c1d453e103 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsModelsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class CollectionsModelsImpl { * The interface defining all the services for NullableClientCollectionsModels to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "NullableClientCollec") public interface CollectionsModelsService { @Get("/type/property/nullable/collections/model/non-null") @@ -64,8 +65,8 @@ public interface CollectionsModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getNonNull(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/model/non-null") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> getNonNull(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getNonNullSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/model/null") @ExpectedResponses({ 200 }) @@ -82,8 +83,8 @@ Response getNonNullSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getNull(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/model/null") @ExpectedResponses({ 200 }) @@ -91,8 +92,8 @@ Mono> getNull(@HeaderParam("Accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getNullSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/model/non-null") @ExpectedResponses({ 204 }) @@ -100,8 +101,9 @@ Response getNullSync(@HeaderParam("Accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> patchNonNull(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/model/non-null") @ExpectedResponses({ 204 }) @@ -109,8 +111,9 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Response patchNonNullSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/model/null") @ExpectedResponses({ 204 }) @@ -118,8 +121,9 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> patchNull(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/model/null") @ExpectedResponses({ 204 }) @@ -127,8 +131,9 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Response patchNullSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -157,7 +162,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNonNull(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getNonNull(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -185,7 +191,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getNonNullSync(accept, requestOptions, Context.NONE); + return service.getNonNullSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -214,7 +220,8 @@ public Response getNonNullWithResponse(RequestOptions requestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getNull(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -242,7 +249,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getNullSync(accept, requestOptions, Context.NONE); + return service.getNullSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -271,7 +278,8 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.patchNonNull(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -300,7 +308,7 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); + return service.patchNonNullSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -329,7 +337,8 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.patchNull(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -358,6 +367,6 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNullSync(contentType, body, requestOptions, Context.NONE); + return service.patchNullSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsStringsImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsStringsImpl.java index 6a7da710b3..d6cd65ef09 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/CollectionsStringsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class CollectionsStringsImpl { * The interface defining all the services for NullableClientCollectionsStrings to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "NullableClientCollec") public interface CollectionsStringsService { @Get("/type/property/nullable/collections/string/non-null") @@ -64,8 +65,8 @@ public interface CollectionsStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getNonNull(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/string/non-null") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> getNonNull(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getNonNullSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/string/null") @ExpectedResponses({ 200 }) @@ -82,8 +83,8 @@ Response getNonNullSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getNull(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/nullable/collections/string/null") @ExpectedResponses({ 200 }) @@ -91,8 +92,8 @@ Mono> getNull(@HeaderParam("Accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getNullSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/string/non-null") @ExpectedResponses({ 204 }) @@ -100,8 +101,9 @@ Response getNullSync(@HeaderParam("Accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> patchNonNull(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/string/non-null") @ExpectedResponses({ 204 }) @@ -109,8 +111,9 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Response patchNonNullSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/string/null") @ExpectedResponses({ 204 }) @@ -118,8 +121,9 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> patchNull(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/collections/string/null") @ExpectedResponses({ 204 }) @@ -127,8 +131,9 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Response patchNullSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -155,7 +160,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNonNull(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getNonNull(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -181,7 +187,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getNonNullSync(accept, requestOptions, Context.NONE); + return service.getNonNullSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -208,7 +214,8 @@ public Response getNonNullWithResponse(RequestOptions requestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getNull(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -234,7 +241,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getNullSync(accept, requestOptions, Context.NONE); + return service.getNullSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -261,7 +268,8 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.patchNonNull(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -288,7 +296,7 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); + return service.patchNonNullSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -315,7 +323,8 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.patchNull(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -342,6 +351,6 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNullSync(contentType, body, requestOptions, Context.NONE); + return service.patchNullSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/DatetimeOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/DatetimeOperationsImpl.java index 976cd5474b..d4356df4d4 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/DatetimeOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/DatetimeOperationsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class DatetimeOperationsImpl { * The interface defining all the services for NullableClientDatetimeOperations to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "NullableClientDateti") public interface DatetimeOperationsService { @Get("/type/property/nullable/datetime/non-null") @@ -64,8 +65,8 @@ public interface DatetimeOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getNonNull(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/datetime/non-null") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> getNonNull(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getNonNullSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/datetime/null") @ExpectedResponses({ 200 }) @@ -82,8 +83,8 @@ Response getNonNullSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getNull(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/nullable/datetime/null") @ExpectedResponses({ 200 }) @@ -91,8 +92,8 @@ Mono> getNull(@HeaderParam("Accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getNullSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/datetime/non-null") @ExpectedResponses({ 204 }) @@ -100,8 +101,9 @@ Response getNullSync(@HeaderParam("Accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> patchNonNull(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/datetime/non-null") @ExpectedResponses({ 204 }) @@ -109,8 +111,9 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Response patchNonNullSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/datetime/null") @ExpectedResponses({ 204 }) @@ -118,8 +121,9 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> patchNull(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/datetime/null") @ExpectedResponses({ 204 }) @@ -127,8 +131,9 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Response patchNullSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -153,7 +158,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNonNull(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getNonNull(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -177,7 +183,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getNonNullSync(accept, requestOptions, Context.NONE); + return service.getNonNullSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -202,7 +208,8 @@ public Response getNonNullWithResponse(RequestOptions requestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getNull(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -226,7 +233,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getNullSync(accept, requestOptions, Context.NONE); + return service.getNullSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -251,7 +258,8 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.patchNonNull(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -276,7 +284,7 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); + return service.patchNonNullSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -301,7 +309,8 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.patchNull(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -326,6 +335,6 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNullSync(contentType, body, requestOptions, Context.NONE); + return service.patchNullSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/DurationOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/DurationOperationsImpl.java index aa7b89dfd1..c4f14ababb 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/DurationOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/DurationOperationsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class DurationOperationsImpl { * The interface defining all the services for NullableClientDurationOperations to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "NullableClientDurati") public interface DurationOperationsService { @Get("/type/property/nullable/duration/non-null") @@ -64,8 +65,8 @@ public interface DurationOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getNonNull(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/duration/non-null") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> getNonNull(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getNonNullSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/duration/null") @ExpectedResponses({ 200 }) @@ -82,8 +83,8 @@ Response getNonNullSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getNull(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/nullable/duration/null") @ExpectedResponses({ 200 }) @@ -91,8 +92,8 @@ Mono> getNull(@HeaderParam("Accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getNullSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/duration/non-null") @ExpectedResponses({ 204 }) @@ -100,8 +101,9 @@ Response getNullSync(@HeaderParam("Accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> patchNonNull(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/duration/non-null") @ExpectedResponses({ 204 }) @@ -109,8 +111,9 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Response patchNonNullSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/duration/null") @ExpectedResponses({ 204 }) @@ -118,8 +121,9 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> patchNull(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/duration/null") @ExpectedResponses({ 204 }) @@ -127,8 +131,9 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Response patchNullSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -153,7 +158,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNonNull(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getNonNull(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -177,7 +183,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getNonNullSync(accept, requestOptions, Context.NONE); + return service.getNonNullSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -202,7 +208,8 @@ public Response getNonNullWithResponse(RequestOptions requestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getNull(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -226,7 +233,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getNullSync(accept, requestOptions, Context.NONE); + return service.getNullSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -251,7 +258,8 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.patchNonNull(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -276,7 +284,7 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); + return service.patchNonNullSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -301,7 +309,8 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.patchNull(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -326,6 +335,6 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNullSync(contentType, body, requestOptions, Context.NONE); + return service.patchNullSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/NullableClientImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/NullableClientImpl.java index 004abade6a..25e685719d 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/NullableClientImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/NullableClientImpl.java @@ -15,6 +15,20 @@ * Initializes a new instance of the NullableClient type. */ public final class NullableClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -143,19 +157,22 @@ public CollectionsStringsImpl getCollectionsStrings() { /** * Initializes an instance of NullableClient client. + * + * @param endpoint Service host. */ - public NullableClientImpl() { + public NullableClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of NullableClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public NullableClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public NullableClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -163,10 +180,12 @@ public NullableClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public NullableClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public NullableClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.stringOperations = new StringOperationsImpl(this); this.bytes = new BytesImpl(this); this.datetimeOperations = new DatetimeOperationsImpl(this); diff --git a/typespec-tests/src/main/java/com/type/property/nullable/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/nullable/implementation/StringOperationsImpl.java index b6582caa2e..c4b61dcb84 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/implementation/StringOperationsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class StringOperationsImpl { * The interface defining all the services for NullableClientStringOperations to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "NullableClientString") public interface StringOperationsService { @Get("/type/property/nullable/string/non-null") @@ -64,8 +65,8 @@ public interface StringOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNonNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getNonNull(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/string/non-null") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> getNonNull(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNonNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getNonNullSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/nullable/string/null") @ExpectedResponses({ 200 }) @@ -82,8 +83,8 @@ Response getNonNullSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getNull(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getNull(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/nullable/string/null") @ExpectedResponses({ 200 }) @@ -91,8 +92,8 @@ Mono> getNull(@HeaderParam("Accept") String accept, Request @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getNullSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getNullSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/string/non-null") @ExpectedResponses({ 204 }) @@ -100,8 +101,9 @@ Response getNullSync(@HeaderParam("Accept") String accept, RequestOp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> patchNonNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> patchNonNull(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/string/non-null") @ExpectedResponses({ 204 }) @@ -109,8 +111,9 @@ Mono> patchNonNull(@HeaderParam("Content-Type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Response patchNonNullSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/string/null") @ExpectedResponses({ 204 }) @@ -118,8 +121,9 @@ Response patchNonNullSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> patchNull(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> patchNull(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/type/property/nullable/string/null") @ExpectedResponses({ 204 }) @@ -127,8 +131,9 @@ Mono> patchNull(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response patchNullSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + Response patchNullSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -153,7 +158,8 @@ Response patchNullSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNonNullWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNonNull(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getNonNull(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -177,7 +183,7 @@ public Mono> getNonNullWithResponseAsync(RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Response getNonNullWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getNonNullSync(accept, requestOptions, Context.NONE); + return service.getNonNullSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -202,7 +208,8 @@ public Response getNonNullWithResponse(RequestOptions requestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getNullWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getNull(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getNull(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -226,7 +233,7 @@ public Mono> getNullWithResponseAsync(RequestOptions reques @ServiceMethod(returns = ReturnType.SINGLE) public Response getNullWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getNullSync(accept, requestOptions, Context.NONE); + return service.getNullSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -251,7 +258,8 @@ public Response getNullWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNonNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNonNull(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.patchNonNull(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -276,7 +284,7 @@ public Mono> patchNonNullWithResponseAsync(BinaryData body, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNonNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNonNullSync(contentType, body, requestOptions, Context.NONE); + return service.patchNonNullSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -301,7 +309,8 @@ public Response patchNonNullWithResponse(BinaryData body, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> patchNullWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return FluxUtil.withContext(context -> service.patchNull(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.patchNull(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -326,6 +335,6 @@ public Mono> patchNullWithResponseAsync(BinaryData body, RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response patchNullWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/merge-patch+json"; - return service.patchNullSync(contentType, body, requestOptions, Context.NONE); + return service.patchNullSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/OptionalClientBuilder.java b/typespec-tests/src/main/java/com/type/property/optional/OptionalClientBuilder.java index b0ae353909..efb4ff35d5 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/OptionalClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/property/optional/OptionalClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -73,8 +74,8 @@ UnionIntLiteralAsyncClient.class, UnionFloatLiteralAsyncClient.class, RequiredAndOptionalAsyncClient.class }) -public final class OptionalClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class OptionalClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -205,6 +206,22 @@ public OptionalClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public OptionalClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -233,7 +250,7 @@ private OptionalClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); OptionalClientImpl client - = new OptionalClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + = new OptionalClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -241,6 +258,7 @@ private OptionalClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/BooleanLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/BooleanLiteralsImpl.java index f7e8e3bacd..e417d0f075 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/BooleanLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/BooleanLiteralsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class BooleanLiteralsImpl { * The interface defining all the services for OptionalClientBooleanLiterals to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "OptionalClientBoolea") public interface BooleanLiteralsService { @Get("/type/property/optional/boolean/literal/all") @@ -64,8 +65,8 @@ public interface BooleanLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getAll(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/boolean/literal/all") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getAllSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/boolean/literal/default") @ExpectedResponses({ 200 }) @@ -82,8 +83,8 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/boolean/literal/default") @ExpectedResponses({ 200 }) @@ -91,8 +92,8 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/boolean/literal/all") @ExpectedResponses({ 204 }) @@ -100,8 +101,9 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putAll(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/boolean/literal/all") @ExpectedResponses({ 204 }) @@ -109,8 +111,9 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/boolean/literal/default") @ExpectedResponses({ 204 }) @@ -118,8 +121,9 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/boolean/literal/default") @ExpectedResponses({ 204 }) @@ -127,8 +131,9 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -152,7 +157,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAll(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getAll(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -175,7 +181,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getAllSync(accept, requestOptions, Context.NONE); + return service.getAllSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -199,7 +205,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDefault(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getDefault(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -222,7 +229,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getDefaultSync(accept, requestOptions, Context.NONE); + return service.getDefaultSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -246,7 +253,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putAll(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -270,7 +278,7 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + return service.putAllSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -294,7 +302,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putDefault(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -318,6 +327,6 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + return service.putDefaultSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/BytesImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/BytesImpl.java index e052565927..4aa5b0e291 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/BytesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/BytesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class BytesImpl { * The interface defining all the services for OptionalClientBytes to be used by the proxy service to perform REST * calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "OptionalClientBytes") public interface BytesService { @Get("/type/property/optional/bytes/all") @@ -63,8 +64,8 @@ public interface BytesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getAll(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/bytes/all") @ExpectedResponses({ 200 }) @@ -72,8 +73,8 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getAllSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/bytes/default") @ExpectedResponses({ 200 }) @@ -81,8 +82,8 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/bytes/default") @ExpectedResponses({ 200 }) @@ -90,8 +91,8 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/bytes/all") @ExpectedResponses({ 204 }) @@ -99,8 +100,9 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putAll(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/bytes/all") @ExpectedResponses({ 204 }) @@ -108,8 +110,9 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/bytes/default") @ExpectedResponses({ 204 }) @@ -117,8 +120,9 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/bytes/default") @ExpectedResponses({ 204 }) @@ -126,8 +130,9 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -151,7 +156,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAll(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getAll(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -174,7 +180,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getAllSync(accept, requestOptions, Context.NONE); + return service.getAllSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -198,7 +204,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDefault(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getDefault(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -221,7 +228,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getDefaultSync(accept, requestOptions, Context.NONE); + return service.getDefaultSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -245,7 +252,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putAll(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -269,7 +277,7 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + return service.putAllSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -293,7 +301,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putDefault(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -317,6 +326,6 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + return service.putDefaultSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsBytesImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsBytesImpl.java index 4a43ffed70..bc22af5f7d 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsBytesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsBytesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class CollectionsBytesImpl { * The interface defining all the services for OptionalClientCollectionsBytes to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "OptionalClientCollec") public interface CollectionsBytesService { @Get("/type/property/optional/collections/bytes/all") @@ -64,8 +65,8 @@ public interface CollectionsBytesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getAll(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/collections/bytes/all") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getAllSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/collections/bytes/default") @ExpectedResponses({ 200 }) @@ -82,8 +83,8 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/collections/bytes/default") @ExpectedResponses({ 200 }) @@ -91,8 +92,8 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/bytes/all") @ExpectedResponses({ 204 }) @@ -100,8 +101,9 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putAll(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/bytes/all") @ExpectedResponses({ 204 }) @@ -109,8 +111,9 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/bytes/default") @ExpectedResponses({ 204 }) @@ -118,8 +121,9 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/bytes/default") @ExpectedResponses({ 204 }) @@ -127,8 +131,9 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -154,7 +159,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAll(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getAll(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -179,7 +185,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getAllSync(accept, requestOptions, Context.NONE); + return service.getAllSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -205,7 +211,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDefault(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getDefault(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -230,7 +237,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getDefaultSync(accept, requestOptions, Context.NONE); + return service.getDefaultSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -256,7 +263,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putAll(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -282,7 +290,7 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + return service.putAllSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -308,7 +316,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putDefault(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -334,6 +343,6 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + return service.putDefaultSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsModelsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsModelsImpl.java index 9ea2a5c48e..f83f9c9443 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/CollectionsModelsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class CollectionsModelsImpl { * The interface defining all the services for OptionalClientCollectionsModels to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "OptionalClientCollec") public interface CollectionsModelsService { @Get("/type/property/optional/collections/model/all") @@ -64,8 +65,8 @@ public interface CollectionsModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getAll(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/collections/model/all") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getAllSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/collections/model/default") @ExpectedResponses({ 200 }) @@ -82,8 +83,8 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/collections/model/default") @ExpectedResponses({ 200 }) @@ -91,8 +92,8 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/model/all") @ExpectedResponses({ 204 }) @@ -100,8 +101,9 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putAll(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/model/all") @ExpectedResponses({ 204 }) @@ -109,8 +111,9 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/model/default") @ExpectedResponses({ 204 }) @@ -118,8 +121,9 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/collections/model/default") @ExpectedResponses({ 204 }) @@ -127,8 +131,9 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -156,7 +161,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAll(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getAll(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -183,7 +189,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getAllSync(accept, requestOptions, Context.NONE); + return service.getAllSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -211,7 +217,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDefault(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getDefault(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -238,7 +245,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getDefaultSync(accept, requestOptions, Context.NONE); + return service.getDefaultSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -266,7 +273,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putAll(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -294,7 +302,7 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + return service.putAllSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -322,7 +330,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putDefault(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -350,6 +359,6 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + return service.putDefaultSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/DatetimeOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/DatetimeOperationsImpl.java index a65a9fbbb5..538f44b6fe 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/DatetimeOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/DatetimeOperationsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class DatetimeOperationsImpl { * The interface defining all the services for OptionalClientDatetimeOperations to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "OptionalClientDateti") public interface DatetimeOperationsService { @Get("/type/property/optional/datetime/all") @@ -64,8 +65,8 @@ public interface DatetimeOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getAll(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/datetime/all") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getAllSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/datetime/default") @ExpectedResponses({ 200 }) @@ -82,8 +83,8 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/datetime/default") @ExpectedResponses({ 200 }) @@ -91,8 +92,8 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/datetime/all") @ExpectedResponses({ 204 }) @@ -100,8 +101,9 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putAll(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/datetime/all") @ExpectedResponses({ 204 }) @@ -109,8 +111,9 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/datetime/default") @ExpectedResponses({ 204 }) @@ -118,8 +121,9 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/datetime/default") @ExpectedResponses({ 204 }) @@ -127,8 +131,9 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -152,7 +157,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAll(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getAll(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -175,7 +181,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getAllSync(accept, requestOptions, Context.NONE); + return service.getAllSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -199,7 +205,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDefault(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getDefault(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -222,7 +229,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getDefaultSync(accept, requestOptions, Context.NONE); + return service.getDefaultSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -246,7 +253,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putAll(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -270,7 +278,7 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + return service.putAllSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -294,7 +302,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putDefault(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -318,6 +327,6 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + return service.putDefaultSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/DurationOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/DurationOperationsImpl.java index a13cc19c3c..3931d71c30 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/DurationOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/DurationOperationsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class DurationOperationsImpl { * The interface defining all the services for OptionalClientDurationOperations to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "OptionalClientDurati") public interface DurationOperationsService { @Get("/type/property/optional/duration/all") @@ -64,8 +65,8 @@ public interface DurationOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getAll(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/duration/all") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getAllSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/duration/default") @ExpectedResponses({ 200 }) @@ -82,8 +83,8 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/duration/default") @ExpectedResponses({ 200 }) @@ -91,8 +92,8 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/duration/all") @ExpectedResponses({ 204 }) @@ -100,8 +101,9 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putAll(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/duration/all") @ExpectedResponses({ 204 }) @@ -109,8 +111,9 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/duration/default") @ExpectedResponses({ 204 }) @@ -118,8 +121,9 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/duration/default") @ExpectedResponses({ 204 }) @@ -127,8 +131,9 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -152,7 +157,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAll(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getAll(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -175,7 +181,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getAllSync(accept, requestOptions, Context.NONE); + return service.getAllSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -199,7 +205,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDefault(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getDefault(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -222,7 +229,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getDefaultSync(accept, requestOptions, Context.NONE); + return service.getDefaultSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -246,7 +253,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putAll(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -270,7 +278,7 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + return service.putAllSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -294,7 +302,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putDefault(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -318,6 +327,6 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + return service.putDefaultSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/FloatLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/FloatLiteralsImpl.java index fbd061c2ba..3b6a473338 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/FloatLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/FloatLiteralsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class FloatLiteralsImpl { * The interface defining all the services for OptionalClientFloatLiterals to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "OptionalClientFloatL") public interface FloatLiteralsService { @Get("/type/property/optional/float/literal/all") @@ -64,8 +65,8 @@ public interface FloatLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getAll(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/float/literal/all") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getAllSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/float/literal/default") @ExpectedResponses({ 200 }) @@ -82,8 +83,8 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/float/literal/default") @ExpectedResponses({ 200 }) @@ -91,8 +92,8 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/float/literal/all") @ExpectedResponses({ 204 }) @@ -100,8 +101,9 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putAll(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/float/literal/all") @ExpectedResponses({ 204 }) @@ -109,8 +111,9 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/float/literal/default") @ExpectedResponses({ 204 }) @@ -118,8 +121,9 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/float/literal/default") @ExpectedResponses({ 204 }) @@ -127,8 +131,9 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -152,7 +157,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAll(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getAll(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -175,7 +181,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getAllSync(accept, requestOptions, Context.NONE); + return service.getAllSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -199,7 +205,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDefault(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getDefault(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -222,7 +229,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getDefaultSync(accept, requestOptions, Context.NONE); + return service.getDefaultSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -246,7 +253,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putAll(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -270,7 +278,7 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + return service.putAllSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -294,7 +302,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putDefault(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -318,6 +327,6 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + return service.putDefaultSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/IntLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/IntLiteralsImpl.java index 09d19ea381..672e4db8c6 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/IntLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/IntLiteralsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class IntLiteralsImpl { * The interface defining all the services for OptionalClientIntLiterals to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "OptionalClientIntLit") public interface IntLiteralsService { @Get("/type/property/optional/int/literal/all") @@ -64,8 +65,8 @@ public interface IntLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getAll(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/int/literal/all") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getAllSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/int/literal/default") @ExpectedResponses({ 200 }) @@ -82,8 +83,8 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/int/literal/default") @ExpectedResponses({ 200 }) @@ -91,8 +92,8 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/int/literal/all") @ExpectedResponses({ 204 }) @@ -100,8 +101,9 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putAll(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/int/literal/all") @ExpectedResponses({ 204 }) @@ -109,8 +111,9 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/int/literal/default") @ExpectedResponses({ 204 }) @@ -118,8 +121,9 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/int/literal/default") @ExpectedResponses({ 204 }) @@ -127,8 +131,9 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -152,7 +157,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAll(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getAll(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -175,7 +181,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getAllSync(accept, requestOptions, Context.NONE); + return service.getAllSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -199,7 +205,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDefault(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getDefault(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -222,7 +229,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getDefaultSync(accept, requestOptions, Context.NONE); + return service.getDefaultSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -246,7 +253,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putAll(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -270,7 +278,7 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + return service.putAllSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -294,7 +302,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putDefault(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -318,6 +327,6 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + return service.putDefaultSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/OptionalClientImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/OptionalClientImpl.java index bbada9f151..3340a31281 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/OptionalClientImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/OptionalClientImpl.java @@ -15,6 +15,20 @@ * Initializes a new instance of the OptionalClient type. */ public final class OptionalClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -269,19 +283,22 @@ public RequiredAndOptionalsImpl getRequiredAndOptionals() { /** * Initializes an instance of OptionalClient client. + * + * @param endpoint Service host. */ - public OptionalClientImpl() { + public OptionalClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of OptionalClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public OptionalClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public OptionalClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -289,10 +306,12 @@ public OptionalClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public OptionalClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public OptionalClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.stringOperations = new StringOperationsImpl(this); this.bytes = new BytesImpl(this); this.datetimeOperations = new DatetimeOperationsImpl(this); diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/PlainDatesImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/PlainDatesImpl.java index 5064ca2915..c971409575 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/PlainDatesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/PlainDatesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class PlainDatesImpl { * The interface defining all the services for OptionalClientPlainDates to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "OptionalClientPlainD") public interface PlainDatesService { @Get("/type/property/optional/plainDate/all") @@ -64,8 +65,8 @@ public interface PlainDatesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getAll(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/plainDate/all") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getAllSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/plainDate/default") @ExpectedResponses({ 200 }) @@ -82,8 +83,8 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/plainDate/default") @ExpectedResponses({ 200 }) @@ -91,8 +92,8 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/plainDate/all") @ExpectedResponses({ 204 }) @@ -100,8 +101,9 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putAll(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/plainDate/all") @ExpectedResponses({ 204 }) @@ -109,8 +111,9 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/plainDate/default") @ExpectedResponses({ 204 }) @@ -118,8 +121,9 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/plainDate/default") @ExpectedResponses({ 204 }) @@ -127,8 +131,9 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -152,7 +157,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAll(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getAll(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -175,7 +181,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getAllSync(accept, requestOptions, Context.NONE); + return service.getAllSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -199,7 +205,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDefault(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getDefault(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -222,7 +229,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getDefaultSync(accept, requestOptions, Context.NONE); + return service.getDefaultSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -246,7 +253,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putAll(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -270,7 +278,7 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + return service.putAllSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -294,7 +302,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putDefault(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -318,6 +327,6 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + return service.putDefaultSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/PlainTimesImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/PlainTimesImpl.java index 82c4a44b0c..12a0ebd724 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/PlainTimesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/PlainTimesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class PlainTimesImpl { * The interface defining all the services for OptionalClientPlainTimes to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "OptionalClientPlainT") public interface PlainTimesService { @Get("/type/property/optional/plainTime/all") @@ -64,8 +65,8 @@ public interface PlainTimesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getAll(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/plainTime/all") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getAllSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/plainTime/default") @ExpectedResponses({ 200 }) @@ -82,8 +83,8 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/plainTime/default") @ExpectedResponses({ 200 }) @@ -91,8 +92,8 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/plainTime/all") @ExpectedResponses({ 204 }) @@ -100,8 +101,9 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putAll(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/plainTime/all") @ExpectedResponses({ 204 }) @@ -109,8 +111,9 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/plainTime/default") @ExpectedResponses({ 204 }) @@ -118,8 +121,9 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/plainTime/default") @ExpectedResponses({ 204 }) @@ -127,8 +131,9 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -152,7 +157,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAll(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getAll(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -175,7 +181,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getAllSync(accept, requestOptions, Context.NONE); + return service.getAllSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -199,7 +205,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDefault(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getDefault(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -222,7 +229,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getDefaultSync(accept, requestOptions, Context.NONE); + return service.getDefaultSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -246,7 +253,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putAll(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -270,7 +278,7 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + return service.putAllSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -294,7 +302,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putDefault(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -318,6 +327,6 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + return service.putDefaultSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/RequiredAndOptionalsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/RequiredAndOptionalsImpl.java index b8a1857bff..4e6d033bea 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/RequiredAndOptionalsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/RequiredAndOptionalsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class RequiredAndOptionalsImpl { * The interface defining all the services for OptionalClientRequiredAndOptionals to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "OptionalClientRequir") public interface RequiredAndOptionalsService { @Get("/type/property/optional/requiredAndOptional/all") @@ -64,8 +65,8 @@ public interface RequiredAndOptionalsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getAll(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/requiredAndOptional/all") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getAllSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/requiredAndOptional/requiredOnly") @ExpectedResponses({ 200 }) @@ -82,8 +83,8 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getRequiredOnly(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getRequiredOnly(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/requiredAndOptional/requiredOnly") @ExpectedResponses({ 200 }) @@ -91,8 +92,8 @@ Mono> getRequiredOnly(@HeaderParam("Accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getRequiredOnlySync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getRequiredOnlySync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/requiredAndOptional/all") @ExpectedResponses({ 204 }) @@ -100,8 +101,9 @@ Response getRequiredOnlySync(@HeaderParam("Accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putAll(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/requiredAndOptional/all") @ExpectedResponses({ 204 }) @@ -109,8 +111,9 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/requiredAndOptional/requiredOnly") @ExpectedResponses({ 204 }) @@ -118,8 +121,9 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putRequiredOnly(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putRequiredOnly(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/requiredAndOptional/requiredOnly") @ExpectedResponses({ 204 }) @@ -127,8 +131,9 @@ Mono> putRequiredOnly(@HeaderParam("Content-Type") String content @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putRequiredOnlySync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putRequiredOnlySync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -153,7 +158,8 @@ Response putRequiredOnlySync(@HeaderParam("Content-Type") String contentTy @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAll(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getAll(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -177,7 +183,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getAllSync(accept, requestOptions, Context.NONE); + return service.getAllSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -202,7 +208,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getRequiredOnlyWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getRequiredOnly(accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.getRequiredOnly(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -226,7 +233,7 @@ public Mono> getRequiredOnlyWithResponseAsync(RequestOption @ServiceMethod(returns = ReturnType.SINGLE) public Response getRequiredOnlyWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getRequiredOnlySync(accept, requestOptions, Context.NONE); + return service.getRequiredOnlySync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -251,7 +258,8 @@ public Response getRequiredOnlyWithResponse(RequestOptions requestOp @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putAll(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -276,7 +284,7 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + return service.putAllSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -301,7 +309,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putRequiredOnlyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putRequiredOnly(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putRequiredOnly(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -326,6 +335,6 @@ public Mono> putRequiredOnlyWithResponseAsync(BinaryData body, Re @ServiceMethod(returns = ReturnType.SINGLE) public Response putRequiredOnlyWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putRequiredOnlySync(contentType, body, requestOptions, Context.NONE); + return service.putRequiredOnlySync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/StringLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/StringLiteralsImpl.java index 7e52d91201..7eb0af857e 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/StringLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/StringLiteralsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class StringLiteralsImpl { * The interface defining all the services for OptionalClientStringLiterals to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "OptionalClientString") public interface StringLiteralsService { @Get("/type/property/optional/string/literal/all") @@ -64,8 +65,8 @@ public interface StringLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getAll(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/string/literal/all") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getAllSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/string/literal/default") @ExpectedResponses({ 200 }) @@ -82,8 +83,8 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/string/literal/default") @ExpectedResponses({ 200 }) @@ -91,8 +92,8 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/literal/all") @ExpectedResponses({ 204 }) @@ -100,8 +101,9 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putAll(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/literal/all") @ExpectedResponses({ 204 }) @@ -109,8 +111,9 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/literal/default") @ExpectedResponses({ 204 }) @@ -118,8 +121,9 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/literal/default") @ExpectedResponses({ 204 }) @@ -127,8 +131,9 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -152,7 +157,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAll(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getAll(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -175,7 +181,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getAllSync(accept, requestOptions, Context.NONE); + return service.getAllSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -199,7 +205,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDefault(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getDefault(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -222,7 +229,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getDefaultSync(accept, requestOptions, Context.NONE); + return service.getDefaultSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -246,7 +253,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putAll(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -270,7 +278,7 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + return service.putAllSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -294,7 +302,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putDefault(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -318,6 +327,6 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + return service.putDefaultSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/StringOperationsImpl.java index 2b1a39629d..e75323f134 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/StringOperationsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class StringOperationsImpl { * The interface defining all the services for OptionalClientStringOperations to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "OptionalClientString") public interface StringOperationsService { @Get("/type/property/optional/string/all") @@ -64,8 +65,8 @@ public interface StringOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getAll(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/string/all") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getAllSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/string/default") @ExpectedResponses({ 200 }) @@ -82,8 +83,8 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/string/default") @ExpectedResponses({ 200 }) @@ -91,8 +92,8 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/all") @ExpectedResponses({ 204 }) @@ -100,8 +101,9 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putAll(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/all") @ExpectedResponses({ 204 }) @@ -109,8 +111,9 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/default") @ExpectedResponses({ 204 }) @@ -118,8 +121,9 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/string/default") @ExpectedResponses({ 204 }) @@ -127,8 +131,9 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -152,7 +157,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAll(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getAll(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -175,7 +181,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getAllSync(accept, requestOptions, Context.NONE); + return service.getAllSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -199,7 +205,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDefault(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getDefault(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -222,7 +229,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getDefaultSync(accept, requestOptions, Context.NONE); + return service.getDefaultSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -246,7 +253,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putAll(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -270,7 +278,7 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + return service.putAllSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -294,7 +302,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putDefault(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -318,6 +327,6 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + return service.putDefaultSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionFloatLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionFloatLiteralsImpl.java index 3ecd52230b..2d6f4c8971 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionFloatLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionFloatLiteralsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class UnionFloatLiteralsImpl { * The interface defining all the services for OptionalClientUnionFloatLiterals to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "OptionalClientUnionF") public interface UnionFloatLiteralsService { @Get("/type/property/optional/union/float/literal/all") @@ -64,8 +65,8 @@ public interface UnionFloatLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getAll(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/float/literal/all") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getAllSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/float/literal/default") @ExpectedResponses({ 200 }) @@ -82,8 +83,8 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/float/literal/default") @ExpectedResponses({ 200 }) @@ -91,8 +92,8 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/float/literal/all") @ExpectedResponses({ 204 }) @@ -100,8 +101,9 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putAll(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/float/literal/all") @ExpectedResponses({ 204 }) @@ -109,8 +111,9 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/float/literal/default") @ExpectedResponses({ 204 }) @@ -118,8 +121,9 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/float/literal/default") @ExpectedResponses({ 204 }) @@ -127,8 +131,9 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -152,7 +157,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAll(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getAll(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -175,7 +181,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getAllSync(accept, requestOptions, Context.NONE); + return service.getAllSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -199,7 +205,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDefault(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getDefault(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -222,7 +229,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getDefaultSync(accept, requestOptions, Context.NONE); + return service.getDefaultSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -246,7 +253,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putAll(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -270,7 +278,7 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + return service.putAllSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -294,7 +302,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putDefault(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -318,6 +327,6 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + return service.putDefaultSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionIntLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionIntLiteralsImpl.java index 0bbfd077ab..1f032a817c 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionIntLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionIntLiteralsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class UnionIntLiteralsImpl { * The interface defining all the services for OptionalClientUnionIntLiterals to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "OptionalClientUnionI") public interface UnionIntLiteralsService { @Get("/type/property/optional/union/int/literal/all") @@ -64,8 +65,8 @@ public interface UnionIntLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getAll(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/int/literal/all") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getAllSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/int/literal/default") @ExpectedResponses({ 200 }) @@ -82,8 +83,8 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/int/literal/default") @ExpectedResponses({ 200 }) @@ -91,8 +92,8 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/int/literal/all") @ExpectedResponses({ 204 }) @@ -100,8 +101,9 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putAll(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/int/literal/all") @ExpectedResponses({ 204 }) @@ -109,8 +111,9 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/int/literal/default") @ExpectedResponses({ 204 }) @@ -118,8 +121,9 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/int/literal/default") @ExpectedResponses({ 204 }) @@ -127,8 +131,9 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -152,7 +157,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAll(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getAll(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -175,7 +181,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getAllSync(accept, requestOptions, Context.NONE); + return service.getAllSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -199,7 +205,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDefault(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getDefault(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -222,7 +229,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getDefaultSync(accept, requestOptions, Context.NONE); + return service.getDefaultSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -246,7 +253,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putAll(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -270,7 +278,7 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + return service.putAllSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -294,7 +302,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putDefault(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -318,6 +327,6 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + return service.putDefaultSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionStringLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionStringLiteralsImpl.java index b4f6fcd356..f3269df466 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionStringLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/optional/implementation/UnionStringLiteralsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class UnionStringLiteralsImpl { * The interface defining all the services for OptionalClientUnionStringLiterals to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "OptionalClientUnionS") public interface UnionStringLiteralsService { @Get("/type/property/optional/union/string/literal/all") @@ -64,8 +65,8 @@ public interface UnionStringLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAll(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getAll(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/string/literal/all") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> getAll(@HeaderParam("Accept") String accept, RequestO @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAllSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getAllSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/string/literal/default") @ExpectedResponses({ 200 }) @@ -82,8 +83,8 @@ Response getAllSync(@HeaderParam("Accept") String accept, RequestOpt @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDefault(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> getDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/property/optional/union/string/literal/default") @ExpectedResponses({ 200 }) @@ -91,8 +92,8 @@ Mono> getDefault(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDefaultSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/string/literal/all") @ExpectedResponses({ 204 }) @@ -100,8 +101,9 @@ Response getDefaultSync(@HeaderParam("Accept") String accept, Reques @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putAll(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putAll(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/string/literal/all") @ExpectedResponses({ 204 }) @@ -109,8 +111,9 @@ Mono> putAll(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putAllSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putAllSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/string/literal/default") @ExpectedResponses({ 204 }) @@ -118,8 +121,9 @@ Response putAllSync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putDefault(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> putDefault(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/optional/union/string/literal/default") @ExpectedResponses({ 204 }) @@ -127,8 +131,9 @@ Mono> putDefault(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putDefaultSync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response putDefaultSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -152,7 +157,8 @@ Response putDefaultSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAllWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAll(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getAll(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -175,7 +181,7 @@ public Mono> getAllWithResponseAsync(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Response getAllWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getAllSync(accept, requestOptions, Context.NONE); + return service.getAllSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -199,7 +205,8 @@ public Response getAllWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDefaultWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDefault(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getDefault(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -222,7 +229,7 @@ public Mono> getDefaultWithResponseAsync(RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getDefaultSync(accept, requestOptions, Context.NONE); + return service.getDefaultSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -246,7 +253,8 @@ public Response getDefaultWithResponse(RequestOptions requestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putAllWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putAll(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putAll(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -270,7 +278,7 @@ public Mono> putAllWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response putAllWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putAllSync(contentType, body, requestOptions, Context.NONE); + return service.putAllSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -294,7 +302,8 @@ public Response putAllWithResponse(BinaryData body, RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putDefaultWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.putDefault(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.putDefault(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -318,6 +327,6 @@ public Mono> putDefaultWithResponseAsync(BinaryData body, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response putDefaultWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putDefaultSync(contentType, body, requestOptions, Context.NONE); + return service.putDefaultSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/ValueTypesClientBuilder.java b/typespec-tests/src/main/java/com/type/property/valuetypes/ValueTypesClientBuilder.java index 04bf5e080a..4c47f75403 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/ValueTypesClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/ValueTypesClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -99,8 +100,8 @@ UnionIntLiteralAsyncClient.class, UnionFloatLiteralAsyncClient.class, UnionEnumValueAsyncClient.class }) -public final class ValueTypesClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class ValueTypesClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -232,6 +233,22 @@ public ValueTypesClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ValueTypesClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -260,7 +277,7 @@ private ValueTypesClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); ValueTypesClientImpl client - = new ValueTypesClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + = new ValueTypesClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -268,6 +285,7 @@ private ValueTypesClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanLiteralsImpl.java index 84b132272b..5848e3691d 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanLiteralsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class BooleanLiteralsImpl { * The interface defining all the services for ValueTypesClientBooleanLiterals to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientBool") public interface BooleanLiteralsService { @Get("/type/property/value-types/boolean/literal") @@ -64,8 +65,8 @@ public interface BooleanLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/boolean/literal") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/boolean/literal") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/boolean/literal") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanOperationsImpl.java index 33efd5ea7f..9afe0ace2c 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BooleanOperationsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class BooleanOperationsImpl { * The interface defining all the services for ValueTypesClientBooleanOperations to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientBool") public interface BooleanOperationsService { @Get("/type/property/value-types/boolean") @@ -64,8 +65,8 @@ public interface BooleanOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/boolean") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/boolean") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/boolean") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BytesImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BytesImpl.java index c6c8425e0f..517428e4ca 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BytesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/BytesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class BytesImpl { * The interface defining all the services for ValueTypesClientBytes to be used by the proxy service to perform REST * calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientByte") public interface BytesService { @Get("/type/property/value-types/bytes") @@ -63,8 +64,8 @@ public interface BytesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/bytes") @ExpectedResponses({ 200 }) @@ -72,8 +73,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/bytes") @ExpectedResponses({ 204 }) @@ -81,8 +82,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/bytes") @ExpectedResponses({ 204 }) @@ -90,7 +92,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -114,7 +116,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -137,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -161,7 +163,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -185,6 +188,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsIntsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsIntsImpl.java index b5716fa66a..a91f37333d 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsIntsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsIntsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class CollectionsIntsImpl { * The interface defining all the services for ValueTypesClientCollectionsInts to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientColl") public interface CollectionsIntsService { @Get("/type/property/value-types/collections/int") @@ -64,8 +65,8 @@ public interface CollectionsIntsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/collections/int") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/collections/int") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/collections/int") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -117,7 +119,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -142,7 +144,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -168,7 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -194,6 +197,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsModelsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsModelsImpl.java index 76dde40f63..791cce1929 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsModelsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class CollectionsModelsImpl { * The interface defining all the services for ValueTypesClientCollectionsModels to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientColl") public interface CollectionsModelsService { @Get("/type/property/value-types/collections/model") @@ -64,8 +65,8 @@ public interface CollectionsModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/collections/model") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/collections/model") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/collections/model") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -119,7 +121,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -146,7 +148,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -174,7 +176,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -202,6 +205,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsStringsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsStringsImpl.java index d9a9898b95..a67d59771e 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/CollectionsStringsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class CollectionsStringsImpl { * The interface defining all the services for ValueTypesClientCollectionsStrings to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientColl") public interface CollectionsStringsService { @Get("/type/property/value-types/collections/string") @@ -64,8 +65,8 @@ public interface CollectionsStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/collections/string") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/collections/string") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/collections/string") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -117,7 +119,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -142,7 +144,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -168,7 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -194,6 +197,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DatetimeOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DatetimeOperationsImpl.java index 08e7321b44..592c4019b5 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DatetimeOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DatetimeOperationsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class DatetimeOperationsImpl { * The interface defining all the services for ValueTypesClientDatetimeOperations to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientDate") public interface DatetimeOperationsService { @Get("/type/property/value-types/datetime") @@ -64,8 +65,8 @@ public interface DatetimeOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/datetime") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/datetime") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/datetime") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/Decimal128sImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/Decimal128sImpl.java index 10faa32c73..b7a90b185b 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/Decimal128sImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/Decimal128sImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class Decimal128sImpl { * The interface defining all the services for ValueTypesClientDecimal128s to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientDeci") public interface Decimal128sService { @Get("/type/property/value-types/decimal128") @@ -64,8 +65,8 @@ public interface Decimal128sService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/decimal128") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/decimal128") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/decimal128") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DecimalsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DecimalsImpl.java index 578fed4876..9de39e4d74 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DecimalsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DecimalsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class DecimalsImpl { * The interface defining all the services for ValueTypesClientDecimals to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientDeci") public interface DecimalsService { @Get("/type/property/value-types/decimal") @@ -63,8 +64,8 @@ public interface DecimalsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/decimal") @ExpectedResponses({ 200 }) @@ -72,8 +73,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/decimal") @ExpectedResponses({ 204 }) @@ -81,8 +82,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/decimal") @ExpectedResponses({ 204 }) @@ -90,7 +92,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -114,7 +116,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -137,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -161,7 +163,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -185,6 +188,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DictionaryStringsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DictionaryStringsImpl.java index f693e7fd90..e9bbea5562 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DictionaryStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DictionaryStringsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class DictionaryStringsImpl { * The interface defining all the services for ValueTypesClientDictionaryStrings to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientDict") public interface DictionaryStringsService { @Get("/type/property/value-types/dictionary/string") @@ -64,8 +65,8 @@ public interface DictionaryStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/dictionary/string") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/dictionary/string") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/dictionary/string") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -117,7 +119,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -142,7 +144,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -168,7 +170,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -194,6 +197,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DurationOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DurationOperationsImpl.java index 9d9b8271e2..cdf87b14a1 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DurationOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/DurationOperationsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class DurationOperationsImpl { * The interface defining all the services for ValueTypesClientDurationOperations to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientDura") public interface DurationOperationsService { @Get("/type/property/value-types/duration") @@ -64,8 +65,8 @@ public interface DurationOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/duration") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/duration") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/duration") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/EnumsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/EnumsImpl.java index 2e57c215e7..f62709f9d9 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/EnumsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/EnumsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class EnumsImpl { * The interface defining all the services for ValueTypesClientEnums to be used by the proxy service to perform REST * calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientEnum") public interface EnumsService { @Get("/type/property/value-types/enum") @@ -63,8 +64,8 @@ public interface EnumsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/enum") @ExpectedResponses({ 200 }) @@ -72,8 +73,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/enum") @ExpectedResponses({ 204 }) @@ -81,8 +82,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/enum") @ExpectedResponses({ 204 }) @@ -90,7 +92,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -114,7 +116,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -137,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -161,7 +163,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -185,6 +188,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ExtensibleEnumsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ExtensibleEnumsImpl.java index 1fb5320647..6146f83517 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ExtensibleEnumsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ExtensibleEnumsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class ExtensibleEnumsImpl { * The interface defining all the services for ValueTypesClientExtensibleEnums to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientExte") public interface ExtensibleEnumsService { @Get("/type/property/value-types/extensible-enum") @@ -64,8 +65,8 @@ public interface ExtensibleEnumsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/extensible-enum") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/extensible-enum") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/extensible-enum") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatLiteralsImpl.java index c91c14688e..bd4c5042b2 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatLiteralsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class FloatLiteralsImpl { * The interface defining all the services for ValueTypesClientFloatLiterals to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientFloa") public interface FloatLiteralsService { @Get("/type/property/value-types/float/literal") @@ -64,8 +65,8 @@ public interface FloatLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/float/literal") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/float/literal") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/float/literal") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatOperationsImpl.java index 836996e73e..4cc17f7625 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/FloatOperationsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class FloatOperationsImpl { * The interface defining all the services for ValueTypesClientFloatOperations to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientFloa") public interface FloatOperationsService { @Get("/type/property/value-types/float") @@ -64,8 +65,8 @@ public interface FloatOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/float") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/float") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/float") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntLiteralsImpl.java index 462b651c2f..2449786fd0 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntLiteralsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class IntLiteralsImpl { * The interface defining all the services for ValueTypesClientIntLiterals to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientIntL") public interface IntLiteralsService { @Get("/type/property/value-types/int/literal") @@ -64,8 +65,8 @@ public interface IntLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/int/literal") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/int/literal") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/int/literal") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntsImpl.java index 8630ec5e99..0a68ae4beb 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/IntsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class IntsImpl { * The interface defining all the services for ValueTypesClientInts to be used by the proxy service to perform REST * calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientInts") public interface IntsService { @Get("/type/property/value-types/int") @@ -63,8 +64,8 @@ public interface IntsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/int") @ExpectedResponses({ 200 }) @@ -72,8 +73,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/int") @ExpectedResponses({ 204 }) @@ -81,8 +82,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/int") @ExpectedResponses({ 204 }) @@ -90,7 +92,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -114,7 +116,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -137,7 +139,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -161,7 +163,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -185,6 +188,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ModelsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ModelsImpl.java index abed839362..04d5f18673 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ModelsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ModelsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class ModelsImpl { * The interface defining all the services for ValueTypesClientModels to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientMode") public interface ModelsService { @Get("/type/property/value-types/model") @@ -63,8 +64,8 @@ public interface ModelsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/model") @ExpectedResponses({ 200 }) @@ -72,8 +73,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/model") @ExpectedResponses({ 204 }) @@ -81,8 +82,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/model") @ExpectedResponses({ 204 }) @@ -90,7 +92,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -116,7 +118,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -141,7 +143,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -167,7 +169,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -193,6 +196,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/NeversImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/NeversImpl.java index a773522602..ab363c68ce 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/NeversImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/NeversImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class NeversImpl { * The interface defining all the services for ValueTypesClientNevers to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientNeve") public interface NeversService { @Get("/type/property/value-types/never") @@ -63,8 +64,8 @@ public interface NeversService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/never") @ExpectedResponses({ 200 }) @@ -72,8 +73,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/never") @ExpectedResponses({ 204 }) @@ -81,8 +82,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/never") @ExpectedResponses({ 204 }) @@ -90,7 +92,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -112,7 +114,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -133,7 +135,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -155,7 +157,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -177,6 +180,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringLiteralsImpl.java index 6ab7abcf0d..f0cfae22a2 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringLiteralsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class StringLiteralsImpl { * The interface defining all the services for ValueTypesClientStringLiterals to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientStri") public interface StringLiteralsService { @Get("/type/property/value-types/string/literal") @@ -64,8 +65,8 @@ public interface StringLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/string/literal") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/string/literal") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/string/literal") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringOperationsImpl.java index 0c8bfe3696..437a592659 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/StringOperationsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class StringOperationsImpl { * The interface defining all the services for ValueTypesClientStringOperations to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientStri") public interface StringOperationsService { @Get("/type/property/value-types/string") @@ -64,8 +65,8 @@ public interface StringOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/string") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/string") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/string") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionEnumValuesImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionEnumValuesImpl.java index 7cef9087a4..c18f9dc2cc 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionEnumValuesImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionEnumValuesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class UnionEnumValuesImpl { * The interface defining all the services for ValueTypesClientUnionEnumValues to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientUnio") public interface UnionEnumValuesService { @Get("/type/property/value-types/union-enum-value") @@ -64,8 +65,8 @@ public interface UnionEnumValuesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/union-enum-value") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union-enum-value") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union-enum-value") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionFloatLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionFloatLiteralsImpl.java index f47119d3de..c587c7094b 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionFloatLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionFloatLiteralsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class UnionFloatLiteralsImpl { * The interface defining all the services for ValueTypesClientUnionFloatLiterals to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientUnio") public interface UnionFloatLiteralsService { @Get("/type/property/value-types/union/float/literal") @@ -64,8 +65,8 @@ public interface UnionFloatLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/union/float/literal") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union/float/literal") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union/float/literal") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionIntLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionIntLiteralsImpl.java index 6746a3f1e7..47b1c3216d 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionIntLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionIntLiteralsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class UnionIntLiteralsImpl { * The interface defining all the services for ValueTypesClientUnionIntLiterals to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientUnio") public interface UnionIntLiteralsService { @Get("/type/property/value-types/union/int/literal") @@ -64,8 +65,8 @@ public interface UnionIntLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/union/int/literal") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union/int/literal") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union/int/literal") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionStringLiteralsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionStringLiteralsImpl.java index ec6ed3fadf..d9176261b9 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionStringLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnionStringLiteralsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class UnionStringLiteralsImpl { * The interface defining all the services for ValueTypesClientUnionStringLiterals to be used by the proxy service * to perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientUnio") public interface UnionStringLiteralsService { @Get("/type/property/value-types/union/string/literal") @@ -64,8 +65,8 @@ public interface UnionStringLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/union/string/literal") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union/string/literal") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/union/string/literal") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownArraysImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownArraysImpl.java index 9c9de29705..5e0ce54caa 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownArraysImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class UnknownArraysImpl { * The interface defining all the services for ValueTypesClientUnknownArrays to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientUnkn") public interface UnknownArraysService { @Get("/type/property/value-types/unknown/array") @@ -64,8 +65,8 @@ public interface UnknownArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/unknown/array") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/array") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/array") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownDictsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownDictsImpl.java index 3e9cd0d034..ddf7456a9e 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownDictsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownDictsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class UnknownDictsImpl { * The interface defining all the services for ValueTypesClientUnknownDicts to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientUnkn") public interface UnknownDictsService { @Get("/type/property/value-types/unknown/dict") @@ -64,8 +65,8 @@ public interface UnknownDictsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/unknown/dict") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/dict") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/dict") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownIntsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownIntsImpl.java index 006f8823f5..c805517099 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownIntsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownIntsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class UnknownIntsImpl { * The interface defining all the services for ValueTypesClientUnknownInts to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientUnkn") public interface UnknownIntsService { @Get("/type/property/value-types/unknown/int") @@ -64,8 +65,8 @@ public interface UnknownIntsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/unknown/int") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/int") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/int") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownStringsImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownStringsImpl.java index 79b9b09940..9d8d1b6204 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownStringsImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/UnknownStringsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class UnknownStringsImpl { * The interface defining all the services for ValueTypesClientUnknownStrings to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ValueTypesClientUnkn") public interface UnknownStringsService { @Get("/type/property/value-types/unknown/string") @@ -64,8 +65,8 @@ public interface UnknownStringsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/property/value-types/unknown/string") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/string") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/property/value-types/unknown/string") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ValueTypesClientImpl.java b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ValueTypesClientImpl.java index 1380cabcd4..74ad9e1c0a 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ValueTypesClientImpl.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/implementation/ValueTypesClientImpl.java @@ -15,6 +15,20 @@ * Initializes a new instance of the ValueTypesClient type. */ public final class ValueTypesClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -451,19 +465,22 @@ public UnionEnumValuesImpl getUnionEnumValues() { /** * Initializes an instance of ValueTypesClient client. + * + * @param endpoint Service host. */ - public ValueTypesClientImpl() { + public ValueTypesClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of ValueTypesClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public ValueTypesClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public ValueTypesClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -471,10 +488,12 @@ public ValueTypesClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public ValueTypesClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public ValueTypesClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.booleanOperations = new BooleanOperationsImpl(this); this.stringOperations = new StringOperationsImpl(this); this.bytes = new BytesImpl(this); diff --git a/typespec-tests/src/main/java/com/type/scalar/ScalarClientBuilder.java b/typespec-tests/src/main/java/com/type/scalar/ScalarClientBuilder.java index be720a82e2..4f97e153e5 100644 --- a/typespec-tests/src/main/java/com/type/scalar/ScalarClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/scalar/ScalarClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -55,8 +56,8 @@ Decimal128TypeAsyncClient.class, DecimalVerifyAsyncClient.class, Decimal128VerifyAsyncClient.class }) -public final class ScalarClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class ScalarClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -187,6 +188,22 @@ public ScalarClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ScalarClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -214,7 +231,8 @@ public ScalarClientBuilder retryPolicy(RetryPolicy retryPolicy) { private ScalarClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - ScalarClientImpl client = new ScalarClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + ScalarClientImpl client + = new ScalarClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -222,6 +240,7 @@ private ScalarClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/BooleanOperationsImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/BooleanOperationsImpl.java index 9ca2085290..de2b4533c8 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/BooleanOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/BooleanOperationsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class BooleanOperationsImpl { * The interface defining all the services for ScalarClientBooleanOperations to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ScalarClientBooleanO") public interface BooleanOperationsService { @Get("/type/scalar/boolean") @@ -64,8 +65,8 @@ public interface BooleanOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/scalar/boolean") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/scalar/boolean") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/scalar/boolean") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -113,7 +115,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -134,7 +136,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -156,7 +158,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -178,6 +181,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128TypesImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128TypesImpl.java index ead3edeadf..485753a5ae 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128TypesImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128TypesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -57,7 +58,7 @@ public final class Decimal128TypesImpl { * The interface defining all the services for ScalarClientDecimal128Types to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ScalarClientDecimal1") public interface Decimal128TypesService { @Get("/type/scalar/decimal128/response_body") @@ -66,8 +67,8 @@ public interface Decimal128TypesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> responseBody(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> responseBody(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal128/response_body") @ExpectedResponses({ 200 }) @@ -75,8 +76,8 @@ Mono> responseBody(@HeaderParam("Accept") String accept, Re @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response responseBodySync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response responseBodySync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/scalar/decimal128/resquest_body") @ExpectedResponses({ 204 }) @@ -84,8 +85,9 @@ Response responseBodySync(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> requestBody(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> requestBody(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/scalar/decimal128/resquest_body") @ExpectedResponses({ 204 }) @@ -93,8 +95,9 @@ Mono> requestBody(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requestBodySync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response requestBodySync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal128/request_parameter") @ExpectedResponses({ 204 }) @@ -102,8 +105,8 @@ Response requestBodySync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> requestParameter(@QueryParam("value") BigDecimal value, RequestOptions requestOptions, - Context context); + Mono> requestParameter(@HostParam("endpoint") String endpoint, + @QueryParam("value") BigDecimal value, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal128/request_parameter") @ExpectedResponses({ 204 }) @@ -111,8 +114,8 @@ Mono> requestParameter(@QueryParam("value") BigDecimal value, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requestParameterSync(@QueryParam("value") BigDecimal value, RequestOptions requestOptions, - Context context); + Response requestParameterSync(@HostParam("endpoint") String endpoint, + @QueryParam("value") BigDecimal value, RequestOptions requestOptions, Context context); } /** @@ -133,7 +136,8 @@ Response requestParameterSync(@QueryParam("value") BigDecimal value, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseBodyWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseBody(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.responseBody(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -154,7 +158,7 @@ public Mono> responseBodyWithResponseAsync(RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Response responseBodyWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.responseBodySync(accept, requestOptions, Context.NONE); + return service.responseBodySync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -176,7 +180,8 @@ public Response responseBodyWithResponse(RequestOptions requestOptio @ServiceMethod(returns = ReturnType.SINGLE) public Mono> requestBodyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.requestBody(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.requestBody(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -198,7 +203,7 @@ public Mono> requestBodyWithResponseAsync(BinaryData body, Reques @ServiceMethod(returns = ReturnType.SINGLE) public Response requestBodyWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.requestBodySync(contentType, body, requestOptions, Context.NONE); + return service.requestBodySync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -214,7 +219,8 @@ public Response requestBodyWithResponse(BinaryData body, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> requestParameterWithResponseAsync(BigDecimal value, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.requestParameter(value, requestOptions, context)); + return FluxUtil.withContext( + context -> service.requestParameter(this.client.getEndpoint(), value, requestOptions, context)); } /** @@ -230,6 +236,6 @@ public Mono> requestParameterWithResponseAsync(BigDecimal value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response requestParameterWithResponse(BigDecimal value, RequestOptions requestOptions) { - return service.requestParameterSync(value, requestOptions, Context.NONE); + return service.requestParameterSync(this.client.getEndpoint(), value, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128VerifiesImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128VerifiesImpl.java index 873e28ba4e..60333b6446 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128VerifiesImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/Decimal128VerifiesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class Decimal128VerifiesImpl { * The interface defining all the services for ScalarClientDecimal128Verifies to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ScalarClientDecimal1") public interface Decimal128VerifiesService { @Get("/type/scalar/decimal128/prepare_verify") @@ -64,8 +65,8 @@ public interface Decimal128VerifiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> prepareVerify(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> prepareVerify(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal128/prepare_verify") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> prepareVerify(@HeaderParam("Accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response prepareVerifySync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response prepareVerifySync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/scalar/decimal128/verify") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response prepareVerifySync(@HeaderParam("Accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> verify(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> verify(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/type/scalar/decimal128/verify") @ExpectedResponses({ 204 }) @@ -91,8 +93,9 @@ Mono> verify(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response verifySync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response verifySync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -115,7 +118,8 @@ Response verifySync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> prepareVerifyWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.prepareVerify(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.prepareVerify(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +142,7 @@ public Mono> prepareVerifyWithResponseAsync(RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response prepareVerifyWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.prepareVerifySync(accept, requestOptions, Context.NONE); + return service.prepareVerifySync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -160,7 +164,8 @@ public Response prepareVerifyWithResponse(RequestOptions requestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Mono> verifyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.verify(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.verify(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -182,6 +187,6 @@ public Mono> verifyWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response verifyWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.verifySync(contentType, body, requestOptions, Context.NONE); + return service.verifySync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalTypesImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalTypesImpl.java index 5773f7981d..f4883c57e8 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalTypesImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalTypesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -57,7 +58,7 @@ public final class DecimalTypesImpl { * The interface defining all the services for ScalarClientDecimalTypes to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ScalarClientDecimalT") public interface DecimalTypesService { @Get("/type/scalar/decimal/response_body") @@ -66,8 +67,8 @@ public interface DecimalTypesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> responseBody(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> responseBody(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal/response_body") @ExpectedResponses({ 200 }) @@ -75,8 +76,8 @@ Mono> responseBody(@HeaderParam("Accept") String accept, Re @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response responseBodySync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response responseBodySync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/type/scalar/decimal/resquest_body") @ExpectedResponses({ 204 }) @@ -84,8 +85,9 @@ Response responseBodySync(@HeaderParam("Accept") String accept, Requ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> requestBody(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> requestBody(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/scalar/decimal/resquest_body") @ExpectedResponses({ 204 }) @@ -93,8 +95,9 @@ Mono> requestBody(@HeaderParam("Content-Type") String contentType @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requestBodySync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response requestBodySync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal/request_parameter") @ExpectedResponses({ 204 }) @@ -102,8 +105,8 @@ Response requestBodySync(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> requestParameter(@QueryParam("value") BigDecimal value, RequestOptions requestOptions, - Context context); + Mono> requestParameter(@HostParam("endpoint") String endpoint, + @QueryParam("value") BigDecimal value, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal/request_parameter") @ExpectedResponses({ 204 }) @@ -111,8 +114,8 @@ Mono> requestParameter(@QueryParam("value") BigDecimal value, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response requestParameterSync(@QueryParam("value") BigDecimal value, RequestOptions requestOptions, - Context context); + Response requestParameterSync(@HostParam("endpoint") String endpoint, + @QueryParam("value") BigDecimal value, RequestOptions requestOptions, Context context); } /** @@ -134,7 +137,8 @@ Response requestParameterSync(@QueryParam("value") BigDecimal value, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Mono> responseBodyWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.responseBody(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.responseBody(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -155,7 +159,7 @@ public Mono> responseBodyWithResponseAsync(RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Response responseBodyWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.responseBodySync(accept, requestOptions, Context.NONE); + return service.responseBodySync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -177,7 +181,8 @@ public Response responseBodyWithResponse(RequestOptions requestOptio @ServiceMethod(returns = ReturnType.SINGLE) public Mono> requestBodyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.requestBody(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.requestBody(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -199,7 +204,7 @@ public Mono> requestBodyWithResponseAsync(BinaryData body, Reques @ServiceMethod(returns = ReturnType.SINGLE) public Response requestBodyWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.requestBodySync(contentType, body, requestOptions, Context.NONE); + return service.requestBodySync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -215,7 +220,8 @@ public Response requestBodyWithResponse(BinaryData body, RequestOptions re */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> requestParameterWithResponseAsync(BigDecimal value, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.requestParameter(value, requestOptions, context)); + return FluxUtil.withContext( + context -> service.requestParameter(this.client.getEndpoint(), value, requestOptions, context)); } /** @@ -231,6 +237,6 @@ public Mono> requestParameterWithResponseAsync(BigDecimal value, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response requestParameterWithResponse(BigDecimal value, RequestOptions requestOptions) { - return service.requestParameterSync(value, requestOptions, Context.NONE); + return service.requestParameterSync(this.client.getEndpoint(), value, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalVerifiesImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalVerifiesImpl.java index c1981b7463..a74d656a76 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalVerifiesImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/DecimalVerifiesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class DecimalVerifiesImpl { * The interface defining all the services for ScalarClientDecimalVerifies to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ScalarClientDecimalV") public interface DecimalVerifiesService { @Get("/type/scalar/decimal/prepare_verify") @@ -64,8 +65,8 @@ public interface DecimalVerifiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> prepareVerify(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> prepareVerify(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/type/scalar/decimal/prepare_verify") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> prepareVerify(@HeaderParam("Accept") String accept, R @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response prepareVerifySync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response prepareVerifySync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/type/scalar/decimal/verify") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response prepareVerifySync(@HeaderParam("Accept") String accept, Req @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> verify(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> verify(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/type/scalar/decimal/verify") @ExpectedResponses({ 204 }) @@ -91,8 +93,9 @@ Mono> verify(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response verifySync(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Response verifySync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); } /** @@ -115,7 +118,8 @@ Response verifySync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> prepareVerifyWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.prepareVerify(accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.prepareVerify(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +142,7 @@ public Mono> prepareVerifyWithResponseAsync(RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response prepareVerifyWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.prepareVerifySync(accept, requestOptions, Context.NONE); + return service.prepareVerifySync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -160,7 +164,8 @@ public Response prepareVerifyWithResponse(RequestOptions requestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Mono> verifyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.verify(contentType, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.verify(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -182,6 +187,6 @@ public Mono> verifyWithResponseAsync(BinaryData body, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response verifyWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.verifySync(contentType, body, requestOptions, Context.NONE); + return service.verifySync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/ScalarClientImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/ScalarClientImpl.java index fe44e11fce..1da15a1e67 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/ScalarClientImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/ScalarClientImpl.java @@ -15,6 +15,20 @@ * Initializes a new instance of the ScalarClient type. */ public final class ScalarClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -143,19 +157,22 @@ public Decimal128VerifiesImpl getDecimal128Verifies() { /** * Initializes an instance of ScalarClient client. + * + * @param endpoint Service host. */ - public ScalarClientImpl() { + public ScalarClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of ScalarClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public ScalarClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public ScalarClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -163,10 +180,12 @@ public ScalarClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public ScalarClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public ScalarClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.stringOperations = new StringOperationsImpl(this); this.booleanOperations = new BooleanOperationsImpl(this); this.unknowns = new UnknownsImpl(this); diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/StringOperationsImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/StringOperationsImpl.java index 876bc0937a..de7b8ad0c7 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/StringOperationsImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/StringOperationsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class StringOperationsImpl { * The interface defining all the services for ScalarClientStringOperations to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ScalarClientStringOp") public interface StringOperationsService { @Get("/type/scalar/string") @@ -64,8 +65,8 @@ public interface StringOperationsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/scalar/string") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/scalar/string") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/scalar/string") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -113,7 +115,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -134,7 +136,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -156,7 +158,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -178,6 +181,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/scalar/implementation/UnknownsImpl.java b/typespec-tests/src/main/java/com/type/scalar/implementation/UnknownsImpl.java index 0ffb66e5aa..584c563198 100644 --- a/typespec-tests/src/main/java/com/type/scalar/implementation/UnknownsImpl.java +++ b/typespec-tests/src/main/java/com/type/scalar/implementation/UnknownsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class UnknownsImpl { * The interface defining all the services for ScalarClientUnknowns to be used by the proxy service to perform REST * calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "ScalarClientUnknowns") public interface UnknownsService { @Get("/type/scalar/unknown") @@ -63,8 +64,8 @@ public interface UnknownsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/scalar/unknown") @ExpectedResponses({ 200 }) @@ -72,8 +73,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Put("/type/scalar/unknown") @ExpectedResponses({ 204 }) @@ -81,8 +82,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> put(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/type/scalar/unknown") @ExpectedResponses({ 204 }) @@ -90,7 +92,7 @@ Mono> put(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putSync(@HeaderParam("Content-Type") String contentType, + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -112,7 +114,7 @@ Response putSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -133,7 +135,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -155,7 +157,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.put(contentType, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -177,6 +180,6 @@ public Mono> putWithResponseAsync(BinaryData body, RequestOptions @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.putSync(contentType, body, requestOptions, Context.NONE); + return service.putSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/UnionClientBuilder.java b/typespec-tests/src/main/java/com/type/union/UnionClientBuilder.java index 68aa7f3355..4283030b51 100644 --- a/typespec-tests/src/main/java/com/type/union/UnionClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/union/UnionClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -61,7 +62,8 @@ StringAndArrayAsyncClient.class, MixedLiteralsAsyncClient.class, MixedTypesAsyncClient.class }) -public final class UnionClientBuilder implements HttpTrait, ConfigurationTrait { +public final class UnionClientBuilder implements HttpTrait, ConfigurationTrait, + EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -192,6 +194,22 @@ public UnionClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public UnionClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -219,7 +237,8 @@ public UnionClientBuilder retryPolicy(RetryPolicy retryPolicy) { private UnionClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - UnionClientImpl client = new UnionClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + UnionClientImpl client + = new UnionClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -227,6 +246,7 @@ private UnionClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/union/implementation/EnumsOnliesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/EnumsOnliesImpl.java index b212091519..0c996a5669 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/EnumsOnliesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/EnumsOnliesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class EnumsOnliesImpl { * The interface defining all the services for UnionClientEnumsOnlies to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "UnionClientEnumsOnli") public interface EnumsOnliesService { @Get("/type/union/enums-only") @@ -64,8 +65,8 @@ public interface EnumsOnliesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/union/enums-only") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Post("/type/union/enums-only") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData sendRequest3, RequestOptions requestOptions, Context context); + Mono> send(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest3, + RequestOptions requestOptions, Context context); @Post("/type/union/enums-only") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> send(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("Content-Type") String contentType, + Response sendSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest3, RequestOptions requestOptions, Context context); } @@ -118,7 +120,7 @@ Response sendSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -144,7 +146,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -171,7 +173,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest3, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.send(contentType, sendRequest3, requestOptions, context)); + return FluxUtil.withContext( + context -> service.send(this.client.getEndpoint(), contentType, sendRequest3, requestOptions, context)); } /** @@ -198,6 +201,6 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest3, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest3, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.sendSync(contentType, sendRequest3, requestOptions, Context.NONE); + return service.sendSync(this.client.getEndpoint(), contentType, sendRequest3, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/FloatsOnliesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/FloatsOnliesImpl.java index a59bb71ea2..535a35f0b4 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/FloatsOnliesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/FloatsOnliesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class FloatsOnliesImpl { * The interface defining all the services for UnionClientFloatsOnlies to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "UnionClientFloatsOnl") public interface FloatsOnliesService { @Get("/type/union/floats-only") @@ -64,8 +65,8 @@ public interface FloatsOnliesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/union/floats-only") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Post("/type/union/floats-only") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData sendRequest5, RequestOptions requestOptions, Context context); + Mono> send(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest5, + RequestOptions requestOptions, Context context); @Post("/type/union/floats-only") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> send(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("Content-Type") String contentType, + Response sendSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest5, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response sendSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest5, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.send(contentType, sendRequest5, requestOptions, context)); + return FluxUtil.withContext( + context -> service.send(this.client.getEndpoint(), contentType, sendRequest5, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest5, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest5, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.sendSync(contentType, sendRequest5, requestOptions, Context.NONE); + return service.sendSync(this.client.getEndpoint(), contentType, sendRequest5, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/IntsOnliesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/IntsOnliesImpl.java index 99d90d9646..3fb60afe18 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/IntsOnliesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/IntsOnliesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class IntsOnliesImpl { * The interface defining all the services for UnionClientIntsOnlies to be used by the proxy service to perform REST * calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "UnionClientIntsOnlie") public interface IntsOnliesService { @Get("/type/union/ints-only") @@ -64,8 +65,8 @@ public interface IntsOnliesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/union/ints-only") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Post("/type/union/ints-only") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData sendRequest6, RequestOptions requestOptions, Context context); + Mono> send(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest6, + RequestOptions requestOptions, Context context); @Post("/type/union/ints-only") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> send(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("Content-Type") String contentType, + Response sendSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest6, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response sendSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest6, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.send(contentType, sendRequest6, requestOptions, context)); + return FluxUtil.withContext( + context -> service.send(this.client.getEndpoint(), contentType, sendRequest6, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest6, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest6, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.sendSync(contentType, sendRequest6, requestOptions, Context.NONE); + return service.sendSync(this.client.getEndpoint(), contentType, sendRequest6, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/MixedLiteralsImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/MixedLiteralsImpl.java index 24bff76dff..ba55149b22 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/MixedLiteralsImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/MixedLiteralsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class MixedLiteralsImpl { * The interface defining all the services for UnionClientMixedLiterals to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "UnionClientMixedLite") public interface MixedLiteralsService { @Get("/type/union/mixed-literals") @@ -64,8 +65,8 @@ public interface MixedLiteralsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/union/mixed-literals") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Post("/type/union/mixed-literals") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData sendRequest1, RequestOptions requestOptions, Context context); + Mono> send(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest1, + RequestOptions requestOptions, Context context); @Post("/type/union/mixed-literals") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> send(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("Content-Type") String contentType, + Response sendSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest1, RequestOptions requestOptions, Context context); } @@ -120,7 +122,7 @@ Response sendSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -148,7 +150,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -177,7 +179,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest1, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.send(contentType, sendRequest1, requestOptions, context)); + return FluxUtil.withContext( + context -> service.send(this.client.getEndpoint(), contentType, sendRequest1, requestOptions, context)); } /** @@ -206,6 +209,6 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest1, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest1, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.sendSync(contentType, sendRequest1, requestOptions, Context.NONE); + return service.sendSync(this.client.getEndpoint(), contentType, sendRequest1, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/MixedTypesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/MixedTypesImpl.java index aafe11c1b4..addcec99e0 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/MixedTypesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/MixedTypesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class MixedTypesImpl { * The interface defining all the services for UnionClientMixedTypes to be used by the proxy service to perform REST * calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "UnionClientMixedType") public interface MixedTypesService { @Get("/type/union/mixed-types") @@ -64,8 +65,8 @@ public interface MixedTypesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/union/mixed-types") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Post("/type/union/mixed-types") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData sendRequest, RequestOptions requestOptions, Context context); + Mono> send(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest, + RequestOptions requestOptions, Context context); @Post("/type/union/mixed-types") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> send(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("Content-Type") String contentType, + Response sendSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest, RequestOptions requestOptions, Context context); } @@ -123,7 +125,7 @@ Response sendSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -154,7 +156,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -186,7 +188,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.send(contentType, sendRequest, requestOptions, context)); + return FluxUtil.withContext( + context -> service.send(this.client.getEndpoint(), contentType, sendRequest, requestOptions, context)); } /** @@ -218,6 +221,6 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest, Reques @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.sendSync(contentType, sendRequest, requestOptions, Context.NONE); + return service.sendSync(this.client.getEndpoint(), contentType, sendRequest, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/ModelsOnliesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/ModelsOnliesImpl.java index 769705e92e..fcb3375e22 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/ModelsOnliesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/ModelsOnliesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class ModelsOnliesImpl { * The interface defining all the services for UnionClientModelsOnlies to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "UnionClientModelsOnl") public interface ModelsOnliesService { @Get("/type/union/models-only") @@ -64,8 +65,8 @@ public interface ModelsOnliesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/union/models-only") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Post("/type/union/models-only") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData sendRequest4, RequestOptions requestOptions, Context context); + Mono> send(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest4, + RequestOptions requestOptions, Context context); @Post("/type/union/models-only") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> send(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("Content-Type") String contentType, + Response sendSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest4, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response sendSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest4, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.send(contentType, sendRequest4, requestOptions, context)); + return FluxUtil.withContext( + context -> service.send(this.client.getEndpoint(), contentType, sendRequest4, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest4, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest4, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.sendSync(contentType, sendRequest4, requestOptions, Context.NONE); + return service.sendSync(this.client.getEndpoint(), contentType, sendRequest4, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/StringAndArraysImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/StringAndArraysImpl.java index 72ad57f6c0..671d05b444 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/StringAndArraysImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/StringAndArraysImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class StringAndArraysImpl { * The interface defining all the services for UnionClientStringAndArrays to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "UnionClientStringAnd") public interface StringAndArraysService { @Get("/type/union/string-and-array") @@ -64,8 +65,8 @@ public interface StringAndArraysService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/union/string-and-array") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Post("/type/union/string-and-array") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData sendRequest2, RequestOptions requestOptions, Context context); + Mono> send(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest2, + RequestOptions requestOptions, Context context); @Post("/type/union/string-and-array") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> send(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("Content-Type") String contentType, + Response sendSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest2, RequestOptions requestOptions, Context context); } @@ -118,7 +120,7 @@ Response sendSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -144,7 +146,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -171,7 +173,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest2, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.send(contentType, sendRequest2, requestOptions, context)); + return FluxUtil.withContext( + context -> service.send(this.client.getEndpoint(), contentType, sendRequest2, requestOptions, context)); } /** @@ -198,6 +201,6 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest2, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest2, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.sendSync(contentType, sendRequest2, requestOptions, Context.NONE); + return service.sendSync(this.client.getEndpoint(), contentType, sendRequest2, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/StringExtensibleNamedsImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/StringExtensibleNamedsImpl.java index b52c1fd016..8e6c8c197a 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/StringExtensibleNamedsImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/StringExtensibleNamedsImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class StringExtensibleNamedsImpl { * The interface defining all the services for UnionClientStringExtensibleNameds to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "UnionClientStringExt") public interface StringExtensibleNamedsService { @Get("/type/union/string-extensible-named") @@ -64,8 +65,8 @@ public interface StringExtensibleNamedsService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/union/string-extensible-named") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Post("/type/union/string-extensible-named") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData sendRequest7, RequestOptions requestOptions, Context context); + Mono> send(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest7, + RequestOptions requestOptions, Context context); @Post("/type/union/string-extensible-named") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> send(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("Content-Type") String contentType, + Response sendSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest7, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response sendSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest7, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.send(contentType, sendRequest7, requestOptions, context)); + return FluxUtil.withContext( + context -> service.send(this.client.getEndpoint(), contentType, sendRequest7, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest7, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest7, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.sendSync(contentType, sendRequest7, requestOptions, Context.NONE); + return service.sendSync(this.client.getEndpoint(), contentType, sendRequest7, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/StringExtensiblesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/StringExtensiblesImpl.java index 91d254d8b4..fd556aca11 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/StringExtensiblesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/StringExtensiblesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class StringExtensiblesImpl { * The interface defining all the services for UnionClientStringExtensibles to be used by the proxy service to * perform REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "UnionClientStringExt") public interface StringExtensiblesService { @Get("/type/union/string-extensible") @@ -64,8 +65,8 @@ public interface StringExtensiblesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/union/string-extensible") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Post("/type/union/string-extensible") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData sendRequest8, RequestOptions requestOptions, Context context); + Mono> send(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest8, + RequestOptions requestOptions, Context context); @Post("/type/union/string-extensible") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> send(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("Content-Type") String contentType, + Response sendSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest8, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response sendSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest8, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.send(contentType, sendRequest8, requestOptions, context)); + return FluxUtil.withContext( + context -> service.send(this.client.getEndpoint(), contentType, sendRequest8, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest8, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest8, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.sendSync(contentType, sendRequest8, requestOptions, Context.NONE); + return service.sendSync(this.client.getEndpoint(), contentType, sendRequest8, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/StringsOnliesImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/StringsOnliesImpl.java index a1f5912b78..902e491648 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/StringsOnliesImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/StringsOnliesImpl.java @@ -9,6 +9,7 @@ import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -55,7 +56,7 @@ public final class StringsOnliesImpl { * The interface defining all the services for UnionClientStringsOnlies to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "UnionClientStringsOn") public interface StringsOnliesService { @Get("/type/union/strings-only") @@ -64,8 +65,8 @@ public interface StringsOnliesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/type/union/strings-only") @ExpectedResponses({ 200 }) @@ -73,8 +74,8 @@ Mono> get(@HeaderParam("Accept") String accept, RequestOpti @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSync(@HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Post("/type/union/strings-only") @ExpectedResponses({ 204 }) @@ -82,8 +83,9 @@ Response getSync(@HeaderParam("Accept") String accept, RequestOption @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> send(@HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData sendRequest9, RequestOptions requestOptions, Context context); + Mono> send(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest9, + RequestOptions requestOptions, Context context); @Post("/type/union/strings-only") @ExpectedResponses({ 204 }) @@ -91,7 +93,7 @@ Mono> send(@HeaderParam("Content-Type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sendSync(@HeaderParam("Content-Type") String contentType, + Response sendSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData sendRequest9, RequestOptions requestOptions, Context context); } @@ -115,7 +117,7 @@ Response sendSync(@HeaderParam("Content-Type") String contentType, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); } /** @@ -138,7 +140,7 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(accept, requestOptions, Context.NONE); + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } /** @@ -162,7 +164,8 @@ public Response getWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendWithResponseAsync(BinaryData sendRequest9, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.send(contentType, sendRequest9, requestOptions, context)); + return FluxUtil.withContext( + context -> service.send(this.client.getEndpoint(), contentType, sendRequest9, requestOptions, context)); } /** @@ -186,6 +189,6 @@ public Mono> sendWithResponseAsync(BinaryData sendRequest9, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response sendWithResponse(BinaryData sendRequest9, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.sendSync(contentType, sendRequest9, requestOptions, Context.NONE); + return service.sendSync(this.client.getEndpoint(), contentType, sendRequest9, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/type/union/implementation/UnionClientImpl.java b/typespec-tests/src/main/java/com/type/union/implementation/UnionClientImpl.java index 050995d3be..7a4459ca77 100644 --- a/typespec-tests/src/main/java/com/type/union/implementation/UnionClientImpl.java +++ b/typespec-tests/src/main/java/com/type/union/implementation/UnionClientImpl.java @@ -15,6 +15,20 @@ * Initializes a new instance of the UnionClient type. */ public final class UnionClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -185,19 +199,22 @@ public MixedTypesImpl getMixedTypes() { /** * Initializes an instance of UnionClient client. + * + * @param endpoint Service host. */ - public UnionClientImpl() { + public UnionClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of UnionClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public UnionClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public UnionClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -205,10 +222,12 @@ public UnionClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public UnionClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public UnionClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.stringsOnlies = new StringsOnliesImpl(this); this.stringExtensibles = new StringExtensiblesImpl(this); this.stringExtensibleNameds = new StringExtensibleNamedsImpl(this); diff --git a/typespec-tests/src/samples/java/com/_specs_/azure/example/basic/generated/BasicAction.java b/typespec-tests/src/samples/java/com/_specs_/azure/example/basic/generated/BasicAction.java index e2bb62fdc7..b89367dc42 100644 --- a/typespec-tests/src/samples/java/com/_specs_/azure/example/basic/generated/BasicAction.java +++ b/typespec-tests/src/samples/java/com/_specs_/azure/example/basic/generated/BasicAction.java @@ -10,13 +10,16 @@ import com._specs_.azure.example.basic.models.ActionResponse; import com._specs_.azure.example.basic.models.Enum; import com._specs_.azure.example.basic.models.Model; +import com.azure.core.util.Configuration; import java.util.Arrays; import java.util.HashMap; import java.util.Map; public class BasicAction { public static void main(String[] args) { - AzureExampleClient azureExampleClient = new AzureExampleClientBuilder().buildClient(); + AzureExampleClient azureExampleClient + = new AzureExampleClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); // BEGIN:com._specs_.azure.example.basic.generated.basicaction.basicaction ActionResponse response = azureExampleClient.basicAction("query", "header", new ActionRequest("text") diff --git a/typespec-tests/src/test/java/com/_specs_/azure/clientgenerator/core/access/generated/AccessClientTestBase.java b/typespec-tests/src/test/java/com/_specs_/azure/clientgenerator/core/access/generated/AccessClientTestBase.java index 994183c7b3..c4218921d9 100644 --- a/typespec-tests/src/test/java/com/_specs_/azure/clientgenerator/core/access/generated/AccessClientTestBase.java +++ b/typespec-tests/src/test/java/com/_specs_/azure/clientgenerator/core/access/generated/AccessClientTestBase.java @@ -18,6 +18,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; class AccessClientTestBase extends TestProxyTestBase { protected PublicOperationClient publicOperationClient; @@ -31,7 +32,8 @@ class AccessClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { AccessClientBuilder publicOperationClientbuilder - = new AccessClientBuilder().httpClient(HttpClient.createDefault()) + = new AccessClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { publicOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -41,7 +43,8 @@ protected void beforeTest() { publicOperationClient = publicOperationClientbuilder.buildPublicOperationClient(); AccessClientBuilder internalOperationClientbuilder - = new AccessClientBuilder().httpClient(HttpClient.createDefault()) + = new AccessClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { internalOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -51,7 +54,8 @@ protected void beforeTest() { internalOperationClient = internalOperationClientbuilder.buildInternalOperationClient(); AccessClientBuilder sharedModelInOperationClientbuilder - = new AccessClientBuilder().httpClient(HttpClient.createDefault()) + = new AccessClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { sharedModelInOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -61,7 +65,8 @@ protected void beforeTest() { sharedModelInOperationClient = sharedModelInOperationClientbuilder.buildSharedModelInOperationClient(); AccessClientBuilder relativeModelInOperationClientbuilder - = new AccessClientBuilder().httpClient(HttpClient.createDefault()) + = new AccessClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { relativeModelInOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); diff --git a/typespec-tests/src/test/java/com/_specs_/azure/clientgenerator/core/usage/generated/UsageClientTestBase.java b/typespec-tests/src/test/java/com/_specs_/azure/clientgenerator/core/usage/generated/UsageClientTestBase.java index 774278f9d7..117dac3564 100644 --- a/typespec-tests/src/test/java/com/_specs_/azure/clientgenerator/core/usage/generated/UsageClientTestBase.java +++ b/typespec-tests/src/test/java/com/_specs_/azure/clientgenerator/core/usage/generated/UsageClientTestBase.java @@ -15,14 +15,17 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; class UsageClientTestBase extends TestProxyTestBase { protected UsageClient usageClient; @Override protected void beforeTest() { - UsageClientBuilder usageClientbuilder = new UsageClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + UsageClientBuilder usageClientbuilder + = new UsageClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { usageClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/_specs_/azure/core/basic/generated/BasicClientTestBase.java b/typespec-tests/src/test/java/com/_specs_/azure/core/basic/generated/BasicClientTestBase.java index b170bd5050..d78436f994 100644 --- a/typespec-tests/src/test/java/com/_specs_/azure/core/basic/generated/BasicClientTestBase.java +++ b/typespec-tests/src/test/java/com/_specs_/azure/core/basic/generated/BasicClientTestBase.java @@ -15,14 +15,17 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; class BasicClientTestBase extends TestProxyTestBase { protected BasicClient basicClient; @Override protected void beforeTest() { - BasicClientBuilder basicClientbuilder = new BasicClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + BasicClientBuilder basicClientbuilder + = new BasicClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { basicClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/_specs_/azure/core/lro/rpc/generated/RpcClientTestBase.java b/typespec-tests/src/test/java/com/_specs_/azure/core/lro/rpc/generated/RpcClientTestBase.java index ddac5cb0db..520ccf1ea3 100644 --- a/typespec-tests/src/test/java/com/_specs_/azure/core/lro/rpc/generated/RpcClientTestBase.java +++ b/typespec-tests/src/test/java/com/_specs_/azure/core/lro/rpc/generated/RpcClientTestBase.java @@ -15,14 +15,17 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; class RpcClientTestBase extends TestProxyTestBase { protected RpcClient rpcClient; @Override protected void beforeTest() { - RpcClientBuilder rpcClientbuilder = new RpcClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + RpcClientBuilder rpcClientbuilder + = new RpcClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { rpcClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/_specs_/azure/core/lro/standard/generated/StandardClientTestBase.java b/typespec-tests/src/test/java/com/_specs_/azure/core/lro/standard/generated/StandardClientTestBase.java index e7d75b18b0..cb08fc2028 100644 --- a/typespec-tests/src/test/java/com/_specs_/azure/core/lro/standard/generated/StandardClientTestBase.java +++ b/typespec-tests/src/test/java/com/_specs_/azure/core/lro/standard/generated/StandardClientTestBase.java @@ -15,14 +15,17 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; class StandardClientTestBase extends TestProxyTestBase { protected StandardClient standardClient; @Override protected void beforeTest() { - StandardClientBuilder standardClientbuilder = new StandardClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + StandardClientBuilder standardClientbuilder + = new StandardClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { standardClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/_specs_/azure/core/model/generated/ModelClientTestBase.java b/typespec-tests/src/test/java/com/_specs_/azure/core/model/generated/ModelClientTestBase.java index 5c53f73869..9743c6f71a 100644 --- a/typespec-tests/src/test/java/com/_specs_/azure/core/model/generated/ModelClientTestBase.java +++ b/typespec-tests/src/test/java/com/_specs_/azure/core/model/generated/ModelClientTestBase.java @@ -15,14 +15,17 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; class ModelClientTestBase extends TestProxyTestBase { protected ModelClient modelClient; @Override protected void beforeTest() { - ModelClientBuilder modelClientbuilder = new ModelClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ModelClientBuilder modelClientbuilder + = new ModelClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { modelClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/_specs_/azure/core/page/generated/PageClientTestBase.java b/typespec-tests/src/test/java/com/_specs_/azure/core/page/generated/PageClientTestBase.java index 8ab03ed7b9..fc7fd8fca5 100644 --- a/typespec-tests/src/test/java/com/_specs_/azure/core/page/generated/PageClientTestBase.java +++ b/typespec-tests/src/test/java/com/_specs_/azure/core/page/generated/PageClientTestBase.java @@ -16,6 +16,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; class PageClientTestBase extends TestProxyTestBase { protected PageClient pageClient; @@ -24,8 +25,10 @@ class PageClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - PageClientBuilder pageClientbuilder = new PageClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + PageClientBuilder pageClientbuilder + = new PageClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { pageClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -34,7 +37,8 @@ protected void beforeTest() { pageClient = pageClientbuilder.buildClient(); PageClientBuilder twoModelsAsPageItemClientbuilder - = new PageClientBuilder().httpClient(HttpClient.createDefault()) + = new PageClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { twoModelsAsPageItemClientbuilder.httpClient(interceptorManager.getPlaybackClient()); diff --git a/typespec-tests/src/test/java/com/_specs_/azure/core/scalar/generated/ScalarClientTestBase.java b/typespec-tests/src/test/java/com/_specs_/azure/core/scalar/generated/ScalarClientTestBase.java index 9ef79ad174..e64f2a3391 100644 --- a/typespec-tests/src/test/java/com/_specs_/azure/core/scalar/generated/ScalarClientTestBase.java +++ b/typespec-tests/src/test/java/com/_specs_/azure/core/scalar/generated/ScalarClientTestBase.java @@ -15,14 +15,17 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; class ScalarClientTestBase extends TestProxyTestBase { protected ScalarClient scalarClient; @Override protected void beforeTest() { - ScalarClientBuilder scalarClientbuilder = new ScalarClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ScalarClientBuilder scalarClientbuilder + = new ScalarClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { scalarClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/_specs_/azure/core/traits/generated/TraitsClientTestBase.java b/typespec-tests/src/test/java/com/_specs_/azure/core/traits/generated/TraitsClientTestBase.java index 453debb61d..ad56f9a814 100644 --- a/typespec-tests/src/test/java/com/_specs_/azure/core/traits/generated/TraitsClientTestBase.java +++ b/typespec-tests/src/test/java/com/_specs_/azure/core/traits/generated/TraitsClientTestBase.java @@ -15,14 +15,17 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; class TraitsClientTestBase extends TestProxyTestBase { protected TraitsClient traitsClient; @Override protected void beforeTest() { - TraitsClientBuilder traitsClientbuilder = new TraitsClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + TraitsClientBuilder traitsClientbuilder + = new TraitsClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { traitsClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/_specs_/azure/example/basic/generated/AzureExampleClientTestBase.java b/typespec-tests/src/test/java/com/_specs_/azure/example/basic/generated/AzureExampleClientTestBase.java index 4ef683eb85..976d88f295 100644 --- a/typespec-tests/src/test/java/com/_specs_/azure/example/basic/generated/AzureExampleClientTestBase.java +++ b/typespec-tests/src/test/java/com/_specs_/azure/example/basic/generated/AzureExampleClientTestBase.java @@ -15,15 +15,17 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; class AzureExampleClientTestBase extends TestProxyTestBase { protected AzureExampleClient azureExampleClient; @Override protected void beforeTest() { - AzureExampleClientBuilder azureExampleClientbuilder - = new AzureExampleClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AzureExampleClientBuilder azureExampleClientbuilder = new AzureExampleClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { azureExampleClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/authentication/apikey/generated/ApiKeyClientTestBase.java b/typespec-tests/src/test/java/com/authentication/apikey/generated/ApiKeyClientTestBase.java index 8786d55aa0..0256b5a0d0 100644 --- a/typespec-tests/src/test/java/com/authentication/apikey/generated/ApiKeyClientTestBase.java +++ b/typespec-tests/src/test/java/com/authentication/apikey/generated/ApiKeyClientTestBase.java @@ -15,14 +15,17 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; class ApiKeyClientTestBase extends TestProxyTestBase { protected ApiKeyClient apiKeyClient; @Override protected void beforeTest() { - ApiKeyClientBuilder apiKeyClientbuilder = new ApiKeyClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ApiKeyClientBuilder apiKeyClientbuilder + = new ApiKeyClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { apiKeyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/authentication/http/custom/generated/CustomClientTestBase.java b/typespec-tests/src/test/java/com/authentication/http/custom/generated/CustomClientTestBase.java index 7a9fa6487e..389d56e2dc 100644 --- a/typespec-tests/src/test/java/com/authentication/http/custom/generated/CustomClientTestBase.java +++ b/typespec-tests/src/test/java/com/authentication/http/custom/generated/CustomClientTestBase.java @@ -15,14 +15,17 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; class CustomClientTestBase extends TestProxyTestBase { protected CustomClient customClient; @Override protected void beforeTest() { - CustomClientBuilder customClientbuilder = new CustomClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + CustomClientBuilder customClientbuilder + = new CustomClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { customClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/authentication/oauth2/generated/OAuth2ClientTestBase.java b/typespec-tests/src/test/java/com/authentication/oauth2/generated/OAuth2ClientTestBase.java index 7366e17cbe..a0c0803a7b 100644 --- a/typespec-tests/src/test/java/com/authentication/oauth2/generated/OAuth2ClientTestBase.java +++ b/typespec-tests/src/test/java/com/authentication/oauth2/generated/OAuth2ClientTestBase.java @@ -16,6 +16,7 @@ import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; import com.azure.core.test.utils.MockTokenCredential; +import com.azure.core.util.Configuration; import com.azure.identity.DefaultAzureCredentialBuilder; class OAuth2ClientTestBase extends TestProxyTestBase { @@ -23,8 +24,10 @@ class OAuth2ClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - OAuth2ClientBuilder oAuth2Clientbuilder = new OAuth2ClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + OAuth2ClientBuilder oAuth2Clientbuilder + = new OAuth2ClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { oAuth2Clientbuilder.httpClient(interceptorManager.getPlaybackClient()) .credential(new MockTokenCredential()); diff --git a/typespec-tests/src/test/java/com/authentication/union/generated/UnionClientTestBase.java b/typespec-tests/src/test/java/com/authentication/union/generated/UnionClientTestBase.java index c137e9522c..87a4cb7c3d 100644 --- a/typespec-tests/src/test/java/com/authentication/union/generated/UnionClientTestBase.java +++ b/typespec-tests/src/test/java/com/authentication/union/generated/UnionClientTestBase.java @@ -16,6 +16,7 @@ import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; import com.azure.core.test.utils.MockTokenCredential; +import com.azure.core.util.Configuration; import com.azure.identity.DefaultAzureCredentialBuilder; class UnionClientTestBase extends TestProxyTestBase { @@ -23,8 +24,10 @@ class UnionClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - UnionClientBuilder unionClientbuilder = new UnionClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + UnionClientBuilder unionClientbuilder + = new UnionClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unionClientbuilder.httpClient(interceptorManager.getPlaybackClient()).credential(new MockTokenCredential()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/azure/specialheaders/xmsclientrequestid/generated/XmsClientRequestIdClientTestBase.java b/typespec-tests/src/test/java/com/azure/specialheaders/xmsclientrequestid/generated/XmsClientRequestIdClientTestBase.java index bf87ba32d7..417c23d587 100644 --- a/typespec-tests/src/test/java/com/azure/specialheaders/xmsclientrequestid/generated/XmsClientRequestIdClientTestBase.java +++ b/typespec-tests/src/test/java/com/azure/specialheaders/xmsclientrequestid/generated/XmsClientRequestIdClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.azure.specialheaders.xmsclientrequestid.XmsClientRequestIdClient; import com.azure.specialheaders.xmsclientrequestid.XmsClientRequestIdClientBuilder; @@ -21,9 +22,10 @@ class XmsClientRequestIdClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - XmsClientRequestIdClientBuilder xmsClientRequestIdClientbuilder - = new XmsClientRequestIdClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + XmsClientRequestIdClientBuilder xmsClientRequestIdClientbuilder = new XmsClientRequestIdClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { xmsClientRequestIdClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/client/naming/generated/NamingClientTestBase.java b/typespec-tests/src/test/java/com/client/naming/generated/NamingClientTestBase.java index 966f8e88d1..db43c89869 100644 --- a/typespec-tests/src/test/java/com/client/naming/generated/NamingClientTestBase.java +++ b/typespec-tests/src/test/java/com/client/naming/generated/NamingClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.client.naming.ClientModelClient; import com.client.naming.NamingClient; import com.client.naming.NamingClientBuilder; @@ -27,8 +28,10 @@ class NamingClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - NamingClientBuilder namingClientbuilder = new NamingClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + NamingClientBuilder namingClientbuilder + = new NamingClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { namingClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -36,8 +39,10 @@ protected void beforeTest() { } namingClient = namingClientbuilder.buildClient(); - NamingClientBuilder clientModelClientbuilder = new NamingClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + NamingClientBuilder clientModelClientbuilder + = new NamingClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { clientModelClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -45,8 +50,10 @@ protected void beforeTest() { } clientModelClient = clientModelClientbuilder.buildClientModelClient(); - NamingClientBuilder unionEnumClientbuilder = new NamingClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + NamingClientBuilder unionEnumClientbuilder + = new NamingClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unionEnumClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/encode/bytes/generated/BytesClientTestBase.java b/typespec-tests/src/test/java/com/encode/bytes/generated/BytesClientTestBase.java index a54927d29b..ee952a4cb2 100644 --- a/typespec-tests/src/test/java/com/encode/bytes/generated/BytesClientTestBase.java +++ b/typespec-tests/src/test/java/com/encode/bytes/generated/BytesClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.encode.bytes.BytesClientBuilder; import com.encode.bytes.HeaderClient; import com.encode.bytes.PropertyClient; @@ -33,8 +34,10 @@ class BytesClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - BytesClientBuilder queryClientbuilder = new BytesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + BytesClientBuilder queryClientbuilder + = new BytesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { queryClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -42,8 +45,10 @@ protected void beforeTest() { } queryClient = queryClientbuilder.buildQueryClient(); - BytesClientBuilder propertyClientbuilder = new BytesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + BytesClientBuilder propertyClientbuilder + = new BytesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { propertyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -51,8 +56,10 @@ protected void beforeTest() { } propertyClient = propertyClientbuilder.buildPropertyClient(); - BytesClientBuilder headerClientbuilder = new BytesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + BytesClientBuilder headerClientbuilder + = new BytesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { headerClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -60,8 +67,10 @@ protected void beforeTest() { } headerClient = headerClientbuilder.buildHeaderClient(); - BytesClientBuilder requestBodyClientbuilder = new BytesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + BytesClientBuilder requestBodyClientbuilder + = new BytesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { requestBodyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -69,8 +78,10 @@ protected void beforeTest() { } requestBodyClient = requestBodyClientbuilder.buildRequestBodyClient(); - BytesClientBuilder responseBodyClientbuilder = new BytesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + BytesClientBuilder responseBodyClientbuilder + = new BytesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { responseBodyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/encode/datetime/generated/DatetimeClientTestBase.java b/typespec-tests/src/test/java/com/encode/datetime/generated/DatetimeClientTestBase.java index 5031e7badb..1d20a9aabb 100644 --- a/typespec-tests/src/test/java/com/encode/datetime/generated/DatetimeClientTestBase.java +++ b/typespec-tests/src/test/java/com/encode/datetime/generated/DatetimeClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.encode.datetime.DatetimeClientBuilder; import com.encode.datetime.HeaderClient; import com.encode.datetime.PropertyClient; @@ -30,8 +31,10 @@ class DatetimeClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - DatetimeClientBuilder queryClientbuilder = new DatetimeClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + DatetimeClientBuilder queryClientbuilder + = new DatetimeClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { queryClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -39,8 +42,10 @@ protected void beforeTest() { } queryClient = queryClientbuilder.buildQueryClient(); - DatetimeClientBuilder propertyClientbuilder = new DatetimeClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + DatetimeClientBuilder propertyClientbuilder + = new DatetimeClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { propertyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -48,8 +53,10 @@ protected void beforeTest() { } propertyClient = propertyClientbuilder.buildPropertyClient(); - DatetimeClientBuilder headerClientbuilder = new DatetimeClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + DatetimeClientBuilder headerClientbuilder + = new DatetimeClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { headerClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -58,7 +65,8 @@ protected void beforeTest() { headerClient = headerClientbuilder.buildHeaderClient(); DatetimeClientBuilder responseHeaderClientbuilder - = new DatetimeClientBuilder().httpClient(HttpClient.createDefault()) + = new DatetimeClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { responseHeaderClientbuilder.httpClient(interceptorManager.getPlaybackClient()); diff --git a/typespec-tests/src/test/java/com/encode/duration/generated/DurationClientTestBase.java b/typespec-tests/src/test/java/com/encode/duration/generated/DurationClientTestBase.java index d100873197..682a70fc1d 100644 --- a/typespec-tests/src/test/java/com/encode/duration/generated/DurationClientTestBase.java +++ b/typespec-tests/src/test/java/com/encode/duration/generated/DurationClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.encode.duration.DurationClientBuilder; import com.encode.duration.HeaderClient; import com.encode.duration.PropertyClient; @@ -27,8 +28,10 @@ class DurationClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - DurationClientBuilder queryClientbuilder = new DurationClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + DurationClientBuilder queryClientbuilder + = new DurationClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { queryClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -36,8 +39,10 @@ protected void beforeTest() { } queryClient = queryClientbuilder.buildQueryClient(); - DurationClientBuilder propertyClientbuilder = new DurationClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + DurationClientBuilder propertyClientbuilder + = new DurationClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { propertyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -45,8 +50,10 @@ protected void beforeTest() { } propertyClient = propertyClientbuilder.buildPropertyClient(); - DurationClientBuilder headerClientbuilder = new DurationClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + DurationClientBuilder headerClientbuilder + = new DurationClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { headerClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/parameters/basic/generated/BasicClientTestBase.java b/typespec-tests/src/test/java/com/parameters/basic/generated/BasicClientTestBase.java index fbe920f8e2..858e5cefc6 100644 --- a/typespec-tests/src/test/java/com/parameters/basic/generated/BasicClientTestBase.java +++ b/typespec-tests/src/test/java/com/parameters/basic/generated/BasicClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.parameters.basic.BasicClientBuilder; import com.parameters.basic.ExplicitBodyClient; import com.parameters.basic.ImplicitBodyClient; @@ -24,8 +25,10 @@ class BasicClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - BasicClientBuilder explicitBodyClientbuilder = new BasicClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + BasicClientBuilder explicitBodyClientbuilder + = new BasicClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { explicitBodyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -33,8 +36,10 @@ protected void beforeTest() { } explicitBodyClient = explicitBodyClientbuilder.buildExplicitBodyClient(); - BasicClientBuilder implicitBodyClientbuilder = new BasicClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + BasicClientBuilder implicitBodyClientbuilder + = new BasicClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { implicitBodyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/parameters/bodyoptionality/generated/BodyOptionalityClientTestBase.java b/typespec-tests/src/test/java/com/parameters/bodyoptionality/generated/BodyOptionalityClientTestBase.java index 08f56ea305..8681264aef 100644 --- a/typespec-tests/src/test/java/com/parameters/bodyoptionality/generated/BodyOptionalityClientTestBase.java +++ b/typespec-tests/src/test/java/com/parameters/bodyoptionality/generated/BodyOptionalityClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.parameters.bodyoptionality.BodyOptionalityClient; import com.parameters.bodyoptionality.BodyOptionalityClientBuilder; import com.parameters.bodyoptionality.OptionalExplicitClient; @@ -24,9 +25,10 @@ class BodyOptionalityClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - BodyOptionalityClientBuilder bodyOptionalityClientbuilder - = new BodyOptionalityClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + BodyOptionalityClientBuilder bodyOptionalityClientbuilder = new BodyOptionalityClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { bodyOptionalityClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -34,9 +36,10 @@ protected void beforeTest() { } bodyOptionalityClient = bodyOptionalityClientbuilder.buildClient(); - BodyOptionalityClientBuilder optionalExplicitClientbuilder - = new BodyOptionalityClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + BodyOptionalityClientBuilder optionalExplicitClientbuilder = new BodyOptionalityClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { optionalExplicitClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/parameters/collectionformat/generated/CollectionFormatClientTestBase.java b/typespec-tests/src/test/java/com/parameters/collectionformat/generated/CollectionFormatClientTestBase.java index ddc63c98a3..56c94fd644 100644 --- a/typespec-tests/src/test/java/com/parameters/collectionformat/generated/CollectionFormatClientTestBase.java +++ b/typespec-tests/src/test/java/com/parameters/collectionformat/generated/CollectionFormatClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.parameters.collectionformat.CollectionFormatClientBuilder; import com.parameters.collectionformat.HeaderClient; import com.parameters.collectionformat.QueryClient; @@ -24,9 +25,10 @@ class CollectionFormatClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - CollectionFormatClientBuilder queryClientbuilder - = new CollectionFormatClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + CollectionFormatClientBuilder queryClientbuilder = new CollectionFormatClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { queryClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -34,9 +36,10 @@ protected void beforeTest() { } queryClient = queryClientbuilder.buildQueryClient(); - CollectionFormatClientBuilder headerClientbuilder - = new CollectionFormatClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + CollectionFormatClientBuilder headerClientbuilder = new CollectionFormatClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { headerClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/parameters/spread/generated/SpreadClientTestBase.java b/typespec-tests/src/test/java/com/parameters/spread/generated/SpreadClientTestBase.java index 6c0ae001b6..93fa3edd55 100644 --- a/typespec-tests/src/test/java/com/parameters/spread/generated/SpreadClientTestBase.java +++ b/typespec-tests/src/test/java/com/parameters/spread/generated/SpreadClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.parameters.spread.AliasClient; import com.parameters.spread.ModelClient; import com.parameters.spread.SpreadClientBuilder; @@ -24,8 +25,10 @@ class SpreadClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - SpreadClientBuilder modelClientbuilder = new SpreadClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + SpreadClientBuilder modelClientbuilder + = new SpreadClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { modelClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -33,8 +36,10 @@ protected void beforeTest() { } modelClient = modelClientbuilder.buildModelClient(); - SpreadClientBuilder aliasClientbuilder = new SpreadClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + SpreadClientBuilder aliasClientbuilder + = new SpreadClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { aliasClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/payload/contentnegotiation/generated/ContentNegotiationClientTestBase.java b/typespec-tests/src/test/java/com/payload/contentnegotiation/generated/ContentNegotiationClientTestBase.java index 1bc401cbb8..d9264cfc76 100644 --- a/typespec-tests/src/test/java/com/payload/contentnegotiation/generated/ContentNegotiationClientTestBase.java +++ b/typespec-tests/src/test/java/com/payload/contentnegotiation/generated/ContentNegotiationClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.payload.contentnegotiation.ContentNegotiationClientBuilder; import com.payload.contentnegotiation.DifferentBodyClient; import com.payload.contentnegotiation.SameBodyClient; @@ -24,9 +25,10 @@ class ContentNegotiationClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - ContentNegotiationClientBuilder sameBodyClientbuilder - = new ContentNegotiationClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ContentNegotiationClientBuilder sameBodyClientbuilder = new ContentNegotiationClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { sameBodyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -34,9 +36,10 @@ protected void beforeTest() { } sameBodyClient = sameBodyClientbuilder.buildSameBodyClient(); - ContentNegotiationClientBuilder differentBodyClientbuilder - = new ContentNegotiationClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ContentNegotiationClientBuilder differentBodyClientbuilder = new ContentNegotiationClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { differentBodyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/payload/jsonmergepatch/generated/JsonMergePatchClientTestBase.java b/typespec-tests/src/test/java/com/payload/jsonmergepatch/generated/JsonMergePatchClientTestBase.java index 171cca5870..3c11b50798 100644 --- a/typespec-tests/src/test/java/com/payload/jsonmergepatch/generated/JsonMergePatchClientTestBase.java +++ b/typespec-tests/src/test/java/com/payload/jsonmergepatch/generated/JsonMergePatchClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.payload.jsonmergepatch.JsonMergePatchClient; import com.payload.jsonmergepatch.JsonMergePatchClientBuilder; @@ -21,9 +22,10 @@ class JsonMergePatchClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - JsonMergePatchClientBuilder jsonMergePatchClientbuilder - = new JsonMergePatchClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + JsonMergePatchClientBuilder jsonMergePatchClientbuilder = new JsonMergePatchClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { jsonMergePatchClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/payload/mediatype/generated/MediaTypeClientTestBase.java b/typespec-tests/src/test/java/com/payload/mediatype/generated/MediaTypeClientTestBase.java index 708444f112..bd185e8a95 100644 --- a/typespec-tests/src/test/java/com/payload/mediatype/generated/MediaTypeClientTestBase.java +++ b/typespec-tests/src/test/java/com/payload/mediatype/generated/MediaTypeClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.payload.mediatype.MediaTypeClient; import com.payload.mediatype.MediaTypeClientBuilder; @@ -22,7 +23,8 @@ class MediaTypeClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { MediaTypeClientBuilder mediaTypeClientbuilder - = new MediaTypeClientBuilder().httpClient(HttpClient.createDefault()) + = new MediaTypeClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { mediaTypeClientbuilder.httpClient(interceptorManager.getPlaybackClient()); diff --git a/typespec-tests/src/test/java/com/payload/multipart/generated/MultiPartClientTestBase.java b/typespec-tests/src/test/java/com/payload/multipart/generated/MultiPartClientTestBase.java index 94e07654e9..a61b42fa8c 100644 --- a/typespec-tests/src/test/java/com/payload/multipart/generated/MultiPartClientTestBase.java +++ b/typespec-tests/src/test/java/com/payload/multipart/generated/MultiPartClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.payload.multipart.MultiPartClient; import com.payload.multipart.MultiPartClientBuilder; @@ -22,7 +23,8 @@ class MultiPartClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { MultiPartClientBuilder multiPartClientbuilder - = new MultiPartClientBuilder().httpClient(HttpClient.createDefault()) + = new MultiPartClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { multiPartClientbuilder.httpClient(interceptorManager.getPlaybackClient()); diff --git a/typespec-tests/src/test/java/com/payload/pageable/generated/PageableClientTestBase.java b/typespec-tests/src/test/java/com/payload/pageable/generated/PageableClientTestBase.java index cb767d29f9..3ea959ef2f 100644 --- a/typespec-tests/src/test/java/com/payload/pageable/generated/PageableClientTestBase.java +++ b/typespec-tests/src/test/java/com/payload/pageable/generated/PageableClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.payload.pageable.PageableClient; import com.payload.pageable.PageableClientBuilder; @@ -21,8 +22,10 @@ class PageableClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - PageableClientBuilder pageableClientbuilder = new PageableClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + PageableClientBuilder pageableClientbuilder + = new PageableClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { pageableClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/serialization/encodedname/json/generated/JsonClientTestBase.java b/typespec-tests/src/test/java/com/serialization/encodedname/json/generated/JsonClientTestBase.java index 68d33b5bf7..4567b7fc19 100644 --- a/typespec-tests/src/test/java/com/serialization/encodedname/json/generated/JsonClientTestBase.java +++ b/typespec-tests/src/test/java/com/serialization/encodedname/json/generated/JsonClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.serialization.encodedname.json.JsonClient; import com.serialization.encodedname.json.JsonClientBuilder; @@ -21,8 +22,10 @@ class JsonClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - JsonClientBuilder jsonClientbuilder = new JsonClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + JsonClientBuilder jsonClientbuilder + = new JsonClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { jsonClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/specialheaders/conditionalrequest/generated/ConditionalRequestClientTestBase.java b/typespec-tests/src/test/java/com/specialheaders/conditionalrequest/generated/ConditionalRequestClientTestBase.java index d1aabccaed..f5c2b95148 100644 --- a/typespec-tests/src/test/java/com/specialheaders/conditionalrequest/generated/ConditionalRequestClientTestBase.java +++ b/typespec-tests/src/test/java/com/specialheaders/conditionalrequest/generated/ConditionalRequestClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.specialheaders.conditionalrequest.ConditionalRequestClient; import com.specialheaders.conditionalrequest.ConditionalRequestClientBuilder; @@ -21,9 +22,10 @@ class ConditionalRequestClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - ConditionalRequestClientBuilder conditionalRequestClientbuilder - = new ConditionalRequestClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ConditionalRequestClientBuilder conditionalRequestClientbuilder = new ConditionalRequestClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { conditionalRequestClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/specialheaders/repeatability/generated/RepeatabilityClientTestBase.java b/typespec-tests/src/test/java/com/specialheaders/repeatability/generated/RepeatabilityClientTestBase.java index d481688f3f..4b06034244 100644 --- a/typespec-tests/src/test/java/com/specialheaders/repeatability/generated/RepeatabilityClientTestBase.java +++ b/typespec-tests/src/test/java/com/specialheaders/repeatability/generated/RepeatabilityClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.specialheaders.repeatability.RepeatabilityClient; import com.specialheaders.repeatability.RepeatabilityClientBuilder; @@ -21,9 +22,10 @@ class RepeatabilityClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - RepeatabilityClientBuilder repeatabilityClientbuilder - = new RepeatabilityClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + RepeatabilityClientBuilder repeatabilityClientbuilder = new RepeatabilityClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { repeatabilityClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/specialwords/generated/SpecialWordsClientTestBase.java b/typespec-tests/src/test/java/com/specialwords/generated/SpecialWordsClientTestBase.java index 1e96e513ff..ea681e6b59 100644 --- a/typespec-tests/src/test/java/com/specialwords/generated/SpecialWordsClientTestBase.java +++ b/typespec-tests/src/test/java/com/specialwords/generated/SpecialWordsClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.specialwords.ModelPropertiesClient; import com.specialwords.ModelsClient; import com.specialwords.OperationsClient; @@ -30,9 +31,10 @@ class SpecialWordsClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - SpecialWordsClientBuilder modelsClientbuilder - = new SpecialWordsClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + SpecialWordsClientBuilder modelsClientbuilder = new SpecialWordsClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { modelsClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -40,9 +42,10 @@ protected void beforeTest() { } modelsClient = modelsClientbuilder.buildModelsClient(); - SpecialWordsClientBuilder modelPropertiesClientbuilder - = new SpecialWordsClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + SpecialWordsClientBuilder modelPropertiesClientbuilder = new SpecialWordsClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { modelPropertiesClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -50,9 +53,10 @@ protected void beforeTest() { } modelPropertiesClient = modelPropertiesClientbuilder.buildModelPropertiesClient(); - SpecialWordsClientBuilder operationsClientbuilder - = new SpecialWordsClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + SpecialWordsClientBuilder operationsClientbuilder = new SpecialWordsClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { operationsClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -60,9 +64,10 @@ protected void beforeTest() { } operationsClient = operationsClientbuilder.buildOperationsClient(); - SpecialWordsClientBuilder parametersClientbuilder - = new SpecialWordsClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + SpecialWordsClientBuilder parametersClientbuilder = new SpecialWordsClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { parametersClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/type/array/generated/ArrayClientTestBase.java b/typespec-tests/src/test/java/com/type/array/generated/ArrayClientTestBase.java index 32c12c87c4..ee39593469 100644 --- a/typespec-tests/src/test/java/com/type/array/generated/ArrayClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/array/generated/ArrayClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.type.array.ArrayClientBuilder; import com.type.array.BooleanValueClient; import com.type.array.DatetimeValueClient; @@ -60,8 +61,10 @@ class ArrayClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - ArrayClientBuilder int32ValueClientbuilder = new ArrayClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ArrayClientBuilder int32ValueClientbuilder + = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { int32ValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -69,8 +72,10 @@ protected void beforeTest() { } int32ValueClient = int32ValueClientbuilder.buildInt32ValueClient(); - ArrayClientBuilder int64ValueClientbuilder = new ArrayClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ArrayClientBuilder int64ValueClientbuilder + = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { int64ValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -78,8 +83,10 @@ protected void beforeTest() { } int64ValueClient = int64ValueClientbuilder.buildInt64ValueClient(); - ArrayClientBuilder booleanValueClientbuilder = new ArrayClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ArrayClientBuilder booleanValueClientbuilder + = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { booleanValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -87,8 +94,10 @@ protected void beforeTest() { } booleanValueClient = booleanValueClientbuilder.buildBooleanValueClient(); - ArrayClientBuilder stringValueClientbuilder = new ArrayClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ArrayClientBuilder stringValueClientbuilder + = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { stringValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -96,8 +105,10 @@ protected void beforeTest() { } stringValueClient = stringValueClientbuilder.buildStringValueClient(); - ArrayClientBuilder float32ValueClientbuilder = new ArrayClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ArrayClientBuilder float32ValueClientbuilder + = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { float32ValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -105,8 +116,10 @@ protected void beforeTest() { } float32ValueClient = float32ValueClientbuilder.buildFloat32ValueClient(); - ArrayClientBuilder datetimeValueClientbuilder = new ArrayClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ArrayClientBuilder datetimeValueClientbuilder + = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { datetimeValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -114,8 +127,10 @@ protected void beforeTest() { } datetimeValueClient = datetimeValueClientbuilder.buildDatetimeValueClient(); - ArrayClientBuilder durationValueClientbuilder = new ArrayClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ArrayClientBuilder durationValueClientbuilder + = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { durationValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -123,8 +138,10 @@ protected void beforeTest() { } durationValueClient = durationValueClientbuilder.buildDurationValueClient(); - ArrayClientBuilder unknownValueClientbuilder = new ArrayClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ArrayClientBuilder unknownValueClientbuilder + = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unknownValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -132,8 +149,10 @@ protected void beforeTest() { } unknownValueClient = unknownValueClientbuilder.buildUnknownValueClient(); - ArrayClientBuilder modelValueClientbuilder = new ArrayClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ArrayClientBuilder modelValueClientbuilder + = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { modelValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -142,7 +161,8 @@ protected void beforeTest() { modelValueClient = modelValueClientbuilder.buildModelValueClient(); ArrayClientBuilder nullableFloatValueClientbuilder - = new ArrayClientBuilder().httpClient(HttpClient.createDefault()) + = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { nullableFloatValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -152,7 +172,8 @@ protected void beforeTest() { nullableFloatValueClient = nullableFloatValueClientbuilder.buildNullableFloatValueClient(); ArrayClientBuilder nullableInt32ValueClientbuilder - = new ArrayClientBuilder().httpClient(HttpClient.createDefault()) + = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { nullableInt32ValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -162,7 +183,8 @@ protected void beforeTest() { nullableInt32ValueClient = nullableInt32ValueClientbuilder.buildNullableInt32ValueClient(); ArrayClientBuilder nullableBooleanValueClientbuilder - = new ArrayClientBuilder().httpClient(HttpClient.createDefault()) + = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { nullableBooleanValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -172,7 +194,8 @@ protected void beforeTest() { nullableBooleanValueClient = nullableBooleanValueClientbuilder.buildNullableBooleanValueClient(); ArrayClientBuilder nullableStringValueClientbuilder - = new ArrayClientBuilder().httpClient(HttpClient.createDefault()) + = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { nullableStringValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -182,7 +205,8 @@ protected void beforeTest() { nullableStringValueClient = nullableStringValueClientbuilder.buildNullableStringValueClient(); ArrayClientBuilder nullableModelValueClientbuilder - = new ArrayClientBuilder().httpClient(HttpClient.createDefault()) + = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { nullableModelValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); diff --git a/typespec-tests/src/test/java/com/type/dictionary/generated/DictionaryClientTestBase.java b/typespec-tests/src/test/java/com/type/dictionary/generated/DictionaryClientTestBase.java index 03dd67334e..cf03b1b620 100644 --- a/typespec-tests/src/test/java/com/type/dictionary/generated/DictionaryClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/dictionary/generated/DictionaryClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.type.dictionary.BooleanValueClient; import com.type.dictionary.DatetimeValueClient; import com.type.dictionary.DictionaryClientBuilder; @@ -52,7 +53,8 @@ class DictionaryClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { DictionaryClientBuilder int32ValueClientbuilder - = new DictionaryClientBuilder().httpClient(HttpClient.createDefault()) + = new DictionaryClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { int32ValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -62,7 +64,8 @@ protected void beforeTest() { int32ValueClient = int32ValueClientbuilder.buildInt32ValueClient(); DictionaryClientBuilder int64ValueClientbuilder - = new DictionaryClientBuilder().httpClient(HttpClient.createDefault()) + = new DictionaryClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { int64ValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -72,7 +75,8 @@ protected void beforeTest() { int64ValueClient = int64ValueClientbuilder.buildInt64ValueClient(); DictionaryClientBuilder booleanValueClientbuilder - = new DictionaryClientBuilder().httpClient(HttpClient.createDefault()) + = new DictionaryClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { booleanValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -82,7 +86,8 @@ protected void beforeTest() { booleanValueClient = booleanValueClientbuilder.buildBooleanValueClient(); DictionaryClientBuilder stringValueClientbuilder - = new DictionaryClientBuilder().httpClient(HttpClient.createDefault()) + = new DictionaryClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { stringValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -92,7 +97,8 @@ protected void beforeTest() { stringValueClient = stringValueClientbuilder.buildStringValueClient(); DictionaryClientBuilder float32ValueClientbuilder - = new DictionaryClientBuilder().httpClient(HttpClient.createDefault()) + = new DictionaryClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { float32ValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -102,7 +108,8 @@ protected void beforeTest() { float32ValueClient = float32ValueClientbuilder.buildFloat32ValueClient(); DictionaryClientBuilder datetimeValueClientbuilder - = new DictionaryClientBuilder().httpClient(HttpClient.createDefault()) + = new DictionaryClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { datetimeValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -112,7 +119,8 @@ protected void beforeTest() { datetimeValueClient = datetimeValueClientbuilder.buildDatetimeValueClient(); DictionaryClientBuilder durationValueClientbuilder - = new DictionaryClientBuilder().httpClient(HttpClient.createDefault()) + = new DictionaryClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { durationValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -122,7 +130,8 @@ protected void beforeTest() { durationValueClient = durationValueClientbuilder.buildDurationValueClient(); DictionaryClientBuilder unknownValueClientbuilder - = new DictionaryClientBuilder().httpClient(HttpClient.createDefault()) + = new DictionaryClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unknownValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -132,7 +141,8 @@ protected void beforeTest() { unknownValueClient = unknownValueClientbuilder.buildUnknownValueClient(); DictionaryClientBuilder modelValueClientbuilder - = new DictionaryClientBuilder().httpClient(HttpClient.createDefault()) + = new DictionaryClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { modelValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -142,7 +152,8 @@ protected void beforeTest() { modelValueClient = modelValueClientbuilder.buildModelValueClient(); DictionaryClientBuilder recursiveModelValueClientbuilder - = new DictionaryClientBuilder().httpClient(HttpClient.createDefault()) + = new DictionaryClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { recursiveModelValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -152,7 +163,8 @@ protected void beforeTest() { recursiveModelValueClient = recursiveModelValueClientbuilder.buildRecursiveModelValueClient(); DictionaryClientBuilder nullableFloatValueClientbuilder - = new DictionaryClientBuilder().httpClient(HttpClient.createDefault()) + = new DictionaryClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { nullableFloatValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); diff --git a/typespec-tests/src/test/java/com/type/enums/extensible/generated/ExtensibleClientTestBase.java b/typespec-tests/src/test/java/com/type/enums/extensible/generated/ExtensibleClientTestBase.java index 080401739c..1e479d9a04 100644 --- a/typespec-tests/src/test/java/com/type/enums/extensible/generated/ExtensibleClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/enums/extensible/generated/ExtensibleClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.type.enums.extensible.ExtensibleClient; import com.type.enums.extensible.ExtensibleClientBuilder; @@ -22,7 +23,8 @@ class ExtensibleClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { ExtensibleClientBuilder extensibleClientbuilder - = new ExtensibleClientBuilder().httpClient(HttpClient.createDefault()) + = new ExtensibleClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { extensibleClientbuilder.httpClient(interceptorManager.getPlaybackClient()); diff --git a/typespec-tests/src/test/java/com/type/enums/fixed/generated/FixedClientTestBase.java b/typespec-tests/src/test/java/com/type/enums/fixed/generated/FixedClientTestBase.java index 27371c3c2a..5d6c8b35c8 100644 --- a/typespec-tests/src/test/java/com/type/enums/fixed/generated/FixedClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/enums/fixed/generated/FixedClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.type.enums.fixed.FixedClient; import com.type.enums.fixed.FixedClientBuilder; @@ -21,8 +22,10 @@ class FixedClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - FixedClientBuilder fixedClientbuilder = new FixedClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + FixedClientBuilder fixedClientbuilder + = new FixedClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { fixedClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/type/model/empty/generated/EmptyClientTestBase.java b/typespec-tests/src/test/java/com/type/model/empty/generated/EmptyClientTestBase.java index 22d948add5..29dddde5d6 100644 --- a/typespec-tests/src/test/java/com/type/model/empty/generated/EmptyClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/model/empty/generated/EmptyClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.type.model.empty.EmptyClient; import com.type.model.empty.EmptyClientBuilder; @@ -21,8 +22,10 @@ class EmptyClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - EmptyClientBuilder emptyClientbuilder = new EmptyClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + EmptyClientBuilder emptyClientbuilder + = new EmptyClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { emptyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/type/model/flatten/generated/FlattenClientTestBase.java b/typespec-tests/src/test/java/com/type/model/flatten/generated/FlattenClientTestBase.java index 54df5552c7..a3f7ccb3b2 100644 --- a/typespec-tests/src/test/java/com/type/model/flatten/generated/FlattenClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/model/flatten/generated/FlattenClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.type.model.flatten.FlattenClient; import com.type.model.flatten.FlattenClientBuilder; @@ -21,8 +22,10 @@ class FlattenClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - FlattenClientBuilder flattenClientbuilder = new FlattenClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + FlattenClientBuilder flattenClientbuilder + = new FlattenClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { flattenClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/type/model/inheritance/enumdiscriminator/generated/EnumDiscriminatorClientTestBase.java b/typespec-tests/src/test/java/com/type/model/inheritance/enumdiscriminator/generated/EnumDiscriminatorClientTestBase.java index c96683a156..1f3fabb711 100644 --- a/typespec-tests/src/test/java/com/type/model/inheritance/enumdiscriminator/generated/EnumDiscriminatorClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/model/inheritance/enumdiscriminator/generated/EnumDiscriminatorClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.type.model.inheritance.enumdiscriminator.EnumDiscriminatorClient; import com.type.model.inheritance.enumdiscriminator.EnumDiscriminatorClientBuilder; @@ -21,9 +22,10 @@ class EnumDiscriminatorClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - EnumDiscriminatorClientBuilder enumDiscriminatorClientbuilder - = new EnumDiscriminatorClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + EnumDiscriminatorClientBuilder enumDiscriminatorClientbuilder = new EnumDiscriminatorClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { enumDiscriminatorClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/type/model/inheritance/enumnesteddiscriminator/generated/EnumNestedDiscriminatorClientTestBase.java b/typespec-tests/src/test/java/com/type/model/inheritance/enumnesteddiscriminator/generated/EnumNestedDiscriminatorClientTestBase.java index 5abc47f79e..07f441fc51 100644 --- a/typespec-tests/src/test/java/com/type/model/inheritance/enumnesteddiscriminator/generated/EnumNestedDiscriminatorClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/model/inheritance/enumnesteddiscriminator/generated/EnumNestedDiscriminatorClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.type.model.inheritance.enumnesteddiscriminator.EnumNestedDiscriminatorClient; import com.type.model.inheritance.enumnesteddiscriminator.EnumNestedDiscriminatorClientBuilder; @@ -22,7 +23,9 @@ class EnumNestedDiscriminatorClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { EnumNestedDiscriminatorClientBuilder enumNestedDiscriminatorClientbuilder - = new EnumNestedDiscriminatorClientBuilder().httpClient(HttpClient.createDefault()) + = new EnumNestedDiscriminatorClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { enumNestedDiscriminatorClientbuilder.httpClient(interceptorManager.getPlaybackClient()); diff --git a/typespec-tests/src/test/java/com/type/model/inheritance/nesteddiscriminator/generated/NestedDiscriminatorClientTestBase.java b/typespec-tests/src/test/java/com/type/model/inheritance/nesteddiscriminator/generated/NestedDiscriminatorClientTestBase.java index abfe43b5ef..bee2a73e84 100644 --- a/typespec-tests/src/test/java/com/type/model/inheritance/nesteddiscriminator/generated/NestedDiscriminatorClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/model/inheritance/nesteddiscriminator/generated/NestedDiscriminatorClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.type.model.inheritance.nesteddiscriminator.NestedDiscriminatorClient; import com.type.model.inheritance.nesteddiscriminator.NestedDiscriminatorClientBuilder; @@ -21,9 +22,10 @@ class NestedDiscriminatorClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - NestedDiscriminatorClientBuilder nestedDiscriminatorClientbuilder - = new NestedDiscriminatorClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + NestedDiscriminatorClientBuilder nestedDiscriminatorClientbuilder = new NestedDiscriminatorClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { nestedDiscriminatorClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/type/model/inheritance/notdiscriminated/generated/NotDiscriminatedClientTestBase.java b/typespec-tests/src/test/java/com/type/model/inheritance/notdiscriminated/generated/NotDiscriminatedClientTestBase.java index fbd619b176..c02c02d657 100644 --- a/typespec-tests/src/test/java/com/type/model/inheritance/notdiscriminated/generated/NotDiscriminatedClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/model/inheritance/notdiscriminated/generated/NotDiscriminatedClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.type.model.inheritance.notdiscriminated.NotDiscriminatedClient; import com.type.model.inheritance.notdiscriminated.NotDiscriminatedClientBuilder; @@ -21,9 +22,10 @@ class NotDiscriminatedClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - NotDiscriminatedClientBuilder notDiscriminatedClientbuilder - = new NotDiscriminatedClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + NotDiscriminatedClientBuilder notDiscriminatedClientbuilder = new NotDiscriminatedClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { notDiscriminatedClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/type/model/inheritance/recursive/generated/RecursiveClientTestBase.java b/typespec-tests/src/test/java/com/type/model/inheritance/recursive/generated/RecursiveClientTestBase.java index 80dd9b4404..1a72d58554 100644 --- a/typespec-tests/src/test/java/com/type/model/inheritance/recursive/generated/RecursiveClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/model/inheritance/recursive/generated/RecursiveClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.type.model.inheritance.recursive.RecursiveClient; import com.type.model.inheritance.recursive.RecursiveClientBuilder; @@ -22,7 +23,8 @@ class RecursiveClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { RecursiveClientBuilder recursiveClientbuilder - = new RecursiveClientBuilder().httpClient(HttpClient.createDefault()) + = new RecursiveClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { recursiveClientbuilder.httpClient(interceptorManager.getPlaybackClient()); diff --git a/typespec-tests/src/test/java/com/type/model/inheritance/singlediscriminator/generated/SingleDiscriminatorClientTestBase.java b/typespec-tests/src/test/java/com/type/model/inheritance/singlediscriminator/generated/SingleDiscriminatorClientTestBase.java index cc9703bcec..b95b97aac9 100644 --- a/typespec-tests/src/test/java/com/type/model/inheritance/singlediscriminator/generated/SingleDiscriminatorClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/model/inheritance/singlediscriminator/generated/SingleDiscriminatorClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.type.model.inheritance.singlediscriminator.SingleDiscriminatorClient; import com.type.model.inheritance.singlediscriminator.SingleDiscriminatorClientBuilder; @@ -21,9 +22,10 @@ class SingleDiscriminatorClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - SingleDiscriminatorClientBuilder singleDiscriminatorClientbuilder - = new SingleDiscriminatorClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + SingleDiscriminatorClientBuilder singleDiscriminatorClientbuilder = new SingleDiscriminatorClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { singleDiscriminatorClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/type/model/usage/generated/UsageClientTestBase.java b/typespec-tests/src/test/java/com/type/model/usage/generated/UsageClientTestBase.java index 4d739c036a..0825f27cea 100644 --- a/typespec-tests/src/test/java/com/type/model/usage/generated/UsageClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/model/usage/generated/UsageClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.type.model.usage.UsageClient; import com.type.model.usage.UsageClientBuilder; @@ -21,8 +22,10 @@ class UsageClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - UsageClientBuilder usageClientbuilder = new UsageClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + UsageClientBuilder usageClientbuilder + = new UsageClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { usageClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/type/model/visibility/generated/VisibilityClientTestBase.java b/typespec-tests/src/test/java/com/type/model/visibility/generated/VisibilityClientTestBase.java index 0aeeca4b63..3e8f731953 100644 --- a/typespec-tests/src/test/java/com/type/model/visibility/generated/VisibilityClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/model/visibility/generated/VisibilityClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.type.model.visibility.VisibilityClient; import com.type.model.visibility.VisibilityClientBuilder; @@ -22,7 +23,8 @@ class VisibilityClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { VisibilityClientBuilder visibilityClientbuilder - = new VisibilityClientBuilder().httpClient(HttpClient.createDefault()) + = new VisibilityClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { visibilityClientbuilder.httpClient(interceptorManager.getPlaybackClient()); diff --git a/typespec-tests/src/test/java/com/type/property/additionalproperties/generated/AdditionalPropertiesClientTestBase.java b/typespec-tests/src/test/java/com/type/property/additionalproperties/generated/AdditionalPropertiesClientTestBase.java index 21d97bbda8..338043b9d9 100644 --- a/typespec-tests/src/test/java/com/type/property/additionalproperties/generated/AdditionalPropertiesClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/property/additionalproperties/generated/AdditionalPropertiesClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.type.property.additionalproperties.AdditionalPropertiesClientBuilder; import com.type.property.additionalproperties.ExtendsDifferentSpreadFloatClient; import com.type.property.additionalproperties.ExtendsDifferentSpreadModelArrayClient; @@ -114,9 +115,10 @@ class AdditionalPropertiesClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - AdditionalPropertiesClientBuilder extendsUnknownClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AdditionalPropertiesClientBuilder extendsUnknownClientbuilder = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { extendsUnknownClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -124,9 +126,10 @@ protected void beforeTest() { } extendsUnknownClient = extendsUnknownClientbuilder.buildExtendsUnknownClient(); - AdditionalPropertiesClientBuilder extendsUnknownDerivedClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AdditionalPropertiesClientBuilder extendsUnknownDerivedClientbuilder = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { extendsUnknownDerivedClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -135,7 +138,9 @@ protected void beforeTest() { extendsUnknownDerivedClient = extendsUnknownDerivedClientbuilder.buildExtendsUnknownDerivedClient(); AdditionalPropertiesClientBuilder extendsUnknownDiscriminatedClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) + = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { extendsUnknownDiscriminatedClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -145,9 +150,10 @@ protected void beforeTest() { extendsUnknownDiscriminatedClient = extendsUnknownDiscriminatedClientbuilder.buildExtendsUnknownDiscriminatedClient(); - AdditionalPropertiesClientBuilder isUnknownClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AdditionalPropertiesClientBuilder isUnknownClientbuilder = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { isUnknownClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -155,9 +161,10 @@ protected void beforeTest() { } isUnknownClient = isUnknownClientbuilder.buildIsUnknownClient(); - AdditionalPropertiesClientBuilder isUnknownDerivedClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AdditionalPropertiesClientBuilder isUnknownDerivedClientbuilder = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { isUnknownDerivedClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -165,9 +172,10 @@ protected void beforeTest() { } isUnknownDerivedClient = isUnknownDerivedClientbuilder.buildIsUnknownDerivedClient(); - AdditionalPropertiesClientBuilder isUnknownDiscriminatedClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AdditionalPropertiesClientBuilder isUnknownDiscriminatedClientbuilder = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { isUnknownDiscriminatedClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -175,9 +183,10 @@ protected void beforeTest() { } isUnknownDiscriminatedClient = isUnknownDiscriminatedClientbuilder.buildIsUnknownDiscriminatedClient(); - AdditionalPropertiesClientBuilder extendsStringClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AdditionalPropertiesClientBuilder extendsStringClientbuilder = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { extendsStringClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -185,9 +194,10 @@ protected void beforeTest() { } extendsStringClient = extendsStringClientbuilder.buildExtendsStringClient(); - AdditionalPropertiesClientBuilder isStringClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AdditionalPropertiesClientBuilder isStringClientbuilder = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { isStringClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -195,9 +205,10 @@ protected void beforeTest() { } isStringClient = isStringClientbuilder.buildIsStringClient(); - AdditionalPropertiesClientBuilder spreadStringClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AdditionalPropertiesClientBuilder spreadStringClientbuilder = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { spreadStringClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -205,9 +216,10 @@ protected void beforeTest() { } spreadStringClient = spreadStringClientbuilder.buildSpreadStringClient(); - AdditionalPropertiesClientBuilder extendsFloatClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AdditionalPropertiesClientBuilder extendsFloatClientbuilder = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { extendsFloatClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -215,9 +227,10 @@ protected void beforeTest() { } extendsFloatClient = extendsFloatClientbuilder.buildExtendsFloatClient(); - AdditionalPropertiesClientBuilder isFloatClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AdditionalPropertiesClientBuilder isFloatClientbuilder = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { isFloatClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -225,9 +238,10 @@ protected void beforeTest() { } isFloatClient = isFloatClientbuilder.buildIsFloatClient(); - AdditionalPropertiesClientBuilder spreadFloatClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AdditionalPropertiesClientBuilder spreadFloatClientbuilder = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { spreadFloatClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -235,9 +249,10 @@ protected void beforeTest() { } spreadFloatClient = spreadFloatClientbuilder.buildSpreadFloatClient(); - AdditionalPropertiesClientBuilder extendsModelClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AdditionalPropertiesClientBuilder extendsModelClientbuilder = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { extendsModelClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -245,9 +260,10 @@ protected void beforeTest() { } extendsModelClient = extendsModelClientbuilder.buildExtendsModelClient(); - AdditionalPropertiesClientBuilder isModelClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AdditionalPropertiesClientBuilder isModelClientbuilder = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { isModelClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -255,9 +271,10 @@ protected void beforeTest() { } isModelClient = isModelClientbuilder.buildIsModelClient(); - AdditionalPropertiesClientBuilder spreadModelClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AdditionalPropertiesClientBuilder spreadModelClientbuilder = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { spreadModelClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -265,9 +282,10 @@ protected void beforeTest() { } spreadModelClient = spreadModelClientbuilder.buildSpreadModelClient(); - AdditionalPropertiesClientBuilder extendsModelArrayClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AdditionalPropertiesClientBuilder extendsModelArrayClientbuilder = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { extendsModelArrayClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -275,9 +293,10 @@ protected void beforeTest() { } extendsModelArrayClient = extendsModelArrayClientbuilder.buildExtendsModelArrayClient(); - AdditionalPropertiesClientBuilder isModelArrayClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AdditionalPropertiesClientBuilder isModelArrayClientbuilder = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { isModelArrayClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -285,9 +304,10 @@ protected void beforeTest() { } isModelArrayClient = isModelArrayClientbuilder.buildIsModelArrayClient(); - AdditionalPropertiesClientBuilder spreadModelArrayClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AdditionalPropertiesClientBuilder spreadModelArrayClientbuilder = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { spreadModelArrayClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -295,9 +315,10 @@ protected void beforeTest() { } spreadModelArrayClient = spreadModelArrayClientbuilder.buildSpreadModelArrayClient(); - AdditionalPropertiesClientBuilder spreadDifferentStringClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AdditionalPropertiesClientBuilder spreadDifferentStringClientbuilder = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { spreadDifferentStringClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -305,9 +326,10 @@ protected void beforeTest() { } spreadDifferentStringClient = spreadDifferentStringClientbuilder.buildSpreadDifferentStringClient(); - AdditionalPropertiesClientBuilder spreadDifferentFloatClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AdditionalPropertiesClientBuilder spreadDifferentFloatClientbuilder = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { spreadDifferentFloatClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -315,9 +337,10 @@ protected void beforeTest() { } spreadDifferentFloatClient = spreadDifferentFloatClientbuilder.buildSpreadDifferentFloatClient(); - AdditionalPropertiesClientBuilder spreadDifferentModelClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AdditionalPropertiesClientBuilder spreadDifferentModelClientbuilder = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { spreadDifferentModelClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -326,7 +349,9 @@ protected void beforeTest() { spreadDifferentModelClient = spreadDifferentModelClientbuilder.buildSpreadDifferentModelClient(); AdditionalPropertiesClientBuilder spreadDifferentModelArrayClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) + = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { spreadDifferentModelArrayClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -336,7 +361,9 @@ protected void beforeTest() { spreadDifferentModelArrayClient = spreadDifferentModelArrayClientbuilder.buildSpreadDifferentModelArrayClient(); AdditionalPropertiesClientBuilder extendsDifferentSpreadStringClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) + = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { extendsDifferentSpreadStringClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -347,7 +374,9 @@ protected void beforeTest() { = extendsDifferentSpreadStringClientbuilder.buildExtendsDifferentSpreadStringClient(); AdditionalPropertiesClientBuilder extendsDifferentSpreadFloatClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) + = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { extendsDifferentSpreadFloatClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -358,7 +387,9 @@ protected void beforeTest() { = extendsDifferentSpreadFloatClientbuilder.buildExtendsDifferentSpreadFloatClient(); AdditionalPropertiesClientBuilder extendsDifferentSpreadModelClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) + = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { extendsDifferentSpreadModelClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -369,7 +400,9 @@ protected void beforeTest() { = extendsDifferentSpreadModelClientbuilder.buildExtendsDifferentSpreadModelClient(); AdditionalPropertiesClientBuilder extendsDifferentSpreadModelArrayClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) + = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { extendsDifferentSpreadModelArrayClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -379,9 +412,10 @@ protected void beforeTest() { extendsDifferentSpreadModelArrayClient = extendsDifferentSpreadModelArrayClientbuilder.buildExtendsDifferentSpreadModelArrayClient(); - AdditionalPropertiesClientBuilder multipleSpreadClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AdditionalPropertiesClientBuilder multipleSpreadClientbuilder = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { multipleSpreadClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -389,9 +423,10 @@ protected void beforeTest() { } multipleSpreadClient = multipleSpreadClientbuilder.buildMultipleSpreadClient(); - AdditionalPropertiesClientBuilder spreadRecordUnionClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AdditionalPropertiesClientBuilder spreadRecordUnionClientbuilder = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { spreadRecordUnionClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -400,7 +435,9 @@ protected void beforeTest() { spreadRecordUnionClient = spreadRecordUnionClientbuilder.buildSpreadRecordUnionClient(); AdditionalPropertiesClientBuilder spreadRecordDiscriminatedUnionClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) + = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { spreadRecordDiscriminatedUnionClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -411,7 +448,9 @@ protected void beforeTest() { = spreadRecordDiscriminatedUnionClientbuilder.buildSpreadRecordDiscriminatedUnionClient(); AdditionalPropertiesClientBuilder spreadRecordNonDiscriminatedUnionClientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) + = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { spreadRecordNonDiscriminatedUnionClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -422,7 +461,9 @@ protected void beforeTest() { = spreadRecordNonDiscriminatedUnionClientbuilder.buildSpreadRecordNonDiscriminatedUnionClient(); AdditionalPropertiesClientBuilder spreadRecordNonDiscriminatedUnion2Clientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) + = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { spreadRecordNonDiscriminatedUnion2Clientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -433,7 +474,9 @@ protected void beforeTest() { = spreadRecordNonDiscriminatedUnion2Clientbuilder.buildSpreadRecordNonDiscriminatedUnion2Client(); AdditionalPropertiesClientBuilder spreadRecordNonDiscriminatedUnion3Clientbuilder - = new AdditionalPropertiesClientBuilder().httpClient(HttpClient.createDefault()) + = new AdditionalPropertiesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { spreadRecordNonDiscriminatedUnion3Clientbuilder.httpClient(interceptorManager.getPlaybackClient()); diff --git a/typespec-tests/src/test/java/com/type/property/nullable/generated/NullableClientTestBase.java b/typespec-tests/src/test/java/com/type/property/nullable/generated/NullableClientTestBase.java index 2026b4a037..c43bb16077 100644 --- a/typespec-tests/src/test/java/com/type/property/nullable/generated/NullableClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/property/nullable/generated/NullableClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.type.property.nullable.BytesClient; import com.type.property.nullable.CollectionsByteClient; import com.type.property.nullable.CollectionsModelClient; @@ -40,7 +41,8 @@ class NullableClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { NullableClientBuilder stringOperationClientbuilder - = new NullableClientBuilder().httpClient(HttpClient.createDefault()) + = new NullableClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { stringOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -49,8 +51,10 @@ protected void beforeTest() { } stringOperationClient = stringOperationClientbuilder.buildStringOperationClient(); - NullableClientBuilder bytesClientbuilder = new NullableClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + NullableClientBuilder bytesClientbuilder + = new NullableClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { bytesClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -59,7 +63,8 @@ protected void beforeTest() { bytesClient = bytesClientbuilder.buildBytesClient(); NullableClientBuilder datetimeOperationClientbuilder - = new NullableClientBuilder().httpClient(HttpClient.createDefault()) + = new NullableClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { datetimeOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -69,7 +74,8 @@ protected void beforeTest() { datetimeOperationClient = datetimeOperationClientbuilder.buildDatetimeOperationClient(); NullableClientBuilder durationOperationClientbuilder - = new NullableClientBuilder().httpClient(HttpClient.createDefault()) + = new NullableClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { durationOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -79,7 +85,8 @@ protected void beforeTest() { durationOperationClient = durationOperationClientbuilder.buildDurationOperationClient(); NullableClientBuilder collectionsByteClientbuilder - = new NullableClientBuilder().httpClient(HttpClient.createDefault()) + = new NullableClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { collectionsByteClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -89,7 +96,8 @@ protected void beforeTest() { collectionsByteClient = collectionsByteClientbuilder.buildCollectionsByteClient(); NullableClientBuilder collectionsModelClientbuilder - = new NullableClientBuilder().httpClient(HttpClient.createDefault()) + = new NullableClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { collectionsModelClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -99,7 +107,8 @@ protected void beforeTest() { collectionsModelClient = collectionsModelClientbuilder.buildCollectionsModelClient(); NullableClientBuilder collectionsStringClientbuilder - = new NullableClientBuilder().httpClient(HttpClient.createDefault()) + = new NullableClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { collectionsStringClientbuilder.httpClient(interceptorManager.getPlaybackClient()); diff --git a/typespec-tests/src/test/java/com/type/property/optional/generated/OptionalClientTestBase.java b/typespec-tests/src/test/java/com/type/property/optional/generated/OptionalClientTestBase.java index 35cec525da..7dac8989f9 100644 --- a/typespec-tests/src/test/java/com/type/property/optional/generated/OptionalClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/property/optional/generated/OptionalClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.type.property.optional.BooleanLiteralClient; import com.type.property.optional.BytesClient; import com.type.property.optional.CollectionsByteClient; @@ -67,7 +68,8 @@ class OptionalClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { OptionalClientBuilder stringOperationClientbuilder - = new OptionalClientBuilder().httpClient(HttpClient.createDefault()) + = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { stringOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -76,8 +78,10 @@ protected void beforeTest() { } stringOperationClient = stringOperationClientbuilder.buildStringOperationClient(); - OptionalClientBuilder bytesClientbuilder = new OptionalClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + OptionalClientBuilder bytesClientbuilder + = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { bytesClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -86,7 +90,8 @@ protected void beforeTest() { bytesClient = bytesClientbuilder.buildBytesClient(); OptionalClientBuilder datetimeOperationClientbuilder - = new OptionalClientBuilder().httpClient(HttpClient.createDefault()) + = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { datetimeOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -96,7 +101,8 @@ protected void beforeTest() { datetimeOperationClient = datetimeOperationClientbuilder.buildDatetimeOperationClient(); OptionalClientBuilder durationOperationClientbuilder - = new OptionalClientBuilder().httpClient(HttpClient.createDefault()) + = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { durationOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -106,7 +112,8 @@ protected void beforeTest() { durationOperationClient = durationOperationClientbuilder.buildDurationOperationClient(); OptionalClientBuilder plainDateClientbuilder - = new OptionalClientBuilder().httpClient(HttpClient.createDefault()) + = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { plainDateClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -116,7 +123,8 @@ protected void beforeTest() { plainDateClient = plainDateClientbuilder.buildPlainDateClient(); OptionalClientBuilder plainTimeClientbuilder - = new OptionalClientBuilder().httpClient(HttpClient.createDefault()) + = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { plainTimeClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -126,7 +134,8 @@ protected void beforeTest() { plainTimeClient = plainTimeClientbuilder.buildPlainTimeClient(); OptionalClientBuilder collectionsByteClientbuilder - = new OptionalClientBuilder().httpClient(HttpClient.createDefault()) + = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { collectionsByteClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -136,7 +145,8 @@ protected void beforeTest() { collectionsByteClient = collectionsByteClientbuilder.buildCollectionsByteClient(); OptionalClientBuilder collectionsModelClientbuilder - = new OptionalClientBuilder().httpClient(HttpClient.createDefault()) + = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { collectionsModelClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -146,7 +156,8 @@ protected void beforeTest() { collectionsModelClient = collectionsModelClientbuilder.buildCollectionsModelClient(); OptionalClientBuilder stringLiteralClientbuilder - = new OptionalClientBuilder().httpClient(HttpClient.createDefault()) + = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { stringLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -156,7 +167,8 @@ protected void beforeTest() { stringLiteralClient = stringLiteralClientbuilder.buildStringLiteralClient(); OptionalClientBuilder intLiteralClientbuilder - = new OptionalClientBuilder().httpClient(HttpClient.createDefault()) + = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { intLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -166,7 +178,8 @@ protected void beforeTest() { intLiteralClient = intLiteralClientbuilder.buildIntLiteralClient(); OptionalClientBuilder floatLiteralClientbuilder - = new OptionalClientBuilder().httpClient(HttpClient.createDefault()) + = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { floatLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -176,7 +189,8 @@ protected void beforeTest() { floatLiteralClient = floatLiteralClientbuilder.buildFloatLiteralClient(); OptionalClientBuilder booleanLiteralClientbuilder - = new OptionalClientBuilder().httpClient(HttpClient.createDefault()) + = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { booleanLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -186,7 +200,8 @@ protected void beforeTest() { booleanLiteralClient = booleanLiteralClientbuilder.buildBooleanLiteralClient(); OptionalClientBuilder unionStringLiteralClientbuilder - = new OptionalClientBuilder().httpClient(HttpClient.createDefault()) + = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unionStringLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -196,7 +211,8 @@ protected void beforeTest() { unionStringLiteralClient = unionStringLiteralClientbuilder.buildUnionStringLiteralClient(); OptionalClientBuilder unionIntLiteralClientbuilder - = new OptionalClientBuilder().httpClient(HttpClient.createDefault()) + = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unionIntLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -206,7 +222,8 @@ protected void beforeTest() { unionIntLiteralClient = unionIntLiteralClientbuilder.buildUnionIntLiteralClient(); OptionalClientBuilder unionFloatLiteralClientbuilder - = new OptionalClientBuilder().httpClient(HttpClient.createDefault()) + = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unionFloatLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -216,7 +233,8 @@ protected void beforeTest() { unionFloatLiteralClient = unionFloatLiteralClientbuilder.buildUnionFloatLiteralClient(); OptionalClientBuilder requiredAndOptionalClientbuilder - = new OptionalClientBuilder().httpClient(HttpClient.createDefault()) + = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { requiredAndOptionalClientbuilder.httpClient(interceptorManager.getPlaybackClient()); diff --git a/typespec-tests/src/test/java/com/type/property/valuetypes/generated/ValueTypesClientTestBase.java b/typespec-tests/src/test/java/com/type/property/valuetypes/generated/ValueTypesClientTestBase.java index 09eb11aa3f..4d6d978e28 100644 --- a/typespec-tests/src/test/java/com/type/property/valuetypes/generated/ValueTypesClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/property/valuetypes/generated/ValueTypesClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.type.property.valuetypes.BooleanLiteralClient; import com.type.property.valuetypes.BooleanOperationClient; import com.type.property.valuetypes.BytesClient; @@ -106,7 +107,8 @@ class ValueTypesClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { ValueTypesClientBuilder booleanOperationClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { booleanOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -116,7 +118,8 @@ protected void beforeTest() { booleanOperationClient = booleanOperationClientbuilder.buildBooleanOperationClient(); ValueTypesClientBuilder stringOperationClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { stringOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -126,7 +129,8 @@ protected void beforeTest() { stringOperationClient = stringOperationClientbuilder.buildStringOperationClient(); ValueTypesClientBuilder bytesClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { bytesClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -135,8 +139,10 @@ protected void beforeTest() { } bytesClient = bytesClientbuilder.buildBytesClient(); - ValueTypesClientBuilder intClientbuilder = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder intClientbuilder + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { intClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -145,7 +151,8 @@ protected void beforeTest() { intClient = intClientbuilder.buildIntClient(); ValueTypesClientBuilder floatOperationClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { floatOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -155,7 +162,8 @@ protected void beforeTest() { floatOperationClient = floatOperationClientbuilder.buildFloatOperationClient(); ValueTypesClientBuilder decimalClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { decimalClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -165,7 +173,8 @@ protected void beforeTest() { decimalClient = decimalClientbuilder.buildDecimalClient(); ValueTypesClientBuilder decimal128Clientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { decimal128Clientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -175,7 +184,8 @@ protected void beforeTest() { decimal128Client = decimal128Clientbuilder.buildDecimal128Client(); ValueTypesClientBuilder datetimeOperationClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { datetimeOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -185,7 +195,8 @@ protected void beforeTest() { datetimeOperationClient = datetimeOperationClientbuilder.buildDatetimeOperationClient(); ValueTypesClientBuilder durationOperationClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { durationOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -194,8 +205,10 @@ protected void beforeTest() { } durationOperationClient = durationOperationClientbuilder.buildDurationOperationClient(); - ValueTypesClientBuilder enumClientbuilder = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder enumClientbuilder + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { enumClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -204,7 +217,8 @@ protected void beforeTest() { enumClient = enumClientbuilder.buildEnumClient(); ValueTypesClientBuilder extensibleEnumClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { extensibleEnumClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -214,7 +228,8 @@ protected void beforeTest() { extensibleEnumClient = extensibleEnumClientbuilder.buildExtensibleEnumClient(); ValueTypesClientBuilder modelClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { modelClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -224,7 +239,8 @@ protected void beforeTest() { modelClient = modelClientbuilder.buildModelClient(); ValueTypesClientBuilder collectionsStringClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { collectionsStringClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -234,7 +250,8 @@ protected void beforeTest() { collectionsStringClient = collectionsStringClientbuilder.buildCollectionsStringClient(); ValueTypesClientBuilder collectionsIntClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { collectionsIntClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -244,7 +261,8 @@ protected void beforeTest() { collectionsIntClient = collectionsIntClientbuilder.buildCollectionsIntClient(); ValueTypesClientBuilder collectionsModelClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { collectionsModelClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -254,7 +272,8 @@ protected void beforeTest() { collectionsModelClient = collectionsModelClientbuilder.buildCollectionsModelClient(); ValueTypesClientBuilder dictionaryStringClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { dictionaryStringClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -264,7 +283,8 @@ protected void beforeTest() { dictionaryStringClient = dictionaryStringClientbuilder.buildDictionaryStringClient(); ValueTypesClientBuilder neverClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { neverClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -274,7 +294,8 @@ protected void beforeTest() { neverClient = neverClientbuilder.buildNeverClient(); ValueTypesClientBuilder unknownStringClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unknownStringClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -284,7 +305,8 @@ protected void beforeTest() { unknownStringClient = unknownStringClientbuilder.buildUnknownStringClient(); ValueTypesClientBuilder unknownIntClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unknownIntClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -294,7 +316,8 @@ protected void beforeTest() { unknownIntClient = unknownIntClientbuilder.buildUnknownIntClient(); ValueTypesClientBuilder unknownDictClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unknownDictClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -304,7 +327,8 @@ protected void beforeTest() { unknownDictClient = unknownDictClientbuilder.buildUnknownDictClient(); ValueTypesClientBuilder unknownArrayClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unknownArrayClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -314,7 +338,8 @@ protected void beforeTest() { unknownArrayClient = unknownArrayClientbuilder.buildUnknownArrayClient(); ValueTypesClientBuilder stringLiteralClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { stringLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -324,7 +349,8 @@ protected void beforeTest() { stringLiteralClient = stringLiteralClientbuilder.buildStringLiteralClient(); ValueTypesClientBuilder intLiteralClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { intLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -334,7 +360,8 @@ protected void beforeTest() { intLiteralClient = intLiteralClientbuilder.buildIntLiteralClient(); ValueTypesClientBuilder floatLiteralClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { floatLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -344,7 +371,8 @@ protected void beforeTest() { floatLiteralClient = floatLiteralClientbuilder.buildFloatLiteralClient(); ValueTypesClientBuilder booleanLiteralClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { booleanLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -354,7 +382,8 @@ protected void beforeTest() { booleanLiteralClient = booleanLiteralClientbuilder.buildBooleanLiteralClient(); ValueTypesClientBuilder unionStringLiteralClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unionStringLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -364,7 +393,8 @@ protected void beforeTest() { unionStringLiteralClient = unionStringLiteralClientbuilder.buildUnionStringLiteralClient(); ValueTypesClientBuilder unionIntLiteralClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unionIntLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -374,7 +404,8 @@ protected void beforeTest() { unionIntLiteralClient = unionIntLiteralClientbuilder.buildUnionIntLiteralClient(); ValueTypesClientBuilder unionFloatLiteralClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unionFloatLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -384,7 +415,8 @@ protected void beforeTest() { unionFloatLiteralClient = unionFloatLiteralClientbuilder.buildUnionFloatLiteralClient(); ValueTypesClientBuilder unionEnumValueClientbuilder - = new ValueTypesClientBuilder().httpClient(HttpClient.createDefault()) + = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unionEnumValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); diff --git a/typespec-tests/src/test/java/com/type/scalar/generated/ScalarClientTestBase.java b/typespec-tests/src/test/java/com/type/scalar/generated/ScalarClientTestBase.java index 3759c34811..82cac5fd58 100644 --- a/typespec-tests/src/test/java/com/type/scalar/generated/ScalarClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/scalar/generated/ScalarClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.type.scalar.BooleanOperationClient; import com.type.scalar.Decimal128TypeClient; import com.type.scalar.Decimal128VerifyClient; @@ -40,7 +41,8 @@ class ScalarClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { ScalarClientBuilder stringOperationClientbuilder - = new ScalarClientBuilder().httpClient(HttpClient.createDefault()) + = new ScalarClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { stringOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -50,7 +52,8 @@ protected void beforeTest() { stringOperationClient = stringOperationClientbuilder.buildStringOperationClient(); ScalarClientBuilder booleanOperationClientbuilder - = new ScalarClientBuilder().httpClient(HttpClient.createDefault()) + = new ScalarClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { booleanOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -59,8 +62,10 @@ protected void beforeTest() { } booleanOperationClient = booleanOperationClientbuilder.buildBooleanOperationClient(); - ScalarClientBuilder unknownClientbuilder = new ScalarClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ScalarClientBuilder unknownClientbuilder + = new ScalarClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unknownClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -68,8 +73,10 @@ protected void beforeTest() { } unknownClient = unknownClientbuilder.buildUnknownClient(); - ScalarClientBuilder decimalTypeClientbuilder = new ScalarClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ScalarClientBuilder decimalTypeClientbuilder + = new ScalarClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { decimalTypeClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -78,7 +85,8 @@ protected void beforeTest() { decimalTypeClient = decimalTypeClientbuilder.buildDecimalTypeClient(); ScalarClientBuilder decimal128TypeClientbuilder - = new ScalarClientBuilder().httpClient(HttpClient.createDefault()) + = new ScalarClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { decimal128TypeClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -88,7 +96,8 @@ protected void beforeTest() { decimal128TypeClient = decimal128TypeClientbuilder.buildDecimal128TypeClient(); ScalarClientBuilder decimalVerifyClientbuilder - = new ScalarClientBuilder().httpClient(HttpClient.createDefault()) + = new ScalarClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { decimalVerifyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -98,7 +107,8 @@ protected void beforeTest() { decimalVerifyClient = decimalVerifyClientbuilder.buildDecimalVerifyClient(); ScalarClientBuilder decimal128VerifyClientbuilder - = new ScalarClientBuilder().httpClient(HttpClient.createDefault()) + = new ScalarClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { decimal128VerifyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); diff --git a/typespec-tests/src/test/java/com/type/union/generated/UnionClientTestBase.java b/typespec-tests/src/test/java/com/type/union/generated/UnionClientTestBase.java index 44b16bf194..d7716e1b64 100644 --- a/typespec-tests/src/test/java/com/type/union/generated/UnionClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/union/generated/UnionClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.type.union.EnumsOnlyClient; import com.type.union.FloatsOnlyClient; import com.type.union.IntsOnlyClient; @@ -48,8 +49,10 @@ class UnionClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - UnionClientBuilder stringsOnlyClientbuilder = new UnionClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + UnionClientBuilder stringsOnlyClientbuilder + = new UnionClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { stringsOnlyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -58,7 +61,8 @@ protected void beforeTest() { stringsOnlyClient = stringsOnlyClientbuilder.buildStringsOnlyClient(); UnionClientBuilder stringExtensibleClientbuilder - = new UnionClientBuilder().httpClient(HttpClient.createDefault()) + = new UnionClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { stringExtensibleClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -68,7 +72,8 @@ protected void beforeTest() { stringExtensibleClient = stringExtensibleClientbuilder.buildStringExtensibleClient(); UnionClientBuilder stringExtensibleNamedClientbuilder - = new UnionClientBuilder().httpClient(HttpClient.createDefault()) + = new UnionClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { stringExtensibleNamedClientbuilder.httpClient(interceptorManager.getPlaybackClient()); @@ -77,8 +82,10 @@ protected void beforeTest() { } stringExtensibleNamedClient = stringExtensibleNamedClientbuilder.buildStringExtensibleNamedClient(); - UnionClientBuilder intsOnlyClientbuilder = new UnionClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + UnionClientBuilder intsOnlyClientbuilder + = new UnionClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { intsOnlyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -86,8 +93,10 @@ protected void beforeTest() { } intsOnlyClient = intsOnlyClientbuilder.buildIntsOnlyClient(); - UnionClientBuilder floatsOnlyClientbuilder = new UnionClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + UnionClientBuilder floatsOnlyClientbuilder + = new UnionClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { floatsOnlyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -95,8 +104,10 @@ protected void beforeTest() { } floatsOnlyClient = floatsOnlyClientbuilder.buildFloatsOnlyClient(); - UnionClientBuilder modelsOnlyClientbuilder = new UnionClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + UnionClientBuilder modelsOnlyClientbuilder + = new UnionClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { modelsOnlyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -104,8 +115,10 @@ protected void beforeTest() { } modelsOnlyClient = modelsOnlyClientbuilder.buildModelsOnlyClient(); - UnionClientBuilder enumsOnlyClientbuilder = new UnionClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + UnionClientBuilder enumsOnlyClientbuilder + = new UnionClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { enumsOnlyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -113,8 +126,10 @@ protected void beforeTest() { } enumsOnlyClient = enumsOnlyClientbuilder.buildEnumsOnlyClient(); - UnionClientBuilder stringAndArrayClientbuilder = new UnionClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + UnionClientBuilder stringAndArrayClientbuilder + = new UnionClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { stringAndArrayClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -122,8 +137,10 @@ protected void beforeTest() { } stringAndArrayClient = stringAndArrayClientbuilder.buildStringAndArrayClient(); - UnionClientBuilder mixedLiteralsClientbuilder = new UnionClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + UnionClientBuilder mixedLiteralsClientbuilder + = new UnionClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { mixedLiteralsClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -131,8 +148,10 @@ protected void beforeTest() { } mixedLiteralsClient = mixedLiteralsClientbuilder.buildMixedLiteralsClient(); - UnionClientBuilder mixedTypesClientbuilder = new UnionClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + UnionClientBuilder mixedTypesClientbuilder + = new UnionClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { mixedTypesClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { From 372da097761a8f32265c60f765f1d88e0e68a3a9 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Fri, 9 Aug 2024 15:54:02 +0800 Subject: [PATCH 43/90] throw error if endpoint parameter is neither union nor endpoint --- typespec-extension/src/code-model-builder.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 6a073560fc..0f9276f52d 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -560,9 +560,11 @@ export class CodeModelBuilder { } else { throw new Error("multiple server url defined for one client is not supported yet"); } - } else { + } else if (initializationProperty.type.kind === "endpoint") { sdkPathParameters = initializationProperty.type.templateArguments; baseUri = initializationProperty.type.serverUrl; + } else { + throw new Error("unexpected endpoint parameter type"); } hostParameters = this.processHostParametersFromSdkType(sdkPathParameters); From 865ac7614ed26549182f8aa255768190b92b1e37 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Fri, 9 Aug 2024 16:02:43 +0800 Subject: [PATCH 44/90] lint --- typespec-extension/src/code-model-builder.ts | 31 +++++++++----------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 0f9276f52d..ea587d4400 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -101,15 +101,12 @@ import { getSummary, getVisibility, isArrayModelType, - isErrorModel, isRecordModelType, listServices, } from "@typespec/compiler"; import { Authentication, HttpOperation, - HttpOperationBody, - HttpOperationMultipartBody, HttpOperationResponse, HttpServer, HttpStatusCodeRange, @@ -566,7 +563,7 @@ export class CodeModelBuilder { } else { throw new Error("unexpected endpoint parameter type"); } - + hostParameters = this.processHostParametersFromSdkType(sdkPathParameters); codeModelClient.addGlobalParameters(hostParameters); } @@ -1144,22 +1141,22 @@ export class CodeModelBuilder { style = SerializationStyle.Simple; break; - case "ssv": - style = SerializationStyle.SpaceDelimited; - break; + case "ssv": + style = SerializationStyle.SpaceDelimited; + break; - case "tsv": - style = SerializationStyle.TabDelimited; - break; + case "tsv": + style = SerializationStyle.TabDelimited; + break; - case "pipes": - style = SerializationStyle.PipeDelimited; - break; + case "pipes": + style = SerializationStyle.PipeDelimited; + break; - case "multi": - style = SerializationStyle.Form; - explode = true; - break; + case "multi": + style = SerializationStyle.Form; + explode = true; + break; default: if (format) { From 62e0b0d9080fd47d33e5740ffba054f9db569e26 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Fri, 9 Aug 2024 16:21:05 +0800 Subject: [PATCH 45/90] remove unused functions and move removeClientSuffix to util --- typespec-extension/src/code-model-builder.ts | 47 +------------------- typespec-extension/src/utils.ts | 5 +++ 2 files changed, 7 insertions(+), 45 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index ea587d4400..486db0cc8c 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -160,7 +160,7 @@ import { modelIs, pushDistinct, } from "./type-utils.js"; -import { getNamespace, logWarning, pascalCase, stringArrayContainsIgnoreCase, trace } from "./utils.js"; +import { getNamespace, logWarning, pascalCase, removeClientSuffix, stringArrayContainsIgnoreCase, trace } from "./utils.js"; import { pathToFileURL } from "url"; const { isEqual } = pkg; @@ -256,8 +256,6 @@ export class CodeModelBuilder { this.options["group-etag-headers"] = false; } - // const clients = this.processClients(); - this.processClientsFromSdkType(); this.processModels(); @@ -642,31 +640,6 @@ export class CodeModelBuilder { } } - private buildSdkPathPathParameterForARM(): SdkPathParameter { - return { - kind: "path", - name: "endpoint", - isGeneratedName: true, - description: "Service host", - onClient: true, - urlEncode: false, - optional: false, - serializedName: "endpoint", - correspondingMethodParams: [], - type: { - kind: "string", - encode: "string", - decorators: [], - name: "string", - crossLanguageDefinitionId: "string", - }, - isApiVersionParam: false, - decorators: [], - apiVersions: [], - crossLanguageDefinitionId: "endpoint", - }; - } - private listSubClientsUnderClient( client: SdkClientType, includeNestedOperationGroups: boolean, @@ -678,7 +651,7 @@ export class CodeModelBuilder { const subClient = method.response; if (!isRootClient) { // if it is not root client, append the parent client's name - subClient.name = this.removeClientSuffix(client.name) + this.removeClientSuffix(pascalCase(subClient.name)); + subClient.name = removeClientSuffix(client.name) + removeClientSuffix(pascalCase(subClient.name)); } operationGroups.push(subClient); if (includeNestedOperationGroups) { @@ -712,10 +685,6 @@ export class CodeModelBuilder { return methods; } - private removeClientSuffix(clientName: string): string { - return clientName.endsWith("Client") ? clientName.slice(0, -6) : clientName; - } - /** * Filter api-versions for "ServiceVersion". * TODO(xiaofei) pending TCGC design: https://github.com/Azure/typespec-azure/issues/965 @@ -737,18 +706,6 @@ export class CodeModelBuilder { .filter((version) => !excludePreview || pinnedApiVersion.includes("preview") || !version.includes("preview")); } - /** - * `@armProviderNamespace` currently will add a default server if not defined globally: - * https://github.com/Azure/typespec-azure/blob/8b8d7c05f168d9305a09691c4fedcb88f4a57652/packages/typespec-azure-resource-manager/src/namespace.ts#L121-L128 - * TODO: if the synthesized server has the right hostParameter, we can use that instead - * - * @param server returned by getServers - * @returns whether it's synthesized by `@armProviderNamespace` - */ - private isArmSynthesizedServer(server: HttpServer): boolean { - return this.isArm() && (!server.parameters || server.parameters.size == 0); - } - private needToSkipProcessingOperation(operation: Operation | undefined, clientContext: ClientContext): boolean { // don't generate protocol and convenience method for overloaded operations // issue link: https://github.com/Azure/autorest.java/issues/1958#issuecomment-1562558219 we will support generate overload methods for non-union type in future (TODO issue: https://github.com/Azure/autorest.java/issues/2160) diff --git a/typespec-extension/src/utils.ts b/typespec-extension/src/utils.ts index a21d5ceedc..e48e60e540 100644 --- a/typespec-extension/src/utils.ts +++ b/typespec-extension/src/utils.ts @@ -39,3 +39,8 @@ export function getNamespace(type: Type | undefined): string | undefined { export function stringArrayContainsIgnoreCase(stringList: string[], str: string): boolean { return stringList && str ? stringList.findIndex((s) => s.toLowerCase() === str.toLowerCase()) != -1 : false; } + +export function removeClientSuffix(clientName: string): string { + const clientSuffix = "Client"; + return clientName.endsWith(clientSuffix) ? clientName.slice(0, -clientSuffix.length) : clientName; +} \ No newline at end of file From 832e5938692bd57b71468f62d2d703a74d99c251 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Fri, 9 Aug 2024 16:21:35 +0800 Subject: [PATCH 46/90] support client crossLanguageDefinitionId --- typespec-extension/src/code-model-builder.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 486db0cc8c..8aea5bb02d 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -511,7 +511,7 @@ export class CodeModelBuilder { // at present, use global security definition security: this.codeModel.security, }); - // codeModelClient.crossLanguageDefinitionId = client.crossLanguageDefinitionId; + codeModelClient.crossLanguageDefinitionId = client.crossLanguageDefinitionId; // versioning const versions = client.apiVersions; From cf230806ae379e44115f7e05451dc3d25458e802 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Fri, 9 Aug 2024 16:35:42 +0800 Subject: [PATCH 47/90] remove unused functions --- typespec-extension/src/code-model-builder.ts | 38 -------------------- 1 file changed, 38 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 8aea5bb02d..ba44b82f0a 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -88,7 +88,6 @@ import { Namespace, Operation, Program, - Scalar, Type, TypeNameOptions, Union, @@ -108,7 +107,6 @@ import { Authentication, HttpOperation, HttpOperationResponse, - HttpServer, HttpStatusCodeRange, HttpStatusCodesEntry, Visibility, @@ -364,17 +362,6 @@ export class CodeModelBuilder { return !this.options["flavor"] || this.options["flavor"].toLocaleLowerCase() === "azure"; } - private isInternal(context: SdkContext, operation: Operation): boolean { - const access = getAccess(operation); - if (access) { - return access === "internal"; - } else { - // TODO: deprecate "internal" - // eslint-disable-next-line deprecation/deprecation - return isInternal(context, operation); - } - } - private processModels() { const processedSdkModels: Set = new Set(); @@ -1535,7 +1522,6 @@ export class CodeModelBuilder { } } - // let responseBody: SdkHttpResponse | undefined = undefined; const bodyType: SdkType | undefined = sdkResponse.type; let trackConvenienceApi: boolean = Boolean(op.convenienceApi); @@ -2138,14 +2124,6 @@ export class CodeModelBuilder { return this.codeModel.schemas.add(unionSchema); } - private processBinarySchema(type: Scalar): BinarySchema { - return this.codeModel.schemas.add( - new BinarySchema(this.getDoc(type), { - summary: this.getSummary(type), - }), - ); - } - private processBinarySchemaFromSdkType(type: SdkBuiltInType): BinarySchema { return this.codeModel.schemas.add( new BinarySchema(type.description ?? "", { @@ -2349,15 +2327,6 @@ export class CodeModelBuilder { } } - private getConvenienceApiName(op: Operation): string | undefined { - // check @convenienceMethod - if (shouldGenerateConvenient(this.sdkContext, op)) { - return this.getName(op); - } else { - return undefined; - } - } - private getConvenienceApiNameFromServiceMethod(sdkMethod: SdkServiceMethod): string | undefined { // check @convenienceMethod if (sdkMethod.__raw && shouldGenerateConvenient(this.sdkContext, sdkMethod.__raw)) { @@ -2617,11 +2586,4 @@ export class CodeModelBuilder { return Boolean(this.codeModel.arm); } - // private getLocationFromSdkParameter(param: SdkModelPropertyType): string { - // if (Object.values(ParameterLocation).includes(param.kind)) { - // return param.kind; - // } else { - // return "none"; - // } - // } } From 2cea2b3b19fd8b03b8bf43b14b3046a7b62bbc59 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Fri, 9 Aug 2024 16:36:53 +0800 Subject: [PATCH 48/90] remove unused imports --- typespec-extension/src/code-model-builder.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index ba44b82f0a..e0f048b789 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -74,7 +74,6 @@ import { getClientType, getWireName, isApiVersion, - isInternal, isSdkBuiltInKind, isSdkIntKind, shouldGenerateConvenient, From 71e0a2da718c0464d7efcd1c8cce0f0a9b5069c0 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 12 Aug 2024 10:54:27 +0800 Subject: [PATCH 49/90] update according to comments --- typespec-extension/src/code-model-builder.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index e0f048b789..a87178b1a7 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -1369,14 +1369,14 @@ export class CodeModelBuilder { // header/query/path params for (const opParameter of parameters) { - this.addParameterOrBodyToCodeModelRequest(opParameter, op, request, schema, parameter); + this.addParameterOrBodyPropertyToCodeModelRequest(opParameter, op, request, schema, parameter); } // body param if (bodyParameter) { if (bodyParameter.type.kind === "model") { - for (const bodyParam of bodyParameter.type.properties) { - if (bodyParam.kind === "property") { - this.addParameterOrBodyToCodeModelRequest(bodyParam, op, request, schema, parameter); + for (const bodyProperty of bodyParameter.type.properties) { + if (bodyProperty.kind === "property") { + this.addParameterOrBodyPropertyToCodeModelRequest(bodyProperty, op, request, schema, parameter); } } } @@ -1440,7 +1440,7 @@ export class CodeModelBuilder { } } - private addParameterOrBodyToCodeModelRequest( + private addParameterOrBodyPropertyToCodeModelRequest( opParameter: SdkPathParameter | SdkHeaderParameter | SdkQueryParameter | SdkBodyModelPropertyType, op: CodeModelOperation, request: Request, @@ -1486,6 +1486,7 @@ export class CodeModelBuilder { } } } + private findResponseBody(bodyType: Type): Type { // find a type that possibly without http metadata like @statusCode return this.getEffectiveSchemaType(bodyType); @@ -2327,8 +2328,8 @@ export class CodeModelBuilder { } private getConvenienceApiNameFromServiceMethod(sdkMethod: SdkServiceMethod): string | undefined { - // check @convenienceMethod - if (sdkMethod.__raw && shouldGenerateConvenient(this.sdkContext, sdkMethod.__raw)) { + // check @convenienceAPI + if (sdkMethod.generateConvenient) { return sdkMethod.name; } else { return undefined; From 3f4c417915273601f05f3640e1224ce8a72d8ca2 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 12 Aug 2024 11:00:48 +0800 Subject: [PATCH 50/90] lint --- typespec-extension/src/code-model-builder.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index a87178b1a7..6c3f8f671f 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -76,7 +76,6 @@ import { isApiVersion, isSdkBuiltInKind, isSdkIntKind, - shouldGenerateConvenient, shouldGenerateProtocol, } from "@azure-tools/typespec-client-generator-core"; import { @@ -157,7 +156,14 @@ import { modelIs, pushDistinct, } from "./type-utils.js"; -import { getNamespace, logWarning, pascalCase, removeClientSuffix, stringArrayContainsIgnoreCase, trace } from "./utils.js"; +import { + getNamespace, + logWarning, + pascalCase, + removeClientSuffix, + stringArrayContainsIgnoreCase, + trace, +} from "./utils.js"; import { pathToFileURL } from "url"; const { isEqual } = pkg; @@ -2585,5 +2591,4 @@ export class CodeModelBuilder { private isArm(): boolean { return Boolean(this.codeModel.arm); } - } From daef68db623b361c0b80c61500391a121f822d84 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 12 Aug 2024 12:13:07 +0800 Subject: [PATCH 51/90] lint --- typespec-extension/src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typespec-extension/src/utils.ts b/typespec-extension/src/utils.ts index e48e60e540..60676b8a8c 100644 --- a/typespec-extension/src/utils.ts +++ b/typespec-extension/src/utils.ts @@ -43,4 +43,4 @@ export function stringArrayContainsIgnoreCase(stringList: string[], str: string) export function removeClientSuffix(clientName: string): string { const clientSuffix = "Client"; return clientName.endsWith(clientSuffix) ? clientName.slice(0, -clientSuffix.length) : clientName; -} \ No newline at end of file +} From 643105bfa52e99ca11e919455876957f6d58e9c6 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 12 Aug 2024 14:31:14 +0800 Subject: [PATCH 52/90] regen --- .../ManagedIdentityTrackedResourceInner.java | 24 +++++----- .../models/NestedProxyResourceInner.java | 24 +++++----- .../models/TopLevelTrackedResourceInner.java | 24 +++++----- .../fluent/models/SalmonInner.java | 26 +++++----- .../models/TopLevelArmResourceInner.java | 24 +++++----- .../models/Error.java | 48 +++++++++---------- .../models/ErrorMin.java | 48 +++++++++---------- .../models/GoblinShark.java | 26 +++++----- .../models/OutputOnlyModelChild.java | 26 +++++----- .../models/SawShark.java | 24 +++++----- .../models/Shark.java | 26 +++++----- .../implementation/ContosoClientImpl.java | 4 +- 12 files changed, 162 insertions(+), 162 deletions(-) diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/models/ManagedIdentityTrackedResourceInner.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/models/ManagedIdentityTrackedResourceInner.java index 386af48ccc..e2074370fd 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/models/ManagedIdentityTrackedResourceInner.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/models/ManagedIdentityTrackedResourceInner.java @@ -37,9 +37,9 @@ public final class ManagedIdentityTrackedResourceInner extends Resource { private SystemData systemData; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /* * The name of the resource. @@ -47,9 +47,9 @@ public final class ManagedIdentityTrackedResourceInner extends Resource { private String name; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /** * Creates an instance of ManagedIdentityTrackedResourceInner class. @@ -107,13 +107,13 @@ public SystemData systemData() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** @@ -127,13 +127,13 @@ public String name() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/NestedProxyResourceInner.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/NestedProxyResourceInner.java index 8f9cd74164..374406c928 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/NestedProxyResourceInner.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/NestedProxyResourceInner.java @@ -29,9 +29,9 @@ public final class NestedProxyResourceInner extends ProxyResource { private SystemData systemData; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /* * The name of the resource. @@ -39,9 +39,9 @@ public final class NestedProxyResourceInner extends ProxyResource { private String name; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /** * Creates an instance of NestedProxyResourceInner class. @@ -79,13 +79,13 @@ public SystemData systemData() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** @@ -99,13 +99,13 @@ public String name() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/TopLevelTrackedResourceInner.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/TopLevelTrackedResourceInner.java index af9aad5493..139269eb15 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/TopLevelTrackedResourceInner.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/TopLevelTrackedResourceInner.java @@ -31,9 +31,9 @@ public final class TopLevelTrackedResourceInner extends Resource { private SystemData systemData; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /* * The name of the resource. @@ -41,9 +41,9 @@ public final class TopLevelTrackedResourceInner extends Resource { private String name; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /** * Creates an instance of TopLevelTrackedResourceInner class. @@ -81,13 +81,13 @@ public SystemData systemData() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** @@ -101,13 +101,13 @@ public String name() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/models/SalmonInner.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/models/SalmonInner.java index f02a79a5b9..1f8f8fb103 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/models/SalmonInner.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/models/SalmonInner.java @@ -40,9 +40,9 @@ public final class SalmonInner extends FishInner { private FishInner partner; /* - * The anotherProperties property. + * The dna property. */ - private AnotherFishProperties innerAnotherProperties = new AnotherFishProperties(); + private String dna; /* * The properties property. @@ -50,9 +50,9 @@ public final class SalmonInner extends FishInner { private FishProperties innerProperties = new FishProperties(); /* - * The dna property. + * The anotherProperties property. */ - private String dna; + private AnotherFishProperties innerAnotherProperties = new AnotherFishProperties(); /** * Creates an instance of SalmonInner class. @@ -131,12 +131,13 @@ public SalmonInner withPartner(FishInner partner) { } /** - * Get the innerAnotherProperties property: The anotherProperties property. + * Get the dna property: The dna property. * - * @return the innerAnotherProperties value. + * @return the dna value. */ - private AnotherFishProperties innerAnotherProperties() { - return this.innerAnotherProperties; + @Override + public String dna() { + return this.dna; } /** @@ -149,13 +150,12 @@ private FishProperties innerProperties() { } /** - * Get the dna property: The dna property. + * Get the innerAnotherProperties property: The anotherProperties property. * - * @return the dna value. + * @return the innerAnotherProperties value. */ - @Override - public String dna() { - return this.dna; + private AnotherFishProperties innerAnotherProperties() { + return this.innerAnotherProperties; } /** diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/models/TopLevelArmResourceInner.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/models/TopLevelArmResourceInner.java index b2f7aa1de2..a838d65b00 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/models/TopLevelArmResourceInner.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/models/TopLevelArmResourceInner.java @@ -31,9 +31,9 @@ public final class TopLevelArmResourceInner extends Resource { private SystemData systemData; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /* * The name of the resource. @@ -41,9 +41,9 @@ public final class TopLevelArmResourceInner extends Resource { private String name; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /** * Creates an instance of TopLevelArmResourceInner class. @@ -70,13 +70,13 @@ public SystemData systemData() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** @@ -90,13 +90,13 @@ public String name() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/Error.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/Error.java index e3969a26cc..f26d740c34 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/Error.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/Error.java @@ -29,24 +29,24 @@ public final class Error extends ManagementError { private String additionalProperty; /* - * Additional info for the error. + * The error code parsed from the body of the http error response. */ - private List additionalInfo; + private String code; /* - * The target of the error. + * The error message parsed from the body of the http error response. */ - private String target; + private String message; /* - * The error message parsed from the body of the http error response. + * The target of the error. */ - private String message; + private String target; /* - * The error code parsed from the body of the http error response. + * Additional info for the error. */ - private String code; + private List additionalInfo; /** * Creates an instance of Error class. @@ -74,43 +74,43 @@ public String getAdditionalProperty() { } /** - * Get the additionalInfo property: Additional info for the error. + * Get the code property: The error code parsed from the body of the http error response. * - * @return the additionalInfo value. + * @return the code value. */ @Override - public List getAdditionalInfo() { - return this.additionalInfo; + public String getCode() { + return this.code; } /** - * Get the target property: The target of the error. + * Get the message property: The error message parsed from the body of the http error response. * - * @return the target value. + * @return the message value. */ @Override - public String getTarget() { - return this.target; + public String getMessage() { + return this.message; } /** - * Get the message property: The error message parsed from the body of the http error response. + * Get the target property: The target of the error. * - * @return the message value. + * @return the target value. */ @Override - public String getMessage() { - return this.message; + public String getTarget() { + return this.target; } /** - * Get the code property: The error code parsed from the body of the http error response. + * Get the additionalInfo property: Additional info for the error. * - * @return the code value. + * @return the additionalInfo value. */ @Override - public String getCode() { - return this.code; + public List getAdditionalInfo() { + return this.additionalInfo; } /** diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/ErrorMin.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/ErrorMin.java index 214e7681d9..7abd94c8d7 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/ErrorMin.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/ErrorMin.java @@ -24,14 +24,14 @@ public final class ErrorMin extends ManagementError { private String additionalProperty; /* - * Additional info for the error. + * The error code parsed from the body of the http error response. */ - private List additionalInfo; + private String code; /* - * Details for the error. + * The error message parsed from the body of the http error response. */ - private List details; + private String message; /* * The target of the error. @@ -39,14 +39,14 @@ public final class ErrorMin extends ManagementError { private String target; /* - * The error message parsed from the body of the http error response. + * Details for the error. */ - private String message; + private List details; /* - * The error code parsed from the body of the http error response. + * Additional info for the error. */ - private String code; + private List additionalInfo; /** * Creates an instance of ErrorMin class. @@ -64,23 +64,23 @@ public String getAdditionalProperty() { } /** - * Get the additionalInfo property: Additional info for the error. + * Get the code property: The error code parsed from the body of the http error response. * - * @return the additionalInfo value. + * @return the code value. */ @Override - public List getAdditionalInfo() { - return this.additionalInfo; + public String getCode() { + return this.code; } /** - * Get the details property: Details for the error. + * Get the message property: The error message parsed from the body of the http error response. * - * @return the details value. + * @return the message value. */ @Override - public List getDetails() { - return this.details; + public String getMessage() { + return this.message; } /** @@ -94,23 +94,23 @@ public String getTarget() { } /** - * Get the message property: The error message parsed from the body of the http error response. + * Get the details property: Details for the error. * - * @return the message value. + * @return the details value. */ @Override - public String getMessage() { - return this.message; + public List getDetails() { + return this.details; } /** - * Get the code property: The error code parsed from the body of the http error response. + * Get the additionalInfo property: Additional info for the error. * - * @return the code value. + * @return the additionalInfo value. */ @Override - public String getCode() { - return this.code; + public List getAdditionalInfo() { + return this.additionalInfo; } /** diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/GoblinShark.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/GoblinShark.java index 9109e90317..2ddfe2eba7 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/GoblinShark.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/GoblinShark.java @@ -29,9 +29,9 @@ public final class GoblinShark extends Shark { private String sharktype = "goblin"; /* - * The anotherProperties property. + * The dna property. */ - private AnotherFishProperties innerAnotherProperties = new AnotherFishProperties(); + private String dna; /* * The properties property. @@ -39,9 +39,9 @@ public final class GoblinShark extends Shark { private FishProperties innerProperties = new FishProperties(); /* - * The dna property. + * The anotherProperties property. */ - private String dna; + private AnotherFishProperties innerAnotherProperties = new AnotherFishProperties(); /** * Creates an instance of GoblinShark class. @@ -70,12 +70,13 @@ public String sharktype() { } /** - * Get the innerAnotherProperties property: The anotherProperties property. + * Get the dna property: The dna property. * - * @return the innerAnotherProperties value. + * @return the dna value. */ - private AnotherFishProperties innerAnotherProperties() { - return this.innerAnotherProperties; + @Override + public String dna() { + return this.dna; } /** @@ -88,13 +89,12 @@ private FishProperties innerProperties() { } /** - * Get the dna property: The dna property. + * Get the innerAnotherProperties property: The anotherProperties property. * - * @return the dna value. + * @return the innerAnotherProperties value. */ - @Override - public String dna() { - return this.dna; + private AnotherFishProperties innerAnotherProperties() { + return this.innerAnotherProperties; } /** diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/OutputOnlyModelChild.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/OutputOnlyModelChild.java index 46141c21de..d8c8677877 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/OutputOnlyModelChild.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/OutputOnlyModelChild.java @@ -29,9 +29,9 @@ public final class OutputOnlyModelChild extends OutputOnlyModelInner { private String childName; /* - * The properties property. + * The name property. */ - private OutputOnlyModelProperties innerProperties; + private String name; /* * The id property. @@ -39,9 +39,9 @@ public final class OutputOnlyModelChild extends OutputOnlyModelInner { private String id; /* - * The name property. + * The properties property. */ - private String name; + private OutputOnlyModelProperties innerProperties; /** * Creates an instance of OutputOnlyModelChild class. @@ -69,12 +69,13 @@ public String childName() { } /** - * Get the innerProperties property: The properties property. + * Get the name property: The name property. * - * @return the innerProperties value. + * @return the name value. */ - private OutputOnlyModelProperties innerProperties() { - return this.innerProperties; + @Override + public String name() { + return this.name; } /** @@ -88,13 +89,12 @@ public String id() { } /** - * Get the name property: The name property. + * Get the innerProperties property: The properties property. * - * @return the name value. + * @return the innerProperties value. */ - @Override - public String name() { - return this.name; + private OutputOnlyModelProperties innerProperties() { + return this.innerProperties; } /** diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/SawShark.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/SawShark.java index 914dfa5301..6c16d30ea2 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/SawShark.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/SawShark.java @@ -39,14 +39,14 @@ public final class SawShark extends Shark { private int age; /* - * The anotherProperties property. + * The properties property. */ - private AnotherFishProperties innerAnotherProperties = new AnotherFishProperties(); + private FishProperties innerProperties = new FishProperties(); /* - * The properties property. + * The anotherProperties property. */ - private FishProperties innerProperties = new FishProperties(); + private AnotherFishProperties innerAnotherProperties = new AnotherFishProperties(); /** * Creates an instance of SawShark class. @@ -115,21 +115,21 @@ public SawShark withAge(int age) { } /** - * Get the innerAnotherProperties property: The anotherProperties property. + * Get the innerProperties property: The properties property. * - * @return the innerAnotherProperties value. + * @return the innerProperties value. */ - private AnotherFishProperties innerAnotherProperties() { - return this.innerAnotherProperties; + private FishProperties innerProperties() { + return this.innerProperties; } /** - * Get the innerProperties property: The properties property. + * Get the innerAnotherProperties property: The anotherProperties property. * - * @return the innerProperties value. + * @return the innerAnotherProperties value. */ - private FishProperties innerProperties() { - return this.innerProperties; + private AnotherFishProperties innerAnotherProperties() { + return this.innerAnotherProperties; } /** diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/Shark.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/Shark.java index df15d3fe6e..16f147f7ec 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/Shark.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/Shark.java @@ -30,9 +30,9 @@ public class Shark extends FishInner { private String sharktype = "shark"; /* - * The anotherProperties property. + * The dna property. */ - private AnotherFishProperties innerAnotherProperties = new AnotherFishProperties(); + private String dna; /* * The properties property. @@ -40,9 +40,9 @@ public class Shark extends FishInner { private FishProperties innerProperties = new FishProperties(); /* - * The dna property. + * The anotherProperties property. */ - private String dna; + private AnotherFishProperties innerAnotherProperties = new AnotherFishProperties(); /** * Creates an instance of Shark class. @@ -70,12 +70,13 @@ public String sharktype() { } /** - * Get the innerAnotherProperties property: The anotherProperties property. + * Get the dna property: The dna property. * - * @return the innerAnotherProperties value. + * @return the dna value. */ - private AnotherFishProperties innerAnotherProperties() { - return this.innerAnotherProperties; + @Override + public String dna() { + return this.dna; } /** @@ -88,13 +89,12 @@ private FishProperties innerProperties() { } /** - * Get the dna property: The dna property. + * Get the innerAnotherProperties property: The anotherProperties property. * - * @return the dna value. + * @return the innerAnotherProperties value. */ - @Override - public String dna() { - return this.dna; + private AnotherFishProperties innerAnotherProperties() { + return this.innerAnotherProperties; } /** diff --git a/typespec-tests/src/main/java/com/cadl/server/implementation/ContosoClientImpl.java b/typespec-tests/src/main/java/com/cadl/server/implementation/ContosoClientImpl.java index 10740ce1d6..249cf6baa7 100644 --- a/typespec-tests/src/main/java/com/cadl/server/implementation/ContosoClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/server/implementation/ContosoClientImpl.java @@ -148,7 +148,7 @@ public interface ContosoClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> get(@HostParam("Endpoint") String endpoint, @HostParam("ApiVersion") String apiVersion, - @PathParam(value = "group", encoded = true) String group, RequestOptions requestOptions, Context context); + @PathParam("group") String group, RequestOptions requestOptions, Context context); @Get("/contoso/{group}") @ExpectedResponses({ 200, 204 }) @@ -157,7 +157,7 @@ Mono> get(@HostParam("Endpoint") String endpoint, @HostParam("Api @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSync(@HostParam("Endpoint") String endpoint, @HostParam("ApiVersion") String apiVersion, - @PathParam(value = "group", encoded = true) String group, RequestOptions requestOptions, Context context); + @PathParam("group") String group, RequestOptions requestOptions, Context context); } /** From fc35d0fe3520cc668a6f2029a64284453d29874d Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 12 Aug 2024 14:34:10 +0800 Subject: [PATCH 53/90] add TODO for allowReserved for path url --- typespec-extension/src/code-model-builder.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 38f5abf976..b6d183fd5e 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -1061,7 +1061,7 @@ export class CodeModelBuilder { const schema = this.processSchemaFromSdkType(sdkType, param.name); let extensions: { [id: string]: any } | undefined = undefined; - // skip-url-encoding,pending on TCGC + // TODO haoling: skip-url-encoding, pending on TCGC issue https://github.com/Azure/typespec-azure/issues/1318 // if (param.kind === "path") { // if (param.allowReserved) { // extensions = extensions ?? {}; @@ -1071,7 +1071,7 @@ export class CodeModelBuilder { // TODO: deprecate this logic of string/url for x-ms-skip-url-encoding if ( (param.kind === "query" || param.kind === "path") && - isSdkBuiltInKind(sdkType.kind) && // TODO: question: Scalar -> builtin kinds, is it fine? + isSdkBuiltInKind(sdkType.kind) && schema instanceof UriSchema ) { extensions = extensions ?? {}; From 52271aa06bca8e4738561ca580447790606eee74 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 12 Aug 2024 15:08:47 +0800 Subject: [PATCH 54/90] update according to comments --- typespec-extension/src/code-model-builder.ts | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index b6d183fd5e..b4ec76bce8 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -568,7 +568,7 @@ export class CodeModelBuilder { // preprocess operation groups and operations // operations without operation group - const serviceMethodsWithoutSubClient = this.listServiceMethodsUnderClient(client, false); + const serviceMethodsWithoutSubClient = this.listServiceMethodsUnderClient(client); let codeModelGroup = new OperationGroup(""); for (const serviceMethod of serviceMethodsWithoutSubClient) { if (!this.needToSkipProcessingOperation(serviceMethod.__raw, clientContext)) { @@ -582,7 +582,7 @@ export class CodeModelBuilder { // operations under operation groups const subClients = this.listSubClientsUnderClient(client, true, true); for (const subClient of subClients) { - const serviceMethods = this.listServiceMethodsUnderClient(subClient, false); + const serviceMethods = this.listServiceMethodsUnderClient(subClient); // operation group with no operation is skipped if (serviceMethods.length > 0) { codeModelGroup = new OperationGroup(subClient.name); @@ -656,20 +656,9 @@ export class CodeModelBuilder { return operationGroups; } - private listServiceMethodsUnderClient( - client: SdkClientType, - includeNestedServiceMethods: boolean, - ): SdkServiceMethod[] { + private listServiceMethodsUnderClient(client: SdkClientType): SdkServiceMethod[] { const methods: SdkServiceMethod[] = []; for (const method of client.methods) { - if (includeNestedServiceMethods) { - if (method.kind === "clientaccessor") { - const client = method.response; - for (const method of this.listServiceMethodsUnderClient(client, includeNestedServiceMethods)) { - methods.push(method); - } - } - } if (method.kind !== "clientaccessor") { methods.push(method); } From 98a141c5999c84124a8fd8a9711b4e5a7be8d5cc Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 12 Aug 2024 15:09:05 +0800 Subject: [PATCH 55/90] regen --- .../ManagedIdentityTrackedResourceInner.java | 24 +++++----- .../models/NestedProxyResourceInner.java | 24 +++++----- .../models/TopLevelTrackedResourceInner.java | 24 +++++----- .../fluent/models/SalmonInner.java | 26 +++++----- .../models/TopLevelArmResourceInner.java | 24 +++++----- .../models/Error.java | 48 +++++++++---------- .../models/ErrorMin.java | 48 +++++++++---------- .../models/GoblinShark.java | 26 +++++----- .../models/OutputOnlyModelChild.java | 26 +++++----- .../models/SawShark.java | 24 +++++----- .../models/Shark.java | 26 +++++----- 11 files changed, 160 insertions(+), 160 deletions(-) diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/models/ManagedIdentityTrackedResourceInner.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/models/ManagedIdentityTrackedResourceInner.java index e2074370fd..386af48ccc 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/models/ManagedIdentityTrackedResourceInner.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/models/ManagedIdentityTrackedResourceInner.java @@ -37,9 +37,9 @@ public final class ManagedIdentityTrackedResourceInner extends Resource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -47,9 +47,9 @@ public final class ManagedIdentityTrackedResourceInner extends Resource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of ManagedIdentityTrackedResourceInner class. @@ -107,13 +107,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -127,13 +127,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/NestedProxyResourceInner.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/NestedProxyResourceInner.java index 374406c928..8f9cd74164 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/NestedProxyResourceInner.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/NestedProxyResourceInner.java @@ -29,9 +29,9 @@ public final class NestedProxyResourceInner extends ProxyResource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -39,9 +39,9 @@ public final class NestedProxyResourceInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of NestedProxyResourceInner class. @@ -79,13 +79,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -99,13 +99,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/TopLevelTrackedResourceInner.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/TopLevelTrackedResourceInner.java index 139269eb15..af9aad5493 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/TopLevelTrackedResourceInner.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/TopLevelTrackedResourceInner.java @@ -31,9 +31,9 @@ public final class TopLevelTrackedResourceInner extends Resource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -41,9 +41,9 @@ public final class TopLevelTrackedResourceInner extends Resource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of TopLevelTrackedResourceInner class. @@ -81,13 +81,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -101,13 +101,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/models/SalmonInner.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/models/SalmonInner.java index 1f8f8fb103..f02a79a5b9 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/models/SalmonInner.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/models/SalmonInner.java @@ -40,9 +40,9 @@ public final class SalmonInner extends FishInner { private FishInner partner; /* - * The dna property. + * The anotherProperties property. */ - private String dna; + private AnotherFishProperties innerAnotherProperties = new AnotherFishProperties(); /* * The properties property. @@ -50,9 +50,9 @@ public final class SalmonInner extends FishInner { private FishProperties innerProperties = new FishProperties(); /* - * The anotherProperties property. + * The dna property. */ - private AnotherFishProperties innerAnotherProperties = new AnotherFishProperties(); + private String dna; /** * Creates an instance of SalmonInner class. @@ -131,13 +131,12 @@ public SalmonInner withPartner(FishInner partner) { } /** - * Get the dna property: The dna property. + * Get the innerAnotherProperties property: The anotherProperties property. * - * @return the dna value. + * @return the innerAnotherProperties value. */ - @Override - public String dna() { - return this.dna; + private AnotherFishProperties innerAnotherProperties() { + return this.innerAnotherProperties; } /** @@ -150,12 +149,13 @@ private FishProperties innerProperties() { } /** - * Get the innerAnotherProperties property: The anotherProperties property. + * Get the dna property: The dna property. * - * @return the innerAnotherProperties value. + * @return the dna value. */ - private AnotherFishProperties innerAnotherProperties() { - return this.innerAnotherProperties; + @Override + public String dna() { + return this.dna; } /** diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/models/TopLevelArmResourceInner.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/models/TopLevelArmResourceInner.java index a838d65b00..b2f7aa1de2 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/models/TopLevelArmResourceInner.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/models/TopLevelArmResourceInner.java @@ -31,9 +31,9 @@ public final class TopLevelArmResourceInner extends Resource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -41,9 +41,9 @@ public final class TopLevelArmResourceInner extends Resource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of TopLevelArmResourceInner class. @@ -70,13 +70,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -90,13 +90,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/Error.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/Error.java index f26d740c34..e3969a26cc 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/Error.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/Error.java @@ -29,24 +29,24 @@ public final class Error extends ManagementError { private String additionalProperty; /* - * The error code parsed from the body of the http error response. + * Additional info for the error. */ - private String code; + private List additionalInfo; /* - * The error message parsed from the body of the http error response. + * The target of the error. */ - private String message; + private String target; /* - * The target of the error. + * The error message parsed from the body of the http error response. */ - private String target; + private String message; /* - * Additional info for the error. + * The error code parsed from the body of the http error response. */ - private List additionalInfo; + private String code; /** * Creates an instance of Error class. @@ -74,43 +74,43 @@ public String getAdditionalProperty() { } /** - * Get the code property: The error code parsed from the body of the http error response. + * Get the additionalInfo property: Additional info for the error. * - * @return the code value. + * @return the additionalInfo value. */ @Override - public String getCode() { - return this.code; + public List getAdditionalInfo() { + return this.additionalInfo; } /** - * Get the message property: The error message parsed from the body of the http error response. + * Get the target property: The target of the error. * - * @return the message value. + * @return the target value. */ @Override - public String getMessage() { - return this.message; + public String getTarget() { + return this.target; } /** - * Get the target property: The target of the error. + * Get the message property: The error message parsed from the body of the http error response. * - * @return the target value. + * @return the message value. */ @Override - public String getTarget() { - return this.target; + public String getMessage() { + return this.message; } /** - * Get the additionalInfo property: Additional info for the error. + * Get the code property: The error code parsed from the body of the http error response. * - * @return the additionalInfo value. + * @return the code value. */ @Override - public List getAdditionalInfo() { - return this.additionalInfo; + public String getCode() { + return this.code; } /** diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/ErrorMin.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/ErrorMin.java index 7abd94c8d7..214e7681d9 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/ErrorMin.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/ErrorMin.java @@ -24,14 +24,14 @@ public final class ErrorMin extends ManagementError { private String additionalProperty; /* - * The error code parsed from the body of the http error response. + * Additional info for the error. */ - private String code; + private List additionalInfo; /* - * The error message parsed from the body of the http error response. + * Details for the error. */ - private String message; + private List details; /* * The target of the error. @@ -39,14 +39,14 @@ public final class ErrorMin extends ManagementError { private String target; /* - * Details for the error. + * The error message parsed from the body of the http error response. */ - private List details; + private String message; /* - * Additional info for the error. + * The error code parsed from the body of the http error response. */ - private List additionalInfo; + private String code; /** * Creates an instance of ErrorMin class. @@ -64,23 +64,23 @@ public String getAdditionalProperty() { } /** - * Get the code property: The error code parsed from the body of the http error response. + * Get the additionalInfo property: Additional info for the error. * - * @return the code value. + * @return the additionalInfo value. */ @Override - public String getCode() { - return this.code; + public List getAdditionalInfo() { + return this.additionalInfo; } /** - * Get the message property: The error message parsed from the body of the http error response. + * Get the details property: Details for the error. * - * @return the message value. + * @return the details value. */ @Override - public String getMessage() { - return this.message; + public List getDetails() { + return this.details; } /** @@ -94,23 +94,23 @@ public String getTarget() { } /** - * Get the details property: Details for the error. + * Get the message property: The error message parsed from the body of the http error response. * - * @return the details value. + * @return the message value. */ @Override - public List getDetails() { - return this.details; + public String getMessage() { + return this.message; } /** - * Get the additionalInfo property: Additional info for the error. + * Get the code property: The error code parsed from the body of the http error response. * - * @return the additionalInfo value. + * @return the code value. */ @Override - public List getAdditionalInfo() { - return this.additionalInfo; + public String getCode() { + return this.code; } /** diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/GoblinShark.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/GoblinShark.java index 2ddfe2eba7..9109e90317 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/GoblinShark.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/GoblinShark.java @@ -29,9 +29,9 @@ public final class GoblinShark extends Shark { private String sharktype = "goblin"; /* - * The dna property. + * The anotherProperties property. */ - private String dna; + private AnotherFishProperties innerAnotherProperties = new AnotherFishProperties(); /* * The properties property. @@ -39,9 +39,9 @@ public final class GoblinShark extends Shark { private FishProperties innerProperties = new FishProperties(); /* - * The anotherProperties property. + * The dna property. */ - private AnotherFishProperties innerAnotherProperties = new AnotherFishProperties(); + private String dna; /** * Creates an instance of GoblinShark class. @@ -70,13 +70,12 @@ public String sharktype() { } /** - * Get the dna property: The dna property. + * Get the innerAnotherProperties property: The anotherProperties property. * - * @return the dna value. + * @return the innerAnotherProperties value. */ - @Override - public String dna() { - return this.dna; + private AnotherFishProperties innerAnotherProperties() { + return this.innerAnotherProperties; } /** @@ -89,12 +88,13 @@ private FishProperties innerProperties() { } /** - * Get the innerAnotherProperties property: The anotherProperties property. + * Get the dna property: The dna property. * - * @return the innerAnotherProperties value. + * @return the dna value. */ - private AnotherFishProperties innerAnotherProperties() { - return this.innerAnotherProperties; + @Override + public String dna() { + return this.dna; } /** diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/OutputOnlyModelChild.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/OutputOnlyModelChild.java index d8c8677877..46141c21de 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/OutputOnlyModelChild.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/OutputOnlyModelChild.java @@ -29,9 +29,9 @@ public final class OutputOnlyModelChild extends OutputOnlyModelInner { private String childName; /* - * The name property. + * The properties property. */ - private String name; + private OutputOnlyModelProperties innerProperties; /* * The id property. @@ -39,9 +39,9 @@ public final class OutputOnlyModelChild extends OutputOnlyModelInner { private String id; /* - * The properties property. + * The name property. */ - private OutputOnlyModelProperties innerProperties; + private String name; /** * Creates an instance of OutputOnlyModelChild class. @@ -69,13 +69,12 @@ public String childName() { } /** - * Get the name property: The name property. + * Get the innerProperties property: The properties property. * - * @return the name value. + * @return the innerProperties value. */ - @Override - public String name() { - return this.name; + private OutputOnlyModelProperties innerProperties() { + return this.innerProperties; } /** @@ -89,12 +88,13 @@ public String id() { } /** - * Get the innerProperties property: The properties property. + * Get the name property: The name property. * - * @return the innerProperties value. + * @return the name value. */ - private OutputOnlyModelProperties innerProperties() { - return this.innerProperties; + @Override + public String name() { + return this.name; } /** diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/SawShark.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/SawShark.java index 6c16d30ea2..914dfa5301 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/SawShark.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/SawShark.java @@ -39,14 +39,14 @@ public final class SawShark extends Shark { private int age; /* - * The properties property. + * The anotherProperties property. */ - private FishProperties innerProperties = new FishProperties(); + private AnotherFishProperties innerAnotherProperties = new AnotherFishProperties(); /* - * The anotherProperties property. + * The properties property. */ - private AnotherFishProperties innerAnotherProperties = new AnotherFishProperties(); + private FishProperties innerProperties = new FishProperties(); /** * Creates an instance of SawShark class. @@ -115,21 +115,21 @@ public SawShark withAge(int age) { } /** - * Get the innerProperties property: The properties property. + * Get the innerAnotherProperties property: The anotherProperties property. * - * @return the innerProperties value. + * @return the innerAnotherProperties value. */ - private FishProperties innerProperties() { - return this.innerProperties; + private AnotherFishProperties innerAnotherProperties() { + return this.innerAnotherProperties; } /** - * Get the innerAnotherProperties property: The anotherProperties property. + * Get the innerProperties property: The properties property. * - * @return the innerAnotherProperties value. + * @return the innerProperties value. */ - private AnotherFishProperties innerAnotherProperties() { - return this.innerAnotherProperties; + private FishProperties innerProperties() { + return this.innerProperties; } /** diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/Shark.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/Shark.java index 16f147f7ec..df15d3fe6e 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/Shark.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/models/Shark.java @@ -30,9 +30,9 @@ public class Shark extends FishInner { private String sharktype = "shark"; /* - * The dna property. + * The anotherProperties property. */ - private String dna; + private AnotherFishProperties innerAnotherProperties = new AnotherFishProperties(); /* * The properties property. @@ -40,9 +40,9 @@ public class Shark extends FishInner { private FishProperties innerProperties = new FishProperties(); /* - * The anotherProperties property. + * The dna property. */ - private AnotherFishProperties innerAnotherProperties = new AnotherFishProperties(); + private String dna; /** * Creates an instance of Shark class. @@ -70,13 +70,12 @@ public String sharktype() { } /** - * Get the dna property: The dna property. + * Get the innerAnotherProperties property: The anotherProperties property. * - * @return the dna value. + * @return the innerAnotherProperties value. */ - @Override - public String dna() { - return this.dna; + private AnotherFishProperties innerAnotherProperties() { + return this.innerAnotherProperties; } /** @@ -89,12 +88,13 @@ private FishProperties innerProperties() { } /** - * Get the innerAnotherProperties property: The anotherProperties property. + * Get the dna property: The dna property. * - * @return the innerAnotherProperties value. + * @return the dna value. */ - private AnotherFishProperties innerAnotherProperties() { - return this.innerAnotherProperties; + @Override + public String dna() { + return this.dna; } /** From 1e05ccd1ae20553ed7fe21351f8bd6232b477678 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 12 Aug 2024 17:31:07 +0800 Subject: [PATCH 56/90] support client default endpoint --- typespec-extension/src/code-model-builder.ts | 2 ++ .../clientgenerator/core/access/AccessClientBuilder.java | 4 ++-- .../clientgenerator/core/usage/UsageClientBuilder.java | 4 ++-- .../com/_specs_/azure/core/basic/BasicClientBuilder.java | 4 ++-- .../com/_specs_/azure/core/lro/rpc/RpcClientBuilder.java | 4 ++-- .../azure/core/lro/standard/StandardClientBuilder.java | 4 ++-- .../com/_specs_/azure/core/model/ModelClientBuilder.java | 4 ++-- .../java/com/_specs_/azure/core/page/PageClientBuilder.java | 4 ++-- .../com/_specs_/azure/core/scalar/ScalarClientBuilder.java | 4 ++-- .../com/_specs_/azure/core/traits/TraitsClientBuilder.java | 4 ++-- .../azure/example/basic/AzureExampleClientBuilder.java | 4 ++-- .../java/com/authentication/apikey/ApiKeyClientBuilder.java | 4 ++-- .../com/authentication/http/custom/CustomClientBuilder.java | 4 ++-- .../java/com/authentication/oauth2/OAuth2ClientBuilder.java | 4 ++-- .../java/com/authentication/union/UnionClientBuilder.java | 4 ++-- .../implementation/ManagedIdentityClientBuilder.java | 3 ++- .../resources/implementation/ResourcesClientBuilder.java | 3 ++- .../xmsclientrequestid/XmsClientRequestIdClientBuilder.java | 4 ++-- .../implementation/ArmResourceProviderClientBuilder.java | 3 ++- .../ArmStreamStyleSerializationClientBuilder.java | 3 ++- .../src/main/java/com/cadl/server/HttpbinClientBuilder.java | 6 +++--- .../main/java/com/client/naming/NamingClientBuilder.java | 4 ++-- .../src/main/java/com/encode/bytes/BytesClientBuilder.java | 4 ++-- .../java/com/encode/datetime/DatetimeClientBuilder.java | 4 ++-- .../java/com/encode/duration/DurationClientBuilder.java | 4 ++-- .../main/java/com/parameters/basic/BasicClientBuilder.java | 4 ++-- .../bodyoptionality/BodyOptionalityClientBuilder.java | 4 ++-- .../collectionformat/CollectionFormatClientBuilder.java | 4 ++-- .../java/com/parameters/spread/SpreadClientBuilder.java | 4 ++-- .../contentnegotiation/ContentNegotiationClientBuilder.java | 4 ++-- .../payload/jsonmergepatch/JsonMergePatchClientBuilder.java | 4 ++-- .../java/com/payload/mediatype/MediaTypeClientBuilder.java | 4 ++-- .../java/com/payload/multipart/MultiPartClientBuilder.java | 4 ++-- .../java/com/payload/pageable/PageableClientBuilder.java | 4 ++-- .../serialization/encodedname/json/JsonClientBuilder.java | 4 ++-- .../conditionalrequest/ConditionalRequestClientBuilder.java | 4 ++-- .../repeatability/RepeatabilityClientBuilder.java | 4 ++-- .../java/com/specialwords/SpecialWordsClientBuilder.java | 4 ++-- .../src/main/java/com/type/array/ArrayClientBuilder.java | 4 ++-- .../java/com/type/dictionary/DictionaryClientBuilder.java | 4 ++-- .../com/type/enums/extensible/ExtensibleClientBuilder.java | 4 ++-- .../main/java/com/type/enums/fixed/FixedClientBuilder.java | 4 ++-- .../main/java/com/type/model/empty/EmptyClientBuilder.java | 4 ++-- .../java/com/type/model/flatten/FlattenClientBuilder.java | 4 ++-- .../enumdiscriminator/EnumDiscriminatorClientBuilder.java | 4 ++-- .../EnumNestedDiscriminatorClientBuilder.java | 4 ++-- .../NestedDiscriminatorClientBuilder.java | 4 ++-- .../notdiscriminated/NotDiscriminatedClientBuilder.java | 4 ++-- .../model/inheritance/recursive/RecursiveClientBuilder.java | 4 ++-- .../SingleDiscriminatorClientBuilder.java | 4 ++-- .../main/java/com/type/model/usage/UsageClientBuilder.java | 4 ++-- .../com/type/model/visibility/VisibilityClientBuilder.java | 4 ++-- .../AdditionalPropertiesClientBuilder.java | 4 ++-- .../com/type/property/nullable/NullableClientBuilder.java | 4 ++-- .../com/type/property/optional/OptionalClientBuilder.java | 4 ++-- .../type/property/valuetypes/ValueTypesClientBuilder.java | 4 ++-- .../src/main/java/com/type/scalar/ScalarClientBuilder.java | 4 ++-- .../src/main/java/com/type/union/UnionClientBuilder.java | 4 ++-- .../_specs_/azure/example/basic/generated/BasicAction.java | 4 +--- 59 files changed, 118 insertions(+), 114 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index b4ec76bce8..8dc78099d8 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -297,9 +297,11 @@ export class CodeModelBuilder { serializedName: arg.name, }, }, + // TODO: deprecate this logic of string/url for x-ms-skip-url-encoding extensions: { "x-ms-skip-url-encoding": schema instanceof UriSchema, }, + clientDefaultValue: arg.clientDefaultValue, }); } hostParameters.push(this.codeModel.addGlobalParameter(parameter)); diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/AccessClientBuilder.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/AccessClientBuilder.java index b35ff4b2e7..3ce73c56e6 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/AccessClientBuilder.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/access/AccessClientBuilder.java @@ -226,8 +226,9 @@ public AccessClientBuilder retryPolicy(RetryPolicy retryPolicy) { private AccessClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; AccessClientImpl client - = new AccessClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new AccessClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -235,7 +236,6 @@ private AccessClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/UsageClientBuilder.java b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/UsageClientBuilder.java index 1a7076c567..16d7b3ae9c 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/UsageClientBuilder.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/clientgenerator/core/usage/UsageClientBuilder.java @@ -217,8 +217,9 @@ public UsageClientBuilder retryPolicy(RetryPolicy retryPolicy) { private UsageClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; UsageClientImpl client - = new UsageClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new UsageClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -226,7 +227,6 @@ private UsageClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/BasicClientBuilder.java b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/BasicClientBuilder.java index 5eb4fb0cf8..8afed75e1f 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/basic/BasicClientBuilder.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/basic/BasicClientBuilder.java @@ -235,10 +235,11 @@ public BasicClientBuilder retryPolicy(RetryPolicy retryPolicy) { private BasicClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; BasicServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : BasicServiceVersion.getLatest(); BasicClientImpl client = new BasicClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), - this.endpoint, localServiceVersion); + localEndpoint, localServiceVersion); return client; } @@ -246,7 +247,6 @@ private BasicClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/RpcClientBuilder.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/RpcClientBuilder.java index cae3c9be65..7bb66a0108 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/RpcClientBuilder.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/rpc/RpcClientBuilder.java @@ -235,10 +235,11 @@ public RpcClientBuilder retryPolicy(RetryPolicy retryPolicy) { private RpcClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; RpcServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : RpcServiceVersion.getLatest(); RpcClientImpl client = new RpcClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), - this.endpoint, localServiceVersion); + localEndpoint, localServiceVersion); return client; } @@ -246,7 +247,6 @@ private RpcClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/StandardClientBuilder.java b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/StandardClientBuilder.java index 5a63fad907..82da25b875 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/StandardClientBuilder.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/lro/standard/StandardClientBuilder.java @@ -235,10 +235,11 @@ public StandardClientBuilder retryPolicy(RetryPolicy retryPolicy) { private StandardClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; StandardServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : StandardServiceVersion.getLatest(); StandardClientImpl client = new StandardClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint, localServiceVersion); return client; } @@ -246,7 +247,6 @@ private StandardClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/model/ModelClientBuilder.java b/typespec-tests/src/main/java/com/_specs_/azure/core/model/ModelClientBuilder.java index 8bdb17f957..50e42f831f 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/model/ModelClientBuilder.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/model/ModelClientBuilder.java @@ -235,10 +235,11 @@ public ModelClientBuilder retryPolicy(RetryPolicy retryPolicy) { private ModelClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; ModelServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : ModelServiceVersion.getLatest(); ModelClientImpl client = new ModelClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), - this.endpoint, localServiceVersion); + localEndpoint, localServiceVersion); return client; } @@ -246,7 +247,6 @@ private ModelClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/page/PageClientBuilder.java b/typespec-tests/src/main/java/com/_specs_/azure/core/page/PageClientBuilder.java index a9d2b453c4..80b9dd8cec 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/page/PageClientBuilder.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/page/PageClientBuilder.java @@ -239,10 +239,11 @@ public PageClientBuilder retryPolicy(RetryPolicy retryPolicy) { private PageClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; PageServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : PageServiceVersion.getLatest(); PageClientImpl client = new PageClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), - this.endpoint, localServiceVersion); + localEndpoint, localServiceVersion); return client; } @@ -250,7 +251,6 @@ private PageClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarClientBuilder.java b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarClientBuilder.java index 6b8c0adbb5..e6b649b449 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarClientBuilder.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/scalar/ScalarClientBuilder.java @@ -235,10 +235,11 @@ public ScalarClientBuilder retryPolicy(RetryPolicy retryPolicy) { private ScalarClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; ScalarServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : ScalarServiceVersion.getLatest(); ScalarClientImpl client = new ScalarClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), - this.endpoint, localServiceVersion); + localEndpoint, localServiceVersion); return client; } @@ -246,7 +247,6 @@ private ScalarClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsClientBuilder.java b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsClientBuilder.java index 95513e117a..fd180f21ec 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsClientBuilder.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/core/traits/TraitsClientBuilder.java @@ -235,10 +235,11 @@ public TraitsClientBuilder retryPolicy(RetryPolicy retryPolicy) { private TraitsClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; TraitsServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : TraitsServiceVersion.getLatest(); TraitsClientImpl client = new TraitsClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), - this.endpoint, localServiceVersion); + localEndpoint, localServiceVersion); return client; } @@ -246,7 +247,6 @@ private TraitsClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/_specs_/azure/example/basic/AzureExampleClientBuilder.java b/typespec-tests/src/main/java/com/_specs_/azure/example/basic/AzureExampleClientBuilder.java index eb659e1df3..1222fc74f1 100644 --- a/typespec-tests/src/main/java/com/_specs_/azure/example/basic/AzureExampleClientBuilder.java +++ b/typespec-tests/src/main/java/com/_specs_/azure/example/basic/AzureExampleClientBuilder.java @@ -235,10 +235,11 @@ public AzureExampleClientBuilder retryPolicy(RetryPolicy retryPolicy) { private AzureExampleClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; BasicServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : BasicServiceVersion.getLatest(); AzureExampleClientImpl client = new AzureExampleClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint, localServiceVersion); return client; } @@ -246,7 +247,6 @@ private AzureExampleClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/authentication/apikey/ApiKeyClientBuilder.java b/typespec-tests/src/main/java/com/authentication/apikey/ApiKeyClientBuilder.java index a3c449d1cf..12c654d41d 100644 --- a/typespec-tests/src/main/java/com/authentication/apikey/ApiKeyClientBuilder.java +++ b/typespec-tests/src/main/java/com/authentication/apikey/ApiKeyClientBuilder.java @@ -236,8 +236,9 @@ public ApiKeyClientBuilder retryPolicy(RetryPolicy retryPolicy) { private ApiKeyClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; ApiKeyClientImpl client - = new ApiKeyClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new ApiKeyClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -245,7 +246,6 @@ private ApiKeyClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/authentication/http/custom/CustomClientBuilder.java b/typespec-tests/src/main/java/com/authentication/http/custom/CustomClientBuilder.java index 606765986b..2242889e36 100644 --- a/typespec-tests/src/main/java/com/authentication/http/custom/CustomClientBuilder.java +++ b/typespec-tests/src/main/java/com/authentication/http/custom/CustomClientBuilder.java @@ -237,8 +237,9 @@ public CustomClientBuilder retryPolicy(RetryPolicy retryPolicy) { private CustomClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; CustomClientImpl client - = new CustomClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new CustomClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -246,7 +247,6 @@ private CustomClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/authentication/oauth2/OAuth2ClientBuilder.java b/typespec-tests/src/main/java/com/authentication/oauth2/OAuth2ClientBuilder.java index aa31f335c9..4c713e4cfa 100644 --- a/typespec-tests/src/main/java/com/authentication/oauth2/OAuth2ClientBuilder.java +++ b/typespec-tests/src/main/java/com/authentication/oauth2/OAuth2ClientBuilder.java @@ -239,8 +239,9 @@ public OAuth2ClientBuilder retryPolicy(RetryPolicy retryPolicy) { private OAuth2ClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; OAuth2ClientImpl client - = new OAuth2ClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new OAuth2ClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -248,7 +249,6 @@ private OAuth2ClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/authentication/union/UnionClientBuilder.java b/typespec-tests/src/main/java/com/authentication/union/UnionClientBuilder.java index 5855133f29..30aa7abda3 100644 --- a/typespec-tests/src/main/java/com/authentication/union/UnionClientBuilder.java +++ b/typespec-tests/src/main/java/com/authentication/union/UnionClientBuilder.java @@ -258,8 +258,9 @@ public UnionClientBuilder retryPolicy(RetryPolicy retryPolicy) { private UnionClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; UnionClientImpl client - = new UnionClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new UnionClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -267,7 +268,6 @@ private UnionClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityClientBuilder.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityClientBuilder.java index 95426bfca5..ded7cbf3a7 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityClientBuilder.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/implementation/ManagedIdentityClientBuilder.java @@ -121,6 +121,7 @@ public ManagedIdentityClientBuilder serializerAdapter(SerializerAdapter serializ * @return an instance of ManagedIdentityClientImpl. */ public ManagedIdentityClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) ? pipeline @@ -131,7 +132,7 @@ public ManagedIdentityClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); ManagedIdentityClientImpl client = new ManagedIdentityClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId); + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/ResourcesClientBuilder.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/ResourcesClientBuilder.java index 3a43718066..0e78a1b9e2 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/ResourcesClientBuilder.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/ResourcesClientBuilder.java @@ -121,6 +121,7 @@ public ResourcesClientBuilder serializerAdapter(SerializerAdapter serializerAdap * @return an instance of ResourcesClientImpl. */ public ResourcesClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) ? pipeline @@ -131,7 +132,7 @@ public ResourcesClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); ResourcesClientImpl client = new ResourcesClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId); + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClientBuilder.java b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClientBuilder.java index 213d53be12..2fe64474b2 100644 --- a/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClientBuilder.java +++ b/typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClientBuilder.java @@ -217,8 +217,9 @@ public XmsClientRequestIdClientBuilder retryPolicy(RetryPolicy retryPolicy) { private XmsClientRequestIdClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; XmsClientRequestIdClientImpl client = new XmsClientRequestIdClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -226,7 +227,6 @@ private XmsClientRequestIdClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientBuilder.java b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientBuilder.java index 0156585f33..2a1cab1217 100644 --- a/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientBuilder.java +++ b/typespec-tests/src/main/java/com/cadl/armresourceprovider/implementation/ArmResourceProviderClientBuilder.java @@ -121,6 +121,7 @@ public ArmResourceProviderClientBuilder serializerAdapter(SerializerAdapter seri * @return an instance of ArmResourceProviderClientImpl. */ public ArmResourceProviderClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) ? pipeline @@ -131,7 +132,7 @@ public ArmResourceProviderClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); ArmResourceProviderClientImpl client = new ArmResourceProviderClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId); + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientBuilder.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientBuilder.java index edb808987a..035c58e4cd 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientBuilder.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientBuilder.java @@ -121,6 +121,7 @@ public ArmStreamStyleSerializationClientBuilder serializerAdapter(SerializerAdap * @return an instance of ArmStreamStyleSerializationClientImpl. */ public ArmStreamStyleSerializationClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) ? pipeline @@ -131,7 +132,7 @@ public ArmStreamStyleSerializationClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); ArmStreamStyleSerializationClientImpl client = new ArmStreamStyleSerializationClientImpl(localPipeline, - localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId); + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/typespec-tests/src/main/java/com/cadl/server/HttpbinClientBuilder.java b/typespec-tests/src/main/java/com/cadl/server/HttpbinClientBuilder.java index 944dd98a8c..dae54e3b35 100644 --- a/typespec-tests/src/main/java/com/cadl/server/HttpbinClientBuilder.java +++ b/typespec-tests/src/main/java/com/cadl/server/HttpbinClientBuilder.java @@ -253,8 +253,10 @@ public HttpbinClientBuilder retryPolicy(RetryPolicy retryPolicy) { private HttpbinClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localDomain = (domain != null) ? domain : "httpbin"; + String localTld = (tld != null) ? tld : "org"; HttpbinClientImpl client = new HttpbinClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), - this.domain, this.tld, this.relativePath); + localDomain, localTld, this.relativePath); return client; } @@ -262,8 +264,6 @@ private HttpbinClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(domain, "'domain' cannot be null."); - Objects.requireNonNull(tld, "'tld' cannot be null."); Objects.requireNonNull(relativePath, "'relativePath' cannot be null."); } diff --git a/typespec-tests/src/main/java/com/client/naming/NamingClientBuilder.java b/typespec-tests/src/main/java/com/client/naming/NamingClientBuilder.java index 12038d5712..87c6004abd 100644 --- a/typespec-tests/src/main/java/com/client/naming/NamingClientBuilder.java +++ b/typespec-tests/src/main/java/com/client/naming/NamingClientBuilder.java @@ -223,8 +223,9 @@ public NamingClientBuilder retryPolicy(RetryPolicy retryPolicy) { private NamingClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; NamingClientImpl client - = new NamingClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new NamingClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -232,7 +233,6 @@ private NamingClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/encode/bytes/BytesClientBuilder.java b/typespec-tests/src/main/java/com/encode/bytes/BytesClientBuilder.java index 2efd7b25e1..df2b8d0061 100644 --- a/typespec-tests/src/main/java/com/encode/bytes/BytesClientBuilder.java +++ b/typespec-tests/src/main/java/com/encode/bytes/BytesClientBuilder.java @@ -227,8 +227,9 @@ public BytesClientBuilder retryPolicy(RetryPolicy retryPolicy) { private BytesClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; BytesClientImpl client - = new BytesClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new BytesClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -236,7 +237,6 @@ private BytesClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/encode/datetime/DatetimeClientBuilder.java b/typespec-tests/src/main/java/com/encode/datetime/DatetimeClientBuilder.java index 39a6c7371d..d228837b6a 100644 --- a/typespec-tests/src/main/java/com/encode/datetime/DatetimeClientBuilder.java +++ b/typespec-tests/src/main/java/com/encode/datetime/DatetimeClientBuilder.java @@ -225,8 +225,9 @@ public DatetimeClientBuilder retryPolicy(RetryPolicy retryPolicy) { private DatetimeClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; DatetimeClientImpl client - = new DatetimeClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new DatetimeClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -234,7 +235,6 @@ private DatetimeClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/encode/duration/DurationClientBuilder.java b/typespec-tests/src/main/java/com/encode/duration/DurationClientBuilder.java index 6f25da7f88..502799aad5 100644 --- a/typespec-tests/src/main/java/com/encode/duration/DurationClientBuilder.java +++ b/typespec-tests/src/main/java/com/encode/duration/DurationClientBuilder.java @@ -223,8 +223,9 @@ public DurationClientBuilder retryPolicy(RetryPolicy retryPolicy) { private DurationClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; DurationClientImpl client - = new DurationClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new DurationClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -232,7 +233,6 @@ private DurationClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/parameters/basic/BasicClientBuilder.java b/typespec-tests/src/main/java/com/parameters/basic/BasicClientBuilder.java index c97efb9668..db9f8484e1 100644 --- a/typespec-tests/src/main/java/com/parameters/basic/BasicClientBuilder.java +++ b/typespec-tests/src/main/java/com/parameters/basic/BasicClientBuilder.java @@ -221,8 +221,9 @@ public BasicClientBuilder retryPolicy(RetryPolicy retryPolicy) { private BasicClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; BasicClientImpl client - = new BasicClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new BasicClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -230,7 +231,6 @@ private BasicClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/parameters/bodyoptionality/BodyOptionalityClientBuilder.java b/typespec-tests/src/main/java/com/parameters/bodyoptionality/BodyOptionalityClientBuilder.java index 1e2e8757c5..8ff3dc9c93 100644 --- a/typespec-tests/src/main/java/com/parameters/bodyoptionality/BodyOptionalityClientBuilder.java +++ b/typespec-tests/src/main/java/com/parameters/bodyoptionality/BodyOptionalityClientBuilder.java @@ -222,8 +222,9 @@ public BodyOptionalityClientBuilder retryPolicy(RetryPolicy retryPolicy) { private BodyOptionalityClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; BodyOptionalityClientImpl client = new BodyOptionalityClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -231,7 +232,6 @@ private BodyOptionalityClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/parameters/collectionformat/CollectionFormatClientBuilder.java b/typespec-tests/src/main/java/com/parameters/collectionformat/CollectionFormatClientBuilder.java index 8deea95059..f029cc7b92 100644 --- a/typespec-tests/src/main/java/com/parameters/collectionformat/CollectionFormatClientBuilder.java +++ b/typespec-tests/src/main/java/com/parameters/collectionformat/CollectionFormatClientBuilder.java @@ -218,8 +218,9 @@ public CollectionFormatClientBuilder retryPolicy(RetryPolicy retryPolicy) { private CollectionFormatClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; CollectionFormatClientImpl client = new CollectionFormatClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -227,7 +228,6 @@ private CollectionFormatClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/parameters/spread/SpreadClientBuilder.java b/typespec-tests/src/main/java/com/parameters/spread/SpreadClientBuilder.java index 88b00bb987..47711e460b 100644 --- a/typespec-tests/src/main/java/com/parameters/spread/SpreadClientBuilder.java +++ b/typespec-tests/src/main/java/com/parameters/spread/SpreadClientBuilder.java @@ -217,8 +217,9 @@ public SpreadClientBuilder retryPolicy(RetryPolicy retryPolicy) { private SpreadClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; SpreadClientImpl client - = new SpreadClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new SpreadClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -226,7 +227,6 @@ private SpreadClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/payload/contentnegotiation/ContentNegotiationClientBuilder.java b/typespec-tests/src/main/java/com/payload/contentnegotiation/ContentNegotiationClientBuilder.java index 7c3671fecf..10d4aa52e6 100644 --- a/typespec-tests/src/main/java/com/payload/contentnegotiation/ContentNegotiationClientBuilder.java +++ b/typespec-tests/src/main/java/com/payload/contentnegotiation/ContentNegotiationClientBuilder.java @@ -222,8 +222,9 @@ public ContentNegotiationClientBuilder retryPolicy(RetryPolicy retryPolicy) { private ContentNegotiationClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; ContentNegotiationClientImpl client = new ContentNegotiationClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -231,7 +232,6 @@ private ContentNegotiationClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/payload/jsonmergepatch/JsonMergePatchClientBuilder.java b/typespec-tests/src/main/java/com/payload/jsonmergepatch/JsonMergePatchClientBuilder.java index c02ea4dced..c669c66315 100644 --- a/typespec-tests/src/main/java/com/payload/jsonmergepatch/JsonMergePatchClientBuilder.java +++ b/typespec-tests/src/main/java/com/payload/jsonmergepatch/JsonMergePatchClientBuilder.java @@ -216,8 +216,9 @@ public JsonMergePatchClientBuilder retryPolicy(RetryPolicy retryPolicy) { private JsonMergePatchClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; JsonMergePatchClientImpl client = new JsonMergePatchClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -225,7 +226,6 @@ private JsonMergePatchClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/payload/mediatype/MediaTypeClientBuilder.java b/typespec-tests/src/main/java/com/payload/mediatype/MediaTypeClientBuilder.java index 9cf857ffde..c2efd2827a 100644 --- a/typespec-tests/src/main/java/com/payload/mediatype/MediaTypeClientBuilder.java +++ b/typespec-tests/src/main/java/com/payload/mediatype/MediaTypeClientBuilder.java @@ -216,8 +216,9 @@ public MediaTypeClientBuilder retryPolicy(RetryPolicy retryPolicy) { private MediaTypeClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; MediaTypeClientImpl client - = new MediaTypeClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new MediaTypeClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -225,7 +226,6 @@ private MediaTypeClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/payload/multipart/MultiPartClientBuilder.java b/typespec-tests/src/main/java/com/payload/multipart/MultiPartClientBuilder.java index 536ffb6800..b1734e648f 100644 --- a/typespec-tests/src/main/java/com/payload/multipart/MultiPartClientBuilder.java +++ b/typespec-tests/src/main/java/com/payload/multipart/MultiPartClientBuilder.java @@ -216,8 +216,9 @@ public MultiPartClientBuilder retryPolicy(RetryPolicy retryPolicy) { private MultiPartClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; MultiPartClientImpl client - = new MultiPartClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new MultiPartClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -225,7 +226,6 @@ private MultiPartClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/payload/pageable/PageableClientBuilder.java b/typespec-tests/src/main/java/com/payload/pageable/PageableClientBuilder.java index 1fee18b6e4..5e4da1687b 100644 --- a/typespec-tests/src/main/java/com/payload/pageable/PageableClientBuilder.java +++ b/typespec-tests/src/main/java/com/payload/pageable/PageableClientBuilder.java @@ -216,8 +216,9 @@ public PageableClientBuilder retryPolicy(RetryPolicy retryPolicy) { private PageableClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; PageableClientImpl client - = new PageableClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new PageableClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -225,7 +226,6 @@ private PageableClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/serialization/encodedname/json/JsonClientBuilder.java b/typespec-tests/src/main/java/com/serialization/encodedname/json/JsonClientBuilder.java index 9beba07083..6ff9943293 100644 --- a/typespec-tests/src/main/java/com/serialization/encodedname/json/JsonClientBuilder.java +++ b/typespec-tests/src/main/java/com/serialization/encodedname/json/JsonClientBuilder.java @@ -217,8 +217,9 @@ public JsonClientBuilder retryPolicy(RetryPolicy retryPolicy) { private JsonClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; JsonClientImpl client - = new JsonClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new JsonClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -226,7 +227,6 @@ private JsonClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/specialheaders/conditionalrequest/ConditionalRequestClientBuilder.java b/typespec-tests/src/main/java/com/specialheaders/conditionalrequest/ConditionalRequestClientBuilder.java index e56487b10b..422aefcef4 100644 --- a/typespec-tests/src/main/java/com/specialheaders/conditionalrequest/ConditionalRequestClientBuilder.java +++ b/typespec-tests/src/main/java/com/specialheaders/conditionalrequest/ConditionalRequestClientBuilder.java @@ -217,8 +217,9 @@ public ConditionalRequestClientBuilder retryPolicy(RetryPolicy retryPolicy) { private ConditionalRequestClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; ConditionalRequestClientImpl client = new ConditionalRequestClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -226,7 +227,6 @@ private ConditionalRequestClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/specialheaders/repeatability/RepeatabilityClientBuilder.java b/typespec-tests/src/main/java/com/specialheaders/repeatability/RepeatabilityClientBuilder.java index eacf687e3b..8502679f2f 100644 --- a/typespec-tests/src/main/java/com/specialheaders/repeatability/RepeatabilityClientBuilder.java +++ b/typespec-tests/src/main/java/com/specialheaders/repeatability/RepeatabilityClientBuilder.java @@ -217,8 +217,9 @@ public RepeatabilityClientBuilder retryPolicy(RetryPolicy retryPolicy) { private RepeatabilityClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; RepeatabilityClientImpl client = new RepeatabilityClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -226,7 +227,6 @@ private RepeatabilityClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/specialwords/SpecialWordsClientBuilder.java b/typespec-tests/src/main/java/com/specialwords/SpecialWordsClientBuilder.java index e44a6573cb..5dce7abed9 100644 --- a/typespec-tests/src/main/java/com/specialwords/SpecialWordsClientBuilder.java +++ b/typespec-tests/src/main/java/com/specialwords/SpecialWordsClientBuilder.java @@ -225,8 +225,9 @@ public SpecialWordsClientBuilder retryPolicy(RetryPolicy retryPolicy) { private SpecialWordsClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; SpecialWordsClientImpl client - = new SpecialWordsClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new SpecialWordsClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -234,7 +235,6 @@ private SpecialWordsClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/array/ArrayClientBuilder.java b/typespec-tests/src/main/java/com/type/array/ArrayClientBuilder.java index f7ea22007f..ff37bf08e4 100644 --- a/typespec-tests/src/main/java/com/type/array/ArrayClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/array/ArrayClientBuilder.java @@ -245,8 +245,9 @@ public ArrayClientBuilder retryPolicy(RetryPolicy retryPolicy) { private ArrayClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; ArrayClientImpl client - = new ArrayClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new ArrayClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -254,7 +255,6 @@ private ArrayClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/dictionary/DictionaryClientBuilder.java b/typespec-tests/src/main/java/com/type/dictionary/DictionaryClientBuilder.java index e5ffe0c0ca..d9c58a5c61 100644 --- a/typespec-tests/src/main/java/com/type/dictionary/DictionaryClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/dictionary/DictionaryClientBuilder.java @@ -239,8 +239,9 @@ public DictionaryClientBuilder retryPolicy(RetryPolicy retryPolicy) { private DictionaryClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; DictionaryClientImpl client - = new DictionaryClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new DictionaryClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -248,7 +249,6 @@ private DictionaryClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/enums/extensible/ExtensibleClientBuilder.java b/typespec-tests/src/main/java/com/type/enums/extensible/ExtensibleClientBuilder.java index bcd992c9b9..a97dfecb8d 100644 --- a/typespec-tests/src/main/java/com/type/enums/extensible/ExtensibleClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/enums/extensible/ExtensibleClientBuilder.java @@ -216,8 +216,9 @@ public ExtensibleClientBuilder retryPolicy(RetryPolicy retryPolicy) { private ExtensibleClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; ExtensibleClientImpl client - = new ExtensibleClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new ExtensibleClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -225,7 +226,6 @@ private ExtensibleClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/enums/fixed/FixedClientBuilder.java b/typespec-tests/src/main/java/com/type/enums/fixed/FixedClientBuilder.java index 4c7362b9df..f6976efa4b 100644 --- a/typespec-tests/src/main/java/com/type/enums/fixed/FixedClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/enums/fixed/FixedClientBuilder.java @@ -216,8 +216,9 @@ public FixedClientBuilder retryPolicy(RetryPolicy retryPolicy) { private FixedClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; FixedClientImpl client - = new FixedClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new FixedClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -225,7 +226,6 @@ private FixedClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/model/empty/EmptyClientBuilder.java b/typespec-tests/src/main/java/com/type/model/empty/EmptyClientBuilder.java index 88e74bda25..169491e894 100644 --- a/typespec-tests/src/main/java/com/type/model/empty/EmptyClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/model/empty/EmptyClientBuilder.java @@ -216,8 +216,9 @@ public EmptyClientBuilder retryPolicy(RetryPolicy retryPolicy) { private EmptyClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; EmptyClientImpl client - = new EmptyClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new EmptyClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -225,7 +226,6 @@ private EmptyClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/model/flatten/FlattenClientBuilder.java b/typespec-tests/src/main/java/com/type/model/flatten/FlattenClientBuilder.java index 642b059314..eb2bb843cb 100644 --- a/typespec-tests/src/main/java/com/type/model/flatten/FlattenClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/model/flatten/FlattenClientBuilder.java @@ -216,8 +216,9 @@ public FlattenClientBuilder retryPolicy(RetryPolicy retryPolicy) { private FlattenClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; FlattenClientImpl client - = new FlattenClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new FlattenClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -225,7 +226,6 @@ private FlattenClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorClientBuilder.java b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorClientBuilder.java index 065dcdd777..2b53d06981 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/enumdiscriminator/EnumDiscriminatorClientBuilder.java @@ -217,8 +217,9 @@ public EnumDiscriminatorClientBuilder retryPolicy(RetryPolicy retryPolicy) { private EnumDiscriminatorClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; EnumDiscriminatorClientImpl client = new EnumDiscriminatorClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -226,7 +227,6 @@ private EnumDiscriminatorClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/enumnesteddiscriminator/EnumNestedDiscriminatorClientBuilder.java b/typespec-tests/src/main/java/com/type/model/inheritance/enumnesteddiscriminator/EnumNestedDiscriminatorClientBuilder.java index 0b3300c939..277df88727 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/enumnesteddiscriminator/EnumNestedDiscriminatorClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/enumnesteddiscriminator/EnumNestedDiscriminatorClientBuilder.java @@ -218,8 +218,9 @@ public EnumNestedDiscriminatorClientBuilder retryPolicy(RetryPolicy retryPolicy) private EnumNestedDiscriminatorClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; EnumNestedDiscriminatorClientImpl client = new EnumNestedDiscriminatorClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -227,7 +228,6 @@ private EnumNestedDiscriminatorClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/nesteddiscriminator/NestedDiscriminatorClientBuilder.java b/typespec-tests/src/main/java/com/type/model/inheritance/nesteddiscriminator/NestedDiscriminatorClientBuilder.java index 2859120a39..90d61f9bf0 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/nesteddiscriminator/NestedDiscriminatorClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/nesteddiscriminator/NestedDiscriminatorClientBuilder.java @@ -217,8 +217,9 @@ public NestedDiscriminatorClientBuilder retryPolicy(RetryPolicy retryPolicy) { private NestedDiscriminatorClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; NestedDiscriminatorClientImpl client = new NestedDiscriminatorClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -226,7 +227,6 @@ private NestedDiscriminatorClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/notdiscriminated/NotDiscriminatedClientBuilder.java b/typespec-tests/src/main/java/com/type/model/inheritance/notdiscriminated/NotDiscriminatedClientBuilder.java index e0de40fca3..65589f6b8f 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/notdiscriminated/NotDiscriminatedClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/notdiscriminated/NotDiscriminatedClientBuilder.java @@ -217,8 +217,9 @@ public NotDiscriminatedClientBuilder retryPolicy(RetryPolicy retryPolicy) { private NotDiscriminatedClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; NotDiscriminatedClientImpl client = new NotDiscriminatedClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -226,7 +227,6 @@ private NotDiscriminatedClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/recursive/RecursiveClientBuilder.java b/typespec-tests/src/main/java/com/type/model/inheritance/recursive/RecursiveClientBuilder.java index 9f61dd0b56..757f02ca3d 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/recursive/RecursiveClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/recursive/RecursiveClientBuilder.java @@ -217,8 +217,9 @@ public RecursiveClientBuilder retryPolicy(RetryPolicy retryPolicy) { private RecursiveClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; RecursiveClientImpl client - = new RecursiveClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new RecursiveClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -226,7 +227,6 @@ private RecursiveClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/model/inheritance/singlediscriminator/SingleDiscriminatorClientBuilder.java b/typespec-tests/src/main/java/com/type/model/inheritance/singlediscriminator/SingleDiscriminatorClientBuilder.java index ce48c6d61b..ccebf1a8b8 100644 --- a/typespec-tests/src/main/java/com/type/model/inheritance/singlediscriminator/SingleDiscriminatorClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/model/inheritance/singlediscriminator/SingleDiscriminatorClientBuilder.java @@ -217,8 +217,9 @@ public SingleDiscriminatorClientBuilder retryPolicy(RetryPolicy retryPolicy) { private SingleDiscriminatorClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; SingleDiscriminatorClientImpl client = new SingleDiscriminatorClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -226,7 +227,6 @@ private SingleDiscriminatorClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/model/usage/UsageClientBuilder.java b/typespec-tests/src/main/java/com/type/model/usage/UsageClientBuilder.java index dab14b45b6..82dfb76e79 100644 --- a/typespec-tests/src/main/java/com/type/model/usage/UsageClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/model/usage/UsageClientBuilder.java @@ -216,8 +216,9 @@ public UsageClientBuilder retryPolicy(RetryPolicy retryPolicy) { private UsageClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; UsageClientImpl client - = new UsageClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new UsageClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -225,7 +226,6 @@ private UsageClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/model/visibility/VisibilityClientBuilder.java b/typespec-tests/src/main/java/com/type/model/visibility/VisibilityClientBuilder.java index 5877c0ceed..70668f3bb1 100644 --- a/typespec-tests/src/main/java/com/type/model/visibility/VisibilityClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/model/visibility/VisibilityClientBuilder.java @@ -216,8 +216,9 @@ public VisibilityClientBuilder retryPolicy(RetryPolicy retryPolicy) { private VisibilityClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; VisibilityClientImpl client - = new VisibilityClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new VisibilityClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -225,7 +226,6 @@ private VisibilityClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/property/additionalproperties/AdditionalPropertiesClientBuilder.java b/typespec-tests/src/main/java/com/type/property/additionalproperties/AdditionalPropertiesClientBuilder.java index a6b3ffd19c..6e1941fd41 100644 --- a/typespec-tests/src/main/java/com/type/property/additionalproperties/AdditionalPropertiesClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/property/additionalproperties/AdditionalPropertiesClientBuilder.java @@ -282,8 +282,9 @@ public AdditionalPropertiesClientBuilder retryPolicy(RetryPolicy retryPolicy) { private AdditionalPropertiesClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; AdditionalPropertiesClientImpl client = new AdditionalPropertiesClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -291,7 +292,6 @@ private AdditionalPropertiesClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/property/nullable/NullableClientBuilder.java b/typespec-tests/src/main/java/com/type/property/nullable/NullableClientBuilder.java index e17e17aaf3..2fd8684062 100644 --- a/typespec-tests/src/main/java/com/type/property/nullable/NullableClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/property/nullable/NullableClientBuilder.java @@ -231,8 +231,9 @@ public NullableClientBuilder retryPolicy(RetryPolicy retryPolicy) { private NullableClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; NullableClientImpl client - = new NullableClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new NullableClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -240,7 +241,6 @@ private NullableClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/property/optional/OptionalClientBuilder.java b/typespec-tests/src/main/java/com/type/property/optional/OptionalClientBuilder.java index efb4ff35d5..10051d33c8 100644 --- a/typespec-tests/src/main/java/com/type/property/optional/OptionalClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/property/optional/OptionalClientBuilder.java @@ -249,8 +249,9 @@ public OptionalClientBuilder retryPolicy(RetryPolicy retryPolicy) { private OptionalClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; OptionalClientImpl client - = new OptionalClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new OptionalClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -258,7 +259,6 @@ private OptionalClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/property/valuetypes/ValueTypesClientBuilder.java b/typespec-tests/src/main/java/com/type/property/valuetypes/ValueTypesClientBuilder.java index 4c47f75403..c08bd9971f 100644 --- a/typespec-tests/src/main/java/com/type/property/valuetypes/ValueTypesClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/property/valuetypes/ValueTypesClientBuilder.java @@ -276,8 +276,9 @@ public ValueTypesClientBuilder retryPolicy(RetryPolicy retryPolicy) { private ValueTypesClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; ValueTypesClientImpl client - = new ValueTypesClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new ValueTypesClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -285,7 +286,6 @@ private ValueTypesClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/scalar/ScalarClientBuilder.java b/typespec-tests/src/main/java/com/type/scalar/ScalarClientBuilder.java index 4f97e153e5..8b71294c9a 100644 --- a/typespec-tests/src/main/java/com/type/scalar/ScalarClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/scalar/ScalarClientBuilder.java @@ -231,8 +231,9 @@ public ScalarClientBuilder retryPolicy(RetryPolicy retryPolicy) { private ScalarClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; ScalarClientImpl client - = new ScalarClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new ScalarClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -240,7 +241,6 @@ private ScalarClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/type/union/UnionClientBuilder.java b/typespec-tests/src/main/java/com/type/union/UnionClientBuilder.java index 4283030b51..25c0117494 100644 --- a/typespec-tests/src/main/java/com/type/union/UnionClientBuilder.java +++ b/typespec-tests/src/main/java/com/type/union/UnionClientBuilder.java @@ -237,8 +237,9 @@ public UnionClientBuilder retryPolicy(RetryPolicy retryPolicy) { private UnionClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; UnionClientImpl client - = new UnionClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + = new UnionClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } @@ -246,7 +247,6 @@ private UnionClientImpl buildInnerClient() { private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } @Generated diff --git a/typespec-tests/src/samples/java/com/_specs_/azure/example/basic/generated/BasicAction.java b/typespec-tests/src/samples/java/com/_specs_/azure/example/basic/generated/BasicAction.java index b89367dc42..5764a952fe 100644 --- a/typespec-tests/src/samples/java/com/_specs_/azure/example/basic/generated/BasicAction.java +++ b/typespec-tests/src/samples/java/com/_specs_/azure/example/basic/generated/BasicAction.java @@ -10,7 +10,6 @@ import com._specs_.azure.example.basic.models.ActionResponse; import com._specs_.azure.example.basic.models.Enum; import com._specs_.azure.example.basic.models.Model; -import com.azure.core.util.Configuration; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -18,8 +17,7 @@ public class BasicAction { public static void main(String[] args) { AzureExampleClient azureExampleClient - = new AzureExampleClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); + = new AzureExampleClientBuilder().endpoint("http://localhost:3000").buildClient(); // BEGIN:com._specs_.azure.example.basic.generated.basicaction.basicaction ActionResponse response = azureExampleClient.basicAction("query", "header", new ActionRequest("text") From 2f04d1ff9d305e1b24e14563ffbeedd7f5613260 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 12 Aug 2024 17:38:34 +0800 Subject: [PATCH 57/90] fix test --- .../src/test/java/com/parameters/spread/SpreadTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typespec-tests/src/test/java/com/parameters/spread/SpreadTests.java b/typespec-tests/src/test/java/com/parameters/spread/SpreadTests.java index bcfa1ac7fa..933c5459ae 100644 --- a/typespec-tests/src/test/java/com/parameters/spread/SpreadTests.java +++ b/typespec-tests/src/test/java/com/parameters/spread/SpreadTests.java @@ -22,9 +22,9 @@ public void testSpread() { aliasClient.spreadWithMultipleParameters("1", "bar", "foo", List.of(1, 2), 1, List.of("foo", "bar")); - aliasClient.spreadParameterWithInnerAlias("1", "foo", "bar", 1); + aliasClient.spreadParameterWithInnerAlias("1", "bar", "foo", 1); - aliasClient.spreadParameterWithInnerModel("1", "foo", "bar"); + aliasClient.spreadParameterWithInnerModel("1", "bar", "foo"); } @Test From 2cde5b3f9b1211ccdedf3a38ac87ca97c97f782a Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Tue, 13 Aug 2024 10:26:34 +0800 Subject: [PATCH 58/90] regen --- .../generated/AccessClientTestBase.java | 32 +-- .../usage/generated/UsageClientTestBase.java | 8 +- .../basic/generated/BasicClientTestBase.java | 8 +- .../lro/rpc/generated/RpcClientTestBase.java | 8 +- .../generated/StandardClientTestBase.java | 8 +- .../model/generated/ModelClientTestBase.java | 8 +- .../page/generated/PageClientTestBase.java | 16 +- .../generated/ScalarClientTestBase.java | 8 +- .../generated/TraitsClientTestBase.java | 8 +- .../generated/AzureExampleClientTestBase.java | 2 +- .../generated/ApiKeyClientTestBase.java | 8 +- .../generated/CustomClientTestBase.java | 8 +- .../generated/OAuth2ClientTestBase.java | 8 +- .../union/generated/UnionClientTestBase.java | 8 +- .../XmsClientRequestIdClientTestBase.java | 2 +- .../generated/HttpbinClientTestBase.java | 4 +- .../generated/NamingClientTestBase.java | 24 +- .../bytes/generated/BytesClientTestBase.java | 40 +-- .../generated/DatetimeClientTestBase.java | 32 +-- .../generated/DurationClientTestBase.java | 24 +- .../basic/generated/BasicClientTestBase.java | 16 +- .../BodyOptionalityClientTestBase.java | 4 +- .../CollectionFormatClientTestBase.java | 4 +- .../generated/SpreadClientTestBase.java | 16 +- .../ContentNegotiationClientTestBase.java | 4 +- .../JsonMergePatchClientTestBase.java | 2 +- .../generated/MediaTypeClientTestBase.java | 8 +- .../generated/MultiPartClientTestBase.java | 8 +- .../generated/PageableClientTestBase.java | 8 +- .../json/generated/JsonClientTestBase.java | 8 +- .../ConditionalRequestClientTestBase.java | 2 +- .../RepeatabilityClientTestBase.java | 2 +- .../generated/SpecialWordsClientTestBase.java | 8 +- .../array/generated/ArrayClientTestBase.java | 112 ++++----- .../generated/DictionaryClientTestBase.java | 88 +++---- .../generated/ExtensibleClientTestBase.java | 8 +- .../fixed/generated/FixedClientTestBase.java | 8 +- .../empty/generated/EmptyClientTestBase.java | 8 +- .../generated/FlattenClientTestBase.java | 8 +- .../EnumDiscriminatorClientTestBase.java | 2 +- ...EnumNestedDiscriminatorClientTestBase.java | 2 +- .../NestedDiscriminatorClientTestBase.java | 2 +- .../NotDiscriminatedClientTestBase.java | 2 +- .../generated/RecursiveClientTestBase.java | 8 +- .../SingleDiscriminatorClientTestBase.java | 2 +- .../usage/generated/UsageClientTestBase.java | 8 +- .../generated/VisibilityClientTestBase.java | 8 +- .../AdditionalPropertiesClientTestBase.java | 64 ++--- .../generated/NullableClientTestBase.java | 56 ++--- .../generated/OptionalClientTestBase.java | 128 +++++----- .../generated/ValueTypesClientTestBase.java | 232 +++++++++--------- .../generated/ScalarClientTestBase.java | 56 ++--- .../union/generated/UnionClientTestBase.java | 80 +++--- 53 files changed, 618 insertions(+), 618 deletions(-) diff --git a/typespec-tests/src/test/java/com/_specs_/azure/clientgenerator/core/access/generated/AccessClientTestBase.java b/typespec-tests/src/test/java/com/_specs_/azure/clientgenerator/core/access/generated/AccessClientTestBase.java index c4218921d9..6d967d662e 100644 --- a/typespec-tests/src/test/java/com/_specs_/azure/clientgenerator/core/access/generated/AccessClientTestBase.java +++ b/typespec-tests/src/test/java/com/_specs_/azure/clientgenerator/core/access/generated/AccessClientTestBase.java @@ -31,10 +31,10 @@ class AccessClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - AccessClientBuilder publicOperationClientbuilder - = new AccessClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AccessClientBuilder publicOperationClientbuilder = new AccessClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { publicOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -42,10 +42,10 @@ protected void beforeTest() { } publicOperationClient = publicOperationClientbuilder.buildPublicOperationClient(); - AccessClientBuilder internalOperationClientbuilder - = new AccessClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AccessClientBuilder internalOperationClientbuilder = new AccessClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { internalOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -53,10 +53,10 @@ protected void beforeTest() { } internalOperationClient = internalOperationClientbuilder.buildInternalOperationClient(); - AccessClientBuilder sharedModelInOperationClientbuilder - = new AccessClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AccessClientBuilder sharedModelInOperationClientbuilder = new AccessClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { sharedModelInOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -64,10 +64,10 @@ protected void beforeTest() { } sharedModelInOperationClient = sharedModelInOperationClientbuilder.buildSharedModelInOperationClient(); - AccessClientBuilder relativeModelInOperationClientbuilder - = new AccessClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AccessClientBuilder relativeModelInOperationClientbuilder = new AccessClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { relativeModelInOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/_specs_/azure/clientgenerator/core/usage/generated/UsageClientTestBase.java b/typespec-tests/src/test/java/com/_specs_/azure/clientgenerator/core/usage/generated/UsageClientTestBase.java index 117dac3564..4e2c739eb3 100644 --- a/typespec-tests/src/test/java/com/_specs_/azure/clientgenerator/core/usage/generated/UsageClientTestBase.java +++ b/typespec-tests/src/test/java/com/_specs_/azure/clientgenerator/core/usage/generated/UsageClientTestBase.java @@ -22,10 +22,10 @@ class UsageClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - UsageClientBuilder usageClientbuilder - = new UsageClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + UsageClientBuilder usageClientbuilder = new UsageClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { usageClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/_specs_/azure/core/basic/generated/BasicClientTestBase.java b/typespec-tests/src/test/java/com/_specs_/azure/core/basic/generated/BasicClientTestBase.java index d78436f994..6451d16c18 100644 --- a/typespec-tests/src/test/java/com/_specs_/azure/core/basic/generated/BasicClientTestBase.java +++ b/typespec-tests/src/test/java/com/_specs_/azure/core/basic/generated/BasicClientTestBase.java @@ -22,10 +22,10 @@ class BasicClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - BasicClientBuilder basicClientbuilder - = new BasicClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + BasicClientBuilder basicClientbuilder = new BasicClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { basicClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/_specs_/azure/core/lro/rpc/generated/RpcClientTestBase.java b/typespec-tests/src/test/java/com/_specs_/azure/core/lro/rpc/generated/RpcClientTestBase.java index 520ccf1ea3..7c4090b05d 100644 --- a/typespec-tests/src/test/java/com/_specs_/azure/core/lro/rpc/generated/RpcClientTestBase.java +++ b/typespec-tests/src/test/java/com/_specs_/azure/core/lro/rpc/generated/RpcClientTestBase.java @@ -22,10 +22,10 @@ class RpcClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - RpcClientBuilder rpcClientbuilder - = new RpcClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + RpcClientBuilder rpcClientbuilder = new RpcClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { rpcClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/_specs_/azure/core/lro/standard/generated/StandardClientTestBase.java b/typespec-tests/src/test/java/com/_specs_/azure/core/lro/standard/generated/StandardClientTestBase.java index cb08fc2028..ac96f13085 100644 --- a/typespec-tests/src/test/java/com/_specs_/azure/core/lro/standard/generated/StandardClientTestBase.java +++ b/typespec-tests/src/test/java/com/_specs_/azure/core/lro/standard/generated/StandardClientTestBase.java @@ -22,10 +22,10 @@ class StandardClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - StandardClientBuilder standardClientbuilder - = new StandardClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + StandardClientBuilder standardClientbuilder = new StandardClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { standardClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/_specs_/azure/core/model/generated/ModelClientTestBase.java b/typespec-tests/src/test/java/com/_specs_/azure/core/model/generated/ModelClientTestBase.java index 9743c6f71a..5c65b8a132 100644 --- a/typespec-tests/src/test/java/com/_specs_/azure/core/model/generated/ModelClientTestBase.java +++ b/typespec-tests/src/test/java/com/_specs_/azure/core/model/generated/ModelClientTestBase.java @@ -22,10 +22,10 @@ class ModelClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - ModelClientBuilder modelClientbuilder - = new ModelClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ModelClientBuilder modelClientbuilder = new ModelClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { modelClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/_specs_/azure/core/page/generated/PageClientTestBase.java b/typespec-tests/src/test/java/com/_specs_/azure/core/page/generated/PageClientTestBase.java index fc7fd8fca5..b5d61efe3d 100644 --- a/typespec-tests/src/test/java/com/_specs_/azure/core/page/generated/PageClientTestBase.java +++ b/typespec-tests/src/test/java/com/_specs_/azure/core/page/generated/PageClientTestBase.java @@ -25,10 +25,10 @@ class PageClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - PageClientBuilder pageClientbuilder - = new PageClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + PageClientBuilder pageClientbuilder = new PageClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { pageClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -36,10 +36,10 @@ protected void beforeTest() { } pageClient = pageClientbuilder.buildClient(); - PageClientBuilder twoModelsAsPageItemClientbuilder - = new PageClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + PageClientBuilder twoModelsAsPageItemClientbuilder = new PageClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { twoModelsAsPageItemClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/_specs_/azure/core/scalar/generated/ScalarClientTestBase.java b/typespec-tests/src/test/java/com/_specs_/azure/core/scalar/generated/ScalarClientTestBase.java index e64f2a3391..426bd1baed 100644 --- a/typespec-tests/src/test/java/com/_specs_/azure/core/scalar/generated/ScalarClientTestBase.java +++ b/typespec-tests/src/test/java/com/_specs_/azure/core/scalar/generated/ScalarClientTestBase.java @@ -22,10 +22,10 @@ class ScalarClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - ScalarClientBuilder scalarClientbuilder - = new ScalarClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ScalarClientBuilder scalarClientbuilder = new ScalarClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { scalarClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/_specs_/azure/core/traits/generated/TraitsClientTestBase.java b/typespec-tests/src/test/java/com/_specs_/azure/core/traits/generated/TraitsClientTestBase.java index ad56f9a814..cc582cb39c 100644 --- a/typespec-tests/src/test/java/com/_specs_/azure/core/traits/generated/TraitsClientTestBase.java +++ b/typespec-tests/src/test/java/com/_specs_/azure/core/traits/generated/TraitsClientTestBase.java @@ -22,10 +22,10 @@ class TraitsClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - TraitsClientBuilder traitsClientbuilder - = new TraitsClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + TraitsClientBuilder traitsClientbuilder = new TraitsClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { traitsClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/_specs_/azure/example/basic/generated/AzureExampleClientTestBase.java b/typespec-tests/src/test/java/com/_specs_/azure/example/basic/generated/AzureExampleClientTestBase.java index 976d88f295..df2da2a545 100644 --- a/typespec-tests/src/test/java/com/_specs_/azure/example/basic/generated/AzureExampleClientTestBase.java +++ b/typespec-tests/src/test/java/com/_specs_/azure/example/basic/generated/AzureExampleClientTestBase.java @@ -23,7 +23,7 @@ class AzureExampleClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { AzureExampleClientBuilder azureExampleClientbuilder = new AzureExampleClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/authentication/apikey/generated/ApiKeyClientTestBase.java b/typespec-tests/src/test/java/com/authentication/apikey/generated/ApiKeyClientTestBase.java index 0256b5a0d0..a4a047af29 100644 --- a/typespec-tests/src/test/java/com/authentication/apikey/generated/ApiKeyClientTestBase.java +++ b/typespec-tests/src/test/java/com/authentication/apikey/generated/ApiKeyClientTestBase.java @@ -22,10 +22,10 @@ class ApiKeyClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - ApiKeyClientBuilder apiKeyClientbuilder - = new ApiKeyClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ApiKeyClientBuilder apiKeyClientbuilder = new ApiKeyClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { apiKeyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/authentication/http/custom/generated/CustomClientTestBase.java b/typespec-tests/src/test/java/com/authentication/http/custom/generated/CustomClientTestBase.java index 389d56e2dc..898fe6fd8b 100644 --- a/typespec-tests/src/test/java/com/authentication/http/custom/generated/CustomClientTestBase.java +++ b/typespec-tests/src/test/java/com/authentication/http/custom/generated/CustomClientTestBase.java @@ -22,10 +22,10 @@ class CustomClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - CustomClientBuilder customClientbuilder - = new CustomClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + CustomClientBuilder customClientbuilder = new CustomClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { customClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/authentication/oauth2/generated/OAuth2ClientTestBase.java b/typespec-tests/src/test/java/com/authentication/oauth2/generated/OAuth2ClientTestBase.java index a0c0803a7b..f4beb748f1 100644 --- a/typespec-tests/src/test/java/com/authentication/oauth2/generated/OAuth2ClientTestBase.java +++ b/typespec-tests/src/test/java/com/authentication/oauth2/generated/OAuth2ClientTestBase.java @@ -24,10 +24,10 @@ class OAuth2ClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - OAuth2ClientBuilder oAuth2Clientbuilder - = new OAuth2ClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + OAuth2ClientBuilder oAuth2Clientbuilder = new OAuth2ClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { oAuth2Clientbuilder.httpClient(interceptorManager.getPlaybackClient()) .credential(new MockTokenCredential()); diff --git a/typespec-tests/src/test/java/com/authentication/union/generated/UnionClientTestBase.java b/typespec-tests/src/test/java/com/authentication/union/generated/UnionClientTestBase.java index 87a4cb7c3d..f2282b1581 100644 --- a/typespec-tests/src/test/java/com/authentication/union/generated/UnionClientTestBase.java +++ b/typespec-tests/src/test/java/com/authentication/union/generated/UnionClientTestBase.java @@ -24,10 +24,10 @@ class UnionClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - UnionClientBuilder unionClientbuilder - = new UnionClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + UnionClientBuilder unionClientbuilder = new UnionClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unionClientbuilder.httpClient(interceptorManager.getPlaybackClient()).credential(new MockTokenCredential()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/azure/specialheaders/xmsclientrequestid/generated/XmsClientRequestIdClientTestBase.java b/typespec-tests/src/test/java/com/azure/specialheaders/xmsclientrequestid/generated/XmsClientRequestIdClientTestBase.java index 417c23d587..0a4be4cc4e 100644 --- a/typespec-tests/src/test/java/com/azure/specialheaders/xmsclientrequestid/generated/XmsClientRequestIdClientTestBase.java +++ b/typespec-tests/src/test/java/com/azure/specialheaders/xmsclientrequestid/generated/XmsClientRequestIdClientTestBase.java @@ -23,7 +23,7 @@ class XmsClientRequestIdClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { XmsClientRequestIdClientBuilder xmsClientRequestIdClientbuilder = new XmsClientRequestIdClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/cadl/server/generated/HttpbinClientTestBase.java b/typespec-tests/src/test/java/com/cadl/server/generated/HttpbinClientTestBase.java index 7575ed931c..2a9a04579b 100644 --- a/typespec-tests/src/test/java/com/cadl/server/generated/HttpbinClientTestBase.java +++ b/typespec-tests/src/test/java/com/cadl/server/generated/HttpbinClientTestBase.java @@ -27,8 +27,8 @@ class HttpbinClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { HttpbinClientBuilder httpbinClientbuilder - = new HttpbinClientBuilder().domain(Configuration.getGlobalConfiguration().get("DOMAIN", "domain")) - .tld(Configuration.getGlobalConfiguration().get("TLD", "tld")) + = new HttpbinClientBuilder().domain(Configuration.getGlobalConfiguration().get("DOMAIN", "httpbin")) + .tld(Configuration.getGlobalConfiguration().get("TLD", "org")) .relativePath(Configuration.getGlobalConfiguration().get("RELATIVEPATH", "relativepath")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); diff --git a/typespec-tests/src/test/java/com/client/naming/generated/NamingClientTestBase.java b/typespec-tests/src/test/java/com/client/naming/generated/NamingClientTestBase.java index db43c89869..27c50ae9de 100644 --- a/typespec-tests/src/test/java/com/client/naming/generated/NamingClientTestBase.java +++ b/typespec-tests/src/test/java/com/client/naming/generated/NamingClientTestBase.java @@ -28,10 +28,10 @@ class NamingClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - NamingClientBuilder namingClientbuilder - = new NamingClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + NamingClientBuilder namingClientbuilder = new NamingClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { namingClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -39,10 +39,10 @@ protected void beforeTest() { } namingClient = namingClientbuilder.buildClient(); - NamingClientBuilder clientModelClientbuilder - = new NamingClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + NamingClientBuilder clientModelClientbuilder = new NamingClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { clientModelClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -50,10 +50,10 @@ protected void beforeTest() { } clientModelClient = clientModelClientbuilder.buildClientModelClient(); - NamingClientBuilder unionEnumClientbuilder - = new NamingClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + NamingClientBuilder unionEnumClientbuilder = new NamingClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unionEnumClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/encode/bytes/generated/BytesClientTestBase.java b/typespec-tests/src/test/java/com/encode/bytes/generated/BytesClientTestBase.java index ee952a4cb2..4cab5d91d9 100644 --- a/typespec-tests/src/test/java/com/encode/bytes/generated/BytesClientTestBase.java +++ b/typespec-tests/src/test/java/com/encode/bytes/generated/BytesClientTestBase.java @@ -34,10 +34,10 @@ class BytesClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - BytesClientBuilder queryClientbuilder - = new BytesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + BytesClientBuilder queryClientbuilder = new BytesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { queryClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -45,10 +45,10 @@ protected void beforeTest() { } queryClient = queryClientbuilder.buildQueryClient(); - BytesClientBuilder propertyClientbuilder - = new BytesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + BytesClientBuilder propertyClientbuilder = new BytesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { propertyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -56,10 +56,10 @@ protected void beforeTest() { } propertyClient = propertyClientbuilder.buildPropertyClient(); - BytesClientBuilder headerClientbuilder - = new BytesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + BytesClientBuilder headerClientbuilder = new BytesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { headerClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -67,10 +67,10 @@ protected void beforeTest() { } headerClient = headerClientbuilder.buildHeaderClient(); - BytesClientBuilder requestBodyClientbuilder - = new BytesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + BytesClientBuilder requestBodyClientbuilder = new BytesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { requestBodyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -78,10 +78,10 @@ protected void beforeTest() { } requestBodyClient = requestBodyClientbuilder.buildRequestBodyClient(); - BytesClientBuilder responseBodyClientbuilder - = new BytesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + BytesClientBuilder responseBodyClientbuilder = new BytesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { responseBodyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/encode/datetime/generated/DatetimeClientTestBase.java b/typespec-tests/src/test/java/com/encode/datetime/generated/DatetimeClientTestBase.java index 1d20a9aabb..05d83226c6 100644 --- a/typespec-tests/src/test/java/com/encode/datetime/generated/DatetimeClientTestBase.java +++ b/typespec-tests/src/test/java/com/encode/datetime/generated/DatetimeClientTestBase.java @@ -31,10 +31,10 @@ class DatetimeClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - DatetimeClientBuilder queryClientbuilder - = new DatetimeClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + DatetimeClientBuilder queryClientbuilder = new DatetimeClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { queryClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -42,10 +42,10 @@ protected void beforeTest() { } queryClient = queryClientbuilder.buildQueryClient(); - DatetimeClientBuilder propertyClientbuilder - = new DatetimeClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + DatetimeClientBuilder propertyClientbuilder = new DatetimeClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { propertyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -53,10 +53,10 @@ protected void beforeTest() { } propertyClient = propertyClientbuilder.buildPropertyClient(); - DatetimeClientBuilder headerClientbuilder - = new DatetimeClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + DatetimeClientBuilder headerClientbuilder = new DatetimeClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { headerClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -64,10 +64,10 @@ protected void beforeTest() { } headerClient = headerClientbuilder.buildHeaderClient(); - DatetimeClientBuilder responseHeaderClientbuilder - = new DatetimeClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + DatetimeClientBuilder responseHeaderClientbuilder = new DatetimeClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { responseHeaderClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/encode/duration/generated/DurationClientTestBase.java b/typespec-tests/src/test/java/com/encode/duration/generated/DurationClientTestBase.java index 682a70fc1d..ff419aed9b 100644 --- a/typespec-tests/src/test/java/com/encode/duration/generated/DurationClientTestBase.java +++ b/typespec-tests/src/test/java/com/encode/duration/generated/DurationClientTestBase.java @@ -28,10 +28,10 @@ class DurationClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - DurationClientBuilder queryClientbuilder - = new DurationClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + DurationClientBuilder queryClientbuilder = new DurationClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { queryClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -39,10 +39,10 @@ protected void beforeTest() { } queryClient = queryClientbuilder.buildQueryClient(); - DurationClientBuilder propertyClientbuilder - = new DurationClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + DurationClientBuilder propertyClientbuilder = new DurationClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { propertyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -50,10 +50,10 @@ protected void beforeTest() { } propertyClient = propertyClientbuilder.buildPropertyClient(); - DurationClientBuilder headerClientbuilder - = new DurationClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + DurationClientBuilder headerClientbuilder = new DurationClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { headerClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/parameters/basic/generated/BasicClientTestBase.java b/typespec-tests/src/test/java/com/parameters/basic/generated/BasicClientTestBase.java index 858e5cefc6..7196d63b31 100644 --- a/typespec-tests/src/test/java/com/parameters/basic/generated/BasicClientTestBase.java +++ b/typespec-tests/src/test/java/com/parameters/basic/generated/BasicClientTestBase.java @@ -25,10 +25,10 @@ class BasicClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - BasicClientBuilder explicitBodyClientbuilder - = new BasicClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + BasicClientBuilder explicitBodyClientbuilder = new BasicClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { explicitBodyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -36,10 +36,10 @@ protected void beforeTest() { } explicitBodyClient = explicitBodyClientbuilder.buildExplicitBodyClient(); - BasicClientBuilder implicitBodyClientbuilder - = new BasicClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + BasicClientBuilder implicitBodyClientbuilder = new BasicClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { implicitBodyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/parameters/bodyoptionality/generated/BodyOptionalityClientTestBase.java b/typespec-tests/src/test/java/com/parameters/bodyoptionality/generated/BodyOptionalityClientTestBase.java index 8681264aef..1c0c67e14b 100644 --- a/typespec-tests/src/test/java/com/parameters/bodyoptionality/generated/BodyOptionalityClientTestBase.java +++ b/typespec-tests/src/test/java/com/parameters/bodyoptionality/generated/BodyOptionalityClientTestBase.java @@ -26,7 +26,7 @@ class BodyOptionalityClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { BodyOptionalityClientBuilder bodyOptionalityClientbuilder = new BodyOptionalityClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -37,7 +37,7 @@ protected void beforeTest() { bodyOptionalityClient = bodyOptionalityClientbuilder.buildClient(); BodyOptionalityClientBuilder optionalExplicitClientbuilder = new BodyOptionalityClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/parameters/collectionformat/generated/CollectionFormatClientTestBase.java b/typespec-tests/src/test/java/com/parameters/collectionformat/generated/CollectionFormatClientTestBase.java index 56c94fd644..52bded4726 100644 --- a/typespec-tests/src/test/java/com/parameters/collectionformat/generated/CollectionFormatClientTestBase.java +++ b/typespec-tests/src/test/java/com/parameters/collectionformat/generated/CollectionFormatClientTestBase.java @@ -26,7 +26,7 @@ class CollectionFormatClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { CollectionFormatClientBuilder queryClientbuilder = new CollectionFormatClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -37,7 +37,7 @@ protected void beforeTest() { queryClient = queryClientbuilder.buildQueryClient(); CollectionFormatClientBuilder headerClientbuilder = new CollectionFormatClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/parameters/spread/generated/SpreadClientTestBase.java b/typespec-tests/src/test/java/com/parameters/spread/generated/SpreadClientTestBase.java index 93fa3edd55..eb5434fc39 100644 --- a/typespec-tests/src/test/java/com/parameters/spread/generated/SpreadClientTestBase.java +++ b/typespec-tests/src/test/java/com/parameters/spread/generated/SpreadClientTestBase.java @@ -25,10 +25,10 @@ class SpreadClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - SpreadClientBuilder modelClientbuilder - = new SpreadClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + SpreadClientBuilder modelClientbuilder = new SpreadClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { modelClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -36,10 +36,10 @@ protected void beforeTest() { } modelClient = modelClientbuilder.buildModelClient(); - SpreadClientBuilder aliasClientbuilder - = new SpreadClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + SpreadClientBuilder aliasClientbuilder = new SpreadClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { aliasClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/payload/contentnegotiation/generated/ContentNegotiationClientTestBase.java b/typespec-tests/src/test/java/com/payload/contentnegotiation/generated/ContentNegotiationClientTestBase.java index d9264cfc76..fe4c66c652 100644 --- a/typespec-tests/src/test/java/com/payload/contentnegotiation/generated/ContentNegotiationClientTestBase.java +++ b/typespec-tests/src/test/java/com/payload/contentnegotiation/generated/ContentNegotiationClientTestBase.java @@ -26,7 +26,7 @@ class ContentNegotiationClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { ContentNegotiationClientBuilder sameBodyClientbuilder = new ContentNegotiationClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -37,7 +37,7 @@ protected void beforeTest() { sameBodyClient = sameBodyClientbuilder.buildSameBodyClient(); ContentNegotiationClientBuilder differentBodyClientbuilder = new ContentNegotiationClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/payload/jsonmergepatch/generated/JsonMergePatchClientTestBase.java b/typespec-tests/src/test/java/com/payload/jsonmergepatch/generated/JsonMergePatchClientTestBase.java index 3c11b50798..bb9a6ab6df 100644 --- a/typespec-tests/src/test/java/com/payload/jsonmergepatch/generated/JsonMergePatchClientTestBase.java +++ b/typespec-tests/src/test/java/com/payload/jsonmergepatch/generated/JsonMergePatchClientTestBase.java @@ -23,7 +23,7 @@ class JsonMergePatchClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { JsonMergePatchClientBuilder jsonMergePatchClientbuilder = new JsonMergePatchClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/payload/mediatype/generated/MediaTypeClientTestBase.java b/typespec-tests/src/test/java/com/payload/mediatype/generated/MediaTypeClientTestBase.java index bd185e8a95..8a5752d00a 100644 --- a/typespec-tests/src/test/java/com/payload/mediatype/generated/MediaTypeClientTestBase.java +++ b/typespec-tests/src/test/java/com/payload/mediatype/generated/MediaTypeClientTestBase.java @@ -22,10 +22,10 @@ class MediaTypeClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - MediaTypeClientBuilder mediaTypeClientbuilder - = new MediaTypeClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + MediaTypeClientBuilder mediaTypeClientbuilder = new MediaTypeClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { mediaTypeClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/payload/multipart/generated/MultiPartClientTestBase.java b/typespec-tests/src/test/java/com/payload/multipart/generated/MultiPartClientTestBase.java index a61b42fa8c..5b1b0baf87 100644 --- a/typespec-tests/src/test/java/com/payload/multipart/generated/MultiPartClientTestBase.java +++ b/typespec-tests/src/test/java/com/payload/multipart/generated/MultiPartClientTestBase.java @@ -22,10 +22,10 @@ class MultiPartClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - MultiPartClientBuilder multiPartClientbuilder - = new MultiPartClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + MultiPartClientBuilder multiPartClientbuilder = new MultiPartClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { multiPartClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/payload/pageable/generated/PageableClientTestBase.java b/typespec-tests/src/test/java/com/payload/pageable/generated/PageableClientTestBase.java index 3ea959ef2f..457250402c 100644 --- a/typespec-tests/src/test/java/com/payload/pageable/generated/PageableClientTestBase.java +++ b/typespec-tests/src/test/java/com/payload/pageable/generated/PageableClientTestBase.java @@ -22,10 +22,10 @@ class PageableClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - PageableClientBuilder pageableClientbuilder - = new PageableClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + PageableClientBuilder pageableClientbuilder = new PageableClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { pageableClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/serialization/encodedname/json/generated/JsonClientTestBase.java b/typespec-tests/src/test/java/com/serialization/encodedname/json/generated/JsonClientTestBase.java index 4567b7fc19..48e63770d1 100644 --- a/typespec-tests/src/test/java/com/serialization/encodedname/json/generated/JsonClientTestBase.java +++ b/typespec-tests/src/test/java/com/serialization/encodedname/json/generated/JsonClientTestBase.java @@ -22,10 +22,10 @@ class JsonClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - JsonClientBuilder jsonClientbuilder - = new JsonClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + JsonClientBuilder jsonClientbuilder = new JsonClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { jsonClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/specialheaders/conditionalrequest/generated/ConditionalRequestClientTestBase.java b/typespec-tests/src/test/java/com/specialheaders/conditionalrequest/generated/ConditionalRequestClientTestBase.java index f5c2b95148..6f58744175 100644 --- a/typespec-tests/src/test/java/com/specialheaders/conditionalrequest/generated/ConditionalRequestClientTestBase.java +++ b/typespec-tests/src/test/java/com/specialheaders/conditionalrequest/generated/ConditionalRequestClientTestBase.java @@ -23,7 +23,7 @@ class ConditionalRequestClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { ConditionalRequestClientBuilder conditionalRequestClientbuilder = new ConditionalRequestClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/specialheaders/repeatability/generated/RepeatabilityClientTestBase.java b/typespec-tests/src/test/java/com/specialheaders/repeatability/generated/RepeatabilityClientTestBase.java index 4b06034244..9dd8381c25 100644 --- a/typespec-tests/src/test/java/com/specialheaders/repeatability/generated/RepeatabilityClientTestBase.java +++ b/typespec-tests/src/test/java/com/specialheaders/repeatability/generated/RepeatabilityClientTestBase.java @@ -23,7 +23,7 @@ class RepeatabilityClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { RepeatabilityClientBuilder repeatabilityClientbuilder = new RepeatabilityClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/specialwords/generated/SpecialWordsClientTestBase.java b/typespec-tests/src/test/java/com/specialwords/generated/SpecialWordsClientTestBase.java index ea681e6b59..a9f0e5e147 100644 --- a/typespec-tests/src/test/java/com/specialwords/generated/SpecialWordsClientTestBase.java +++ b/typespec-tests/src/test/java/com/specialwords/generated/SpecialWordsClientTestBase.java @@ -32,7 +32,7 @@ class SpecialWordsClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { SpecialWordsClientBuilder modelsClientbuilder = new SpecialWordsClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -43,7 +43,7 @@ protected void beforeTest() { modelsClient = modelsClientbuilder.buildModelsClient(); SpecialWordsClientBuilder modelPropertiesClientbuilder = new SpecialWordsClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -54,7 +54,7 @@ protected void beforeTest() { modelPropertiesClient = modelPropertiesClientbuilder.buildModelPropertiesClient(); SpecialWordsClientBuilder operationsClientbuilder = new SpecialWordsClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -65,7 +65,7 @@ protected void beforeTest() { operationsClient = operationsClientbuilder.buildOperationsClient(); SpecialWordsClientBuilder parametersClientbuilder = new SpecialWordsClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/type/array/generated/ArrayClientTestBase.java b/typespec-tests/src/test/java/com/type/array/generated/ArrayClientTestBase.java index ee39593469..dff94f0fac 100644 --- a/typespec-tests/src/test/java/com/type/array/generated/ArrayClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/array/generated/ArrayClientTestBase.java @@ -61,10 +61,10 @@ class ArrayClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - ArrayClientBuilder int32ValueClientbuilder - = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ArrayClientBuilder int32ValueClientbuilder = new ArrayClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { int32ValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -72,10 +72,10 @@ protected void beforeTest() { } int32ValueClient = int32ValueClientbuilder.buildInt32ValueClient(); - ArrayClientBuilder int64ValueClientbuilder - = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ArrayClientBuilder int64ValueClientbuilder = new ArrayClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { int64ValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -83,10 +83,10 @@ protected void beforeTest() { } int64ValueClient = int64ValueClientbuilder.buildInt64ValueClient(); - ArrayClientBuilder booleanValueClientbuilder - = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ArrayClientBuilder booleanValueClientbuilder = new ArrayClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { booleanValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -94,10 +94,10 @@ protected void beforeTest() { } booleanValueClient = booleanValueClientbuilder.buildBooleanValueClient(); - ArrayClientBuilder stringValueClientbuilder - = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ArrayClientBuilder stringValueClientbuilder = new ArrayClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { stringValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -105,10 +105,10 @@ protected void beforeTest() { } stringValueClient = stringValueClientbuilder.buildStringValueClient(); - ArrayClientBuilder float32ValueClientbuilder - = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ArrayClientBuilder float32ValueClientbuilder = new ArrayClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { float32ValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -116,10 +116,10 @@ protected void beforeTest() { } float32ValueClient = float32ValueClientbuilder.buildFloat32ValueClient(); - ArrayClientBuilder datetimeValueClientbuilder - = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ArrayClientBuilder datetimeValueClientbuilder = new ArrayClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { datetimeValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -127,10 +127,10 @@ protected void beforeTest() { } datetimeValueClient = datetimeValueClientbuilder.buildDatetimeValueClient(); - ArrayClientBuilder durationValueClientbuilder - = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ArrayClientBuilder durationValueClientbuilder = new ArrayClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { durationValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -138,10 +138,10 @@ protected void beforeTest() { } durationValueClient = durationValueClientbuilder.buildDurationValueClient(); - ArrayClientBuilder unknownValueClientbuilder - = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ArrayClientBuilder unknownValueClientbuilder = new ArrayClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unknownValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -149,10 +149,10 @@ protected void beforeTest() { } unknownValueClient = unknownValueClientbuilder.buildUnknownValueClient(); - ArrayClientBuilder modelValueClientbuilder - = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ArrayClientBuilder modelValueClientbuilder = new ArrayClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { modelValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -160,10 +160,10 @@ protected void beforeTest() { } modelValueClient = modelValueClientbuilder.buildModelValueClient(); - ArrayClientBuilder nullableFloatValueClientbuilder - = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ArrayClientBuilder nullableFloatValueClientbuilder = new ArrayClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { nullableFloatValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -171,10 +171,10 @@ protected void beforeTest() { } nullableFloatValueClient = nullableFloatValueClientbuilder.buildNullableFloatValueClient(); - ArrayClientBuilder nullableInt32ValueClientbuilder - = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ArrayClientBuilder nullableInt32ValueClientbuilder = new ArrayClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { nullableInt32ValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -182,10 +182,10 @@ protected void beforeTest() { } nullableInt32ValueClient = nullableInt32ValueClientbuilder.buildNullableInt32ValueClient(); - ArrayClientBuilder nullableBooleanValueClientbuilder - = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ArrayClientBuilder nullableBooleanValueClientbuilder = new ArrayClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { nullableBooleanValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -193,10 +193,10 @@ protected void beforeTest() { } nullableBooleanValueClient = nullableBooleanValueClientbuilder.buildNullableBooleanValueClient(); - ArrayClientBuilder nullableStringValueClientbuilder - = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ArrayClientBuilder nullableStringValueClientbuilder = new ArrayClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { nullableStringValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -204,10 +204,10 @@ protected void beforeTest() { } nullableStringValueClient = nullableStringValueClientbuilder.buildNullableStringValueClient(); - ArrayClientBuilder nullableModelValueClientbuilder - = new ArrayClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ArrayClientBuilder nullableModelValueClientbuilder = new ArrayClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { nullableModelValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/type/dictionary/generated/DictionaryClientTestBase.java b/typespec-tests/src/test/java/com/type/dictionary/generated/DictionaryClientTestBase.java index cf03b1b620..eb6b0bd8ad 100644 --- a/typespec-tests/src/test/java/com/type/dictionary/generated/DictionaryClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/dictionary/generated/DictionaryClientTestBase.java @@ -52,10 +52,10 @@ class DictionaryClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - DictionaryClientBuilder int32ValueClientbuilder - = new DictionaryClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + DictionaryClientBuilder int32ValueClientbuilder = new DictionaryClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { int32ValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -63,10 +63,10 @@ protected void beforeTest() { } int32ValueClient = int32ValueClientbuilder.buildInt32ValueClient(); - DictionaryClientBuilder int64ValueClientbuilder - = new DictionaryClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + DictionaryClientBuilder int64ValueClientbuilder = new DictionaryClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { int64ValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -74,10 +74,10 @@ protected void beforeTest() { } int64ValueClient = int64ValueClientbuilder.buildInt64ValueClient(); - DictionaryClientBuilder booleanValueClientbuilder - = new DictionaryClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + DictionaryClientBuilder booleanValueClientbuilder = new DictionaryClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { booleanValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -85,10 +85,10 @@ protected void beforeTest() { } booleanValueClient = booleanValueClientbuilder.buildBooleanValueClient(); - DictionaryClientBuilder stringValueClientbuilder - = new DictionaryClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + DictionaryClientBuilder stringValueClientbuilder = new DictionaryClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { stringValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -96,10 +96,10 @@ protected void beforeTest() { } stringValueClient = stringValueClientbuilder.buildStringValueClient(); - DictionaryClientBuilder float32ValueClientbuilder - = new DictionaryClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + DictionaryClientBuilder float32ValueClientbuilder = new DictionaryClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { float32ValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -107,10 +107,10 @@ protected void beforeTest() { } float32ValueClient = float32ValueClientbuilder.buildFloat32ValueClient(); - DictionaryClientBuilder datetimeValueClientbuilder - = new DictionaryClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + DictionaryClientBuilder datetimeValueClientbuilder = new DictionaryClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { datetimeValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -118,10 +118,10 @@ protected void beforeTest() { } datetimeValueClient = datetimeValueClientbuilder.buildDatetimeValueClient(); - DictionaryClientBuilder durationValueClientbuilder - = new DictionaryClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + DictionaryClientBuilder durationValueClientbuilder = new DictionaryClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { durationValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -129,10 +129,10 @@ protected void beforeTest() { } durationValueClient = durationValueClientbuilder.buildDurationValueClient(); - DictionaryClientBuilder unknownValueClientbuilder - = new DictionaryClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + DictionaryClientBuilder unknownValueClientbuilder = new DictionaryClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unknownValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -140,10 +140,10 @@ protected void beforeTest() { } unknownValueClient = unknownValueClientbuilder.buildUnknownValueClient(); - DictionaryClientBuilder modelValueClientbuilder - = new DictionaryClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + DictionaryClientBuilder modelValueClientbuilder = new DictionaryClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { modelValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -151,10 +151,10 @@ protected void beforeTest() { } modelValueClient = modelValueClientbuilder.buildModelValueClient(); - DictionaryClientBuilder recursiveModelValueClientbuilder - = new DictionaryClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + DictionaryClientBuilder recursiveModelValueClientbuilder = new DictionaryClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { recursiveModelValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -162,10 +162,10 @@ protected void beforeTest() { } recursiveModelValueClient = recursiveModelValueClientbuilder.buildRecursiveModelValueClient(); - DictionaryClientBuilder nullableFloatValueClientbuilder - = new DictionaryClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + DictionaryClientBuilder nullableFloatValueClientbuilder = new DictionaryClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { nullableFloatValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/type/enums/extensible/generated/ExtensibleClientTestBase.java b/typespec-tests/src/test/java/com/type/enums/extensible/generated/ExtensibleClientTestBase.java index 1e479d9a04..c69dc45559 100644 --- a/typespec-tests/src/test/java/com/type/enums/extensible/generated/ExtensibleClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/enums/extensible/generated/ExtensibleClientTestBase.java @@ -22,10 +22,10 @@ class ExtensibleClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - ExtensibleClientBuilder extensibleClientbuilder - = new ExtensibleClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ExtensibleClientBuilder extensibleClientbuilder = new ExtensibleClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { extensibleClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/type/enums/fixed/generated/FixedClientTestBase.java b/typespec-tests/src/test/java/com/type/enums/fixed/generated/FixedClientTestBase.java index 5d6c8b35c8..42c3443dba 100644 --- a/typespec-tests/src/test/java/com/type/enums/fixed/generated/FixedClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/enums/fixed/generated/FixedClientTestBase.java @@ -22,10 +22,10 @@ class FixedClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - FixedClientBuilder fixedClientbuilder - = new FixedClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + FixedClientBuilder fixedClientbuilder = new FixedClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { fixedClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/type/model/empty/generated/EmptyClientTestBase.java b/typespec-tests/src/test/java/com/type/model/empty/generated/EmptyClientTestBase.java index 29dddde5d6..b79668911d 100644 --- a/typespec-tests/src/test/java/com/type/model/empty/generated/EmptyClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/model/empty/generated/EmptyClientTestBase.java @@ -22,10 +22,10 @@ class EmptyClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - EmptyClientBuilder emptyClientbuilder - = new EmptyClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + EmptyClientBuilder emptyClientbuilder = new EmptyClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { emptyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/type/model/flatten/generated/FlattenClientTestBase.java b/typespec-tests/src/test/java/com/type/model/flatten/generated/FlattenClientTestBase.java index a3f7ccb3b2..cbfde057d5 100644 --- a/typespec-tests/src/test/java/com/type/model/flatten/generated/FlattenClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/model/flatten/generated/FlattenClientTestBase.java @@ -22,10 +22,10 @@ class FlattenClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - FlattenClientBuilder flattenClientbuilder - = new FlattenClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + FlattenClientBuilder flattenClientbuilder = new FlattenClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { flattenClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/type/model/inheritance/enumdiscriminator/generated/EnumDiscriminatorClientTestBase.java b/typespec-tests/src/test/java/com/type/model/inheritance/enumdiscriminator/generated/EnumDiscriminatorClientTestBase.java index 1f3fabb711..3dfa60ccab 100644 --- a/typespec-tests/src/test/java/com/type/model/inheritance/enumdiscriminator/generated/EnumDiscriminatorClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/model/inheritance/enumdiscriminator/generated/EnumDiscriminatorClientTestBase.java @@ -23,7 +23,7 @@ class EnumDiscriminatorClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { EnumDiscriminatorClientBuilder enumDiscriminatorClientbuilder = new EnumDiscriminatorClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/type/model/inheritance/enumnesteddiscriminator/generated/EnumNestedDiscriminatorClientTestBase.java b/typespec-tests/src/test/java/com/type/model/inheritance/enumnesteddiscriminator/generated/EnumNestedDiscriminatorClientTestBase.java index 07f441fc51..ccc4713985 100644 --- a/typespec-tests/src/test/java/com/type/model/inheritance/enumnesteddiscriminator/generated/EnumNestedDiscriminatorClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/model/inheritance/enumnesteddiscriminator/generated/EnumNestedDiscriminatorClientTestBase.java @@ -24,7 +24,7 @@ class EnumNestedDiscriminatorClientTestBase extends TestProxyTestBase { protected void beforeTest() { EnumNestedDiscriminatorClientBuilder enumNestedDiscriminatorClientbuilder = new EnumNestedDiscriminatorClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/type/model/inheritance/nesteddiscriminator/generated/NestedDiscriminatorClientTestBase.java b/typespec-tests/src/test/java/com/type/model/inheritance/nesteddiscriminator/generated/NestedDiscriminatorClientTestBase.java index bee2a73e84..f22e376b2c 100644 --- a/typespec-tests/src/test/java/com/type/model/inheritance/nesteddiscriminator/generated/NestedDiscriminatorClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/model/inheritance/nesteddiscriminator/generated/NestedDiscriminatorClientTestBase.java @@ -23,7 +23,7 @@ class NestedDiscriminatorClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { NestedDiscriminatorClientBuilder nestedDiscriminatorClientbuilder = new NestedDiscriminatorClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/type/model/inheritance/notdiscriminated/generated/NotDiscriminatedClientTestBase.java b/typespec-tests/src/test/java/com/type/model/inheritance/notdiscriminated/generated/NotDiscriminatedClientTestBase.java index c02c02d657..980407e0d3 100644 --- a/typespec-tests/src/test/java/com/type/model/inheritance/notdiscriminated/generated/NotDiscriminatedClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/model/inheritance/notdiscriminated/generated/NotDiscriminatedClientTestBase.java @@ -23,7 +23,7 @@ class NotDiscriminatedClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { NotDiscriminatedClientBuilder notDiscriminatedClientbuilder = new NotDiscriminatedClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/type/model/inheritance/recursive/generated/RecursiveClientTestBase.java b/typespec-tests/src/test/java/com/type/model/inheritance/recursive/generated/RecursiveClientTestBase.java index 1a72d58554..15cc609f64 100644 --- a/typespec-tests/src/test/java/com/type/model/inheritance/recursive/generated/RecursiveClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/model/inheritance/recursive/generated/RecursiveClientTestBase.java @@ -22,10 +22,10 @@ class RecursiveClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - RecursiveClientBuilder recursiveClientbuilder - = new RecursiveClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + RecursiveClientBuilder recursiveClientbuilder = new RecursiveClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { recursiveClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/type/model/inheritance/singlediscriminator/generated/SingleDiscriminatorClientTestBase.java b/typespec-tests/src/test/java/com/type/model/inheritance/singlediscriminator/generated/SingleDiscriminatorClientTestBase.java index b95b97aac9..a871b2e7ac 100644 --- a/typespec-tests/src/test/java/com/type/model/inheritance/singlediscriminator/generated/SingleDiscriminatorClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/model/inheritance/singlediscriminator/generated/SingleDiscriminatorClientTestBase.java @@ -23,7 +23,7 @@ class SingleDiscriminatorClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { SingleDiscriminatorClientBuilder singleDiscriminatorClientbuilder = new SingleDiscriminatorClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/type/model/usage/generated/UsageClientTestBase.java b/typespec-tests/src/test/java/com/type/model/usage/generated/UsageClientTestBase.java index 0825f27cea..e135b9c68c 100644 --- a/typespec-tests/src/test/java/com/type/model/usage/generated/UsageClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/model/usage/generated/UsageClientTestBase.java @@ -22,10 +22,10 @@ class UsageClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - UsageClientBuilder usageClientbuilder - = new UsageClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + UsageClientBuilder usageClientbuilder = new UsageClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { usageClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/type/model/visibility/generated/VisibilityClientTestBase.java b/typespec-tests/src/test/java/com/type/model/visibility/generated/VisibilityClientTestBase.java index 3e8f731953..b610274bf6 100644 --- a/typespec-tests/src/test/java/com/type/model/visibility/generated/VisibilityClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/model/visibility/generated/VisibilityClientTestBase.java @@ -22,10 +22,10 @@ class VisibilityClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - VisibilityClientBuilder visibilityClientbuilder - = new VisibilityClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + VisibilityClientBuilder visibilityClientbuilder = new VisibilityClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { visibilityClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/type/property/additionalproperties/generated/AdditionalPropertiesClientTestBase.java b/typespec-tests/src/test/java/com/type/property/additionalproperties/generated/AdditionalPropertiesClientTestBase.java index 338043b9d9..2b3a3758dc 100644 --- a/typespec-tests/src/test/java/com/type/property/additionalproperties/generated/AdditionalPropertiesClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/property/additionalproperties/generated/AdditionalPropertiesClientTestBase.java @@ -116,7 +116,7 @@ class AdditionalPropertiesClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { AdditionalPropertiesClientBuilder extendsUnknownClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -127,7 +127,7 @@ protected void beforeTest() { extendsUnknownClient = extendsUnknownClientbuilder.buildExtendsUnknownClient(); AdditionalPropertiesClientBuilder extendsUnknownDerivedClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -139,7 +139,7 @@ protected void beforeTest() { AdditionalPropertiesClientBuilder extendsUnknownDiscriminatedClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -151,7 +151,7 @@ protected void beforeTest() { = extendsUnknownDiscriminatedClientbuilder.buildExtendsUnknownDiscriminatedClient(); AdditionalPropertiesClientBuilder isUnknownClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -162,7 +162,7 @@ protected void beforeTest() { isUnknownClient = isUnknownClientbuilder.buildIsUnknownClient(); AdditionalPropertiesClientBuilder isUnknownDerivedClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -173,7 +173,7 @@ protected void beforeTest() { isUnknownDerivedClient = isUnknownDerivedClientbuilder.buildIsUnknownDerivedClient(); AdditionalPropertiesClientBuilder isUnknownDiscriminatedClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -184,7 +184,7 @@ protected void beforeTest() { isUnknownDiscriminatedClient = isUnknownDiscriminatedClientbuilder.buildIsUnknownDiscriminatedClient(); AdditionalPropertiesClientBuilder extendsStringClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -195,7 +195,7 @@ protected void beforeTest() { extendsStringClient = extendsStringClientbuilder.buildExtendsStringClient(); AdditionalPropertiesClientBuilder isStringClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -206,7 +206,7 @@ protected void beforeTest() { isStringClient = isStringClientbuilder.buildIsStringClient(); AdditionalPropertiesClientBuilder spreadStringClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -217,7 +217,7 @@ protected void beforeTest() { spreadStringClient = spreadStringClientbuilder.buildSpreadStringClient(); AdditionalPropertiesClientBuilder extendsFloatClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -228,7 +228,7 @@ protected void beforeTest() { extendsFloatClient = extendsFloatClientbuilder.buildExtendsFloatClient(); AdditionalPropertiesClientBuilder isFloatClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -239,7 +239,7 @@ protected void beforeTest() { isFloatClient = isFloatClientbuilder.buildIsFloatClient(); AdditionalPropertiesClientBuilder spreadFloatClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -250,7 +250,7 @@ protected void beforeTest() { spreadFloatClient = spreadFloatClientbuilder.buildSpreadFloatClient(); AdditionalPropertiesClientBuilder extendsModelClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -261,7 +261,7 @@ protected void beforeTest() { extendsModelClient = extendsModelClientbuilder.buildExtendsModelClient(); AdditionalPropertiesClientBuilder isModelClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -272,7 +272,7 @@ protected void beforeTest() { isModelClient = isModelClientbuilder.buildIsModelClient(); AdditionalPropertiesClientBuilder spreadModelClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -283,7 +283,7 @@ protected void beforeTest() { spreadModelClient = spreadModelClientbuilder.buildSpreadModelClient(); AdditionalPropertiesClientBuilder extendsModelArrayClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -294,7 +294,7 @@ protected void beforeTest() { extendsModelArrayClient = extendsModelArrayClientbuilder.buildExtendsModelArrayClient(); AdditionalPropertiesClientBuilder isModelArrayClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -305,7 +305,7 @@ protected void beforeTest() { isModelArrayClient = isModelArrayClientbuilder.buildIsModelArrayClient(); AdditionalPropertiesClientBuilder spreadModelArrayClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -316,7 +316,7 @@ protected void beforeTest() { spreadModelArrayClient = spreadModelArrayClientbuilder.buildSpreadModelArrayClient(); AdditionalPropertiesClientBuilder spreadDifferentStringClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -327,7 +327,7 @@ protected void beforeTest() { spreadDifferentStringClient = spreadDifferentStringClientbuilder.buildSpreadDifferentStringClient(); AdditionalPropertiesClientBuilder spreadDifferentFloatClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -338,7 +338,7 @@ protected void beforeTest() { spreadDifferentFloatClient = spreadDifferentFloatClientbuilder.buildSpreadDifferentFloatClient(); AdditionalPropertiesClientBuilder spreadDifferentModelClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -350,7 +350,7 @@ protected void beforeTest() { AdditionalPropertiesClientBuilder spreadDifferentModelArrayClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -362,7 +362,7 @@ protected void beforeTest() { AdditionalPropertiesClientBuilder extendsDifferentSpreadStringClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -375,7 +375,7 @@ protected void beforeTest() { AdditionalPropertiesClientBuilder extendsDifferentSpreadFloatClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -388,7 +388,7 @@ protected void beforeTest() { AdditionalPropertiesClientBuilder extendsDifferentSpreadModelClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -401,7 +401,7 @@ protected void beforeTest() { AdditionalPropertiesClientBuilder extendsDifferentSpreadModelArrayClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -413,7 +413,7 @@ protected void beforeTest() { = extendsDifferentSpreadModelArrayClientbuilder.buildExtendsDifferentSpreadModelArrayClient(); AdditionalPropertiesClientBuilder multipleSpreadClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -424,7 +424,7 @@ protected void beforeTest() { multipleSpreadClient = multipleSpreadClientbuilder.buildMultipleSpreadClient(); AdditionalPropertiesClientBuilder spreadRecordUnionClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -436,7 +436,7 @@ protected void beforeTest() { AdditionalPropertiesClientBuilder spreadRecordDiscriminatedUnionClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -449,7 +449,7 @@ protected void beforeTest() { AdditionalPropertiesClientBuilder spreadRecordNonDiscriminatedUnionClientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -462,7 +462,7 @@ protected void beforeTest() { AdditionalPropertiesClientBuilder spreadRecordNonDiscriminatedUnion2Clientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { @@ -475,7 +475,7 @@ protected void beforeTest() { AdditionalPropertiesClientBuilder spreadRecordNonDiscriminatedUnion3Clientbuilder = new AdditionalPropertiesClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/typespec-tests/src/test/java/com/type/property/nullable/generated/NullableClientTestBase.java b/typespec-tests/src/test/java/com/type/property/nullable/generated/NullableClientTestBase.java index c43bb16077..cc371f12ce 100644 --- a/typespec-tests/src/test/java/com/type/property/nullable/generated/NullableClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/property/nullable/generated/NullableClientTestBase.java @@ -40,10 +40,10 @@ class NullableClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - NullableClientBuilder stringOperationClientbuilder - = new NullableClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + NullableClientBuilder stringOperationClientbuilder = new NullableClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { stringOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -51,10 +51,10 @@ protected void beforeTest() { } stringOperationClient = stringOperationClientbuilder.buildStringOperationClient(); - NullableClientBuilder bytesClientbuilder - = new NullableClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + NullableClientBuilder bytesClientbuilder = new NullableClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { bytesClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -62,10 +62,10 @@ protected void beforeTest() { } bytesClient = bytesClientbuilder.buildBytesClient(); - NullableClientBuilder datetimeOperationClientbuilder - = new NullableClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + NullableClientBuilder datetimeOperationClientbuilder = new NullableClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { datetimeOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -73,10 +73,10 @@ protected void beforeTest() { } datetimeOperationClient = datetimeOperationClientbuilder.buildDatetimeOperationClient(); - NullableClientBuilder durationOperationClientbuilder - = new NullableClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + NullableClientBuilder durationOperationClientbuilder = new NullableClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { durationOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -84,10 +84,10 @@ protected void beforeTest() { } durationOperationClient = durationOperationClientbuilder.buildDurationOperationClient(); - NullableClientBuilder collectionsByteClientbuilder - = new NullableClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + NullableClientBuilder collectionsByteClientbuilder = new NullableClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { collectionsByteClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -95,10 +95,10 @@ protected void beforeTest() { } collectionsByteClient = collectionsByteClientbuilder.buildCollectionsByteClient(); - NullableClientBuilder collectionsModelClientbuilder - = new NullableClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + NullableClientBuilder collectionsModelClientbuilder = new NullableClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { collectionsModelClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -106,10 +106,10 @@ protected void beforeTest() { } collectionsModelClient = collectionsModelClientbuilder.buildCollectionsModelClient(); - NullableClientBuilder collectionsStringClientbuilder - = new NullableClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + NullableClientBuilder collectionsStringClientbuilder = new NullableClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { collectionsStringClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/type/property/optional/generated/OptionalClientTestBase.java b/typespec-tests/src/test/java/com/type/property/optional/generated/OptionalClientTestBase.java index 7dac8989f9..f376090519 100644 --- a/typespec-tests/src/test/java/com/type/property/optional/generated/OptionalClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/property/optional/generated/OptionalClientTestBase.java @@ -67,10 +67,10 @@ class OptionalClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - OptionalClientBuilder stringOperationClientbuilder - = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + OptionalClientBuilder stringOperationClientbuilder = new OptionalClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { stringOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -78,10 +78,10 @@ protected void beforeTest() { } stringOperationClient = stringOperationClientbuilder.buildStringOperationClient(); - OptionalClientBuilder bytesClientbuilder - = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + OptionalClientBuilder bytesClientbuilder = new OptionalClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { bytesClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -89,10 +89,10 @@ protected void beforeTest() { } bytesClient = bytesClientbuilder.buildBytesClient(); - OptionalClientBuilder datetimeOperationClientbuilder - = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + OptionalClientBuilder datetimeOperationClientbuilder = new OptionalClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { datetimeOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -100,10 +100,10 @@ protected void beforeTest() { } datetimeOperationClient = datetimeOperationClientbuilder.buildDatetimeOperationClient(); - OptionalClientBuilder durationOperationClientbuilder - = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + OptionalClientBuilder durationOperationClientbuilder = new OptionalClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { durationOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -111,10 +111,10 @@ protected void beforeTest() { } durationOperationClient = durationOperationClientbuilder.buildDurationOperationClient(); - OptionalClientBuilder plainDateClientbuilder - = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + OptionalClientBuilder plainDateClientbuilder = new OptionalClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { plainDateClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -122,10 +122,10 @@ protected void beforeTest() { } plainDateClient = plainDateClientbuilder.buildPlainDateClient(); - OptionalClientBuilder plainTimeClientbuilder - = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + OptionalClientBuilder plainTimeClientbuilder = new OptionalClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { plainTimeClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -133,10 +133,10 @@ protected void beforeTest() { } plainTimeClient = plainTimeClientbuilder.buildPlainTimeClient(); - OptionalClientBuilder collectionsByteClientbuilder - = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + OptionalClientBuilder collectionsByteClientbuilder = new OptionalClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { collectionsByteClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -144,10 +144,10 @@ protected void beforeTest() { } collectionsByteClient = collectionsByteClientbuilder.buildCollectionsByteClient(); - OptionalClientBuilder collectionsModelClientbuilder - = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + OptionalClientBuilder collectionsModelClientbuilder = new OptionalClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { collectionsModelClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -155,10 +155,10 @@ protected void beforeTest() { } collectionsModelClient = collectionsModelClientbuilder.buildCollectionsModelClient(); - OptionalClientBuilder stringLiteralClientbuilder - = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + OptionalClientBuilder stringLiteralClientbuilder = new OptionalClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { stringLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -166,10 +166,10 @@ protected void beforeTest() { } stringLiteralClient = stringLiteralClientbuilder.buildStringLiteralClient(); - OptionalClientBuilder intLiteralClientbuilder - = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + OptionalClientBuilder intLiteralClientbuilder = new OptionalClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { intLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -177,10 +177,10 @@ protected void beforeTest() { } intLiteralClient = intLiteralClientbuilder.buildIntLiteralClient(); - OptionalClientBuilder floatLiteralClientbuilder - = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + OptionalClientBuilder floatLiteralClientbuilder = new OptionalClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { floatLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -188,10 +188,10 @@ protected void beforeTest() { } floatLiteralClient = floatLiteralClientbuilder.buildFloatLiteralClient(); - OptionalClientBuilder booleanLiteralClientbuilder - = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + OptionalClientBuilder booleanLiteralClientbuilder = new OptionalClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { booleanLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -199,10 +199,10 @@ protected void beforeTest() { } booleanLiteralClient = booleanLiteralClientbuilder.buildBooleanLiteralClient(); - OptionalClientBuilder unionStringLiteralClientbuilder - = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + OptionalClientBuilder unionStringLiteralClientbuilder = new OptionalClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unionStringLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -210,10 +210,10 @@ protected void beforeTest() { } unionStringLiteralClient = unionStringLiteralClientbuilder.buildUnionStringLiteralClient(); - OptionalClientBuilder unionIntLiteralClientbuilder - = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + OptionalClientBuilder unionIntLiteralClientbuilder = new OptionalClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unionIntLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -221,10 +221,10 @@ protected void beforeTest() { } unionIntLiteralClient = unionIntLiteralClientbuilder.buildUnionIntLiteralClient(); - OptionalClientBuilder unionFloatLiteralClientbuilder - = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + OptionalClientBuilder unionFloatLiteralClientbuilder = new OptionalClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unionFloatLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -232,10 +232,10 @@ protected void beforeTest() { } unionFloatLiteralClient = unionFloatLiteralClientbuilder.buildUnionFloatLiteralClient(); - OptionalClientBuilder requiredAndOptionalClientbuilder - = new OptionalClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + OptionalClientBuilder requiredAndOptionalClientbuilder = new OptionalClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { requiredAndOptionalClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/type/property/valuetypes/generated/ValueTypesClientTestBase.java b/typespec-tests/src/test/java/com/type/property/valuetypes/generated/ValueTypesClientTestBase.java index 4d6d978e28..6a9e20c137 100644 --- a/typespec-tests/src/test/java/com/type/property/valuetypes/generated/ValueTypesClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/property/valuetypes/generated/ValueTypesClientTestBase.java @@ -106,10 +106,10 @@ class ValueTypesClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - ValueTypesClientBuilder booleanOperationClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder booleanOperationClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { booleanOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -117,10 +117,10 @@ protected void beforeTest() { } booleanOperationClient = booleanOperationClientbuilder.buildBooleanOperationClient(); - ValueTypesClientBuilder stringOperationClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder stringOperationClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { stringOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -128,10 +128,10 @@ protected void beforeTest() { } stringOperationClient = stringOperationClientbuilder.buildStringOperationClient(); - ValueTypesClientBuilder bytesClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder bytesClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { bytesClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -139,10 +139,10 @@ protected void beforeTest() { } bytesClient = bytesClientbuilder.buildBytesClient(); - ValueTypesClientBuilder intClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder intClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { intClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -150,10 +150,10 @@ protected void beforeTest() { } intClient = intClientbuilder.buildIntClient(); - ValueTypesClientBuilder floatOperationClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder floatOperationClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { floatOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -161,10 +161,10 @@ protected void beforeTest() { } floatOperationClient = floatOperationClientbuilder.buildFloatOperationClient(); - ValueTypesClientBuilder decimalClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder decimalClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { decimalClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -172,10 +172,10 @@ protected void beforeTest() { } decimalClient = decimalClientbuilder.buildDecimalClient(); - ValueTypesClientBuilder decimal128Clientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder decimal128Clientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { decimal128Clientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -183,10 +183,10 @@ protected void beforeTest() { } decimal128Client = decimal128Clientbuilder.buildDecimal128Client(); - ValueTypesClientBuilder datetimeOperationClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder datetimeOperationClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { datetimeOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -194,10 +194,10 @@ protected void beforeTest() { } datetimeOperationClient = datetimeOperationClientbuilder.buildDatetimeOperationClient(); - ValueTypesClientBuilder durationOperationClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder durationOperationClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { durationOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -205,10 +205,10 @@ protected void beforeTest() { } durationOperationClient = durationOperationClientbuilder.buildDurationOperationClient(); - ValueTypesClientBuilder enumClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder enumClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { enumClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -216,10 +216,10 @@ protected void beforeTest() { } enumClient = enumClientbuilder.buildEnumClient(); - ValueTypesClientBuilder extensibleEnumClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder extensibleEnumClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { extensibleEnumClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -227,10 +227,10 @@ protected void beforeTest() { } extensibleEnumClient = extensibleEnumClientbuilder.buildExtensibleEnumClient(); - ValueTypesClientBuilder modelClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder modelClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { modelClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -238,10 +238,10 @@ protected void beforeTest() { } modelClient = modelClientbuilder.buildModelClient(); - ValueTypesClientBuilder collectionsStringClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder collectionsStringClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { collectionsStringClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -249,10 +249,10 @@ protected void beforeTest() { } collectionsStringClient = collectionsStringClientbuilder.buildCollectionsStringClient(); - ValueTypesClientBuilder collectionsIntClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder collectionsIntClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { collectionsIntClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -260,10 +260,10 @@ protected void beforeTest() { } collectionsIntClient = collectionsIntClientbuilder.buildCollectionsIntClient(); - ValueTypesClientBuilder collectionsModelClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder collectionsModelClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { collectionsModelClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -271,10 +271,10 @@ protected void beforeTest() { } collectionsModelClient = collectionsModelClientbuilder.buildCollectionsModelClient(); - ValueTypesClientBuilder dictionaryStringClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder dictionaryStringClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { dictionaryStringClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -282,10 +282,10 @@ protected void beforeTest() { } dictionaryStringClient = dictionaryStringClientbuilder.buildDictionaryStringClient(); - ValueTypesClientBuilder neverClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder neverClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { neverClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -293,10 +293,10 @@ protected void beforeTest() { } neverClient = neverClientbuilder.buildNeverClient(); - ValueTypesClientBuilder unknownStringClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder unknownStringClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unknownStringClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -304,10 +304,10 @@ protected void beforeTest() { } unknownStringClient = unknownStringClientbuilder.buildUnknownStringClient(); - ValueTypesClientBuilder unknownIntClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder unknownIntClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unknownIntClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -315,10 +315,10 @@ protected void beforeTest() { } unknownIntClient = unknownIntClientbuilder.buildUnknownIntClient(); - ValueTypesClientBuilder unknownDictClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder unknownDictClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unknownDictClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -326,10 +326,10 @@ protected void beforeTest() { } unknownDictClient = unknownDictClientbuilder.buildUnknownDictClient(); - ValueTypesClientBuilder unknownArrayClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder unknownArrayClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unknownArrayClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -337,10 +337,10 @@ protected void beforeTest() { } unknownArrayClient = unknownArrayClientbuilder.buildUnknownArrayClient(); - ValueTypesClientBuilder stringLiteralClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder stringLiteralClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { stringLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -348,10 +348,10 @@ protected void beforeTest() { } stringLiteralClient = stringLiteralClientbuilder.buildStringLiteralClient(); - ValueTypesClientBuilder intLiteralClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder intLiteralClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { intLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -359,10 +359,10 @@ protected void beforeTest() { } intLiteralClient = intLiteralClientbuilder.buildIntLiteralClient(); - ValueTypesClientBuilder floatLiteralClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder floatLiteralClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { floatLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -370,10 +370,10 @@ protected void beforeTest() { } floatLiteralClient = floatLiteralClientbuilder.buildFloatLiteralClient(); - ValueTypesClientBuilder booleanLiteralClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder booleanLiteralClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { booleanLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -381,10 +381,10 @@ protected void beforeTest() { } booleanLiteralClient = booleanLiteralClientbuilder.buildBooleanLiteralClient(); - ValueTypesClientBuilder unionStringLiteralClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder unionStringLiteralClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unionStringLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -392,10 +392,10 @@ protected void beforeTest() { } unionStringLiteralClient = unionStringLiteralClientbuilder.buildUnionStringLiteralClient(); - ValueTypesClientBuilder unionIntLiteralClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder unionIntLiteralClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unionIntLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -403,10 +403,10 @@ protected void beforeTest() { } unionIntLiteralClient = unionIntLiteralClientbuilder.buildUnionIntLiteralClient(); - ValueTypesClientBuilder unionFloatLiteralClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder unionFloatLiteralClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unionFloatLiteralClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -414,10 +414,10 @@ protected void beforeTest() { } unionFloatLiteralClient = unionFloatLiteralClientbuilder.buildUnionFloatLiteralClient(); - ValueTypesClientBuilder unionEnumValueClientbuilder - = new ValueTypesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ValueTypesClientBuilder unionEnumValueClientbuilder = new ValueTypesClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unionEnumValueClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/type/scalar/generated/ScalarClientTestBase.java b/typespec-tests/src/test/java/com/type/scalar/generated/ScalarClientTestBase.java index 82cac5fd58..63b9007c62 100644 --- a/typespec-tests/src/test/java/com/type/scalar/generated/ScalarClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/scalar/generated/ScalarClientTestBase.java @@ -40,10 +40,10 @@ class ScalarClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - ScalarClientBuilder stringOperationClientbuilder - = new ScalarClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ScalarClientBuilder stringOperationClientbuilder = new ScalarClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { stringOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -51,10 +51,10 @@ protected void beforeTest() { } stringOperationClient = stringOperationClientbuilder.buildStringOperationClient(); - ScalarClientBuilder booleanOperationClientbuilder - = new ScalarClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ScalarClientBuilder booleanOperationClientbuilder = new ScalarClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { booleanOperationClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -62,10 +62,10 @@ protected void beforeTest() { } booleanOperationClient = booleanOperationClientbuilder.buildBooleanOperationClient(); - ScalarClientBuilder unknownClientbuilder - = new ScalarClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ScalarClientBuilder unknownClientbuilder = new ScalarClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { unknownClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -73,10 +73,10 @@ protected void beforeTest() { } unknownClient = unknownClientbuilder.buildUnknownClient(); - ScalarClientBuilder decimalTypeClientbuilder - = new ScalarClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ScalarClientBuilder decimalTypeClientbuilder = new ScalarClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { decimalTypeClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -84,10 +84,10 @@ protected void beforeTest() { } decimalTypeClient = decimalTypeClientbuilder.buildDecimalTypeClient(); - ScalarClientBuilder decimal128TypeClientbuilder - = new ScalarClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ScalarClientBuilder decimal128TypeClientbuilder = new ScalarClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { decimal128TypeClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -95,10 +95,10 @@ protected void beforeTest() { } decimal128TypeClient = decimal128TypeClientbuilder.buildDecimal128TypeClient(); - ScalarClientBuilder decimalVerifyClientbuilder - = new ScalarClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ScalarClientBuilder decimalVerifyClientbuilder = new ScalarClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { decimalVerifyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -106,10 +106,10 @@ protected void beforeTest() { } decimalVerifyClient = decimalVerifyClientbuilder.buildDecimalVerifyClient(); - ScalarClientBuilder decimal128VerifyClientbuilder - = new ScalarClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + ScalarClientBuilder decimal128VerifyClientbuilder = new ScalarClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { decimal128VerifyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/type/union/generated/UnionClientTestBase.java b/typespec-tests/src/test/java/com/type/union/generated/UnionClientTestBase.java index d7716e1b64..4c8e1671b5 100644 --- a/typespec-tests/src/test/java/com/type/union/generated/UnionClientTestBase.java +++ b/typespec-tests/src/test/java/com/type/union/generated/UnionClientTestBase.java @@ -49,10 +49,10 @@ class UnionClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - UnionClientBuilder stringsOnlyClientbuilder - = new UnionClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + UnionClientBuilder stringsOnlyClientbuilder = new UnionClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { stringsOnlyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -60,10 +60,10 @@ protected void beforeTest() { } stringsOnlyClient = stringsOnlyClientbuilder.buildStringsOnlyClient(); - UnionClientBuilder stringExtensibleClientbuilder - = new UnionClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + UnionClientBuilder stringExtensibleClientbuilder = new UnionClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { stringExtensibleClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -71,10 +71,10 @@ protected void beforeTest() { } stringExtensibleClient = stringExtensibleClientbuilder.buildStringExtensibleClient(); - UnionClientBuilder stringExtensibleNamedClientbuilder - = new UnionClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + UnionClientBuilder stringExtensibleNamedClientbuilder = new UnionClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { stringExtensibleNamedClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -82,10 +82,10 @@ protected void beforeTest() { } stringExtensibleNamedClient = stringExtensibleNamedClientbuilder.buildStringExtensibleNamedClient(); - UnionClientBuilder intsOnlyClientbuilder - = new UnionClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + UnionClientBuilder intsOnlyClientbuilder = new UnionClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { intsOnlyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -93,10 +93,10 @@ protected void beforeTest() { } intsOnlyClient = intsOnlyClientbuilder.buildIntsOnlyClient(); - UnionClientBuilder floatsOnlyClientbuilder - = new UnionClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + UnionClientBuilder floatsOnlyClientbuilder = new UnionClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { floatsOnlyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -104,10 +104,10 @@ protected void beforeTest() { } floatsOnlyClient = floatsOnlyClientbuilder.buildFloatsOnlyClient(); - UnionClientBuilder modelsOnlyClientbuilder - = new UnionClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + UnionClientBuilder modelsOnlyClientbuilder = new UnionClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { modelsOnlyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -115,10 +115,10 @@ protected void beforeTest() { } modelsOnlyClient = modelsOnlyClientbuilder.buildModelsOnlyClient(); - UnionClientBuilder enumsOnlyClientbuilder - = new UnionClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + UnionClientBuilder enumsOnlyClientbuilder = new UnionClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { enumsOnlyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -126,10 +126,10 @@ protected void beforeTest() { } enumsOnlyClient = enumsOnlyClientbuilder.buildEnumsOnlyClient(); - UnionClientBuilder stringAndArrayClientbuilder - = new UnionClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + UnionClientBuilder stringAndArrayClientbuilder = new UnionClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { stringAndArrayClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -137,10 +137,10 @@ protected void beforeTest() { } stringAndArrayClient = stringAndArrayClientbuilder.buildStringAndArrayClient(); - UnionClientBuilder mixedLiteralsClientbuilder - = new UnionClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + UnionClientBuilder mixedLiteralsClientbuilder = new UnionClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { mixedLiteralsClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { @@ -148,10 +148,10 @@ protected void beforeTest() { } mixedLiteralsClient = mixedLiteralsClientbuilder.buildMixedLiteralsClient(); - UnionClientBuilder mixedTypesClientbuilder - = new UnionClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + UnionClientBuilder mixedTypesClientbuilder = new UnionClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { mixedTypesClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { From f47bf773d4c166998be05f096ab14477dcab34a0 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Tue, 13 Aug 2024 11:33:55 +0800 Subject: [PATCH 59/90] remove suffix --- typespec-extension/src/code-model-builder.ts | 44 ++++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 8dc78099d8..2632f09542 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -259,7 +259,7 @@ export class CodeModelBuilder { this.options["group-etag-headers"] = false; } - this.processClientsFromSdkType(); + this.processClients(); this.processModels(); @@ -475,7 +475,7 @@ export class CodeModelBuilder { } } - private processClientsFromSdkType() { + private processClients() { // preprocess group-etag-headers this.options["group-etag-headers"] = this.options["group-etag-headers"] ?? true; @@ -520,7 +520,7 @@ export class CodeModelBuilder { } codeModelClient.apiVersions = []; - for (const version of this.getFilteredApiVersionsFromString( + for (const version of this.getFilteredApiVersions( this.apiVersion, versions, this.options["service-version-exclude-preview"], @@ -574,7 +574,7 @@ export class CodeModelBuilder { let codeModelGroup = new OperationGroup(""); for (const serviceMethod of serviceMethodsWithoutSubClient) { if (!this.needToSkipProcessingOperation(serviceMethod.__raw, clientContext)) { - codeModelGroup.addOperation(this.processOperationFromSdkType(serviceMethod, clientContext, "")); + codeModelGroup.addOperation(this.processOperation(serviceMethod, clientContext, "")); } } if (codeModelGroup.operations?.length > 0) { @@ -591,7 +591,7 @@ export class CodeModelBuilder { for (const serviceMethod of serviceMethods) { if (!this.needToSkipProcessingOperation(serviceMethod.__raw, clientContext)) { codeModelGroup.addOperation( - this.processOperationFromSdkType(serviceMethod, clientContext, subClient.name), + this.processOperation(serviceMethod, clientContext, subClient.name), ); } } @@ -676,7 +676,7 @@ export class CodeModelBuilder { * @param versions api-versions to filter * @returns filtered api-versions */ - private getFilteredApiVersionsFromString( + private getFilteredApiVersions( pinnedApiVersion: string | undefined, versions: string[], excludePreview: boolean = false, @@ -721,7 +721,7 @@ export class CodeModelBuilder { } } - private processOperationFromSdkType( + private processOperation( sdkMethod: SdkServiceMethod, clientContext: ClientContext, groupName: string, @@ -816,12 +816,12 @@ export class CodeModelBuilder { continue; } } - this.processParameterFromSdkType(codeModelOperation, param, clientContext); + this.processParameter(codeModelOperation, param, clientContext); } // body if (httpOperation.bodyParam && httpOperation.__raw && sdkMethod.__raw && httpOperation.bodyParam.type.__raw) { - this.processParameterBodyFromSdkType( + this.processParameterBody( codeModelOperation, httpOperation.__raw, httpOperation, @@ -831,38 +831,38 @@ export class CodeModelBuilder { // group ETag header parameters, if exists if (this.options["group-etag-headers"]) { - this.processEtagHeaderParametersFromSdkType(codeModelOperation, sdkMethod.operation); + this.processEtagHeaderParameters(codeModelOperation, sdkMethod.operation); } // lro metadata let lroMetadata = new LongRunningMetadata(false); if (sdkMethod.kind === "lro" || sdkMethod.kind === "lropaging") { - lroMetadata = this.processLroMetadataFromSdkType(codeModelOperation, sdkMethod); + lroMetadata = this.processLroMetadata(codeModelOperation, sdkMethod); } // responses for (const [code, response] of sdkMethod.operation.responses) { - this.processResponseFromSdkType(codeModelOperation, code, response, lroMetadata.longRunning, false); + this.processResponse(codeModelOperation, code, response, lroMetadata.longRunning, false); } // exception for (const [code, response] of sdkMethod.operation.exceptions) { - this.processResponseFromSdkType(codeModelOperation, code, response, lroMetadata.longRunning, true); + this.processResponse(codeModelOperation, code, response, lroMetadata.longRunning, true); } // check for paged // this.processRouteForPaged(codeModelOperation, sdkMethod.operation.__raw.responses); - this.processRouteForPagedFromSdkType(codeModelOperation, sdkMethod.operation.responses, sdkMethod); + this.processRouteForPaged(codeModelOperation, sdkMethod.operation.responses, sdkMethod); // check for long-running operation - this.processRouteForLongRunningFromSdkType(codeModelOperation, sdkMethod.operation.responses, lroMetadata); + this.processRouteForLongRunning(codeModelOperation, sdkMethod.operation.responses, lroMetadata); operationGroup.addOperation(codeModelOperation); return codeModelOperation; } - private processRouteForPagedFromSdkType( + private processRouteForPaged( op: CodeModelOperation, responses: Map, sdkMethod: SdkMethod, @@ -891,7 +891,7 @@ export class CodeModelBuilder { } } - private processLroMetadataFromSdkType( + private processLroMetadata( op: CodeModelOperation, sdkMethod: SdkLroServiceMethod | SdkLroPagingServiceMethod, ): LongRunningMetadata { @@ -984,7 +984,7 @@ export class CodeModelBuilder { return new LongRunningMetadata(false); } - private processRouteForLongRunningFromSdkType( + private processRouteForLongRunning( op: CodeModelOperation, responses: Map, lroMetadata: LongRunningMetadata, @@ -1011,7 +1011,7 @@ export class CodeModelBuilder { private _armApiVersionParameter?: Parameter; - private processParameterFromSdkType( + private processParameter( op: CodeModelOperation, param: SdkQueryParameter | SdkPathParameter | SdkHeaderParameter, clientContext: ClientContext, @@ -1157,7 +1157,7 @@ export class CodeModelBuilder { } } - private processEtagHeaderParametersFromSdkType(op: CodeModelOperation, httpOperation: SdkHttpOperation) { + private processEtagHeaderParameters(op: CodeModelOperation, httpOperation: SdkHttpOperation) { if (op.convenienceApi && op.parameters && op.signatureParameters) { const etagHeadersNames = new Set([ "if-match", @@ -1292,7 +1292,7 @@ export class CodeModelBuilder { } } - private processParameterBodyFromSdkType( + private processParameterBody( op: CodeModelOperation, rawHttpOperation: HttpOperation, sdkHttpOperation: SdkHttpOperation, @@ -1497,7 +1497,7 @@ export class CodeModelBuilder { return this.getEffectiveSchemaType(bodyType); } - private processResponseFromSdkType( + private processResponse( op: CodeModelOperation, statusCode: number | HttpStatusCodeRange | "*", sdkResponse: SdkHttpResponse, From ad910d8340d9d3abb863fbf92fa21e7ad46b8935 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Tue, 13 Aug 2024 11:46:03 +0800 Subject: [PATCH 60/90] format --- typespec-extension/src/code-model-builder.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 2632f09542..456873e03b 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -590,9 +590,7 @@ export class CodeModelBuilder { codeModelGroup = new OperationGroup(subClient.name); for (const serviceMethod of serviceMethods) { if (!this.needToSkipProcessingOperation(serviceMethod.__raw, clientContext)) { - codeModelGroup.addOperation( - this.processOperation(serviceMethod, clientContext, subClient.name), - ); + codeModelGroup.addOperation(this.processOperation(serviceMethod, clientContext, subClient.name)); } } codeModelClient.operationGroups.push(codeModelGroup); @@ -821,12 +819,7 @@ export class CodeModelBuilder { // body if (httpOperation.bodyParam && httpOperation.__raw && sdkMethod.__raw && httpOperation.bodyParam.type.__raw) { - this.processParameterBody( - codeModelOperation, - httpOperation.__raw, - httpOperation, - httpOperation.bodyParam, - ); + this.processParameterBody(codeModelOperation, httpOperation.__raw, httpOperation, httpOperation.bodyParam); } // group ETag header parameters, if exists From 593aa597eb588c162163d0d9b4df78bf3282b840 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Tue, 13 Aug 2024 12:08:12 +0800 Subject: [PATCH 61/90] remove unused functions --- typespec-extension/src/code-model-builder.ts | 41 -------------------- typespec-extension/src/type-utils.ts | 17 -------- 2 files changed, 58 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 456873e03b..b17f421f1e 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -70,7 +70,6 @@ import { UsageFlags, createSdkContext, getAllModels, - getClientNameOverride, getClientType, getWireName, isApiVersion, @@ -91,10 +90,8 @@ import { Union, getDoc, getEffectiveModelType, - getFriendlyName, getNamespaceFullName, getOverloadedOperation, - getProjectedName, getSummary, getVisibility, isArrayModelType, @@ -104,7 +101,6 @@ import { import { Authentication, HttpOperation, - HttpOperationResponse, HttpStatusCodeRange, HttpStatusCodesEntry, Visibility, @@ -112,7 +108,6 @@ import { getHeaderFieldName, getPathParamName, getQueryParamName, - getStatusCodeDescription, isHeader, isPathParam, isQueryParam, @@ -1624,14 +1619,6 @@ export class CodeModelBuilder { } } - private getResponseDescription(resp: HttpOperationResponse): string { - return ( - resp.description || - (resp.statusCodes === "*" ? "An unexpected error response" : getStatusCodeDescription(resp.statusCodes)) || - "" - ); - } - private processSchemaFromSdkType(type: SdkType, nameHint: string): Schema { return this.schemaCache.process(type, nameHint) || fail("Unable to process schema."); } @@ -2233,34 +2220,6 @@ export class CodeModelBuilder { return target ? getSummary(this.program, target) : undefined; } - private getName(target: ModelProperty | Operation, nameHint: string | undefined = undefined): string { - // TODO: once getLibraryName API in typespec-client-generator-core can get projected name from language and client, as well as can handle template case, use getLibraryName API - const emitterClientName = getClientNameOverride(this.sdkContext, target); - if (emitterClientName && typeof emitterClientName === "string") { - return emitterClientName; - } - // TODO: deprecate getProjectedName - const languageProjectedName = getProjectedName(this.program, target, "java"); - if (languageProjectedName) { - return languageProjectedName; - } - - const clientProjectedName = getProjectedName(this.program, target, "client"); - if (clientProjectedName) { - return clientProjectedName; - } - - const friendlyName = getFriendlyName(this.program, target); - if (friendlyName) { - return friendlyName; - } - - if (typeof target.name === "symbol") { - return ""; - } - return target.name || ""; - } - private getSerializedName(target: ModelProperty): string { if (isHeader(this.program, target)) { return getHeaderFieldName(this.program, target); diff --git a/typespec-extension/src/type-utils.ts b/typespec-extension/src/type-utils.ts index 71bb07dc97..ed9a04eb7d 100644 --- a/typespec-extension/src/type-utils.ts +++ b/typespec-extension/src/type-utils.ts @@ -1,7 +1,6 @@ import { DecoratedType, DecoratorApplication, - EncodeData, EnumMember, IntrinsicScalarName, Model, @@ -110,22 +109,6 @@ export function getDefaultValue(value: Value | undefined): any { return undefined; } -export function getDurationFormat(encode: EncodeData): DurationSchema["format"] { - let format: DurationSchema["format"] = "duration-rfc3339"; - // duration encoded as seconds - if (encode.encoding === "seconds") { - const scalarName = encode.type.name; - if (scalarName.startsWith("int") || scalarName.startsWith("uint") || scalarName === "safeint") { - format = "seconds-integer"; - } else if (scalarName.startsWith("float")) { - format = "seconds-number"; - } else { - throw new Error(`Unrecognized scalar type used by duration encoded as seconds: '${scalarName}'.`); - } - } - return format; -} - export function getDurationFormatFromSdkType(type: SdkDurationType): DurationSchema["format"] { let format: DurationSchema["format"] = "duration-rfc3339"; // duration encoded as seconds From b18b95254efe95e551de8a8ba1439655d6ca6de7 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Tue, 13 Aug 2024 12:19:04 +0800 Subject: [PATCH 62/90] regen --- .../implementation/FirstClientImpl.java | 11 +- .../service/implementation/Group3sImpl.java | 27 +-- .../service/implementation/Group4sImpl.java | 14 +- .../service/implementation/Group5sImpl.java | 14 +- .../implementation/SecondClientImpl.java | 13 +- .../implementation/FormDatasImpl.java | 189 +++++++++--------- 6 files changed, 119 insertions(+), 149 deletions(-) diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/FirstClientImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/FirstClientImpl.java index 972b7ef996..eb816c9671 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/FirstClientImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/FirstClientImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -177,7 +176,7 @@ public interface FirstClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> one(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/one") @ExpectedResponses({ 204 }) @@ -186,7 +185,7 @@ Mono> one(@HostParam("endpoint") String endpoint, @HostParam("cli @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response oneSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -201,9 +200,8 @@ Response oneSync(@HostParam("endpoint") String endpoint, @HostParam("clien */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> oneWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.one(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); + .withContext(context -> service.one(this.getEndpoint(), this.getClient(), requestOptions, context)); } /** @@ -218,7 +216,6 @@ public Mono> oneWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response oneWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.oneSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); + return service.oneSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/Group3sImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/Group3sImpl.java index 19df9b6a82..f24593118f 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/Group3sImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/Group3sImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -62,7 +61,7 @@ public interface Group3sService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> two(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/two") @ExpectedResponses({ 204 }) @@ -71,7 +70,7 @@ Mono> two(@HostParam("endpoint") String endpoint, @HostParam("cli @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response twoSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/three") @ExpectedResponses({ 204 }) @@ -80,7 +79,7 @@ Response twoSync(@HostParam("endpoint") String endpoint, @HostParam("clien @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> three(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/three") @ExpectedResponses({ 204 }) @@ -89,7 +88,7 @@ Mono> three(@HostParam("endpoint") String endpoint, @HostParam("c @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response threeSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -104,9 +103,8 @@ Response threeSync(@HostParam("endpoint") String endpoint, @HostParam("cli */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> twoWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.two(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.two(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -121,9 +119,7 @@ public Mono> twoWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response twoWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.twoSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.twoSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } /** @@ -138,9 +134,8 @@ public Response twoWithResponse(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> threeWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.three(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.three(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -155,8 +150,6 @@ public Mono> threeWithResponseAsync(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Response threeWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.threeSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.threeSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/Group4sImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/Group4sImpl.java index 0f1e01d3aa..e7c54920b9 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/Group4sImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/Group4sImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -62,7 +61,7 @@ public interface Group4sService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> four(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/four") @ExpectedResponses({ 204 }) @@ -71,7 +70,7 @@ Mono> four(@HostParam("endpoint") String endpoint, @HostParam("cl @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response fourSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -86,9 +85,8 @@ Response fourSync(@HostParam("endpoint") String endpoint, @HostParam("clie */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fourWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.four(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.four(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -103,8 +101,6 @@ public Mono> fourWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fourWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.fourSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.fourSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/Group5sImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/Group5sImpl.java index 354453123a..30f45f556a 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/Group5sImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/Group5sImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -62,7 +61,7 @@ public interface Group5sService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> six(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/six") @ExpectedResponses({ 204 }) @@ -71,7 +70,7 @@ Mono> six(@HostParam("endpoint") String endpoint, @HostParam("cli @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response sixSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -86,9 +85,8 @@ Response sixSync(@HostParam("endpoint") String endpoint, @HostParam("clien */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sixWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.six(this.client.getEndpoint(), this.client.getClient(), accept, - requestOptions, context)); + return FluxUtil.withContext( + context -> service.six(this.client.getEndpoint(), this.client.getClient(), requestOptions, context)); } /** @@ -103,8 +101,6 @@ public Mono> sixWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sixWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.sixSync(this.client.getEndpoint(), this.client.getClient(), accept, requestOptions, - Context.NONE); + return service.sixSync(this.client.getEndpoint(), this.client.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/client/structure/service/implementation/SecondClientImpl.java b/typespec-tests/src/main/java/com/client/structure/service/implementation/SecondClientImpl.java index 8b81a40577..89bb2a6ada 100644 --- a/typespec-tests/src/main/java/com/client/structure/service/implementation/SecondClientImpl.java +++ b/typespec-tests/src/main/java/com/client/structure/service/implementation/SecondClientImpl.java @@ -5,7 +5,6 @@ package com.client.structure.service.implementation; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; @@ -162,7 +161,7 @@ public interface SecondClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> five(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Post("/five") @ExpectedResponses({ 204 }) @@ -171,7 +170,7 @@ Mono> five(@HostParam("endpoint") String endpoint, @HostParam("cl @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response fiveSync(@HostParam("endpoint") String endpoint, @HostParam("client") String client, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); } /** @@ -186,9 +185,8 @@ Response fiveSync(@HostParam("endpoint") String endpoint, @HostParam("clie */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> fiveWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.five(this.getEndpoint(), this.getClient(), accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.five(this.getEndpoint(), this.getClient(), requestOptions, context)); } /** @@ -203,7 +201,6 @@ public Mono> fiveWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response fiveWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.fiveSync(this.getEndpoint(), this.getClient(), accept, requestOptions, Context.NONE); + return service.fiveSync(this.getEndpoint(), this.getClient(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/payload/multipart/implementation/FormDatasImpl.java b/typespec-tests/src/main/java/com/payload/multipart/implementation/FormDatasImpl.java index 23e72d60a6..9136290d42 100644 --- a/typespec-tests/src/main/java/com/payload/multipart/implementation/FormDatasImpl.java +++ b/typespec-tests/src/main/java/com/payload/multipart/implementation/FormDatasImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class FormDatasImpl { * The interface defining all the services for MultiPartClientFormDatas to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "MultiPartClientFormD") public interface FormDatasService { // @Multipart not supported by RestProxy @@ -64,8 +65,8 @@ public interface FormDatasService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> basic(@HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + Mono> basic(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -75,8 +76,9 @@ Mono> basic(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response basicSync(@HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + Response basicSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/complex-parts") @@ -85,8 +87,8 @@ Response basicSync(@HeaderParam("content-type") String contentType, @Heade @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> complex(@HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + Mono> complex(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -96,8 +98,8 @@ Mono> complex(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response complexSync(@HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + Response complexSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -107,8 +109,8 @@ Response complexSync(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> jsonPart(@HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + Mono> jsonPart(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -118,8 +120,8 @@ Mono> jsonPart(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response jsonPartSync(@HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + Response jsonPartSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -129,8 +131,8 @@ Response jsonPartSync(@HeaderParam("content-type") String contentType, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> binaryArrayParts(@HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + Mono> binaryArrayParts(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -140,8 +142,8 @@ Mono> binaryArrayParts(@HeaderParam("content-type") String conten @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response binaryArrayPartsSync(@HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + Response binaryArrayPartsSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -151,8 +153,8 @@ Response binaryArrayPartsSync(@HeaderParam("content-type") String contentT @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> multiBinaryParts(@HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + Mono> multiBinaryParts(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -162,8 +164,8 @@ Mono> multiBinaryParts(@HeaderParam("content-type") String conten @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response multiBinaryPartsSync(@HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + Response multiBinaryPartsSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -173,8 +175,8 @@ Response multiBinaryPartsSync(@HeaderParam("content-type") String contentT @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> checkFileNameAndContentType(@HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + Mono> checkFileNameAndContentType(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -184,8 +186,8 @@ Mono> checkFileNameAndContentType(@HeaderParam("content-type") St @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response checkFileNameAndContentTypeSync(@HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + Response checkFileNameAndContentTypeSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -195,9 +197,10 @@ Response checkFileNameAndContentTypeSync(@HeaderParam("content-type") Stri @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> anonymousModel(@HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData anonymousModelRequest, - RequestOptions requestOptions, Context context); + Mono> anonymousModel(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, + @BodyParam("multipart/form-data") BinaryData anonymousModelRequest, RequestOptions requestOptions, + Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/anonymous-model") @@ -206,9 +209,10 @@ Mono> anonymousModel(@HeaderParam("content-type") String contentT @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response anonymousModelSync(@HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData anonymousModelRequest, - RequestOptions requestOptions, Context context); + Response anonymousModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, + @BodyParam("multipart/form-data") BinaryData anonymousModelRequest, RequestOptions requestOptions, + Context context); // @Multipart not supported by RestProxy @Post("/multipart/form-data/check-filename-and-specific-content-type-with-httppart") @@ -217,8 +221,8 @@ Response anonymousModelSync(@HeaderParam("content-type") String contentTyp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> fileWithHttpPartSpecificContentType(@HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + Mono> fileWithHttpPartSpecificContentType(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -228,8 +232,8 @@ Mono> fileWithHttpPartSpecificContentType(@HeaderParam("content-t @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response fileWithHttpPartSpecificContentTypeSync(@HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + Response fileWithHttpPartSpecificContentTypeSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -239,8 +243,8 @@ Response fileWithHttpPartSpecificContentTypeSync(@HeaderParam("content-typ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> fileWithHttpPartRequiredContentType(@HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + Mono> fileWithHttpPartRequiredContentType(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -250,8 +254,8 @@ Mono> fileWithHttpPartRequiredContentType(@HeaderParam("content-t @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response fileWithHttpPartRequiredContentTypeSync(@HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + Response fileWithHttpPartRequiredContentTypeSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -261,8 +265,8 @@ Response fileWithHttpPartRequiredContentTypeSync(@HeaderParam("content-typ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> fileWithHttpPartOptionalContentType(@HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + Mono> fileWithHttpPartOptionalContentType(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -272,8 +276,8 @@ Mono> fileWithHttpPartOptionalContentType(@HeaderParam("content-t @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response fileWithHttpPartOptionalContentTypeSync(@HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + Response fileWithHttpPartOptionalContentTypeSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -283,8 +287,8 @@ Response fileWithHttpPartOptionalContentTypeSync(@HeaderParam("content-typ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> complexWithHttpPart(@HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + Mono> complexWithHttpPart(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); // @Multipart not supported by RestProxy @@ -294,8 +298,8 @@ Mono> complexWithHttpPart(@HeaderParam("content-type") String con @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response complexWithHttpPartSync(@HeaderParam("content-type") String contentType, - @HeaderParam("accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + Response complexWithHttpPartSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); } @@ -313,8 +317,8 @@ Response complexWithHttpPartSync(@HeaderParam("content-type") String conte @ServiceMethod(returns = ReturnType.SINGLE) public Mono> basicWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.basic(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.basic(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -331,8 +335,7 @@ public Mono> basicWithResponseAsync(BinaryData body, RequestOptio @ServiceMethod(returns = ReturnType.SINGLE) public Response basicWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.basicSync(contentType, accept, body, requestOptions, Context.NONE); + return service.basicSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -349,8 +352,8 @@ public Response basicWithResponse(BinaryData body, RequestOptions requestO @ServiceMethod(returns = ReturnType.SINGLE) public Mono> complexWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.complex(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.complex(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -367,8 +370,7 @@ public Mono> complexWithResponseAsync(BinaryData body, RequestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response complexWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.complexSync(contentType, accept, body, requestOptions, Context.NONE); + return service.complexSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -385,8 +387,8 @@ public Response complexWithResponse(BinaryData body, RequestOptions reques @ServiceMethod(returns = ReturnType.SINGLE) public Mono> jsonPartWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.jsonPart(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.jsonPart(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -403,8 +405,7 @@ public Mono> jsonPartWithResponseAsync(BinaryData body, RequestOp @ServiceMethod(returns = ReturnType.SINGLE) public Response jsonPartWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.jsonPartSync(contentType, accept, body, requestOptions, Context.NONE); + return service.jsonPartSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -421,9 +422,8 @@ public Response jsonPartWithResponse(BinaryData body, RequestOptions reque @ServiceMethod(returns = ReturnType.SINGLE) public Mono> binaryArrayPartsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.binaryArrayParts(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.binaryArrayParts(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -440,8 +440,7 @@ public Mono> binaryArrayPartsWithResponseAsync(BinaryData body, R @ServiceMethod(returns = ReturnType.SINGLE) public Response binaryArrayPartsWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.binaryArrayPartsSync(contentType, accept, body, requestOptions, Context.NONE); + return service.binaryArrayPartsSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -458,9 +457,8 @@ public Response binaryArrayPartsWithResponse(BinaryData body, RequestOptio @ServiceMethod(returns = ReturnType.SINGLE) public Mono> multiBinaryPartsWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.multiBinaryParts(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.multiBinaryParts(this.client.getEndpoint(), contentType, body, requestOptions, context)); } /** @@ -477,8 +475,7 @@ public Mono> multiBinaryPartsWithResponseAsync(BinaryData body, R @ServiceMethod(returns = ReturnType.SINGLE) public Response multiBinaryPartsWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.multiBinaryPartsSync(contentType, accept, body, requestOptions, Context.NONE); + return service.multiBinaryPartsSync(this.client.getEndpoint(), contentType, body, requestOptions, Context.NONE); } /** @@ -496,9 +493,8 @@ public Response multiBinaryPartsWithResponse(BinaryData body, RequestOptio public Mono> checkFileNameAndContentTypeWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.checkFileNameAndContentType(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.checkFileNameAndContentType(this.client.getEndpoint(), + contentType, body, requestOptions, context)); } /** @@ -515,8 +511,8 @@ public Mono> checkFileNameAndContentTypeWithResponseAsync(BinaryD @ServiceMethod(returns = ReturnType.SINGLE) public Response checkFileNameAndContentTypeWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.checkFileNameAndContentTypeSync(contentType, accept, body, requestOptions, Context.NONE); + return service.checkFileNameAndContentTypeSync(this.client.getEndpoint(), contentType, body, requestOptions, + Context.NONE); } /** @@ -534,9 +530,8 @@ public Response checkFileNameAndContentTypeWithResponse(BinaryData body, R public Mono> anonymousModelWithResponseAsync(BinaryData anonymousModelRequest, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.anonymousModel(contentType, accept, anonymousModelRequest, requestOptions, context)); + return FluxUtil.withContext(context -> service.anonymousModel(this.client.getEndpoint(), contentType, + anonymousModelRequest, requestOptions, context)); } /** @@ -553,8 +548,8 @@ public Mono> anonymousModelWithResponseAsync(BinaryData anonymous @ServiceMethod(returns = ReturnType.SINGLE) public Response anonymousModelWithResponse(BinaryData anonymousModelRequest, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.anonymousModelSync(contentType, accept, anonymousModelRequest, requestOptions, Context.NONE); + return service.anonymousModelSync(this.client.getEndpoint(), contentType, anonymousModelRequest, requestOptions, + Context.NONE); } /** @@ -572,9 +567,8 @@ public Response anonymousModelWithResponse(BinaryData anonymousModelReques public Mono> fileWithHttpPartSpecificContentTypeWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.fileWithHttpPartSpecificContentType(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.fileWithHttpPartSpecificContentType(this.client.getEndpoint(), + contentType, body, requestOptions, context)); } /** @@ -592,8 +586,8 @@ public Mono> fileWithHttpPartSpecificContentTypeWithResponseAsync public Response fileWithHttpPartSpecificContentTypeWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.fileWithHttpPartSpecificContentTypeSync(contentType, accept, body, requestOptions, Context.NONE); + return service.fileWithHttpPartSpecificContentTypeSync(this.client.getEndpoint(), contentType, body, + requestOptions, Context.NONE); } /** @@ -611,9 +605,8 @@ public Response fileWithHttpPartSpecificContentTypeWithResponse(BinaryData public Mono> fileWithHttpPartRequiredContentTypeWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.fileWithHttpPartRequiredContentType(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.fileWithHttpPartRequiredContentType(this.client.getEndpoint(), + contentType, body, requestOptions, context)); } /** @@ -631,8 +624,8 @@ public Mono> fileWithHttpPartRequiredContentTypeWithResponseAsync public Response fileWithHttpPartRequiredContentTypeWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.fileWithHttpPartRequiredContentTypeSync(contentType, accept, body, requestOptions, Context.NONE); + return service.fileWithHttpPartRequiredContentTypeSync(this.client.getEndpoint(), contentType, body, + requestOptions, Context.NONE); } /** @@ -650,9 +643,8 @@ public Response fileWithHttpPartRequiredContentTypeWithResponse(BinaryData public Mono> fileWithHttpPartOptionalContentTypeWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.fileWithHttpPartOptionalContentType(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.fileWithHttpPartOptionalContentType(this.client.getEndpoint(), + contentType, body, requestOptions, context)); } /** @@ -670,8 +662,8 @@ public Mono> fileWithHttpPartOptionalContentTypeWithResponseAsync public Response fileWithHttpPartOptionalContentTypeWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.fileWithHttpPartOptionalContentTypeSync(contentType, accept, body, requestOptions, Context.NONE); + return service.fileWithHttpPartOptionalContentTypeSync(this.client.getEndpoint(), contentType, body, + requestOptions, Context.NONE); } /** @@ -688,9 +680,8 @@ public Response fileWithHttpPartOptionalContentTypeWithResponse(BinaryData @ServiceMethod(returns = ReturnType.SINGLE) public Mono> complexWithHttpPartWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.complexWithHttpPart(contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.complexWithHttpPart(this.client.getEndpoint(), contentType, body, + requestOptions, context)); } /** @@ -707,7 +698,7 @@ public Mono> complexWithHttpPartWithResponseAsync(BinaryData body @ServiceMethod(returns = ReturnType.SINGLE) public Response complexWithHttpPartWithResponse(BinaryData body, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.complexWithHttpPartSync(contentType, accept, body, requestOptions, Context.NONE); + return service.complexWithHttpPartSync(this.client.getEndpoint(), contentType, body, requestOptions, + Context.NONE); } } From c007e8225c52dfd4c53446fd7ea0785ddeee8d74 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Tue, 13 Aug 2024 14:48:08 +0800 Subject: [PATCH 63/90] fix --- typespec-extension/src/code-model-builder.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index b17f421f1e..365e48ca73 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -269,7 +269,7 @@ export class CodeModelBuilder { return this.codeModel; } - private processHostParametersFromSdkType(sdkPathParameters: SdkPathParameter[]): Parameter[] { + private processHostParameters(sdkPathParameters: SdkPathParameter[]): Parameter[] { const hostParameters: Parameter[] = []; let parameter; sdkPathParameters.forEach((arg) => { @@ -551,7 +551,7 @@ export class CodeModelBuilder { throw new Error("unexpected endpoint parameter type"); } - hostParameters = this.processHostParametersFromSdkType(sdkPathParameters); + hostParameters = this.processHostParameters(sdkPathParameters); codeModelClient.addGlobalParameters(hostParameters); } }); From f5626c1f260c6d758f7ec080d7b6d385a497b17b Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Tue, 13 Aug 2024 15:39:57 +0800 Subject: [PATCH 64/90] update function name according to comments --- typespec-extension/src/code-model-builder.ts | 21 +++++++++----------- typespec-extension/src/operation-utils.ts | 12 +++++------ 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 365e48ca73..7703a3d3d4 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -136,9 +136,9 @@ import { isKnownContentType, isLroNewPollingStrategy, isPayloadProperty, - sdkHttpOperationIsJsonMergePatch, - sdkHttpOperationIsMultipart, - sdkHttpOperationIsMultipleContentTypes, + operationIsJsonMergePatch, + operationIsMultipart, + operationIsMultipleContentTypes, } from "./operation-utils.js"; import { PreNamer } from "./prenamer/prenamer.js"; import { @@ -749,21 +749,18 @@ export class CodeModelBuilder { let apiComment: string | undefined = undefined; if (generateConvenienceApi) { // check if the convenience API need to be disabled for some special cases - if (sdkHttpOperationIsMultipart(httpOperation)) { + if (operationIsMultipart(httpOperation)) { // do not generate protocol method for multipart/form-data, as it be very hard for user to prepare the request body as BinaryData generateProtocolApi = false; apiComment = `Protocol API requires serialization of parts with content-disposition and data, as operation '${operationName}' is 'multipart/form-data'`; this.logWarning(apiComment); - } else if (sdkHttpOperationIsMultipleContentTypes(httpOperation)) { + } else if (operationIsMultipleContentTypes(httpOperation)) { // and multiple content types // issue link: https://github.com/Azure/autorest.java/issues/1958#issuecomment-1562558219 generateConvenienceApi = false; apiComment = `Convenience API is not generated, as operation '${operationName}' is multiple content-type`; this.logWarning(apiComment); - } else if ( - sdkHttpOperationIsJsonMergePatch(httpOperation) && - this.options["stream-style-serialization"] === false - ) { + } else if (operationIsJsonMergePatch(httpOperation) && this.options["stream-style-serialization"] === false) { // do not generate convenient method for json merge patch operation if stream-style-serialization is not enabled generateConvenienceApi = false; apiComment = `Convenience API is not generated, as operation '${operationName}' is 'application/merge-patch+json' and stream-style-serialization is not enabled`; @@ -1322,10 +1319,10 @@ export class CodeModelBuilder { this.trackSchemaUsage(schema, { usage: [op.internalApi ? SchemaContext.Internal : SchemaContext.Public] }); } - if (sdkHttpOperationIsJsonMergePatch(sdkHttpOperation)) { + if (operationIsJsonMergePatch(sdkHttpOperation)) { this.trackSchemaUsage(schema, { usage: [SchemaContext.JsonMergePatch] }); } - if (op.convenienceApi && sdkHttpOperationIsMultipart(sdkHttpOperation)) { + if (op.convenienceApi && operationIsMultipart(sdkHttpOperation)) { this.trackSchemaUsage(schema, { serializationFormats: [KnownMediaType.Multipart] }); } @@ -1344,7 +1341,7 @@ export class CodeModelBuilder { parameter.language.default.name = "request"; } - if (sdkHttpOperationIsJsonMergePatch(sdkHttpOperation)) { + if (operationIsJsonMergePatch(sdkHttpOperation)) { // skip model flatten, if "application/merge-patch+json" schema.language.default.name = pascalCase(op.language.default.name) + "PatchRequest"; return; diff --git a/typespec-extension/src/operation-utils.ts b/typespec-extension/src/operation-utils.ts index adbcaa84e2..488f178f35 100644 --- a/typespec-extension/src/operation-utils.ts +++ b/typespec-extension/src/operation-utils.ts @@ -42,15 +42,15 @@ export function isKnownContentType(contentTypes: string[]): boolean { }); } -export function sdkHttpOperationIsJsonMergePatch(op: SdkHttpOperation): boolean { - return sdkHttpOperationIsContentType(op, "application/merge-patch+json"); +export function operationIsJsonMergePatch(op: SdkHttpOperation): boolean { + return operationIsContentType(op, "application/merge-patch+json"); } -export function sdkHttpOperationIsMultipart(op: SdkHttpOperation): boolean { - return sdkHttpOperationIsContentType(op, "multipart/form-data"); +export function operationIsMultipart(op: SdkHttpOperation): boolean { + return operationIsContentType(op, "multipart/form-data"); } -function sdkHttpOperationIsContentType(op: SdkHttpOperation, contentType: string): boolean { +function operationIsContentType(op: SdkHttpOperation, contentType: string): boolean { for (const param of op.parameters) { if (param.kind === "header" && param.serializedName.toLowerCase() === CONTENT_TYPE_KEY) { if (param.type.kind === "constant" && param.type.value === contentType) { @@ -61,7 +61,7 @@ function sdkHttpOperationIsContentType(op: SdkHttpOperation, contentType: string return false; } -export function sdkHttpOperationIsMultipleContentTypes(op: SdkHttpOperation): boolean { +export function operationIsMultipleContentTypes(op: SdkHttpOperation): boolean { if ( op.parameters && op.parameters.some( From dabfd8f472707d40bfd2cd1551e6263092505b2c Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Wed, 14 Aug 2024 11:16:40 +0800 Subject: [PATCH 65/90] add param location check --- typespec-extension/src/code-model-builder.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 7703a3d3d4..bb3ca9a269 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -795,7 +795,7 @@ export class CodeModelBuilder { // path/query/header parameters for (const param of httpOperation.parameters) { // if it's paged operation with request body, skip content-type header added by TCGC, as next link call should not have content type header - if ((sdkMethod.kind === "paging" || sdkMethod.kind === "lropaging") && httpOperation.bodyParam) { + if ((sdkMethod.kind === "paging" || sdkMethod.kind === "lropaging") && httpOperation.bodyParam && param.kind === "header") { if (param.serializedName.toLocaleLowerCase() === "content-type") { continue; } From e5b66c8484d8afe9b7c7ff699a12bd6f565bc0f4 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Wed, 14 Aug 2024 17:17:17 +0800 Subject: [PATCH 66/90] update according to comments --- typespec-extension/src/code-model-builder.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index bb3ca9a269..612ad50886 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -542,13 +542,11 @@ export class CodeModelBuilder { } } } else { - throw new Error("multiple server url defined for one client is not supported yet"); + throw new Error("Multiple server url defined for one client is not supported yet."); } } else if (initializationProperty.type.kind === "endpoint") { sdkPathParameters = initializationProperty.type.templateArguments; baseUri = initializationProperty.type.serverUrl; - } else { - throw new Error("unexpected endpoint parameter type"); } hostParameters = this.processHostParameters(sdkPathParameters); @@ -795,7 +793,11 @@ export class CodeModelBuilder { // path/query/header parameters for (const param of httpOperation.parameters) { // if it's paged operation with request body, skip content-type header added by TCGC, as next link call should not have content type header - if ((sdkMethod.kind === "paging" || sdkMethod.kind === "lropaging") && httpOperation.bodyParam && param.kind === "header") { + if ( + (sdkMethod.kind === "paging" || sdkMethod.kind === "lropaging") && + httpOperation.bodyParam && + param.kind === "header" + ) { if (param.serializedName.toLocaleLowerCase() === "content-type") { continue; } From 42f4eaeba299f25d195ea50c665df54361fbc074 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Wed, 14 Aug 2024 17:17:32 +0800 Subject: [PATCH 67/90] handle param.onClient --- typespec-extension/src/code-model-builder.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 612ad50886..7194a9c557 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -1116,9 +1116,11 @@ export class CodeModelBuilder { } const nullable = param.type.kind === "nullable"; + const onClient = param.onClient; + const implementationLocation = onClient ? ImplementationLocation.Client : ImplementationLocation.Method; const parameter = new Parameter(param.name, param.details ?? "", schema, { summary: param.description, - implementation: ImplementationLocation.Method, + implementation: implementationLocation, required: !param.optional, nullable: nullable, protocol: { @@ -1134,7 +1136,11 @@ export class CodeModelBuilder { }, extensions: extensions, }); - op.addParameter(parameter); + if (onClient) { + clientContext.addGlobalParameter(parameter); + } else { + op.addParameter(parameter); + } this.trackSchemaUsage(schema, { usage: [SchemaContext.Input] }); From 8352f12eeb2fb26e3363678910d9582e606493c0 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Wed, 14 Aug 2024 17:19:07 +0800 Subject: [PATCH 68/90] update method to use shorter name --- typespec-extension/src/code-model-builder.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 7194a9c557..2ed7c98691 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -738,7 +738,7 @@ export class CodeModelBuilder { (codeModelOperation as CrossLanguageDefinition).crossLanguageDefinitionId = sdkMethod.crossLanguageDefintionId; codeModelOperation.internalApi = sdkMethod.access === "internal"; - const convenienceApiName = this.getConvenienceApiNameFromServiceMethod(sdkMethod); + const convenienceApiName = this.getConvenienceApiName(sdkMethod); let generateConvenienceApi: boolean = Boolean(convenienceApiName); let generateProtocolApi: boolean = sdkMethod.__raw ? shouldGenerateProtocol(this.sdkContext, sdkMethod.__raw) @@ -2289,7 +2289,7 @@ export class CodeModelBuilder { } } - private getConvenienceApiNameFromServiceMethod(sdkMethod: SdkServiceMethod): string | undefined { + private getConvenienceApiName(sdkMethod: SdkServiceMethod): string | undefined { // check @convenienceAPI if (sdkMethod.generateConvenient) { return sdkMethod.name; From 733f220c7480038c9557458c3efaa28686cf488e Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Fri, 16 Aug 2024 17:43:07 +0800 Subject: [PATCH 69/90] apply the bug fix --- typespec-extension/src/code-model-builder.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 8367a62774..9ffb054ea2 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -1461,13 +1461,14 @@ export class CodeModelBuilder { ) { const serializedName = opParameter.serializedName; let existParameter: Parameter | undefined; - if (opParameter.kind !== "property") { + // if (opParameter.kind !== "property") { // property of body, only check parameter location as there could only be 1 body in operation // existParameter = op.parameters?.find((it) => it.protocol.http?.in === ParameterLocation.Body); // } else { - // header/query/path, same location - existParameter = op.parameters?.find((it) => it.protocol.http?.in === opParameter.kind && it.language.default.serializedName === serializedName); - } + // header/query/path, same location and same serializedName + // existParameter = op.parameters?.find((it) => it.protocol.http?.in === opParameter.kind && it.language.default.serializedName === serializedName); + // } + existParameter = op.parameters?.find((it) => it.language.default.serializedName === serializedName); request.parameters = request.parameters ?? []; if (existParameter) { // parameter From a0d6c98bc30f125b4c8b6c385cf2b3cc00b78dde Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 19 Aug 2024 10:34:01 +0800 Subject: [PATCH 70/90] regen --- .../FlattenPropertyClientBuilder.java | 26 ++++++-- .../FlattenPropertyClientImpl.java | 60 ++++++++++++++----- .../TopLevelTrackedResourcesClientImpl.java | 58 +++++++++++------- .../encode/numeric/NumericClientBuilder.java | 24 +++++++- .../implementation/NumericClientImpl.java | 29 +++++++-- .../implementation/PropertiesImpl.java | 31 +++++++--- .../notversioned/NotVersionedAsyncClient.java | 22 +++---- .../notversioned/NotVersionedClient.java | 22 +++---- .../NotVersionedClientBuilder.java | 23 ++++++- .../NotVersionedClientImpl.java | 48 +++++++++------ .../FlattenPropertyClientTestBase.java | 8 ++- .../generated/NumericClientTestBase.java | 5 +- .../generated/NotVersionedClientTestBase.java | 1 + 13 files changed, 249 insertions(+), 108 deletions(-) diff --git a/typespec-tests/src/main/java/com/azure/clientgenerator/core/flattenproperty/FlattenPropertyClientBuilder.java b/typespec-tests/src/main/java/com/azure/clientgenerator/core/flattenproperty/FlattenPropertyClientBuilder.java index 422c23abbd..08b80bc950 100644 --- a/typespec-tests/src/main/java/com/azure/clientgenerator/core/flattenproperty/FlattenPropertyClientBuilder.java +++ b/typespec-tests/src/main/java/com/azure/clientgenerator/core/flattenproperty/FlattenPropertyClientBuilder.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,8 +41,8 @@ * A builder for creating a new instance of the FlattenPropertyClient type. */ @ServiceClientBuilder(serviceClients = { FlattenPropertyClient.class, FlattenPropertyAsyncClient.class }) -public final class FlattenPropertyClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class FlattenPropertyClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -173,6 +174,22 @@ public FlattenPropertyClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FlattenPropertyClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -200,8 +217,9 @@ public FlattenPropertyClientBuilder retryPolicy(RetryPolicy retryPolicy) { private FlattenPropertyClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FlattenPropertyClientImpl client - = new FlattenPropertyClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; + FlattenPropertyClientImpl client = new FlattenPropertyClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } diff --git a/typespec-tests/src/main/java/com/azure/clientgenerator/core/flattenproperty/implementation/FlattenPropertyClientImpl.java b/typespec-tests/src/main/java/com/azure/clientgenerator/core/flattenproperty/implementation/FlattenPropertyClientImpl.java index 18de092add..7444598c17 100644 --- a/typespec-tests/src/main/java/com/azure/clientgenerator/core/flattenproperty/implementation/FlattenPropertyClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/clientgenerator/core/flattenproperty/implementation/FlattenPropertyClientImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -40,6 +41,20 @@ public final class FlattenPropertyClientImpl { */ private final FlattenPropertyClientService service; + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -70,19 +85,22 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of FlattenPropertyClient client. + * + * @param endpoint Service host. */ - public FlattenPropertyClientImpl() { + public FlattenPropertyClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of FlattenPropertyClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public FlattenPropertyClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public FlattenPropertyClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -90,10 +108,12 @@ public FlattenPropertyClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public FlattenPropertyClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public FlattenPropertyClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.service = RestProxy.create(FlattenPropertyClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -102,7 +122,7 @@ public FlattenPropertyClientImpl(HttpPipeline httpPipeline, SerializerAdapter se * The interface defining all the services for FlattenPropertyClient to be used by the proxy service to perform REST * calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "FlattenPropertyClien") public interface FlattenPropertyClientService { @Put("/azure/client-generator-core/flatten-property/flattenModel") @@ -111,7 +131,8 @@ public interface FlattenPropertyClientService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putFlattenModel(@HeaderParam("accept") String accept, + Mono> putFlattenModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/azure/client-generator-core/flatten-property/flattenModel") @@ -120,7 +141,8 @@ Mono> putFlattenModel(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putFlattenModelSync(@HeaderParam("accept") String accept, + Response putFlattenModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/azure/client-generator-core/flatten-property/nestedFlattenModel") @@ -129,7 +151,8 @@ Response putFlattenModelSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putNestedFlattenModel(@HeaderParam("accept") String accept, + Mono> putNestedFlattenModel(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); @Put("/azure/client-generator-core/flatten-property/nestedFlattenModel") @@ -138,7 +161,8 @@ Mono> putNestedFlattenModel(@HeaderParam("accept") String a @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putNestedFlattenModelSync(@HeaderParam("accept") String accept, + Response putNestedFlattenModelSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData input, RequestOptions requestOptions, Context context); } @@ -180,8 +204,10 @@ Response putNestedFlattenModelSync(@HeaderParam("accept") String acc @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putFlattenModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putFlattenModel(accept, input, requestOptions, context)); + return FluxUtil.withContext(context -> service.putFlattenModel(this.getEndpoint(), contentType, accept, input, + requestOptions, context)); } /** @@ -220,8 +246,10 @@ public Mono> putFlattenModelWithResponseAsync(BinaryData in */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putFlattenModelWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.putFlattenModelSync(accept, input, requestOptions, Context.NONE); + return service.putFlattenModelSync(this.getEndpoint(), contentType, accept, input, requestOptions, + Context.NONE); } /** @@ -268,8 +296,10 @@ public Response putFlattenModelWithResponse(BinaryData input, Reques @ServiceMethod(returns = ReturnType.SINGLE) public Mono> putNestedFlattenModelWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.putNestedFlattenModel(accept, input, requestOptions, context)); + return FluxUtil.withContext(context -> service.putNestedFlattenModel(this.getEndpoint(), contentType, accept, + input, requestOptions, context)); } /** @@ -314,7 +344,9 @@ public Mono> putNestedFlattenModelWithResponseAsync(BinaryD */ @ServiceMethod(returns = ReturnType.SINGLE) public Response putNestedFlattenModelWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.putNestedFlattenModelSync(accept, input, requestOptions, Context.NONE); + return service.putNestedFlattenModelSync(this.getEndpoint(), contentType, accept, input, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java index 7250350c1b..4ce32888f2 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/implementation/TopLevelTrackedResourcesClientImpl.java @@ -81,9 +81,8 @@ Mono> getByResourceGroup(@HostParam("endp @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) @@ -91,10 +90,9 @@ Mono>> createOrReplace(@HostParam("endpoint") String e @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @HeaderParam("accept") String accept, @BodyParam("application/json") TopLevelTrackedResourceInner resource, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") TopLevelTrackedResourceInner resource, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) @@ -102,7 +100,7 @@ Mono>> update(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @HeaderParam("accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") TopLevelTrackedResourceInner properties, Context context); @Headers({ "Content-Type: application/json" }) @@ -113,7 +111,7 @@ Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources") @@ -121,7 +119,7 @@ Mono>> delete(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -130,9 +128,8 @@ Mono> listByResourceGroup(@HostParam @UnexpectedResponseExceptionType(ManagementException.class) Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/topLevelTrackedResources/{topLevelTrackedResourceName}/actionSync") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(ManagementException.class) @@ -140,8 +137,8 @@ Mono> actionSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("topLevelTrackedResourceName") String topLevelTrackedResourceName, - @HeaderParam("accept") String accept, @BodyParam("application/json") NotificationDetails body, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") NotificationDetails body, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -149,7 +146,7 @@ Mono> actionSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -157,7 +154,7 @@ Mono> listByResourceGroupNext( @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** @@ -318,11 +315,12 @@ private Mono>> createOrReplaceWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, resource, - context)) + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, contentType, accept, + resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -363,10 +361,12 @@ private Mono>> createOrReplaceWithResponseAsync(String } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, resource, context); + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, contentType, accept, + resource, context); } /** @@ -566,11 +566,12 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, properties, - context)) + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, contentType, accept, + properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -611,10 +612,11 @@ private Mono>> updateWithResponseAsync(String resource } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, topLevelTrackedResourceName, accept, properties, context); + resourceGroupName, topLevelTrackedResourceName, contentType, accept, properties, context); } /** @@ -1262,10 +1264,12 @@ private Mono> actionSyncWithResponseAsync(String resourceGroupNam } else { body.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.actionSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, body, context)) + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, contentType, accept, + body, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1305,10 +1309,12 @@ private Mono> actionSyncWithResponseAsync(String resourceGroupNam } else { body.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.actionSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, accept, body, context); + this.client.getSubscriptionId(), resourceGroupName, topLevelTrackedResourceName, contentType, accept, body, + context); } /** @@ -1363,6 +1369,8 @@ public void actionSync(String resourceGroupName, String topLevelTrackedResourceN } /** + * List TopLevelTrackedResource resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1391,6 +1399,8 @@ private Mono> listByResourceGroupNex } /** + * List TopLevelTrackedResource resources by resource group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1419,6 +1429,8 @@ private Mono> listByResourceGroupNex } /** + * List TopLevelTrackedResource resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1447,6 +1459,8 @@ private Mono> listBySubscriptionNext } /** + * List TopLevelTrackedResource resources by subscription ID + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/typespec-tests/src/main/java/com/encode/numeric/NumericClientBuilder.java b/typespec-tests/src/main/java/com/encode/numeric/NumericClientBuilder.java index 10b5459239..e227406f3c 100644 --- a/typespec-tests/src/main/java/com/encode/numeric/NumericClientBuilder.java +++ b/typespec-tests/src/main/java/com/encode/numeric/NumericClientBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -40,8 +41,8 @@ * A builder for creating a new instance of the NumericClient type. */ @ServiceClientBuilder(serviceClients = { NumericClient.class, NumericAsyncClient.class }) -public final class NumericClientBuilder - implements HttpTrait, ConfigurationTrait { +public final class NumericClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -172,6 +173,22 @@ public NumericClientBuilder configuration(Configuration configuration) { return this; } + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public NumericClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -199,8 +216,9 @@ public NumericClientBuilder retryPolicy(RetryPolicy retryPolicy) { private NumericClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; NumericClientImpl client - = new NumericClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + = new NumericClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } diff --git a/typespec-tests/src/main/java/com/encode/numeric/implementation/NumericClientImpl.java b/typespec-tests/src/main/java/com/encode/numeric/implementation/NumericClientImpl.java index 233fd3eaa9..8f00a5a257 100644 --- a/typespec-tests/src/main/java/com/encode/numeric/implementation/NumericClientImpl.java +++ b/typespec-tests/src/main/java/com/encode/numeric/implementation/NumericClientImpl.java @@ -15,6 +15,20 @@ * Initializes a new instance of the NumericClient type. */ public final class NumericClientImpl { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + /** * The HTTP pipeline to send requests through. */ @@ -59,19 +73,22 @@ public PropertiesImpl getProperties() { /** * Initializes an instance of NumericClient client. + * + * @param endpoint Service host. */ - public NumericClientImpl() { + public NumericClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter()); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** * Initializes an instance of NumericClient client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. */ - public NumericClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + public NumericClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -79,10 +96,12 @@ public NumericClientImpl(HttpPipeline httpPipeline) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. */ - public NumericClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter) { + public NumericClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; this.properties = new PropertiesImpl(this); } } diff --git a/typespec-tests/src/main/java/com/encode/numeric/implementation/PropertiesImpl.java b/typespec-tests/src/main/java/com/encode/numeric/implementation/PropertiesImpl.java index 5122f7a0ac..072d8ed024 100644 --- a/typespec-tests/src/main/java/com/encode/numeric/implementation/PropertiesImpl.java +++ b/typespec-tests/src/main/java/com/encode/numeric/implementation/PropertiesImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -54,7 +55,7 @@ public final class PropertiesImpl { * The interface defining all the services for NumericClientProperties to be used by the proxy service to perform * REST calls. */ - @Host("http://localhost:3000") + @Host("{endpoint}") @ServiceInterface(name = "NumericClientPropert") public interface PropertiesService { @Post("/encode/numeric/property/safeint") @@ -63,7 +64,8 @@ public interface PropertiesService { @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> safeintAsString(@HeaderParam("accept") String accept, + Mono> safeintAsString(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/numeric/property/safeint") @@ -72,7 +74,8 @@ Mono> safeintAsString(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response safeintAsStringSync(@HeaderParam("accept") String accept, + Response safeintAsStringSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/numeric/property/uint32") @@ -81,7 +84,8 @@ Response safeintAsStringSync(@HeaderParam("accept") String accept, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> uint32AsStringOptional(@HeaderParam("accept") String accept, + Mono> uint32AsStringOptional(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/encode/numeric/property/uint32") @@ -90,7 +94,8 @@ Mono> uint32AsStringOptional(@HeaderParam("accept") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response uint32AsStringOptionalSync(@HeaderParam("accept") String accept, + Response uint32AsStringOptionalSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); } @@ -122,8 +127,10 @@ Response uint32AsStringOptionalSync(@HeaderParam("accept") String ac */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> safeintAsStringWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.safeintAsString(accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.safeintAsString(this.client.getEndpoint(), contentType, accept, + body, requestOptions, context)); } /** @@ -154,8 +161,10 @@ public Mono> safeintAsStringWithResponseAsync(BinaryData bo */ @ServiceMethod(returns = ReturnType.SINGLE) public Response safeintAsStringWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.safeintAsStringSync(accept, body, requestOptions, Context.NONE); + return service.safeintAsStringSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } /** @@ -187,8 +196,10 @@ public Response safeintAsStringWithResponse(BinaryData body, Request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> uint32AsStringOptionalWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.uint32AsStringOptional(accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.uint32AsStringOptional(this.client.getEndpoint(), contentType, + accept, body, requestOptions, context)); } /** @@ -219,7 +230,9 @@ public Mono> uint32AsStringOptionalWithResponseAsync(Binary */ @ServiceMethod(returns = ReturnType.SINGLE) public Response uint32AsStringOptionalWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.uint32AsStringOptionalSync(accept, body, requestOptions, Context.NONE); + return service.uint32AsStringOptionalSync(this.client.getEndpoint(), contentType, accept, body, requestOptions, + Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/server/versions/notversioned/NotVersionedAsyncClient.java b/typespec-tests/src/main/java/com/server/versions/notversioned/NotVersionedAsyncClient.java index 9b8a616fab..5e2a2352ee 100644 --- a/typespec-tests/src/main/java/com/server/versions/notversioned/NotVersionedAsyncClient.java +++ b/typespec-tests/src/main/java/com/server/versions/notversioned/NotVersionedAsyncClient.java @@ -55,7 +55,6 @@ public Mono> withoutApiVersionWithResponse(RequestOptions request /** * The withQueryApiVersion operation. * - * @param apiVersion The apiVersion parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -65,14 +64,13 @@ public Mono> withoutApiVersionWithResponse(RequestOptions request */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> withQueryApiVersionWithResponse(String apiVersion, RequestOptions requestOptions) { - return this.serviceClient.withQueryApiVersionWithResponseAsync(apiVersion, requestOptions); + public Mono> withQueryApiVersionWithResponse(RequestOptions requestOptions) { + return this.serviceClient.withQueryApiVersionWithResponseAsync(requestOptions); } /** * The withPathApiVersion operation. * - * @param apiVersion The apiVersion parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -82,8 +80,8 @@ public Mono> withQueryApiVersionWithResponse(String apiVersion, R */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> withPathApiVersionWithResponse(String apiVersion, RequestOptions requestOptions) { - return this.serviceClient.withPathApiVersionWithResponseAsync(apiVersion, requestOptions); + public Mono> withPathApiVersionWithResponse(RequestOptions requestOptions) { + return this.serviceClient.withPathApiVersionWithResponseAsync(requestOptions); } /** @@ -107,8 +105,6 @@ public Mono withoutApiVersion() { /** * The withQueryApiVersion operation. * - * @param apiVersion The apiVersion parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. @@ -118,17 +114,15 @@ public Mono withoutApiVersion() { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono withQueryApiVersion(String apiVersion) { + public Mono withQueryApiVersion() { // Generated convenience method for withQueryApiVersionWithResponse RequestOptions requestOptions = new RequestOptions(); - return withQueryApiVersionWithResponse(apiVersion, requestOptions).flatMap(FluxUtil::toMono); + return withQueryApiVersionWithResponse(requestOptions).flatMap(FluxUtil::toMono); } /** * The withPathApiVersion operation. * - * @param apiVersion The apiVersion parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. @@ -138,9 +132,9 @@ public Mono withQueryApiVersion(String apiVersion) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono withPathApiVersion(String apiVersion) { + public Mono withPathApiVersion() { // Generated convenience method for withPathApiVersionWithResponse RequestOptions requestOptions = new RequestOptions(); - return withPathApiVersionWithResponse(apiVersion, requestOptions).flatMap(FluxUtil::toMono); + return withPathApiVersionWithResponse(requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/typespec-tests/src/main/java/com/server/versions/notversioned/NotVersionedClient.java b/typespec-tests/src/main/java/com/server/versions/notversioned/NotVersionedClient.java index 291982cfa0..eba1aea904 100644 --- a/typespec-tests/src/main/java/com/server/versions/notversioned/NotVersionedClient.java +++ b/typespec-tests/src/main/java/com/server/versions/notversioned/NotVersionedClient.java @@ -53,7 +53,6 @@ public Response withoutApiVersionWithResponse(RequestOptions requestOption /** * The withQueryApiVersion operation. * - * @param apiVersion The apiVersion parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -63,14 +62,13 @@ public Response withoutApiVersionWithResponse(RequestOptions requestOption */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response withQueryApiVersionWithResponse(String apiVersion, RequestOptions requestOptions) { - return this.serviceClient.withQueryApiVersionWithResponse(apiVersion, requestOptions); + public Response withQueryApiVersionWithResponse(RequestOptions requestOptions) { + return this.serviceClient.withQueryApiVersionWithResponse(requestOptions); } /** * The withPathApiVersion operation. * - * @param apiVersion The apiVersion parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -80,8 +78,8 @@ public Response withQueryApiVersionWithResponse(String apiVersion, Request */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response withPathApiVersionWithResponse(String apiVersion, RequestOptions requestOptions) { - return this.serviceClient.withPathApiVersionWithResponse(apiVersion, requestOptions); + public Response withPathApiVersionWithResponse(RequestOptions requestOptions) { + return this.serviceClient.withPathApiVersionWithResponse(requestOptions); } /** @@ -104,8 +102,6 @@ public void withoutApiVersion() { /** * The withQueryApiVersion operation. * - * @param apiVersion The apiVersion parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. @@ -114,17 +110,15 @@ public void withoutApiVersion() { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void withQueryApiVersion(String apiVersion) { + public void withQueryApiVersion() { // Generated convenience method for withQueryApiVersionWithResponse RequestOptions requestOptions = new RequestOptions(); - withQueryApiVersionWithResponse(apiVersion, requestOptions).getValue(); + withQueryApiVersionWithResponse(requestOptions).getValue(); } /** * The withPathApiVersion operation. * - * @param apiVersion The apiVersion parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. @@ -133,9 +127,9 @@ public void withQueryApiVersion(String apiVersion) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void withPathApiVersion(String apiVersion) { + public void withPathApiVersion() { // Generated convenience method for withPathApiVersionWithResponse RequestOptions requestOptions = new RequestOptions(); - withPathApiVersionWithResponse(apiVersion, requestOptions).getValue(); + withPathApiVersionWithResponse(requestOptions).getValue(); } } diff --git a/typespec-tests/src/main/java/com/server/versions/notversioned/NotVersionedClientBuilder.java b/typespec-tests/src/main/java/com/server/versions/notversioned/NotVersionedClientBuilder.java index a45cce4ea5..a05fd57893 100644 --- a/typespec-tests/src/main/java/com/server/versions/notversioned/NotVersionedClientBuilder.java +++ b/typespec-tests/src/main/java/com/server/versions/notversioned/NotVersionedClientBuilder.java @@ -190,6 +190,24 @@ public NotVersionedClientBuilder endpoint(String endpoint) { return this; } + /* + * + */ + @Generated + private String apiVersion; + + /** + * Sets. + * + * @param apiVersion the apiVersion value. + * @return the NotVersionedClientBuilder. + */ + @Generated + public NotVersionedClientBuilder apiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -217,8 +235,8 @@ public NotVersionedClientBuilder retryPolicy(RetryPolicy retryPolicy) { private NotVersionedClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - NotVersionedClientImpl client - = new NotVersionedClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + NotVersionedClientImpl client = new NotVersionedClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, this.apiVersion); return client; } @@ -227,6 +245,7 @@ private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + Objects.requireNonNull(apiVersion, "'apiVersion' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/server/versions/notversioned/implementation/NotVersionedClientImpl.java b/typespec-tests/src/main/java/com/server/versions/notversioned/implementation/NotVersionedClientImpl.java index eff9b16d95..e989cd1859 100644 --- a/typespec-tests/src/main/java/com/server/versions/notversioned/implementation/NotVersionedClientImpl.java +++ b/typespec-tests/src/main/java/com/server/versions/notversioned/implementation/NotVersionedClientImpl.java @@ -54,6 +54,19 @@ public String getEndpoint() { return this.endpoint; } + /** + */ + private final String apiVersion; + + /** + * Gets. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + /** * The HTTP pipeline to send requests through. */ @@ -86,10 +99,11 @@ public SerializerAdapter getSerializerAdapter() { * Initializes an instance of NotVersionedClient client. * * @param endpoint Need to be set as 'http://localhost:3000' in client. + * @param apiVersion */ - public NotVersionedClientImpl(String endpoint) { + public NotVersionedClientImpl(String endpoint, String apiVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion); } /** @@ -97,9 +111,10 @@ public NotVersionedClientImpl(String endpoint) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param endpoint Need to be set as 'http://localhost:3000' in client. + * @param apiVersion */ - public NotVersionedClientImpl(HttpPipeline httpPipeline, String endpoint) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); + public NotVersionedClientImpl(HttpPipeline httpPipeline, String endpoint, String apiVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion); } /** @@ -108,11 +123,14 @@ public NotVersionedClientImpl(HttpPipeline httpPipeline, String endpoint) { * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param endpoint Need to be set as 'http://localhost:3000' in client. + * @param apiVersion */ - public NotVersionedClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { + public NotVersionedClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, + String apiVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; + this.apiVersion = apiVersion; this.service = RestProxy.create(NotVersionedClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -212,7 +230,6 @@ public Response withoutApiVersionWithResponse(RequestOptions requestOption /** * The withQueryApiVersion operation. * - * @param apiVersion The apiVersion parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -221,15 +238,14 @@ public Response withoutApiVersionWithResponse(RequestOptions requestOption * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> withQueryApiVersionWithResponseAsync(String apiVersion, RequestOptions requestOptions) { + public Mono> withQueryApiVersionWithResponseAsync(RequestOptions requestOptions) { return FluxUtil.withContext( - context -> service.withQueryApiVersion(this.getEndpoint(), apiVersion, requestOptions, context)); + context -> service.withQueryApiVersion(this.getEndpoint(), this.getApiVersion(), requestOptions, context)); } /** * The withQueryApiVersion operation. * - * @param apiVersion The apiVersion parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -238,14 +254,13 @@ public Mono> withQueryApiVersionWithResponseAsync(String apiVersi * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response withQueryApiVersionWithResponse(String apiVersion, RequestOptions requestOptions) { - return service.withQueryApiVersionSync(this.getEndpoint(), apiVersion, requestOptions, Context.NONE); + public Response withQueryApiVersionWithResponse(RequestOptions requestOptions) { + return service.withQueryApiVersionSync(this.getEndpoint(), this.getApiVersion(), requestOptions, Context.NONE); } /** * The withPathApiVersion operation. * - * @param apiVersion The apiVersion parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -254,15 +269,14 @@ public Response withQueryApiVersionWithResponse(String apiVersion, Request * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> withPathApiVersionWithResponseAsync(String apiVersion, RequestOptions requestOptions) { + public Mono> withPathApiVersionWithResponseAsync(RequestOptions requestOptions) { return FluxUtil.withContext( - context -> service.withPathApiVersion(this.getEndpoint(), apiVersion, requestOptions, context)); + context -> service.withPathApiVersion(this.getEndpoint(), this.getApiVersion(), requestOptions, context)); } /** * The withPathApiVersion operation. * - * @param apiVersion The apiVersion parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -271,7 +285,7 @@ public Mono> withPathApiVersionWithResponseAsync(String apiVersio * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response withPathApiVersionWithResponse(String apiVersion, RequestOptions requestOptions) { - return service.withPathApiVersionSync(this.getEndpoint(), apiVersion, requestOptions, Context.NONE); + public Response withPathApiVersionWithResponse(RequestOptions requestOptions) { + return service.withPathApiVersionSync(this.getEndpoint(), this.getApiVersion(), requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/test/java/com/azure/clientgenerator/core/flattenproperty/generated/FlattenPropertyClientTestBase.java b/typespec-tests/src/test/java/com/azure/clientgenerator/core/flattenproperty/generated/FlattenPropertyClientTestBase.java index 6dd9056471..4b7d84689b 100644 --- a/typespec-tests/src/test/java/com/azure/clientgenerator/core/flattenproperty/generated/FlattenPropertyClientTestBase.java +++ b/typespec-tests/src/test/java/com/azure/clientgenerator/core/flattenproperty/generated/FlattenPropertyClientTestBase.java @@ -15,15 +15,17 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; class FlattenPropertyClientTestBase extends TestProxyTestBase { protected FlattenPropertyClient flattenPropertyClient; @Override protected void beforeTest() { - FlattenPropertyClientBuilder flattenPropertyClientbuilder - = new FlattenPropertyClientBuilder().httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + FlattenPropertyClientBuilder flattenPropertyClientbuilder = new FlattenPropertyClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { flattenPropertyClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { diff --git a/typespec-tests/src/test/java/com/encode/numeric/generated/NumericClientTestBase.java b/typespec-tests/src/test/java/com/encode/numeric/generated/NumericClientTestBase.java index 50713b9843..8b865bf807 100644 --- a/typespec-tests/src/test/java/com/encode/numeric/generated/NumericClientTestBase.java +++ b/typespec-tests/src/test/java/com/encode/numeric/generated/NumericClientTestBase.java @@ -13,6 +13,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; import com.encode.numeric.NumericClient; import com.encode.numeric.NumericClientBuilder; @@ -21,7 +22,9 @@ class NumericClientTestBase extends TestProxyTestBase { @Override protected void beforeTest() { - NumericClientBuilder numericClientbuilder = new NumericClientBuilder().httpClient(HttpClient.createDefault()) + NumericClientBuilder numericClientbuilder = new NumericClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { numericClientbuilder.httpClient(interceptorManager.getPlaybackClient()); diff --git a/typespec-tests/src/test/java/com/server/versions/notversioned/generated/NotVersionedClientTestBase.java b/typespec-tests/src/test/java/com/server/versions/notversioned/generated/NotVersionedClientTestBase.java index 5aa4f10da4..479bc2470b 100644 --- a/typespec-tests/src/test/java/com/server/versions/notversioned/generated/NotVersionedClientTestBase.java +++ b/typespec-tests/src/test/java/com/server/versions/notversioned/generated/NotVersionedClientTestBase.java @@ -24,6 +24,7 @@ class NotVersionedClientTestBase extends TestProxyTestBase { protected void beforeTest() { NotVersionedClientBuilder notVersionedClientbuilder = new NotVersionedClientBuilder() .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .apiVersion(Configuration.getGlobalConfiguration().get("APIVERSION", "apiversion")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { From 7af447b70dcced5976ce8b426c7ea59c0ca5e966 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 19 Aug 2024 10:36:49 +0800 Subject: [PATCH 71/90] integrate with bug fix on flattened model property and parameter has the same name --- typespec-extension/src/code-model-builder.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 9ffb054ea2..901fe0480e 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -1461,14 +1461,10 @@ export class CodeModelBuilder { ) { const serializedName = opParameter.serializedName; let existParameter: Parameter | undefined; - // if (opParameter.kind !== "property") { - // property of body, only check parameter location as there could only be 1 body in operation - // existParameter = op.parameters?.find((it) => it.protocol.http?.in === ParameterLocation.Body); - // } else { + if (opParameter.kind !== "property") { // not body property // header/query/path, same location and same serializedName - // existParameter = op.parameters?.find((it) => it.protocol.http?.in === opParameter.kind && it.language.default.serializedName === serializedName); - // } - existParameter = op.parameters?.find((it) => it.language.default.serializedName === serializedName); + existParameter = op.parameters?.find((it) => it.protocol.http?.in === opParameter.kind && it.language.default.serializedName === serializedName); + } request.parameters = request.parameters ?? []; if (existParameter) { // parameter From 48ab63dfd5d6942b9d5b4c94f77d258b08477d69 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 19 Aug 2024 10:37:21 +0800 Subject: [PATCH 72/90] add op.addParameter(parameter); for param.onclient as well --- typespec-extension/src/code-model-builder.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 901fe0480e..c8ba1cefe3 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -1151,6 +1151,7 @@ export class CodeModelBuilder { extensions: extensions, }); if (onClient) { + op.addParameter(parameter); clientContext.addGlobalParameter(parameter); } else { op.addParameter(parameter); From 5c71c0b7cabfa9969958e0ad986752ac8612c53d Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 19 Aug 2024 10:48:01 +0800 Subject: [PATCH 73/90] format and lint --- typespec-extension/src/code-model-builder.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index c8ba1cefe3..37832d2d98 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -108,8 +108,6 @@ import { getHeaderFieldName, getPathParamName, getQueryParamName, - getServers, - getStatusCodeDescription, isBody, isBodyRoot, isHeader, @@ -717,8 +715,7 @@ export class CodeModelBuilder { ).toString(); } - operationExamples[operationExample.title ?? operationExample.operationId ?? sdkMethod.name] = - operationExample; + operationExamples[operationExample.title ?? operationExample.operationId ?? sdkMethod.name] = operationExample; } return operationExamples; } else { @@ -1462,9 +1459,12 @@ export class CodeModelBuilder { ) { const serializedName = opParameter.serializedName; let existParameter: Parameter | undefined; - if (opParameter.kind !== "property") { // not body property + if (opParameter.kind !== "property") { + // not body property // header/query/path, same location and same serializedName - existParameter = op.parameters?.find((it) => it.protocol.http?.in === opParameter.kind && it.language.default.serializedName === serializedName); + existParameter = op.parameters?.find( + (it) => it.protocol.http?.in === opParameter.kind && it.language.default.serializedName === serializedName, + ); } request.parameters = request.parameters ?? []; if (existParameter) { @@ -2461,7 +2461,7 @@ export class CodeModelBuilder { } private isSubscriptionId(param: SdkPathParameter): boolean { - return "subscriptionId".toLocaleLowerCase() === param.name.toLocaleLowerCase(); + return "subscriptionId".toLocaleLowerCase() === param.serializedName.toLocaleLowerCase(); } private subscriptionIdParameter(parameter: SdkPathParameter): Parameter { From e8a8d3b3b2bdd3309274434eaa947b416f4a87c1 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 19 Aug 2024 11:13:24 +0800 Subject: [PATCH 74/90] fix NotVersionedTests --- .../src/test/java/com/server/versions/NotVersionedTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typespec-tests/src/test/java/com/server/versions/NotVersionedTests.java b/typespec-tests/src/test/java/com/server/versions/NotVersionedTests.java index a1ea6f70cf..9472e4cbb4 100644 --- a/typespec-tests/src/test/java/com/server/versions/NotVersionedTests.java +++ b/typespec-tests/src/test/java/com/server/versions/NotVersionedTests.java @@ -17,8 +17,8 @@ public class NotVersionedTests { public void test() { client.withoutApiVersion(); - client.withPathApiVersion("v1.0"); + client.withPathApiVersion(); - client.withQueryApiVersion("v1.0"); + client.withQueryApiVersion(); } } From fe181549ba58c4edec95dace017d2d8ccb25dedc Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 19 Aug 2024 12:41:08 +0800 Subject: [PATCH 75/90] revet the changes on onClient and support --- typespec-extension/src/code-model-builder.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 37832d2d98..c9926c6c3a 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -1127,11 +1127,9 @@ export class CodeModelBuilder { } const nullable = param.type.kind === "nullable"; - const onClient = param.onClient; - const implementationLocation = onClient ? ImplementationLocation.Client : ImplementationLocation.Method; const parameter = new Parameter(param.name, param.details ?? "", schema, { summary: param.description, - implementation: implementationLocation, + implementation: ImplementationLocation.Method, required: !param.optional, nullable: nullable, protocol: { @@ -1147,12 +1145,7 @@ export class CodeModelBuilder { }, extensions: extensions, }); - if (onClient) { - op.addParameter(parameter); - clientContext.addGlobalParameter(parameter); - } else { - op.addParameter(parameter); - } + op.addParameter(parameter); this.trackSchemaUsage(schema, { usage: [SchemaContext.Input] }); From a423afaf64feb57783a12857305f84f7f3bae973 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 19 Aug 2024 12:41:19 +0800 Subject: [PATCH 76/90] support allowReserved for path --- typespec-extension/src/code-model-builder.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index c9926c6c3a..2078f4c8e6 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -1051,12 +1051,12 @@ export class CodeModelBuilder { let extensions: { [id: string]: any } | undefined = undefined; // TODO haoling: skip-url-encoding, pending on TCGC issue https://github.com/Azure/typespec-azure/issues/1318 - // if (param.kind === "path") { - // if (param.allowReserved) { - // extensions = extensions ?? {}; - // extensions["x-ms-skip-url-encoding"] = true; - // } - // } + if (param.kind === "path") { + if (param.allowReserved) { + extensions = extensions ?? {}; + extensions["x-ms-skip-url-encoding"] = true; + } + } // TODO: deprecate this logic of string/url for x-ms-skip-url-encoding if ( (param.kind === "query" || param.kind === "path") && From fa1d2a7afa2d28d115289c65f2ee907a6499eea8 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 19 Aug 2024 12:41:30 +0800 Subject: [PATCH 77/90] regen --- .../implementation/ContosoClientImpl.java | 4 +- .../notversioned/NotVersionedAsyncClient.java | 22 +++++---- .../notversioned/NotVersionedClient.java | 22 +++++---- .../NotVersionedClientBuilder.java | 23 +-------- .../NotVersionedClientImpl.java | 48 +++++++------------ .../server/versions/NotVersionedTests.java | 4 +- .../generated/NotVersionedClientTestBase.java | 1 - 7 files changed, 51 insertions(+), 73 deletions(-) diff --git a/typespec-tests/src/main/java/com/cadl/server/implementation/ContosoClientImpl.java b/typespec-tests/src/main/java/com/cadl/server/implementation/ContosoClientImpl.java index 249cf6baa7..10740ce1d6 100644 --- a/typespec-tests/src/main/java/com/cadl/server/implementation/ContosoClientImpl.java +++ b/typespec-tests/src/main/java/com/cadl/server/implementation/ContosoClientImpl.java @@ -148,7 +148,7 @@ public interface ContosoClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> get(@HostParam("Endpoint") String endpoint, @HostParam("ApiVersion") String apiVersion, - @PathParam("group") String group, RequestOptions requestOptions, Context context); + @PathParam(value = "group", encoded = true) String group, RequestOptions requestOptions, Context context); @Get("/contoso/{group}") @ExpectedResponses({ 200, 204 }) @@ -157,7 +157,7 @@ Mono> get(@HostParam("Endpoint") String endpoint, @HostParam("Api @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSync(@HostParam("Endpoint") String endpoint, @HostParam("ApiVersion") String apiVersion, - @PathParam("group") String group, RequestOptions requestOptions, Context context); + @PathParam(value = "group", encoded = true) String group, RequestOptions requestOptions, Context context); } /** diff --git a/typespec-tests/src/main/java/com/server/versions/notversioned/NotVersionedAsyncClient.java b/typespec-tests/src/main/java/com/server/versions/notversioned/NotVersionedAsyncClient.java index 5e2a2352ee..9b8a616fab 100644 --- a/typespec-tests/src/main/java/com/server/versions/notversioned/NotVersionedAsyncClient.java +++ b/typespec-tests/src/main/java/com/server/versions/notversioned/NotVersionedAsyncClient.java @@ -55,6 +55,7 @@ public Mono> withoutApiVersionWithResponse(RequestOptions request /** * The withQueryApiVersion operation. * + * @param apiVersion The apiVersion parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -64,13 +65,14 @@ public Mono> withoutApiVersionWithResponse(RequestOptions request */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> withQueryApiVersionWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withQueryApiVersionWithResponseAsync(requestOptions); + public Mono> withQueryApiVersionWithResponse(String apiVersion, RequestOptions requestOptions) { + return this.serviceClient.withQueryApiVersionWithResponseAsync(apiVersion, requestOptions); } /** * The withPathApiVersion operation. * + * @param apiVersion The apiVersion parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -80,8 +82,8 @@ public Mono> withQueryApiVersionWithResponse(RequestOptions reque */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> withPathApiVersionWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withPathApiVersionWithResponseAsync(requestOptions); + public Mono> withPathApiVersionWithResponse(String apiVersion, RequestOptions requestOptions) { + return this.serviceClient.withPathApiVersionWithResponseAsync(apiVersion, requestOptions); } /** @@ -105,6 +107,8 @@ public Mono withoutApiVersion() { /** * The withQueryApiVersion operation. * + * @param apiVersion The apiVersion parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. @@ -114,15 +118,17 @@ public Mono withoutApiVersion() { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono withQueryApiVersion() { + public Mono withQueryApiVersion(String apiVersion) { // Generated convenience method for withQueryApiVersionWithResponse RequestOptions requestOptions = new RequestOptions(); - return withQueryApiVersionWithResponse(requestOptions).flatMap(FluxUtil::toMono); + return withQueryApiVersionWithResponse(apiVersion, requestOptions).flatMap(FluxUtil::toMono); } /** * The withPathApiVersion operation. * + * @param apiVersion The apiVersion parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. @@ -132,9 +138,9 @@ public Mono withQueryApiVersion() { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono withPathApiVersion() { + public Mono withPathApiVersion(String apiVersion) { // Generated convenience method for withPathApiVersionWithResponse RequestOptions requestOptions = new RequestOptions(); - return withPathApiVersionWithResponse(requestOptions).flatMap(FluxUtil::toMono); + return withPathApiVersionWithResponse(apiVersion, requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/typespec-tests/src/main/java/com/server/versions/notversioned/NotVersionedClient.java b/typespec-tests/src/main/java/com/server/versions/notversioned/NotVersionedClient.java index eba1aea904..291982cfa0 100644 --- a/typespec-tests/src/main/java/com/server/versions/notversioned/NotVersionedClient.java +++ b/typespec-tests/src/main/java/com/server/versions/notversioned/NotVersionedClient.java @@ -53,6 +53,7 @@ public Response withoutApiVersionWithResponse(RequestOptions requestOption /** * The withQueryApiVersion operation. * + * @param apiVersion The apiVersion parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -62,13 +63,14 @@ public Response withoutApiVersionWithResponse(RequestOptions requestOption */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response withQueryApiVersionWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withQueryApiVersionWithResponse(requestOptions); + public Response withQueryApiVersionWithResponse(String apiVersion, RequestOptions requestOptions) { + return this.serviceClient.withQueryApiVersionWithResponse(apiVersion, requestOptions); } /** * The withPathApiVersion operation. * + * @param apiVersion The apiVersion parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -78,8 +80,8 @@ public Response withQueryApiVersionWithResponse(RequestOptions requestOpti */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response withPathApiVersionWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withPathApiVersionWithResponse(requestOptions); + public Response withPathApiVersionWithResponse(String apiVersion, RequestOptions requestOptions) { + return this.serviceClient.withPathApiVersionWithResponse(apiVersion, requestOptions); } /** @@ -102,6 +104,8 @@ public void withoutApiVersion() { /** * The withQueryApiVersion operation. * + * @param apiVersion The apiVersion parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. @@ -110,15 +114,17 @@ public void withoutApiVersion() { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void withQueryApiVersion() { + public void withQueryApiVersion(String apiVersion) { // Generated convenience method for withQueryApiVersionWithResponse RequestOptions requestOptions = new RequestOptions(); - withQueryApiVersionWithResponse(requestOptions).getValue(); + withQueryApiVersionWithResponse(apiVersion, requestOptions).getValue(); } /** * The withPathApiVersion operation. * + * @param apiVersion The apiVersion parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. @@ -127,9 +133,9 @@ public void withQueryApiVersion() { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void withPathApiVersion() { + public void withPathApiVersion(String apiVersion) { // Generated convenience method for withPathApiVersionWithResponse RequestOptions requestOptions = new RequestOptions(); - withPathApiVersionWithResponse(requestOptions).getValue(); + withPathApiVersionWithResponse(apiVersion, requestOptions).getValue(); } } diff --git a/typespec-tests/src/main/java/com/server/versions/notversioned/NotVersionedClientBuilder.java b/typespec-tests/src/main/java/com/server/versions/notversioned/NotVersionedClientBuilder.java index a05fd57893..a45cce4ea5 100644 --- a/typespec-tests/src/main/java/com/server/versions/notversioned/NotVersionedClientBuilder.java +++ b/typespec-tests/src/main/java/com/server/versions/notversioned/NotVersionedClientBuilder.java @@ -190,24 +190,6 @@ public NotVersionedClientBuilder endpoint(String endpoint) { return this; } - /* - * - */ - @Generated - private String apiVersion; - - /** - * Sets. - * - * @param apiVersion the apiVersion value. - * @return the NotVersionedClientBuilder. - */ - @Generated - public NotVersionedClientBuilder apiVersion(String apiVersion) { - this.apiVersion = apiVersion; - return this; - } - /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -235,8 +217,8 @@ public NotVersionedClientBuilder retryPolicy(RetryPolicy retryPolicy) { private NotVersionedClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - NotVersionedClientImpl client = new NotVersionedClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, this.apiVersion); + NotVersionedClientImpl client + = new NotVersionedClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); return client; } @@ -245,7 +227,6 @@ private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); - Objects.requireNonNull(apiVersion, "'apiVersion' cannot be null."); } @Generated diff --git a/typespec-tests/src/main/java/com/server/versions/notversioned/implementation/NotVersionedClientImpl.java b/typespec-tests/src/main/java/com/server/versions/notversioned/implementation/NotVersionedClientImpl.java index e989cd1859..eff9b16d95 100644 --- a/typespec-tests/src/main/java/com/server/versions/notversioned/implementation/NotVersionedClientImpl.java +++ b/typespec-tests/src/main/java/com/server/versions/notversioned/implementation/NotVersionedClientImpl.java @@ -54,19 +54,6 @@ public String getEndpoint() { return this.endpoint; } - /** - */ - private final String apiVersion; - - /** - * Gets. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - /** * The HTTP pipeline to send requests through. */ @@ -99,11 +86,10 @@ public SerializerAdapter getSerializerAdapter() { * Initializes an instance of NotVersionedClient client. * * @param endpoint Need to be set as 'http://localhost:3000' in client. - * @param apiVersion */ - public NotVersionedClientImpl(String endpoint, String apiVersion) { + public NotVersionedClientImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -111,10 +97,9 @@ public NotVersionedClientImpl(String endpoint, String apiVersion) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param endpoint Need to be set as 'http://localhost:3000' in client. - * @param apiVersion */ - public NotVersionedClientImpl(HttpPipeline httpPipeline, String endpoint, String apiVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion); + public NotVersionedClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -123,14 +108,11 @@ public NotVersionedClientImpl(HttpPipeline httpPipeline, String endpoint, String * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param endpoint Need to be set as 'http://localhost:3000' in client. - * @param apiVersion */ - public NotVersionedClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - String apiVersion) { + public NotVersionedClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; - this.apiVersion = apiVersion; this.service = RestProxy.create(NotVersionedClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -230,6 +212,7 @@ public Response withoutApiVersionWithResponse(RequestOptions requestOption /** * The withQueryApiVersion operation. * + * @param apiVersion The apiVersion parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -238,14 +221,15 @@ public Response withoutApiVersionWithResponse(RequestOptions requestOption * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> withQueryApiVersionWithResponseAsync(RequestOptions requestOptions) { + public Mono> withQueryApiVersionWithResponseAsync(String apiVersion, RequestOptions requestOptions) { return FluxUtil.withContext( - context -> service.withQueryApiVersion(this.getEndpoint(), this.getApiVersion(), requestOptions, context)); + context -> service.withQueryApiVersion(this.getEndpoint(), apiVersion, requestOptions, context)); } /** * The withQueryApiVersion operation. * + * @param apiVersion The apiVersion parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -254,13 +238,14 @@ public Mono> withQueryApiVersionWithResponseAsync(RequestOptions * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response withQueryApiVersionWithResponse(RequestOptions requestOptions) { - return service.withQueryApiVersionSync(this.getEndpoint(), this.getApiVersion(), requestOptions, Context.NONE); + public Response withQueryApiVersionWithResponse(String apiVersion, RequestOptions requestOptions) { + return service.withQueryApiVersionSync(this.getEndpoint(), apiVersion, requestOptions, Context.NONE); } /** * The withPathApiVersion operation. * + * @param apiVersion The apiVersion parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -269,14 +254,15 @@ public Response withQueryApiVersionWithResponse(RequestOptions requestOpti * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> withPathApiVersionWithResponseAsync(RequestOptions requestOptions) { + public Mono> withPathApiVersionWithResponseAsync(String apiVersion, RequestOptions requestOptions) { return FluxUtil.withContext( - context -> service.withPathApiVersion(this.getEndpoint(), this.getApiVersion(), requestOptions, context)); + context -> service.withPathApiVersion(this.getEndpoint(), apiVersion, requestOptions, context)); } /** * The withPathApiVersion operation. * + * @param apiVersion The apiVersion parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -285,7 +271,7 @@ public Mono> withPathApiVersionWithResponseAsync(RequestOptions r * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response withPathApiVersionWithResponse(RequestOptions requestOptions) { - return service.withPathApiVersionSync(this.getEndpoint(), this.getApiVersion(), requestOptions, Context.NONE); + public Response withPathApiVersionWithResponse(String apiVersion, RequestOptions requestOptions) { + return service.withPathApiVersionSync(this.getEndpoint(), apiVersion, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/test/java/com/server/versions/NotVersionedTests.java b/typespec-tests/src/test/java/com/server/versions/NotVersionedTests.java index 9472e4cbb4..a1ea6f70cf 100644 --- a/typespec-tests/src/test/java/com/server/versions/NotVersionedTests.java +++ b/typespec-tests/src/test/java/com/server/versions/NotVersionedTests.java @@ -17,8 +17,8 @@ public class NotVersionedTests { public void test() { client.withoutApiVersion(); - client.withPathApiVersion(); + client.withPathApiVersion("v1.0"); - client.withQueryApiVersion(); + client.withQueryApiVersion("v1.0"); } } diff --git a/typespec-tests/src/test/java/com/server/versions/notversioned/generated/NotVersionedClientTestBase.java b/typespec-tests/src/test/java/com/server/versions/notversioned/generated/NotVersionedClientTestBase.java index 479bc2470b..5aa4f10da4 100644 --- a/typespec-tests/src/test/java/com/server/versions/notversioned/generated/NotVersionedClientTestBase.java +++ b/typespec-tests/src/test/java/com/server/versions/notversioned/generated/NotVersionedClientTestBase.java @@ -24,7 +24,6 @@ class NotVersionedClientTestBase extends TestProxyTestBase { protected void beforeTest() { NotVersionedClientBuilder notVersionedClientbuilder = new NotVersionedClientBuilder() .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .apiVersion(Configuration.getGlobalConfiguration().get("APIVERSION", "apiversion")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { From e9ec415a8c1c821d9cb1278f8843d8deb715c22a Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 19 Aug 2024 15:28:03 +0800 Subject: [PATCH 78/90] update according to comment: paging, content-type --- typespec-extension/src/code-model-builder.ts | 15 ++++++++------- typespec-extension/src/operation-utils.ts | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 2078f4c8e6..646833bd86 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -132,6 +132,7 @@ import { EmitterOptions } from "./emitter.js"; import { createPollOperationDetailsSchema, getFileDetailsSchema } from "./external-schemas.js"; import { ClientContext } from "./models.js"; import { + CONTENT_TYPE_KEY, ORIGIN_API_VERSION, SPECIAL_HEADER_NAMES, cloneOperationParameter, @@ -809,13 +810,13 @@ export class CodeModelBuilder { httpOperation.bodyParam && param.kind === "header" ) { - if (param.serializedName.toLocaleLowerCase() === "content-type") { + if (param.serializedName.toLocaleLowerCase() === CONTENT_TYPE_KEY) { continue; } } // if the request body is optional, skip content-type header added by TCGC if (httpOperation.bodyParam && httpOperation.bodyParam.optional) { - if (param.serializedName.toLocaleLowerCase() === "content-type") { + if (param.serializedName.toLocaleLowerCase() === CONTENT_TYPE_KEY) { continue; } } @@ -849,7 +850,6 @@ export class CodeModelBuilder { } // check for paged - // this.processRouteForPaged(codeModelOperation, sdkMethod.operation.__raw.responses); this.processRouteForPaged(codeModelOperation, sdkMethod.operation.responses, sdkMethod); // check for long-running operation @@ -869,12 +869,13 @@ export class CodeModelBuilder { for (const [_, response] of responses) { const bodyType = response.type; if (bodyType && bodyType.kind === "model") { - const pagedResult = sdkMethod.__raw_paged_metadata; - if (pagedResult) { + const itemName = sdkMethod.response.resultPath; + const nextLinkName = sdkMethod.nextLinkPath; + if (itemName && nextLinkName) { op.extensions = op.extensions ?? {}; op.extensions["x-ms-pageable"] = { - itemName: pagedResult.itemsProperty?.name, - nextLinkName: pagedResult.nextLinkProperty?.name, + itemName: itemName, + nextLinkName: nextLinkName, }; op.responses?.forEach((r) => { diff --git a/typespec-extension/src/operation-utils.ts b/typespec-extension/src/operation-utils.ts index 488f178f35..012f669990 100644 --- a/typespec-extension/src/operation-utils.ts +++ b/typespec-extension/src/operation-utils.ts @@ -18,7 +18,7 @@ export const SPECIAL_HEADER_NAMES = new Set([ export const ORIGIN_API_VERSION = "modelerfour:synthesized/api-version"; -const CONTENT_TYPE_KEY = "content-type"; +export const CONTENT_TYPE_KEY = "content-type"; // azure-core SerializerEncoding.SUPPORTED_MIME_TYPES const SUPPORTED_MIME_TYPES = new Set([ From e5adc5d89465cc832f7feb560a35e5705d751dc7 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 19 Aug 2024 15:56:12 +0800 Subject: [PATCH 79/90] remove unused logics in processing lro --- typespec-extension/src/code-model-builder.ts | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 646833bd86..5eb9c62169 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -993,19 +993,6 @@ export class CodeModelBuilder { op.extensions["x-ms-long-running-operation"] = true; return; } - - for (const [_, response] of responses) { - if (response.headers) { - for (const header of response.headers) { - if (isPollingLocation(this.program, header.__raw)) { - op.extensions = op.extensions ?? {}; - op.extensions["x-ms-long-running-operation"] = true; - - break; - } - } - } - } } private _armApiVersionParameter?: Parameter; From 6c1cdc45525db84b750e88b8863edb3209d724ba Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 19 Aug 2024 16:00:30 +0800 Subject: [PATCH 80/90] lint --- typespec-extension/src/code-model-builder.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 5eb9c62169..184c219b84 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -41,7 +41,6 @@ import { VirtualParameter, } from "@autorest/codemodel"; import { KnownMediaType } from "@azure-tools/codegen"; -import { isPollingLocation } from "@azure-tools/typespec-azure-core"; import { SdkArrayType, SdkBodyModelPropertyType, From b7ff02c70f5ab694cf858c9304725d1e6bce56ea Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 19 Aug 2024 16:23:02 +0800 Subject: [PATCH 81/90] add test case to test HttpStatusCodeRange --- .../errormodel/ErrorModelAsyncClient.java | 50 ++++++++++++ .../com/cadl/errormodel/ErrorModelClient.java | 49 +++++++++++ .../implementation/ErrorOpsImpl.java | 81 +++++++++++++++++++ typespec-tests/tsp/error.tsp | 12 +++ 4 files changed, 192 insertions(+) diff --git a/typespec-tests/src/main/java/com/cadl/errormodel/ErrorModelAsyncClient.java b/typespec-tests/src/main/java/com/cadl/errormodel/ErrorModelAsyncClient.java index 602e578228..dc5951a021 100644 --- a/typespec-tests/src/main/java/com/cadl/errormodel/ErrorModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/cadl/errormodel/ErrorModelAsyncClient.java @@ -73,6 +73,39 @@ public Mono> readWithResponse(RequestOptions requestOptions return this.serviceClient.readWithResponseAsync(requestOptions); } + /** + * The readWithCustomizedError operation. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     error (Required): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> readWithCustomizedErrorWithResponse(RequestOptions requestOptions) { + return this.serviceClient.readWithCustomizedErrorWithResponseAsync(requestOptions); + } + /** * The read operation. * @@ -91,4 +124,21 @@ public Mono read() { return readWithResponse(requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(Diagnostic.class)); } + + /** + * The readWithCustomizedError operation. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono readWithCustomizedError() { + // Generated convenience method for readWithCustomizedErrorWithResponse + RequestOptions requestOptions = new RequestOptions(); + return readWithCustomizedErrorWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Diagnostic.class)); + } } diff --git a/typespec-tests/src/main/java/com/cadl/errormodel/ErrorModelClient.java b/typespec-tests/src/main/java/com/cadl/errormodel/ErrorModelClient.java index 979c6a833b..445a1a992f 100644 --- a/typespec-tests/src/main/java/com/cadl/errormodel/ErrorModelClient.java +++ b/typespec-tests/src/main/java/com/cadl/errormodel/ErrorModelClient.java @@ -71,6 +71,39 @@ public Response readWithResponse(RequestOptions requestOptions) { return this.serviceClient.readWithResponse(requestOptions); } + /** + * The readWithCustomizedError operation. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     error (Required): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response readWithCustomizedErrorWithResponse(RequestOptions requestOptions) { + return this.serviceClient.readWithCustomizedErrorWithResponse(requestOptions); + } + /** * The read operation. * @@ -88,4 +121,20 @@ public Diagnostic read() { RequestOptions requestOptions = new RequestOptions(); return readWithResponse(requestOptions).getValue().toObject(Diagnostic.class); } + + /** + * The readWithCustomizedError operation. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Diagnostic readWithCustomizedError() { + // Generated convenience method for readWithCustomizedErrorWithResponse + RequestOptions requestOptions = new RequestOptions(); + return readWithCustomizedErrorWithResponse(requestOptions).getValue().toObject(Diagnostic.class); + } } diff --git a/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorOpsImpl.java b/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorOpsImpl.java index 259b2fa4b1..ccb93122ef 100644 --- a/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorOpsImpl.java +++ b/typespec-tests/src/main/java/com/cadl/errormodel/implementation/ErrorOpsImpl.java @@ -73,6 +73,20 @@ Mono> read(@HostParam("endpoint") String endpoint, @HeaderP @UnexpectedResponseExceptionType(HttpResponseException.class) Response readSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/error/statuscoderange") + @ExpectedResponses({ 200, 201, 400, 401, 402, 403, 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> readWithCustomizedError(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/error/statuscoderange") + @ExpectedResponses({ 200, 201, 400, 401, 402, 403, 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response readWithCustomizedErrorSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** @@ -145,4 +159,71 @@ public Response readWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; return service.readSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); } + + /** + * The readWithCustomizedError operation. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     error (Required): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> readWithCustomizedErrorWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.readWithCustomizedError(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The readWithCustomizedError operation. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     error (Required): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response readWithCustomizedErrorWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.readWithCustomizedErrorSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } } diff --git a/typespec-tests/tsp/error.tsp b/typespec-tests/tsp/error.tsp index aa02f36a61..9970603d04 100644 --- a/typespec-tests/tsp/error.tsp +++ b/typespec-tests/tsp/error.tsp @@ -16,7 +16,19 @@ model Diagnostic { error: Error; } + +@error +model UserError { + @statusCode + @minValue(400) + @maxValue(404) + status: int32; +} + @route("/error") interface ErrorOp { read(): ResourceCreatedOrOkResponse | ErrorResponse; + + @route("/statuscoderange") + readWithCustomizedError(): ResourceCreatedOrOkResponse | UserError; } From 33a3cef4b461fe24982d5c49669dc542b7aa55c2 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Mon, 19 Aug 2024 18:51:18 +0800 Subject: [PATCH 82/90] format typespec-tests --- typespec-tests/tsp/error.tsp | 1 - 1 file changed, 1 deletion(-) diff --git a/typespec-tests/tsp/error.tsp b/typespec-tests/tsp/error.tsp index 9970603d04..2d8c225a7b 100644 --- a/typespec-tests/tsp/error.tsp +++ b/typespec-tests/tsp/error.tsp @@ -16,7 +16,6 @@ model Diagnostic { error: Error; } - @error model UserError { @statusCode From 3954d93bfe6779a3cd1a0bfd31856e9f91bf8768 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Wed, 21 Aug 2024 16:03:31 +0800 Subject: [PATCH 83/90] address comments --- typespec-extension/src/code-model-builder.ts | 23 ++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 184c219b84..6a792815a8 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -687,7 +687,10 @@ export class CodeModelBuilder { private needToSkipProcessingOperation(operation: Operation | undefined, clientContext: ClientContext): boolean { // don't generate protocol and convenience method for overloaded operations // issue link: https://github.com/Azure/autorest.java/issues/1958#issuecomment-1562558219 we will support generate overload methods for non-union type in future (TODO issue: https://github.com/Azure/autorest.java/issues/2160) - if (operation && getOverloadedOperation(this.program, operation)) { + if (operation === undefined) { + return true; + } + if (getOverloadedOperation(this.program, operation)) { this.trace(`Operation '${operation.name}' is temporary skipped, as it is an overloaded operation`); return true; } @@ -733,10 +736,8 @@ export class CodeModelBuilder { const operationId = groupName ? `${groupName}_${operationName}` : `${operationName}`; const operationGroup = this.codeModel.getOperationGroup(groupName); - let operationExamples = undefined; - if (sdkMethod.operation && sdkMethod.operation.__raw) { - operationExamples = this.getOperationExample(sdkMethod); - } + let operationExamples = this.getOperationExample(sdkMethod); + const codeModelOperation = new CodeModelOperation(operationName, sdkMethod.details ?? "", { operationId: operationId, @@ -750,10 +751,8 @@ export class CodeModelBuilder { codeModelOperation.internalApi = sdkMethod.access === "internal"; const convenienceApiName = this.getConvenienceApiName(sdkMethod); - let generateConvenienceApi: boolean = Boolean(convenienceApiName); - let generateProtocolApi: boolean = sdkMethod.__raw - ? shouldGenerateProtocol(this.sdkContext, sdkMethod.__raw) - : true; + let generateConvenienceApi: boolean = sdkMethod.generateConvenient; + let generateProtocolApi: boolean = sdkMethod.generateProtocol; let apiComment: string | undefined = undefined; if (generateConvenienceApi) { @@ -814,6 +813,7 @@ export class CodeModelBuilder { } } // if the request body is optional, skip content-type header added by TCGC + // TODO: add optional content type to code-model, and support optional content-type from codegen, https://github.com/Azure/autorest.java/issues/2930 if (httpOperation.bodyParam && httpOperation.bodyParam.optional) { if (param.serializedName.toLocaleLowerCase() === CONTENT_TYPE_KEY) { continue; @@ -823,7 +823,7 @@ export class CodeModelBuilder { } // body - if (httpOperation.bodyParam && httpOperation.__raw && sdkMethod.__raw && httpOperation.bodyParam.type.__raw) { + if (httpOperation.bodyParam && httpOperation.__raw && httpOperation.bodyParam.type.__raw) { this.processParameterBody(codeModelOperation, httpOperation.__raw, httpOperation, httpOperation.bodyParam); } @@ -1037,7 +1037,6 @@ export class CodeModelBuilder { const schema = this.processSchemaFromSdkType(sdkType, param.name); let extensions: { [id: string]: any } | undefined = undefined; - // TODO haoling: skip-url-encoding, pending on TCGC issue https://github.com/Azure/typespec-azure/issues/1318 if (param.kind === "path") { if (param.allowReserved) { extensions = extensions ?? {}; @@ -1071,6 +1070,7 @@ export class CodeModelBuilder { const format = param.collectionFormat; switch (format) { case "csv": + case "simple": style = SerializationStyle.Simple; break; @@ -1087,6 +1087,7 @@ export class CodeModelBuilder { break; case "multi": + case "form": style = SerializationStyle.Form; explode = true; break; From f3fb702aa75ef168c28364e25eab22b8cc552933 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Wed, 21 Aug 2024 16:06:24 +0800 Subject: [PATCH 84/90] bump minor version --- typespec-extension/changelog.md | 6 ++++++ typespec-extension/package.json | 2 +- typespec-tests/package.json | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/typespec-extension/changelog.md b/typespec-extension/changelog.md index d99c687c1d..573f343647 100644 --- a/typespec-extension/changelog.md +++ b/typespec-extension/changelog.md @@ -1,5 +1,11 @@ # Release History +## 0.20.0 (2024-08-23) + +Compatible with compiler 0.59. + +- Adopt TCGC `sdkPackage`. + ## 0.19.2 (2024-08-16) Compatible with compiler 0.59. diff --git a/typespec-extension/package.json b/typespec-extension/package.json index c8531d3617..98b3a6a0be 100644 --- a/typespec-extension/package.json +++ b/typespec-extension/package.json @@ -1,6 +1,6 @@ { "name": "@azure-tools/typespec-java", - "version": "0.19.2", + "version": "0.20.0", "description": "TypeSpec library for emitting Java client from the TypeSpec REST protocol binding", "keywords": [ "TypeSpec" diff --git a/typespec-tests/package.json b/typespec-tests/package.json index 1dd7b8bd5e..0ab1c13dd3 100644 --- a/typespec-tests/package.json +++ b/typespec-tests/package.json @@ -10,7 +10,7 @@ }, "dependencies": { "@azure-tools/cadl-ranch-specs": "0.36.1", - "@azure-tools/typespec-java": "file:/../typespec-extension/azure-tools-typespec-java-0.19.2.tgz" + "@azure-tools/typespec-java": "file:/../typespec-extension/azure-tools-typespec-java-0.20.0.tgz" }, "devDependencies": { "@typespec/prettier-plugin-typespec": "~0.59.0", From 3563e1e9d5f407fcd028659bec5ce68db3d493a4 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Wed, 21 Aug 2024 16:07:46 +0800 Subject: [PATCH 85/90] format and lint --- typespec-extension/src/code-model-builder.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 6a792815a8..1476788d7f 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -74,7 +74,6 @@ import { isApiVersion, isSdkBuiltInKind, isSdkIntKind, - shouldGenerateProtocol, } from "@azure-tools/typespec-client-generator-core"; import { EmitContext, @@ -736,8 +735,7 @@ export class CodeModelBuilder { const operationId = groupName ? `${groupName}_${operationName}` : `${operationName}`; const operationGroup = this.codeModel.getOperationGroup(groupName); - let operationExamples = this.getOperationExample(sdkMethod); - + const operationExamples = this.getOperationExample(sdkMethod); const codeModelOperation = new CodeModelOperation(operationName, sdkMethod.details ?? "", { operationId: operationId, From eda4e543b6d644e40f5c5fc8d015e0127560f0f1 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Wed, 21 Aug 2024 17:27:44 +0800 Subject: [PATCH 86/90] use TCGC sdkBody.contentTypes to set to mediaTypes --- typespec-extension/src/code-model-builder.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 450c3665e0..1d8eb24070 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -44,6 +44,7 @@ import { KnownMediaType } from "@azure-tools/codegen"; import { SdkArrayType, SdkBodyModelPropertyType, + SdkBodyParameter, SdkBuiltInType, SdkClientType, SdkConstantType, @@ -1275,10 +1276,10 @@ export class CodeModelBuilder { op: CodeModelOperation, rawHttpOperation: HttpOperation, sdkHttpOperation: SdkHttpOperation, - sdkBody: SdkModelPropertyType, + sdkBody: SdkBodyParameter, ) { // set contentTypes to mediaTypes - op.requests![0].protocol.http!.mediaTypes = rawHttpOperation.parameters.body!.contentTypes; + op.requests![0].protocol.http!.mediaTypes = sdkBody.contentTypes; const unknownRequestBody = op.requests![0].protocol.http!.mediaTypes && From c3328babc2aa66eb5f428ff1aec51a31defdf2e0 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Thu, 22 Aug 2024 10:57:26 +0800 Subject: [PATCH 87/90] address comments --- typespec-extension/src/code-model-builder.ts | 17 ++++++----------- typespec-extension/src/type-utils.ts | 4 ++-- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 1d8eb24070..9ca1ac2cc7 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -151,6 +151,7 @@ import { getNonNullSdkType, getUnionDescription, getUsage, + isStable, modelIs, pushDistinct, } from "./type-utils.js"; @@ -535,15 +536,15 @@ export class CodeModelBuilder { if (initializationProperty.kind === "endpoint") { let sdkPathParameters: SdkPathParameter[] = []; if (initializationProperty.type.kind === "union") { - if (initializationProperty.type.values.length <= 2) { - // only get the path parameters from the endpoint whose serverUrl is not {"endpoint"} + if (initializationProperty.type.values.length === 2) { + // only get the sdkPathParameters from the endpoint whose serverUrl is not {"endpoint"} for (const endpointType of initializationProperty.type.values) { if (endpointType.kind === "endpoint" && endpointType.serverUrl !== "{endpoint}") { sdkPathParameters = endpointType.templateArguments; baseUri = endpointType.serverUrl; } } - } else { + } else if (initializationProperty.type.values.length > 2) { throw new Error("Multiple server url defined for one client is not supported yet."); } } else if (initializationProperty.type.kind === "endpoint") { @@ -679,9 +680,9 @@ export class CodeModelBuilder { } return versions .slice(0, versions.indexOf(pinnedApiVersion) + 1) - .filter((version) => !excludePreview || pinnedApiVersion.includes("preview") || !version.includes("preview")); + .filter((version) => !excludePreview || !isStable(pinnedApiVersion) || isStable(version)); } - + private needToSkipProcessingOperation(operation: Operation | undefined, clientContext: ClientContext): boolean { // don't generate protocol and convenience method for overloaded operations // issue link: https://github.com/Azure/autorest.java/issues/1958#issuecomment-1562558219 we will support generate overload methods for non-union type in future (TODO issue: https://github.com/Azure/autorest.java/issues/2160) @@ -1085,12 +1086,6 @@ export class CodeModelBuilder { style = SerializationStyle.Form; explode = true; break; - - default: - if (format) { - this.logWarning(`Unrecognized query parameter format: '${format}'.`); - } - break; } } else if (param.kind === "header") { const format = param.collectionFormat; diff --git a/typespec-extension/src/type-utils.ts b/typespec-extension/src/type-utils.ts index ed9a04eb7d..23fdb6eabe 100644 --- a/typespec-extension/src/type-utils.ts +++ b/typespec-extension/src/type-utils.ts @@ -50,8 +50,8 @@ export class ProcessingCache { } } -export function isStable(version: Version): boolean { - return !version.value.toLowerCase().includes("preview"); +export function isStable(version: string): boolean { + return !version.toLowerCase().includes("preview"); } /** adds only if the item is not in the collection already From 5cb0da560fe37c72a92945635c29f164a9e2624f Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Thu, 22 Aug 2024 10:57:49 +0800 Subject: [PATCH 88/90] changelog --- typespec-extension/changelog.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/typespec-extension/changelog.md b/typespec-extension/changelog.md index 573f343647..4d01e00310 100644 --- a/typespec-extension/changelog.md +++ b/typespec-extension/changelog.md @@ -1,10 +1,16 @@ # Release History -## 0.20.0 (2024-08-23) +## 0.20.0 (2024-08-26) Compatible with compiler 0.59. - Adopt TCGC `sdkPackage`. +- Always allow override `endpoint` parameter in `Builder`. +- Client method parameters' order changes when define the method parameters using spread in TypeSpec. + +## 0.19.3 (2024-08-21) + +Compatible with compiler 0.59. ## 0.19.2 (2024-08-16) From 43c2a7a4123d78dbbf2fcbca508bf2690e7805f1 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Thu, 22 Aug 2024 11:10:41 +0800 Subject: [PATCH 89/90] format and lint --- typespec-extension/src/code-model-builder.ts | 2 +- typespec-extension/src/type-utils.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/typespec-extension/src/code-model-builder.ts b/typespec-extension/src/code-model-builder.ts index 9ca1ac2cc7..9c34f62f4f 100644 --- a/typespec-extension/src/code-model-builder.ts +++ b/typespec-extension/src/code-model-builder.ts @@ -682,7 +682,7 @@ export class CodeModelBuilder { .slice(0, versions.indexOf(pinnedApiVersion) + 1) .filter((version) => !excludePreview || !isStable(pinnedApiVersion) || isStable(version)); } - + private needToSkipProcessingOperation(operation: Operation | undefined, clientContext: ClientContext): boolean { // don't generate protocol and convenience method for overloaded operations // issue link: https://github.com/Azure/autorest.java/issues/1958#issuecomment-1562558219 we will support generate overload methods for non-union type in future (TODO issue: https://github.com/Azure/autorest.java/issues/2160) diff --git a/typespec-extension/src/type-utils.ts b/typespec-extension/src/type-utils.ts index 23fdb6eabe..3e47fe807b 100644 --- a/typespec-extension/src/type-utils.ts +++ b/typespec-extension/src/type-utils.ts @@ -23,7 +23,6 @@ import { DurationSchema } from "./common/schemas/time.js"; import { getNamespace } from "./utils.js"; import { getUnionAsEnum } from "@azure-tools/typespec-azure-core"; import { SdkDurationType, SdkType, isSdkFloatKind, isSdkIntKind } from "@azure-tools/typespec-client-generator-core"; -import { Version } from "@typespec/versioning"; /** Acts as a cache for processing inputs. * From 2df13e40a653761e524cc6a4c5c2d7b9a9741575 Mon Sep 17 00:00:00 2001 From: Haoling Dong Date: Thu, 22 Aug 2024 15:05:30 +0800 Subject: [PATCH 90/90] changelog --- typespec-extension/changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typespec-extension/changelog.md b/typespec-extension/changelog.md index 4d01e00310..a6934b42b6 100644 --- a/typespec-extension/changelog.md +++ b/typespec-extension/changelog.md @@ -12,7 +12,7 @@ Compatible with compiler 0.59. Compatible with compiler 0.59. -## 0.19.2 (2024-08-16) +## 0.19.2 (2024-08-21) Compatible with compiler 0.59.